Skip to content

Commit

Permalink
Merge pull request #50 from LBNL-ETA/2024SeptemberFixes
Browse files Browse the repository at this point in the history
2024 september fixes
  • Loading branch information
vidanovic authored Sep 23, 2024
2 parents be26253 + 2ecd0ed commit 368d8c2
Show file tree
Hide file tree
Showing 45 changed files with 727 additions and 215 deletions.
29 changes: 18 additions & 11 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,28 @@ jobs:
matrix:
os: [windows-2019]
arch: [x86, x64]
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.arch }}

- name: Install packages
run: pip install wheel
run: |
pip install wheel
pip install setuptools
- name: build
run: python setup.py bdist_wheel

- name: upload wheels
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
path: ./dist/*.whl

Expand All @@ -44,27 +46,29 @@ jobs:
# There is documentation here https://github.com/pypa/cibuildwheel/blob/main/docs/cpp_standards.md on how to
# set it but I could not get it to work while using the standard images provided by github actions does work.
os: [macos-latest]
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
env:
SYSTEM_VERSION_COMPAT: 0

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install packages
run: pip install wheel
run: |
pip install wheel
pip install setuptools
- name: build
run: python setup.py bdist_wheel

- name: upload wheels
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
path: ./dist/*.whl

Expand All @@ -80,9 +84,12 @@ jobs:
# Note that at least manylinux2014 is needed to get support for C++17
- name: Build manylinux Python wheels
uses: RalfG/[email protected]_x86_64
with:
python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312'
build-requirements: 'setuptools'

- name: upload wheels
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
path: ./dist/*-manylinux*.whl

2 changes: 1 addition & 1 deletion CMakeLists-WinCalc.txt.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ include(ExternalProject)

ExternalProject_Add(wincalc
GIT_REPOSITORY https://github.com/LBNL-ETA/WinCalc.git
GIT_TAG "v2.4.1"
GIT_TAG "2024SeptemberFixes"

UPDATE_COMMAND ""
PATCH_COMMAND ""
Expand Down
2 changes: 1 addition & 1 deletion examples/bsdf_shade_igsdb_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

bsdf_hemisphere = pywincalc.BSDFHemisphere.create(pywincalc.BSDFBasisType.FULL)

bsdf_igsdb_id = 14710
bsdf_igsdb_id = 18955

bsdf_igsdb_response = requests.get(url_single_product_datafile.format(id=bsdf_igsdb_id), headers=headers)

Expand Down
22 changes: 22 additions & 0 deletions examples/gap_annulus_cylinder_pillar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import pywincalc

pillar = pywincalc.AnnulusCylinderPillar(height=0.002, material_conductivity=20,
cell_area=pywincalc.pillar_cell_area(pywincalc.CellSpacingType.SQUARE, 0.03),
inner_radius=0.01e-3, outer_radius=0.25e-3)
gap = pywincalc.Layers.create_pillar(pillar=pillar, pressure=0.1333)

gaps = [gap]

clear_3_path = "products/CLEAR_3.DAT"
clear_3 = pywincalc.parse_optics_file(clear_3_path)
solid_layers = [clear_3, clear_3]

# Create a glazing system. This only shows an example of getting one result from a glazing system
# created using default environmental conditions.
#
# For more possible results see optical_results_NFRC.py
#
# For more on environmental conditions see environmental_conditions_user_defined.py
glazing_system = pywincalc.GlazingSystem(solid_layers=solid_layers, gap_layers=gaps)
u_value = glazing_system.u()
print(f"U-value for the system: {u_value}")
22 changes: 22 additions & 0 deletions examples/gap_cylindrical_pillar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import pywincalc

pillar = pywincalc.CylindricalPillar(height=0.002, material_conductivity=20,
cell_area=pywincalc.pillar_cell_area(pywincalc.CellSpacingType.SQUARE, 0.03),
radius=0.25e-3)
gap = pywincalc.Layers.create_pillar(pillar=pillar, pressure=0.1333)

gaps = [gap]

clear_3_path = "products/CLEAR_3.DAT"
clear_3 = pywincalc.parse_optics_file(clear_3_path)
solid_layers = [clear_3, clear_3]

# Create a glazing system. This only shows an example of getting one result from a glazing system
# created using default environmental conditions.
#
# For more possible results see optical_results_NFRC.py
#
# For more on environmental conditions see environmental_conditions_user_defined.py
glazing_system = pywincalc.GlazingSystem(solid_layers=solid_layers, gap_layers=gaps)
u_value = glazing_system.u()
print(f"U-value for the system: {u_value}")
22 changes: 22 additions & 0 deletions examples/gap_linear_bearing_pillar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import pywincalc

pillar = pywincalc.LinearBearingPillar(height=0.002, material_conductivity=20,
cell_area=pywincalc.pillar_cell_area(pywincalc.CellSpacingType.SQUARE, 0.03),
length=0.25e-3, width=0.01e-3)
gap = pywincalc.Layers.create_pillar(pillar=pillar, pressure=0.1333)

gaps = [gap]

clear_3_path = "products/CLEAR_3.DAT"
clear_3 = pywincalc.parse_optics_file(clear_3_path)
solid_layers = [clear_3, clear_3]

# Create a glazing system. This only shows an example of getting one result from a glazing system
# created using default environmental conditions.
#
# For more possible results see optical_results_NFRC.py
#
# For more on environmental conditions see environmental_conditions_user_defined.py
glazing_system = pywincalc.GlazingSystem(solid_layers=solid_layers, gap_layers=gaps)
u_value = glazing_system.u()
print(f"U-value for the system: {u_value}")
24 changes: 24 additions & 0 deletions examples/gap_measured_pillar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import pywincalc

glass_1 = pywincalc.Glass(thickness=0.05, conductivity=1, emissivity=0.8)
glass_2 = pywincalc.Glass(thickness=0.05, conductivity=1, emissivity=0.8)
measured_pillar = pywincalc.PillarMeasurement(total_thickness=0.12, conductivity=0.3, temperature_surface_1=295,
temperature_surface_4=305, glass_1=glass_1, glass_2=glass_2)

gap = pywincalc.Layers.create_pillar(pillar=measured_pillar)

gaps = [gap]

clear_3_path = "products/CLEAR_3.DAT"
clear_3 = pywincalc.parse_optics_file(clear_3_path)
solid_layers = [clear_3, clear_3]

# Create a glazing system. This only shows an example of getting one result from a glazing system
# created using default environmental conditions.
#
# For more possible results see optical_results_NFRC.py
#
# For more on environmental conditions see environmental_conditions_user_defined.py
glazing_system = pywincalc.GlazingSystem(solid_layers=solid_layers, gap_layers=gaps)
u_value = glazing_system.u()
print(f"U-value for the system: {u_value}")
22 changes: 22 additions & 0 deletions examples/gap_pentagon_pillar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import pywincalc

pillar = pywincalc.PolygonalPillar(height=0.002, material_conductivity=20,
cell_area=pywincalc.pillar_cell_area(pywincalc.CellSpacingType.SQUARE, 0.03),
length=0.25e-3, polygon_type=pywincalc.PolygonType.PENTAGON)
gap = pywincalc.Layers.create_pillar(pillar=pillar, pressure=0.1333)

gaps = [gap]

clear_3_path = "products/CLEAR_3.DAT"
clear_3 = pywincalc.parse_optics_file(clear_3_path)
solid_layers = [clear_3, clear_3]

# Create a glazing system. This only shows an example of getting one result from a glazing system
# created using default environmental conditions.
#
# For more possible results see optical_results_NFRC.py
#
# For more on environmental conditions see environmental_conditions_user_defined.py
glazing_system = pywincalc.GlazingSystem(solid_layers=solid_layers, gap_layers=gaps)
u_value = glazing_system.u()
print(f"U-value for the system: {u_value}")
22 changes: 22 additions & 0 deletions examples/gap_rectangular_pillar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import pywincalc

pillar = pywincalc.RectangularPillar(height=0.002, material_conductivity=20,
cell_area=pywincalc.pillar_cell_area(pywincalc.CellSpacingType.SQUARE, 0.03),
length=0.25e-3, width=0.05e-3)
gap = pywincalc.Layers.create_pillar(pillar=pillar, pressure=0.1333)

gaps = [gap]

clear_3_path = "products/CLEAR_3.DAT"
clear_3 = pywincalc.parse_optics_file(clear_3_path)
solid_layers = [clear_3, clear_3]

# Create a glazing system. This only shows an example of getting one result from a glazing system
# created using default environmental conditions.
#
# For more possible results see optical_results_NFRC.py
#
# For more on environmental conditions see environmental_conditions_user_defined.py
glazing_system = pywincalc.GlazingSystem(solid_layers=solid_layers, gap_layers=gaps)
u_value = glazing_system.u()
print(f"U-value for the system: {u_value}")
22 changes: 22 additions & 0 deletions examples/gap_spherical_pillar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import pywincalc

pillar = pywincalc.SphericalPillar(height=0.002, material_conductivity=20,
cell_area=pywincalc.pillar_cell_area(pywincalc.CellSpacingType.SQUARE, 0.03),
radius_of_contact=0.25e-3)
gap = pywincalc.Layers.create_pillar(pillar=pillar, pressure=0.1333)

gaps = [gap]

clear_3_path = "products/CLEAR_3.DAT"
clear_3 = pywincalc.parse_optics_file(clear_3_path)
solid_layers = [clear_3, clear_3]

# Create a glazing system. This only shows an example of getting one result from a glazing system
# created using default environmental conditions.
#
# For more possible results see optical_results_NFRC.py
#
# For more on environmental conditions see environmental_conditions_user_defined.py
glazing_system = pywincalc.GlazingSystem(solid_layers=solid_layers, gap_layers=gaps)
u_value = glazing_system.u()
print(f"U-value for the system: {u_value}")
22 changes: 22 additions & 0 deletions examples/gap_triangular_pillar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import pywincalc

pillar = pywincalc.PolygonalPillar(height=0.002, material_conductivity=20,
cell_area=pywincalc.pillar_cell_area(pywincalc.CellSpacingType.SQUARE, 0.03),
length=0.25e-3, polygon_type=pywincalc.PolygonType.TRIANGLE)
gap = pywincalc.Layers.create_pillar(pillar=pillar, pressure=0.1333)

gaps = [gap]

clear_3_path = "products/CLEAR_3.DAT"
clear_3 = pywincalc.parse_optics_file(clear_3_path)
solid_layers = [clear_3, clear_3]

# Create a glazing system. This only shows an example of getting one result from a glazing system
# created using default environmental conditions.
#
# For more possible results see optical_results_NFRC.py
#
# For more on environmental conditions see environmental_conditions_user_defined.py
glazing_system = pywincalc.GlazingSystem(solid_layers=solid_layers, gap_layers=gaps)
u_value = glazing_system.u()
print(f"U-value for the system: {u_value}")
22 changes: 22 additions & 0 deletions examples/gap_truncated_cone_pillar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import pywincalc

pillar = pywincalc.TruncatedConePillar(height=0.002, material_conductivity=20,
cell_area=pywincalc.pillar_cell_area(pywincalc.CellSpacingType.SQUARE, 0.03),
radius_1=0.25e-3, radius_2=0.01e-3)
gap = pywincalc.Layers.create_pillar(pillar=pillar, pressure=0.1333)

gaps = [gap]

clear_3_path = "products/CLEAR_3.DAT"
clear_3 = pywincalc.parse_optics_file(clear_3_path)
solid_layers = [clear_3, clear_3]

# Create a glazing system. This only shows an example of getting one result from a glazing system
# created using default environmental conditions.
#
# For more possible results see optical_results_NFRC.py
#
# For more on environmental conditions see environmental_conditions_user_defined.py
glazing_system = pywincalc.GlazingSystem(solid_layers=solid_layers, gap_layers=gaps)
u_value = glazing_system.u()
print(f"U-value for the system: {u_value}")
8 changes: 4 additions & 4 deletions examples/gaps_and_gases.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@
# (optionally) adding support pillars. Currently only circular pillars
# are supported.

# This creates a gap with the default gas (Air) and a pressure of 0.1333 Pa
gap_6 = pywincalc.Layers.gap(thickness=.001, pressure=0.1333)
# Add circular pillars to the gap
gap_6 = pywincalc.Layers.add_circular_pillar(gap_6, conductivity=999, spacing=0.03, radius=0.0002)
pillar = pywincalc.CylindricalPillar(height=0.002, material_conductivity=20,
cell_area=pywincalc.pillar_cell_area(pywincalc.CellSpacingType.SQUARE, 0.03),
radius=0.25e-3)
gap_6 = pywincalc.Layers.create_pillar(pillar=pillar, pressure=0.1333)

# Gaps can now have forced ventilation. To create one first create a regular gap and then convert
# to a forced ventilated gap. The gap that will be converted can be any of the above.
Expand Down
4 changes: 2 additions & 2 deletions examples/glass_user_defined_nband_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ def raw_glazing_wavelength_data():
ir_transmittance_back=glass_ir_transmittance_back,
emissivity_front=glass_emissivity_front,
emissivity_back=glass_emissivity_back,
permeability_factor=glass_permeability_factor,
flipped=flipped)

# Next create the thermal data for the glass layer
Expand All @@ -295,7 +294,8 @@ def raw_glazing_wavelength_data():
opening_bottom=glass_opening_bottom,
opening_left=glass_opening_left,
opening_right=glass_opening_right,
opening_front=glass_opening_front)
effective_front_thermal_openness_area=glass_opening_front,
permeability_factor=glass_permeability_factor)

# Create a glass layer from both the optical and thermal data
glass_layer = pywincalc.ProductDataOpticalAndThermal(glass_n_band_optical_data,
Expand Down
Loading

0 comments on commit 368d8c2

Please sign in to comment.