Skip to content

Commit

Permalink
Added standards file to package. Changed load_standard so it defaults…
Browse files Browse the repository at this point in the history
… to using the NFRC standard.
  • Loading branch information
StephenCzarnecki committed Mar 24, 2023
1 parent f4d2b0c commit 774776a
Show file tree
Hide file tree
Showing 94 changed files with 37 additions and 38 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.12)

set( CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON )

set( target_name pywincalc )
set( target_name _pywincalc )
project( ${target_name} )

set(JSON_BuildTests OFF CACHE BOOL "")
Expand Down
6 changes: 6 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
include pywincalc/standards/*.dsp
include pywincalc/standards/*.loc
include pywincalc/standards/*.scc
include pywincalc/standards/*.ssp
include pywincalc/standards/*.std
include pywincalc/standards/*.wvl
35 changes: 15 additions & 20 deletions examples/igsdb_custom_venetian.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,31 +35,26 @@
# Currently the only modeling parameter for venetian layers is the distribution method.
# That defaults to directional diffuse but can be changed to uniform-diffuse on a per-layer basis
distribution_method = pywincalc.DistributionMethodType.UNIFORM_DIFFUSE
geometry = pywincalc.VenetianGeometry(slat_width_meters=slat_width,
slat_spacing_meters=slat_spacing,
geometry = pywincalc.VenetianGeometry(slat_width_meters=slat_width,
slat_spacing_meters=slat_spacing,
slat_curvature_meters=slat_curvature,
slat_tilt_degrees=slat_tilt,
number_slat_segments=number_segments,
slat_tilt_degrees=slat_tilt,
number_slat_segments=number_segments,
distribution_method=distribution_method)

# Convert the parsed shade material data into a solid layer. Without doing
# anything else this would be treated as a solid sheet of the material.
venetian_layer = pywincalc.convert_to_solid_layer(shade_material)
# The easiest way to transform it into a Venetian blind is to replace the optical portion
# with a ProductDataOpticalVenetian object made from the material's optical data
# and the user-defined geometry created above.
venetian_layer.optical_data = pywincalc.ProductDataOpticalVenetian(venetian_layer.optical_data, geometry)
# Create a layer from the geometry and material
venetian_layer = pywincalc.create_venetian_blind(geometry=geometry, material=shade_material)

# If there are any side gaps in the shade those can be set in the thermal part of the solid layer.
# In this case the left and right openings would apply if the length of the slats was less than the width
# of the glazing system and the top and bottom openings would apply if the top and bottom slats did not
# sit flush with the top and bottom of the glazing system when the slats are closed.
# Do not take slat angle into account for these values.
# These values are for example purposes only
venetian_layer.thermal_data.opening_top = .01 # 10mm top gap
venetian_layer.thermal_data.opening_bottom = .01 # 10mm bottom gap
venetian_layer.thermal_data.opening_left = .02 # 20mm left gap
venetian_layer.thermal_data.opening_right = .02 # 20mm right gap
venetian_layer.thermal_data.opening_top = .01 # 10mm top gap
venetian_layer.thermal_data.opening_bottom = .01 # 10mm bottom gap
venetian_layer.thermal_data.opening_left = .02 # 20mm left gap
venetian_layer.thermal_data.opening_right = .02 # 20mm right gap

# Create a glazing system. This only shows an example of getting one result from a glazing system
# created using default environmental conditions.
Expand All @@ -68,11 +63,11 @@
#
# For more on environmental conditions see custom_environmental_conditions.py
glazing_system = pywincalc.GlazingSystem(optical_standard=optical_standard,
solid_layers=[venetian_layer],
gap_layers=[],
width_meters=glazing_system_width,
height_meters=glazing_system_height,
bsdf_hemisphere=bsdf_hemisphere)
solid_layers=[venetian_layer],
gap_layers=[],
width_meters=glazing_system_width,
height_meters=glazing_system_height,
bsdf_hemisphere=bsdf_hemisphere)

u_value = glazing_system.u()
print(
Expand Down
23 changes: 8 additions & 15 deletions examples/igsdb_custom_vertical_venetian.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import pywincalc
import requests
from igsdb_interaction import url_single_product, headers
import results_printer

# Path to the optical standard file. All other files referenced by the standard file must be in the same directory
# Note: While all optical standards packaged with WINDOW should work with optical calculations care should be
Expand Down Expand Up @@ -32,12 +31,12 @@
slat_spacing = .050 # spacing of 50 mm
slat_curvature = .025 # curvature of 25 mm
slat_tilt = 15 # 15 degree tilt
number_segments = 5 # The default is 5. Do not change unless there is a reason to. This should usually be omitted but is shown here for completeness
number_segments = 5 # The default is 5. Do not change unless there is a reason to.
# Currently the only modeling parameter for venetian layers is the distribution method.
# That defaults to directional diffuse but can be changed to uniform-diffuse on a per-layer basis
distribution_method = pywincalc.DistributionMethodType.UNIFORM_DIFFUSE

# To make the Venetian vertical set is_horizonatl = False when creating the geometry
# To make the Venetian vertical set is_horizontal = False when creating the geometry
geometry = pywincalc.VenetianGeometry(slat_width_meters=slat_width,
slat_spacing_meters=slat_spacing,
slat_curvature_meters=slat_curvature,
Expand All @@ -46,18 +45,13 @@
distribution_method=distribution_method,
is_horizontal=False)

# Convert the parsed shade material data into a solid layer. Without doing
# anything else this would be treated as a solid sheet of the material.
venetian_layer = pywincalc.convert_to_solid_layer(shade_material)
# The easiest way to transform it into a Venetian blind is to replace the optical portion
# with a ProductDataOpticalVenetian object made from the material's optical data
# and the user-defined geometry created above.
venetian_layer.optical_data = pywincalc.ProductDataOpticalVenetian(venetian_layer.optical_data, geometry)
# Create a layer from the geometry and material
venetian_layer = pywincalc.create_venetian_blind(geometry=geometry, material=shade_material)

# If there are any side gaps in the shade those can be set in the thermal part of the solid layer.
# In this case the top and bottom openings would apply if the length of the slats was less than the height
# of the glazing system and the left and right openings would apply if the left and slats did not sit flush
# with the sides of the glazing system when the slats are closed. D
# In this case the left and right openings would apply if the length of the slats was less than the width
# of the glazing system and the top and bottom openings would apply if the top and bottom slats did not
# sit flush with the top and bottom of the glazing system when the slats are closed.
# Do not take slat angle into account for these values.
# These values are for example purposes only
venetian_layer.thermal_data.opening_top = .01 # 10mm top gap
Expand All @@ -80,5 +74,4 @@

u_value = glazing_system.u()
print(
"U-value for a custom vertical Venetian blind made from a material downloaded from igsdb.lbl.glv: {v}".format(
v=u_value))
"U-value for a custom Venetian blind made from a material downloaded from igsdb.lbl.glv: {v}".format(v=u_value))
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,10 @@ author_email = sczarnecki@lbl.gov
license = BSD 3-clause
license_file = LICENSE

[options]
zip_safe = False
include_package_data = True
packages = pywincalc

[bdist_wheel]
universal = 1
4 changes: 2 additions & 2 deletions src/pywincalc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ template <class Product_Data_N_Band_Optical_Base =
};
#endif

PYBIND11_MODULE(pywincalc, m) {
PYBIND11_MODULE(_pywincalc, m) {
m.doc() = "Python bindings for WinCalc";

py::enum_<Gases::GasDef>(m, "PredefinedGasType", py::arithmetic())
Expand Down Expand Up @@ -1019,7 +1019,7 @@ PYBIND11_MODULE(pywincalc, m) {
"Convert a list of product data into a solid layer that can be used in "
"glazing systems.");

m.def("load_standard",
m.def("_load_standard",
py::overload_cast<std::string const &>(
&window_standards::load_optical_standard),
"Load standard from .std file");
Expand Down

0 comments on commit 774776a

Please sign in to comment.