From 20b9585d862001e17babd823a6ff82f9ca1581fc Mon Sep 17 00:00:00 2001 From: Simon Vidanovic Date: Thu, 7 Dec 2023 14:23:50 -0800 Subject: [PATCH 01/27] Cylindrical pillar added. --- CMakeLists-WinCalc.txt.in | 2 +- pywincalc/__init__.py | 7 +- src/wincalcbindings.cpp | 132 ++++++++++++++++++++++++++++---------- 3 files changed, 104 insertions(+), 37 deletions(-) diff --git a/CMakeLists-WinCalc.txt.in b/CMakeLists-WinCalc.txt.in index 5f429b5..22f2726 100644 --- a/CMakeLists-WinCalc.txt.in +++ b/CMakeLists-WinCalc.txt.in @@ -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 "VacuumDec2023" UPDATE_COMMAND "" PATCH_COMMAND "" diff --git a/pywincalc/__init__.py b/pywincalc/__init__.py index aaa709e..e7da2c2 100644 --- a/pywincalc/__init__.py +++ b/pywincalc/__init__.py @@ -29,7 +29,8 @@ from wincalcbindings import AirHorizontalDirection, BSDF, BSDFBasisType, BSDFDirection, BSDFDirections, BSDFHemisphere, \ BSDFIntegrator, BoundaryConditionsCoefficientModelType, CMABestWorstUFactors, CMAResult, CMAWindow, \ - CMAWindowDualVisionHorizontal, CMAWindowDualVisionVertical, CMAWindowSingleVision, CircularPillar, CoatedSide, \ + CMAWindowDualVisionHorizontal, CMAWindowDualVisionVertical, CMAWindowSingleVision, CellSpacingType, pillar_cell_area, \ + PillarData, CylindricalPillar, UniversalSupportPillar, CylindricalPillarLayer, CoatedSide, \ ColorResult, DeflectionResults, DistributionMethodType, DualBandBSDF, EffectiveOpenness, Environment, Environments, \ FlippableSolidLayer, Gas, GasCoefficients, GasData, GlazingSystem as _GlazingSystem, GlazingSystemDimensions, \ IGUGapLayer, IntegrationRule, IntegrationRuleType, Lab, Layers, MaterialType, \ @@ -42,7 +43,7 @@ ProductDataOpticalDualBandBSDF, ProductDataOpticalDualBandHemispheric, ProductDataOpticalNBand, \ ProductDataOpticalPerforatedScreen, ProductDataOpticalVenetian, ProductDataOpticalWithMaterial, \ ProductDataOpticalWovenShade, ProductDataThermal, ProductGeometry, PropertySimple, RGB, Side, \ - SpectalDataWavelengthRangeMethodType, Spectrum, SpectrumType, SquareMatrix, SupportPillar, TarcogSystemType, \ + SpectalDataWavelengthRangeMethodType, Spectrum, SpectrumType, SquareMatrix, TarcogSystemType, \ ThermalIRResults, ThmxBoundaryCondition, ThmxBoundaryConditionPolygon, ThmxCMABestWorstOption, ThmxCMAOptions, \ ThmxFileContents, ThmxMaterial, ThmxMeshParameters, ThmxPolygon, ThmxPolygonPoint, ThmxRGB, ThmxResult, \ ThmxUFactorProjectionResult, ThmxUFactorResults, Trichromatic, VenetianGeometry, WavelengthBSDFs, \ @@ -53,7 +54,7 @@ get_spacer_keff, nfrc_shgc_environments, nfrc_u_environments, parse_bsdf_xml_file, parse_bsdf_xml_string, \ parse_json, parse_json_file, parse_optics_file, parse_thmx_file, parse_thmx_string, IGUVentilatedGapLayer, \ forced_ventilation_gap - + @deprecation.deprecated(deprecated_in="3.0.0", removed_in="4.0.0", diff --git a/src/wincalcbindings.cpp b/src/wincalcbindings.cpp index 21a448b..d0ad0f3 100644 --- a/src/wincalcbindings.cpp +++ b/src/wincalcbindings.cpp @@ -113,26 +113,55 @@ class Py_Product_Data_Optical : public wincalc::Product_Data_Optical //_Base { public: using wincalc::Product_Data_Optical::Product_Data_Optical; // Inherit - // constructors + // constructors std::vector wavelengths() const override { PYBIND11_OVERRIDE_PURE(std::vector, wincalc::Product_Data_Optical, wavelengths, ); } }; -class Py_CSupportPillar : public Tarcog::ISO15099::CSupportPillar //_Base -{ +// struct PyCylindricalPillar : public Tarcog::ISO15099::CylindricalPillar {}; +// +// struct PySphericalPillar : public Tarcog::ISO15099::SphericalPillar {}; +// +// struct PyRectangularPillar : public Tarcog::ISO15099::RectangularPillar {}; +// +// struct PyPolygonalPillar : public Tarcog::ISO15099::PolygonalPillar {}; +// +// struct PyLinearBearingPillar : public Tarcog::ISO15099::LinearBearingPillar +// {}; +// +// struct PyTruncatedConePillar : public Tarcog::ISO15099::TruncatedConePillar +// {}; +// +// struct PyAnnulusCylinderPillar +// : public Tarcog::ISO15099::AnnulusCylinderPillar {}; + +class Py_UniversalSupportPillar + : public Tarcog::ISO15099::UniversalSupportPillar { public: - using Tarcog::ISO15099::CSupportPillar::CSupportPillar; // Inherit - // constructors + using Tarcog::ISO15099::UniversalSupportPillar::UniversalSupportPillar; protected: - double conductivityOfPillarArray() override { - PYBIND11_OVERRIDE_PURE(double, Tarcog::ISO15099::CSupportPillar, - conductivityOfPillarArray, ); + double areaOfContact() override { + PYBIND11_OVERRIDE_PURE(double, Tarcog::ISO15099::UniversalSupportPillar, + areaOfContact, ); } }; +// class Py_CSupportPillar : public Tarcog::ISO15099::CSupportPillar //_Base +//{ +// public: +// using Tarcog::ISO15099::CSupportPillar::CSupportPillar; // Inherit +// // constructors +// +// protected: +// double conductivityOfPillarArray() override { +// PYBIND11_OVERRIDE_PURE(double, Tarcog::ISO15099::CSupportPillar, +// conductivityOfPillarArray,); +// } +// }; + PYBIND11_MODULE(wincalcbindings, m) { m.doc() = "Python bindings for WinCalc"; @@ -183,21 +212,61 @@ PYBIND11_MODULE(wincalcbindings, m) { .def(py::init(), py::arg("thickness"), py::arg("pressure"), py::arg("gas")); - py::class_>(m, - "SupportPillar") - .def(py::init(), - py::arg("gap_layer"), py::arg("conductivity")); - - py::class_>( - m, "CircularPillar") - .def(py::init(), - py::arg("gap_layer"), py::arg("conductivity"), py::arg("spacing"), - py::arg("radius")); + py::enum_(m, "CellSpacingType", py::arithmetic()) + .value("SQUARE", Tarcog::ISO15099::CellSpacingType::Square) + .value("SHIFTEDSQUARE", Tarcog::ISO15099::CellSpacingType::ShiftedSquare) + .value("SHIFTEDROTATEDSQUARE", Tarcog::ISO15099::CellSpacingType::ShiftedRotatedSquare); + + m.def("pillar_cell_area", Tarcog::ISO15099::pillarCellArea, py::arg("cell_spacing_type"), py::arg("sp")); + + py::class_>( + m, "UniversalSupportPillar") + .def(py::init(), + py::arg("gap_layer"), py::arg("material_conductivity"), + py::arg("cell_area")); + + // py::class_>(m, + // "SupportPillar") + // .def(py::init(), + // py::arg("gap_layer"), py::arg("conductivity")); + + py::class_>(m, "PillarData") + .def(py::init(), + py::arg("height"), py::arg("material_conductivity"), py::arg("cell_area")) + .def_readwrite("height", &Tarcog::ISO15099::PillarData::height) + .def_readwrite("material_conductivity", + &Tarcog::ISO15099::PillarData::materialConductivity) + .def_readwrite("cell_area", &Tarcog::ISO15099::PillarData::cellArea); + + py::class_>( + m, "CylindricalPillar") + .def(py::init(), + py::arg("height"), py::arg("material_conductivity"), py::arg("cell_area"), py::arg("radius")) + .def_readwrite("radius", &Tarcog::ISO15099::CylindricalPillar::radius); + + py::class_>( + m, "CylindricalPillarLayer") + .def(py::init(), + py::arg("gap_layer"), py::arg("cylindrical_pillar")); + + // py::class_>( + // m, "CircularPillar") + // .def(py::init(), + // py::arg("gap_layer"), py::arg("conductivity"), + // py::arg("spacing"), py::arg("radius")); py::class_(), py::arg("gap_layer"), py::arg("inlet_temperature"), py::arg("inlet_speed")) - .def("inlet_temperature", - &Tarcog::ISO15099::CIGUVentilatedGapLayer::inletTemperature) - .def("outlet_temperature", - &Tarcog::ISO15099::CIGUVentilatedGapLayer::outletTemperature) .def("layer_temperature", - &Tarcog::ISO15099::CIGUVentilatedGapLayer::layerTemperature) + &Tarcog::ISO15099::CIGUVentilatedGapLayer::averageLayerTemperature) .def("set_flow_geometry", &Tarcog::ISO15099::CIGUVentilatedGapLayer::setFlowGeometry, py::arg("a_in"), py::arg("a_out")) @@ -1585,9 +1650,10 @@ PYBIND11_MODULE(wincalcbindings, m) { "Factory function to create a Tarcog gap from a gas", py::arg("thickness"), py::arg("gas"), py::arg("pressure") = 101325) - .def_static("add_circular_pillar", - &Tarcog::ISO15099::Layers::addCircularPillar, - "Static function to add a circular pillar to a Tarcog gap", - py::arg("gap"), py::arg("conductivity"), py::arg("spacing"), - py::arg("radius")); + .def_static( + "create_pillar", + py::overload_cast(&Tarcog::ISO15099::Layers::createPillar), + "Static function to add a cylindrical pillar to a Tarcog gap", + py::arg("pillar"), py::arg("pressure")); } From d5a954aa000acdd94977f97a6d60b29db7d55a08 Mon Sep 17 00:00:00 2001 From: Simon Vidanovic Date: Thu, 7 Dec 2023 14:25:49 -0800 Subject: [PATCH 02/27] Example for cylindrical pillar added. --- examples/gaps_and_gases.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/gaps_and_gases.py b/examples/gaps_and_gases.py index 298d157..ee2934e 100644 --- a/examples/gaps_and_gases.py +++ b/examples/gaps_and_gases.py @@ -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. From 2a70d32a0ea437ac94ddc08b7575fd32590c830d Mon Sep 17 00:00:00 2001 From: Simon Vidanovic Date: Thu, 7 Dec 2023 15:21:25 -0800 Subject: [PATCH 03/27] Spherical, Rectangular, Triangular, Pentagon and Hexagon pillars added. --- pywincalc/__init__.py | 4 +- src/wincalcbindings.cpp | 3268 ++++++++++++++++++++------------------- 2 files changed, 1662 insertions(+), 1610 deletions(-) diff --git a/pywincalc/__init__.py b/pywincalc/__init__.py index e7da2c2..4ac266d 100644 --- a/pywincalc/__init__.py +++ b/pywincalc/__init__.py @@ -29,8 +29,8 @@ from wincalcbindings import AirHorizontalDirection, BSDF, BSDFBasisType, BSDFDirection, BSDFDirections, BSDFHemisphere, \ BSDFIntegrator, BoundaryConditionsCoefficientModelType, CMABestWorstUFactors, CMAResult, CMAWindow, \ - CMAWindowDualVisionHorizontal, CMAWindowDualVisionVertical, CMAWindowSingleVision, CellSpacingType, pillar_cell_area, \ - PillarData, CylindricalPillar, UniversalSupportPillar, CylindricalPillarLayer, CoatedSide, \ + CMAWindowDualVisionHorizontal, CMAWindowDualVisionVertical, CMAWindowSingleVision, CellSpacingType, PolygonType, pillar_cell_area, \ + PillarData, CylindricalPillar, SphericalPillar, RectangularPillar, PolygonalPillar, UniversalSupportPillar, CylindricalPillarLayer, SphericalPillarLayer, RectangularPillarLayer, TriangularPillarLayer, PentagonPillarLayer, HexagonPillarLayer, CoatedSide, \ ColorResult, DeflectionResults, DistributionMethodType, DualBandBSDF, EffectiveOpenness, Environment, Environments, \ FlippableSolidLayer, Gas, GasCoefficients, GasData, GlazingSystem as _GlazingSystem, GlazingSystemDimensions, \ IGUGapLayer, IntegrationRule, IntegrationRuleType, Lab, Layers, MaterialType, \ diff --git a/src/wincalcbindings.cpp b/src/wincalcbindings.cpp index d0ad0f3..b1c7ad5 100644 --- a/src/wincalcbindings.cpp +++ b/src/wincalcbindings.cpp @@ -7,1653 +7,1705 @@ namespace py = pybind11; using namespace pybind11::literals; -template +template void declare_wce_optical_result_simple(py::module &m, std::string typestr) { - using Class = wincalc::WCE_Optical_Result_Simple; - std::string pyclass_name = std::string("OpticalResultFluxType") + typestr; - py::class_(m, pyclass_name.c_str(), py::buffer_protocol(), - py::dynamic_attr()) - .def_readwrite("direct_direct", &Class::direct_direct) - .def_readwrite("direct_diffuse", &Class::direct_diffuse) - .def_readwrite("diffuse_diffuse", &Class::diffuse_diffuse) - .def_readwrite("direct_hemispherical", &Class::direct_hemispherical) - .def_readwrite("matrix", &Class::matrix); + using Class = wincalc::WCE_Optical_Result_Simple; + std::string pyclass_name = std::string("OpticalResultFluxType") + typestr; + py::class_(m, pyclass_name.c_str(), py::buffer_protocol(), + py::dynamic_attr()) + .def_readwrite("direct_direct", &Class::direct_direct) + .def_readwrite("direct_diffuse", &Class::direct_diffuse) + .def_readwrite("diffuse_diffuse", &Class::diffuse_diffuse) + .def_readwrite("direct_hemispherical", &Class::direct_hemispherical) + .def_readwrite("matrix", &Class::matrix); } -template +template void declare_wce_optical_result_absorptance(py::module &m, std::string typestr) { - using Class = wincalc::WCE_Optical_Result_Absorptance; - std::string pyclass_name = std::string("OpticalResultAbsorptance") + typestr; - py::class_(m, pyclass_name.c_str(), py::buffer_protocol(), - py::dynamic_attr()) - .def_readwrite("direct", &Class::total_direct) - .def_readwrite("diffuse", &Class::total_diffuse) - .def_readwrite("total_direct", &Class::total_direct) - .def_readwrite("total_diffuse", &Class::total_diffuse) - .def_readwrite("heat_direct", &Class::heat_direct) - .def_readwrite("heat_diffuse", &Class::heat_diffuse) - .def_readwrite("electricity_direct", &Class::electricity_direct) - .def_readwrite("electricity_diffuse", &Class::electricity_diffuse) - .def_readwrite("angular_total", &Class::angular_total) - .def_readwrite("angular_heat", &Class::angular_heat) - .def_readwrite("angular_electricity", &Class::angular_electricity); + using Class = wincalc::WCE_Optical_Result_Absorptance; + std::string pyclass_name = std::string("OpticalResultAbsorptance") + typestr; + py::class_(m, pyclass_name.c_str(), py::buffer_protocol(), + py::dynamic_attr()) + .def_readwrite("direct", &Class::total_direct) + .def_readwrite("diffuse", &Class::total_diffuse) + .def_readwrite("total_direct", &Class::total_direct) + .def_readwrite("total_diffuse", &Class::total_diffuse) + .def_readwrite("heat_direct", &Class::heat_direct) + .def_readwrite("heat_diffuse", &Class::heat_diffuse) + .def_readwrite("electricity_direct", &Class::electricity_direct) + .def_readwrite("electricity_diffuse", &Class::electricity_diffuse) + .def_readwrite("angular_total", &Class::angular_total) + .def_readwrite("angular_heat", &Class::angular_heat) + .def_readwrite("angular_electricity", &Class::angular_electricity); } -template +template void declare_wce_optical_result_layer(py::module &m, std::string typestr) { - using Class = wincalc::WCE_Optical_Result_Layer; - declare_wce_optical_result_absorptance(m, typestr); - std::string pyclass_name = std::string("OpticalResultLayer") + typestr; - py::class_(m, pyclass_name.c_str(), py::buffer_protocol(), - py::dynamic_attr()) - .def_readwrite("absorptance", &Class::absorptance); + using Class = wincalc::WCE_Optical_Result_Layer; + declare_wce_optical_result_absorptance(m, typestr); + std::string pyclass_name = std::string("OpticalResultLayer") + typestr; + py::class_(m, pyclass_name.c_str(), py::buffer_protocol(), + py::dynamic_attr()) + .def_readwrite("absorptance", &Class::absorptance); } -template +template void declare_wce_optical_transmission_result(py::module &m, std::string typestr) { - using Class = wincalc::WCE_Optical_Transmission_Result; - std::string pyclass_name = std::string("OpticalResultTransmission") + typestr; - py::class_(m, pyclass_name.c_str(), py::buffer_protocol(), - py::dynamic_attr()) - .def_readwrite("transmittance", &Class::transmittance) - .def_readwrite("reflectance", &Class::reflectance); + using Class = wincalc::WCE_Optical_Transmission_Result; + std::string pyclass_name = std::string("OpticalResultTransmission") + typestr; + py::class_(m, pyclass_name.c_str(), py::buffer_protocol(), + py::dynamic_attr()) + .def_readwrite("transmittance", &Class::transmittance) + .def_readwrite("reflectance", &Class::reflectance); } -template +template void declare_wce_optical_result_by_side(py::module &m, std::string typestr) { - using Class = wincalc::WCE_Optical_Result_By_Side; - std::string pyclass_name = std::string("OpticalResultSide") + typestr; - py::class_(m, pyclass_name.c_str(), py::buffer_protocol(), - py::dynamic_attr()) - .def_readwrite("front", &Class::front) - .def_readwrite("back", &Class::back); + using Class = wincalc::WCE_Optical_Result_By_Side; + std::string pyclass_name = std::string("OpticalResultSide") + typestr; + py::class_(m, pyclass_name.c_str(), py::buffer_protocol(), + py::dynamic_attr()) + .def_readwrite("front", &Class::front) + .def_readwrite("back", &Class::back); } -template +template void declare_wce_optical_results_template(py::module &m, std::string typestr) { - using Class = wincalc::WCE_Optical_Results_Template; - declare_wce_optical_result_simple(m, typestr); - declare_wce_optical_transmission_result< - wincalc::WCE_Optical_Result_Simple>(m, typestr); - declare_wce_optical_result_by_side>>(m, typestr); - declare_wce_optical_result_layer(m, typestr); - declare_wce_optical_result_by_side>( - m, typestr + "_Layer"); - std::string pyclass_name = std::string("OpticalResults") + typestr; - py::class_(m, pyclass_name.c_str(), py::buffer_protocol(), - py::dynamic_attr()) - .def_readwrite("system_results", &Class::system_results, - "Results for the entire system.") - .def_readwrite("layer_results", &Class::layer_results, - "A list of results where each item in the list contains " - "the results for one layer in the system."); + using Class = wincalc::WCE_Optical_Results_Template; + declare_wce_optical_result_simple(m, typestr); + declare_wce_optical_transmission_result< + wincalc::WCE_Optical_Result_Simple>(m, typestr); + declare_wce_optical_result_by_side>>(m, typestr); + declare_wce_optical_result_layer(m, typestr); + declare_wce_optical_result_by_side>( + m, typestr + "_Layer"); + std::string pyclass_name = std::string("OpticalResults") + typestr; + py::class_(m, pyclass_name.c_str(), py::buffer_protocol(), + py::dynamic_attr()) + .def_readwrite("system_results", &Class::system_results, + "Results for the entire system.") + .def_readwrite("layer_results", &Class::layer_results, + "A list of results where each item in the list contains " + "the results for one layer in the system."); } -template <> +template<> void declare_wce_optical_results_template( - py::module &m, std::string typestr) { - using Class = wincalc::WCE_Optical_Results_Template; - declare_wce_optical_result_simple(m, typestr); - declare_wce_optical_transmission_result< - wincalc::WCE_Optical_Result_Simple>(m, typestr); - declare_wce_optical_result_by_side>>(m, typestr); - std::string pyclass_name = std::string("OpticalResults") + typestr; - py::class_(m, pyclass_name.c_str(), py::buffer_protocol(), - py::dynamic_attr()) - .def_readwrite("system_results", &Class::system_results, - "Results for the entire system. Layer results for colors " - "are not currently supported."); + py::module &m, std::string typestr) { + using Class = wincalc::WCE_Optical_Results_Template; + declare_wce_optical_result_simple(m, typestr); + declare_wce_optical_transmission_result< + wincalc::WCE_Optical_Result_Simple>(m, typestr); + declare_wce_optical_result_by_side>>(m, typestr); + std::string pyclass_name = std::string("OpticalResults") + typestr; + py::class_(m, pyclass_name.c_str(), py::buffer_protocol(), + py::dynamic_attr()) + .def_readwrite("system_results", &Class::system_results, + "Results for the entire system. Layer results for colors " + "are not currently supported."); } class Py_Product_Data_Optical : public wincalc::Product_Data_Optical //_Base { public: - using wincalc::Product_Data_Optical::Product_Data_Optical; // Inherit - // constructors - std::vector wavelengths() const override { - PYBIND11_OVERRIDE_PURE(std::vector, wincalc::Product_Data_Optical, - wavelengths, ); - } + using wincalc::Product_Data_Optical::Product_Data_Optical; // Inherit + // constructors + std::vector wavelengths() const override { + PYBIND11_OVERRIDE_PURE(std::vector, wincalc::Product_Data_Optical, + wavelengths,); + } }; -// struct PyCylindricalPillar : public Tarcog::ISO15099::CylindricalPillar {}; -// -// struct PySphericalPillar : public Tarcog::ISO15099::SphericalPillar {}; -// -// struct PyRectangularPillar : public Tarcog::ISO15099::RectangularPillar {}; -// -// struct PyPolygonalPillar : public Tarcog::ISO15099::PolygonalPillar {}; -// -// struct PyLinearBearingPillar : public Tarcog::ISO15099::LinearBearingPillar -// {}; -// -// struct PyTruncatedConePillar : public Tarcog::ISO15099::TruncatedConePillar -// {}; -// -// struct PyAnnulusCylinderPillar -// : public Tarcog::ISO15099::AnnulusCylinderPillar {}; - class Py_UniversalSupportPillar - : public Tarcog::ISO15099::UniversalSupportPillar { + : public Tarcog::ISO15099::UniversalSupportPillar { public: - using Tarcog::ISO15099::UniversalSupportPillar::UniversalSupportPillar; + using Tarcog::ISO15099::UniversalSupportPillar::UniversalSupportPillar; protected: - double areaOfContact() override { - PYBIND11_OVERRIDE_PURE(double, Tarcog::ISO15099::UniversalSupportPillar, - areaOfContact, ); - } + double areaOfContact() override { + PYBIND11_OVERRIDE_PURE(double, Tarcog::ISO15099::UniversalSupportPillar, + areaOfContact,); + } }; -// class Py_CSupportPillar : public Tarcog::ISO15099::CSupportPillar //_Base -//{ -// public: -// using Tarcog::ISO15099::CSupportPillar::CSupportPillar; // Inherit -// // constructors -// -// protected: -// double conductivityOfPillarArray() override { -// PYBIND11_OVERRIDE_PURE(double, Tarcog::ISO15099::CSupportPillar, -// conductivityOfPillarArray,); -// } -// }; - PYBIND11_MODULE(wincalcbindings, m) { - m.doc() = "Python bindings for WinCalc"; - - py::enum_(m, "PredefinedGasType", py::arithmetic()) - .value("AIR", Gases::GasDef::Air) - .value("ARGON", Gases::GasDef::Argon) - .value("KRYPTON", Gases::GasDef::Krypton) - .value("XENON", Gases::GasDef::Xenon); - - py::class_(m, "GasCoefficients") - .def(py::init(), py::arg("A"), - py::arg("B"), py::arg("C")); - - py::class_(m, "GasData") - .def(py::init(), - py::arg("name"), py::arg("molecular_weight"), - py::arg("specific_heat_ratio"), py::arg("Cp"), - py::arg("thermal_conductivity"), py::arg("viscosity")) - .def("get_molecular_weight", &Gases::CGasData::getMolecularWeight) - .def("get_property_value", &Gases::CGasData::getPropertyValue, - py::arg("type"), py::arg("temperature")) - .def("get_specific_heat_ratio", &Gases::CGasData::getSpecificHeatRatio) - .def("name", &Gases::CGasData::name); - - py::class_(m, "Gas") - .def(py::init const &>(), py::arg("gases")) - .def("get_simple_gas_properties", &Gases::CGas::getSimpleGasProperties) - .def("get_gas_properties", &Gases::CGas::getGasProperties) - .def("set_temperature_and_pressure", - &Gases::CGas::setTemperatureAndPressure) - .def("gas_items", &Gases::CGas::gasItems) - .def("total_percent", &Gases::CGas::totalPercent) - .def("add_gas_items", &Gases::CGas::addGasItems) - .def("add_gas_item", - py::overload_cast( - &Gases::CGas::addGasItem), - py::arg("percent"), py::arg("gas_data")) - .def("add_gas_item", - py::overload_cast(&Gases::CGas::addGasItem), - py::arg("percent"), py::arg("predefined_gas")); - - py::class_>(m, "IGUGapLayer") - .def(py::init(), py::arg("thickness"), - py::arg("pressure")) - .def(py::init(), - py::arg("thickness"), py::arg("pressure"), py::arg("gas")); - - py::enum_(m, "CellSpacingType", py::arithmetic()) - .value("SQUARE", Tarcog::ISO15099::CellSpacingType::Square) - .value("SHIFTEDSQUARE", Tarcog::ISO15099::CellSpacingType::ShiftedSquare) - .value("SHIFTEDROTATEDSQUARE", Tarcog::ISO15099::CellSpacingType::ShiftedRotatedSquare); - - m.def("pillar_cell_area", Tarcog::ISO15099::pillarCellArea, py::arg("cell_spacing_type"), py::arg("sp")); - - py::class_>( - m, "UniversalSupportPillar") - .def(py::init(), - py::arg("gap_layer"), py::arg("material_conductivity"), - py::arg("cell_area")); - - // py::class_>(m, - // "SupportPillar") - // .def(py::init(), - // py::arg("gap_layer"), py::arg("conductivity")); - - py::class_>(m, "PillarData") - .def(py::init(), - py::arg("height"), py::arg("material_conductivity"), py::arg("cell_area")) - .def_readwrite("height", &Tarcog::ISO15099::PillarData::height) - .def_readwrite("material_conductivity", - &Tarcog::ISO15099::PillarData::materialConductivity) - .def_readwrite("cell_area", &Tarcog::ISO15099::PillarData::cellArea); - - py::class_>( - m, "CylindricalPillar") - .def(py::init(), - py::arg("height"), py::arg("material_conductivity"), py::arg("cell_area"), py::arg("radius")) - .def_readwrite("radius", &Tarcog::ISO15099::CylindricalPillar::radius); - - py::class_>( - m, "CylindricalPillarLayer") - .def(py::init(), - py::arg("gap_layer"), py::arg("cylindrical_pillar")); - - // py::class_>( - // m, "CircularPillar") - // .def(py::init(), - // py::arg("gap_layer"), py::arg("conductivity"), - // py::arg("spacing"), py::arg("radius")); - - py::class_>( - m, "IGUVentilatedGapLayer") - .def(py::init const &>(), - py::arg("gap_layer")) - .def(py::init, double, - double>(), - py::arg("gap_layer"), py::arg("inlet_temperature"), - py::arg("inlet_speed")) - .def("layer_temperature", - &Tarcog::ISO15099::CIGUVentilatedGapLayer::averageLayerTemperature) - .def("set_flow_geometry", - &Tarcog::ISO15099::CIGUVentilatedGapLayer::setFlowGeometry, - py::arg("a_in"), py::arg("a_out")) - .def("set_inlet_temperature", - &Tarcog::ISO15099::CIGUVentilatedGapLayer::setInletTemperature, - py::arg("inlet_temperature")) - .def("set_flow_temperatures", - &Tarcog::ISO15099::CIGUVentilatedGapLayer::setFlowTemperatures, - py::arg("inlet_temperature"), py::arg("outlet_temperature")) - .def("set_flow_speed", - &Tarcog::ISO15099::CIGUVentilatedGapLayer::setFlowSpeed, - py::arg("speed")) - .def("smooth_energy_gain", - &Tarcog::ISO15099::CIGUVentilatedGapLayer::smoothEnergyGain, - py::arg("qv1"), py::arg("qv2")) - .def( - "calculate_ventilated_airflow", - &Tarcog::ISO15099::CIGUVentilatedGapLayer::calculateVentilatedAirflow, - py::arg("inlet_temperature")) - .def("calculate_thermally_driven_airflow_with_adjacent_gap", - &Tarcog::ISO15099::CIGUVentilatedGapLayer:: - calculateThermallyDrivenAirflowWithAdjacentGap, - py::arg("adjacent_gap")) - .def("clone", &Tarcog::ISO15099::CIGUVentilatedGapLayer::clone); - - m.def("forced_ventilation_gap", - Tarcog::ISO15099::Layers::forcedVentilationGap, py::arg("gap"), - py::arg("forced_ventilation_air_speed"), - py::arg("forced_ventilation_air_temperature")); - - py::class_(m, - "OpticalMeasurementComponent") - .def(py::init(), - py::arg("transmittance_front"), py::arg("transmittance_back"), - py::arg("reflectance_front"), py::arg("reflectance_back")) - .def_readwrite("transmittance_front", - &OpticsParser::MeasurementComponent::tf) - .def_readwrite("transmittance_back", - &OpticsParser::MeasurementComponent::tb) - .def_readwrite("reflectance_front", - &OpticsParser::MeasurementComponent::rf) - .def_readwrite("reflectance_back", - &OpticsParser::MeasurementComponent::rb); - - py::class_(m, "PVWavelengthData") - .def(py::init(), py::arg("eqe_front"), - py::arg("eqe_back")) - .def_readwrite("eqq_front", &OpticsParser::PVWavelengthData::eqef) - .def_readwrite("eqe_back", &OpticsParser::PVWavelengthData::eqeb); - - py::class_(m, "WavelengthData") - .def(py::init>(), - py::arg("wavelength_microns"), py::arg("direct_component"), - py::arg("diffuse_component") = - std::optional()) - .def(py::init(), - py::arg("wavelength_microns"), py::arg("direct_transmittance"), - py::arg("direct_reflectance_front"), - py::arg("direct_reflectance_back")) - .def(py::init(), - py::arg("wavelength_microns"), py::arg("direct_transmittance_front"), - py::arg("diffuse_transmittance_front"), - py::arg("direct_transmittance_back"), - py::arg("diffuse_transmittance_back"), - py::arg("direct_reflectance_front"), - py::arg("diffuse_reflectance_front"), - py::arg("direct_reflectance_back"), - py::arg("diffuse_reflectance_back")) - .def_readwrite("wavelength", &OpticsParser::WLData::wavelength) - .def_readwrite("direct_component", &OpticsParser::WLData::directComponent) - .def_readwrite("diffuse_component", - &OpticsParser::WLData::diffuseComponent) - .def_readwrite("pv_component", &OpticsParser::WLData::pvComponent); - - py::class_>(m, - "ProductGeometry"); - - py::class_>( - m, "ParsedVenetianGeometry") - .def(py::init(), - py::arg("slat_width"), py::arg("slat_spacing"), - py::arg("slat_curvature"), py::arg("slat_tilt") = 0, - py::arg("tilt_choice") = "0", py::arg("number_segments") = 5) - .def_readwrite("slat_width", &OpticsParser::VenetianGeometry::slatWidth) - .def_readwrite("slat_spacing", - &OpticsParser::VenetianGeometry::slatSpacing) - .def_readwrite("slat_curvature", - &OpticsParser::VenetianGeometry::slatCurvature) - .def_readwrite("slat_tilt", &OpticsParser::VenetianGeometry::slatTilt) - .def_readwrite("number_segments", - &OpticsParser::VenetianGeometry::numberSegments); - - py::class_>( - m, "ParsedWovenGeometry") - .def(py::init()) - .def_readwrite("thread_diameter", - &OpticsParser::WovenGeometry::threadDiameter) - .def_readwrite("thread_spacing", - &OpticsParser::WovenGeometry::threadSpacing) - .def_readwrite("shade_thickness", - &OpticsParser::WovenGeometry::shadeThickness); - - py::class_>( - m, "ParsedPerforatedGeometry") - .def(py::init(), - py::arg("spacing_x_meters"), py::arg("spacing_y_meters"), - py::arg("dimension_x_meters"), py::arg("dimension_y_meters"), - py::arg("perforation_type")) - .def_readwrite("spacing_x", &OpticsParser::PerforatedGeometry::spacingX) - .def_readwrite("spacing_y", &OpticsParser::PerforatedGeometry::spacingY) - .def_readwrite("dimension_x", - &OpticsParser::PerforatedGeometry::dimensionX) - .def_readwrite("dimension_y", - &OpticsParser::PerforatedGeometry::dimensionY) - .def_readwrite("perforation_type", - &OpticsParser::PerforatedGeometry::perforationType); - - py::class_(m, "BSDF") - .def_readwrite("data", &OpticsParser::BSDF::data) - .def_readwrite("row_angle_basis_name", - &OpticsParser::BSDF::rowAngleBasisName) - .def_readwrite("column_angle_basis_name", - &OpticsParser::BSDF::columnAngleBasisName); - - py::class_(m, "WavelengthBSDFs") - .def_readwrite("transmittance_front", &OpticsParser::WavelengthBSDFs::tf) - .def_readwrite("transmittance_back", &OpticsParser::WavelengthBSDFs::tb) - .def_readwrite("reflectance_front", &OpticsParser::WavelengthBSDFs::rf) - .def_readwrite("reflectance_back", &OpticsParser::WavelengthBSDFs::rb); - - py::class_(m, "DualBandBSDF") - .def_readwrite("solar", &OpticsParser::DualBandBSDF::solar) - .def_readwrite("visible", &OpticsParser::DualBandBSDF::visible); - - py::class_(m, "PVPowerProperty") - .def(py::init(), py::arg("jsc"), py::arg("voc"), - py::arg("ff")) - .def_readwrite("jsc", &OpticsParser::PVPowerProperty::jsc) - .def_readwrite("voc", &OpticsParser::PVPowerProperty::voc) - .def_readwrite("ff", &OpticsParser::PVPowerProperty::ff); - - py::class_>(m, "ProductData") - .def_readwrite("product_name", &OpticsParser::ProductData::productName) - .def_readwrite("product_type", &OpticsParser::ProductData::productType) - .def_readwrite("product_subtype", - &OpticsParser::ProductData::productSubtype) - .def_readwrite("nfrc_id", &OpticsParser::ProductData::nfrcid) - .def_readwrite("thickness", &OpticsParser::ProductData::thickness) - .def_readwrite("conductivity", &OpticsParser::ProductData::conductivity) - .def_readwrite("coating_name", &OpticsParser::ProductData::coatingName) - .def_readwrite("coated_side", &OpticsParser::ProductData::coatedSide) - .def_readwrite("ir_transmittance", - &OpticsParser::ProductData::IRTransmittance) - .def_readwrite("emissivity_front", - &OpticsParser::ProductData::frontEmissivity) - .def_readwrite("emissivity_back", - &OpticsParser::ProductData::backEmissivity) - .def_readwrite("measurements", &OpticsParser::ProductData::measurements) - .def_readwrite("permeability_factor", - &OpticsParser::ProductData::permeabilityFactor) - .def_readwrite("density", &OpticsParser::ProductData::density) - .def_readwrite("youngs_modulus", - &OpticsParser::ProductData::youngsModulus) - .def_readwrite("pv_power_properties", - &OpticsParser::ProductData::pvPowerProperties) - .def_readwrite("composition", &OpticsParser::ProductData::composition); - - py::class_>( - m, "ProductComposistionData") - .def(py::init, - std::shared_ptr>(), - py::arg("solid_layers"), py::arg("product_geometry")) - .def_readwrite("material", - &OpticsParser::CompositionInformation::material) - .def_readwrite("geometry", - &OpticsParser::CompositionInformation::geometry); - - py::enum_(m, "SpectrumType", - py::arithmetic()) - .value("NONE", window_standards::Spectrum_Type::NONE) - .value("FILE", window_standards::Spectrum_Type::FILE) - .value("BLACKBODY", window_standards::Spectrum_Type::BLACKBODY) - .value("UV_ACTION", window_standards::Spectrum_Type::UV_ACTION) - .value("KROCHMANN", window_standards::Spectrum_Type::KROCHMANN); - - py::class_(m, "Spectrum") - .def_readwrite("type", &window_standards::Spectrum::type) - .def_readwrite("description", &window_standards::Spectrum::description) - .def_readwrite("t", &window_standards::Spectrum::t) - .def_readwrite("a", &window_standards::Spectrum::a) - .def_readwrite("b", &window_standards::Spectrum::b) - .def_readwrite("values", &window_standards::Spectrum::values); - - py::enum_(m, "WavelengthSetType", - py::arithmetic()) - .value("FILE", window_standards::Wavelength_Set_Type::FILE) - .value("SOURCE", window_standards::Wavelength_Set_Type::SOURCE) - .value("DATA", window_standards::Wavelength_Set_Type::DATA); - - py::class_(m, "WavelengthSet") - .def_readwrite("type", &window_standards::Wavelength_Set::type) - .def_readwrite("description", - &window_standards::Wavelength_Set::description) - .def_readwrite("values", &window_standards::Wavelength_Set::values); - - py::enum_( - m, "WavelengthBoundaryType", py::arithmetic()) - .value("NUMBER", window_standards::Wavelength_Boundary_Type::NUMBER) - .value("WAVELENGTH_SET", - window_standards::Wavelength_Boundary_Type::WAVELENGTH_SET); - - py::class_(m, "WavelengthBoundary") - .def_readwrite("type", &window_standards::Wavelength_Boundary::type) - .def_readwrite("value", &window_standards::Wavelength_Boundary::value); - - py::enum_(m, "IntegrationRuleType", + m.doc() = "Python bindings for WinCalc"; + + py::enum_(m, "PredefinedGasType", py::arithmetic()) + .value("AIR", Gases::GasDef::Air) + .value("ARGON", Gases::GasDef::Argon) + .value("KRYPTON", Gases::GasDef::Krypton) + .value("XENON", Gases::GasDef::Xenon); + + py::class_(m, "GasCoefficients") + .def(py::init(), py::arg("A"), + py::arg("B"), py::arg("C")); + + py::class_(m, "GasData") + .def(py::init(), + py::arg("name"), py::arg("molecular_weight"), + py::arg("specific_heat_ratio"), py::arg("Cp"), + py::arg("thermal_conductivity"), py::arg("viscosity")) + .def("get_molecular_weight", &Gases::CGasData::getMolecularWeight) + .def("get_property_value", &Gases::CGasData::getPropertyValue, + py::arg("type"), py::arg("temperature")) + .def("get_specific_heat_ratio", &Gases::CGasData::getSpecificHeatRatio) + .def("name", &Gases::CGasData::name); + + py::class_(m, "Gas") + .def(py::init const &>(), py::arg("gases")) + .def("get_simple_gas_properties", &Gases::CGas::getSimpleGasProperties) + .def("get_gas_properties", &Gases::CGas::getGasProperties) + .def("set_temperature_and_pressure", + &Gases::CGas::setTemperatureAndPressure) + .def("gas_items", &Gases::CGas::gasItems) + .def("total_percent", &Gases::CGas::totalPercent) + .def("add_gas_items", &Gases::CGas::addGasItems) + .def("add_gas_item", + py::overload_cast( + &Gases::CGas::addGasItem), + py::arg("percent"), py::arg("gas_data")) + .def("add_gas_item", + py::overload_cast(&Gases::CGas::addGasItem), + py::arg("percent"), py::arg("predefined_gas")); + + py::class_>(m, "IGUGapLayer") + .def(py::init(), py::arg("thickness"), + py::arg("pressure")) + .def(py::init(), + py::arg("thickness"), py::arg("pressure"), py::arg("gas")); + + py::enum_(m, "CellSpacingType", py::arithmetic()) + .value("SQUARE", Tarcog::ISO15099::CellSpacingType::Square) + .value("SHIFTEDSQUARE", Tarcog::ISO15099::CellSpacingType::ShiftedSquare) + .value("SHIFTEDROTATEDSQUARE", Tarcog::ISO15099::CellSpacingType::ShiftedRotatedSquare); + + m.def("pillar_cell_area", Tarcog::ISO15099::pillarCellArea, py::arg("cell_spacing_type"), py::arg("sp")); + + py::enum_(m, "PolygonType", py::arithmetic()) + .value("TRIANGLE", Tarcog::ISO15099::PolygonType::Triangle) + .value("PENTAGON", Tarcog::ISO15099::PolygonType::Pentagon) + .value("HEXAGON", Tarcog::ISO15099::PolygonType::Hexagon); + + py::class_>( + m, "UniversalSupportPillar") + .def(py::init(), + py::arg("gap_layer"), py::arg("material_conductivity"), + py::arg("cell_area")); + + py::class_>(m, "PillarData") + .def(py::init(), + py::arg("height"), py::arg("material_conductivity"), py::arg("cell_area")) + .def_readwrite("height", &Tarcog::ISO15099::PillarData::height) + .def_readwrite("material_conductivity", + &Tarcog::ISO15099::PillarData::materialConductivity) + .def_readwrite("cell_area", &Tarcog::ISO15099::PillarData::cellArea); + + py::class_>( + m, "CylindricalPillar") + .def(py::init(), + py::arg("height"), py::arg("material_conductivity"), py::arg("cell_area"), py::arg("radius")) + .def_readwrite("radius", &Tarcog::ISO15099::CylindricalPillar::radius); + + py::class_>( + m, "CylindricalPillarLayer") + .def(py::init(), + py::arg("gap_layer"), py::arg("cylindrical_pillar")); + + py::class_>( + m, "SphericalPillar") + .def(py::init(), + py::arg("height"), py::arg("material_conductivity"), py::arg("cell_area"), + py::arg("radius_of_contact")) + .def_readwrite("radius_of_contact", &Tarcog::ISO15099::SphericalPillar::radiusOfContact); + + py::class_>( + m, "SphericalPillarLayer") + .def(py::init(), + py::arg("gap_layer"), py::arg("spherical_pillar")); + + py::class_>( + m, "RectangularPillar") + .def(py::init(), + py::arg("height"), py::arg("material_conductivity"), py::arg("cell_area"), py::arg("length"), + py::arg("width")) + .def_readwrite("length", &Tarcog::ISO15099::RectangularPillar::length) + .def_readwrite("width", &Tarcog::ISO15099::RectangularPillar::width); + + py::class_>( + m, "RectangularPillarLayer") + .def(py::init(), + py::arg("gap_layer"), py::arg("rectangular_pillar")); + + py::class_>( + m, "PolygonalPillar") + .def(py::init(), + py::arg("height"), py::arg("material_conductivity"), py::arg("cell_area"), py::arg("length"), + py::arg("polygon_type")) + .def_readwrite("length", &Tarcog::ISO15099::PolygonalPillar::length) + .def_readwrite("polygon_type", &Tarcog::ISO15099::PolygonalPillar::type); + + py::class_>( + m, "TriangularPillarLayer") + .def(py::init(), + py::arg("gap_layer"), py::arg("polygon_pillar")); + + py::class_>( + m, "PentagonPillarLayer") + .def(py::init(), + py::arg("gap_layer"), py::arg("polygon_pillar")); + + py::class_>( + m, "HexagonPillarLayer") + .def(py::init(), + py::arg("gap_layer"), py::arg("polygon_pillar")); + + // py::class_>( + // m, "CircularPillar") + // .def(py::init(), + // py::arg("gap_layer"), py::arg("conductivity"), + // py::arg("spacing"), py::arg("radius")); + + py::class_>( + m, "IGUVentilatedGapLayer") + .def(py::init const &>(), + py::arg("gap_layer")) + .def(py::init, double, + double>(), + py::arg("gap_layer"), py::arg("inlet_temperature"), + py::arg("inlet_speed")) + .def("layer_temperature", + &Tarcog::ISO15099::CIGUVentilatedGapLayer::averageLayerTemperature) + .def("set_flow_geometry", + &Tarcog::ISO15099::CIGUVentilatedGapLayer::setFlowGeometry, + py::arg("a_in"), py::arg("a_out")) + .def("set_inlet_temperature", + &Tarcog::ISO15099::CIGUVentilatedGapLayer::setInletTemperature, + py::arg("inlet_temperature")) + .def("set_flow_temperatures", + &Tarcog::ISO15099::CIGUVentilatedGapLayer::setFlowTemperatures, + py::arg("inlet_temperature"), py::arg("outlet_temperature")) + .def("set_flow_speed", + &Tarcog::ISO15099::CIGUVentilatedGapLayer::setFlowSpeed, + py::arg("speed")) + .def("smooth_energy_gain", + &Tarcog::ISO15099::CIGUVentilatedGapLayer::smoothEnergyGain, + py::arg("qv1"), py::arg("qv2")) + .def( + "calculate_ventilated_airflow", + &Tarcog::ISO15099::CIGUVentilatedGapLayer::calculateVentilatedAirflow, + py::arg("inlet_temperature")) + .def("calculate_thermally_driven_airflow_with_adjacent_gap", + &Tarcog::ISO15099::CIGUVentilatedGapLayer:: + calculateThermallyDrivenAirflowWithAdjacentGap, + py::arg("adjacent_gap")) + .def("clone", &Tarcog::ISO15099::CIGUVentilatedGapLayer::clone); + + m.def("forced_ventilation_gap", + Tarcog::ISO15099::Layers::forcedVentilationGap, py::arg("gap"), + py::arg("forced_ventilation_air_speed"), + py::arg("forced_ventilation_air_temperature")); + + py::class_(m, + "OpticalMeasurementComponent") + .def(py::init(), + py::arg("transmittance_front"), py::arg("transmittance_back"), + py::arg("reflectance_front"), py::arg("reflectance_back")) + .def_readwrite("transmittance_front", + &OpticsParser::MeasurementComponent::tf) + .def_readwrite("transmittance_back", + &OpticsParser::MeasurementComponent::tb) + .def_readwrite("reflectance_front", + &OpticsParser::MeasurementComponent::rf) + .def_readwrite("reflectance_back", + &OpticsParser::MeasurementComponent::rb); + + py::class_(m, "PVWavelengthData") + .def(py::init(), py::arg("eqe_front"), + py::arg("eqe_back")) + .def_readwrite("eqq_front", &OpticsParser::PVWavelengthData::eqef) + .def_readwrite("eqe_back", &OpticsParser::PVWavelengthData::eqeb); + + py::class_(m, "WavelengthData") + .def(py::init>(), + py::arg("wavelength_microns"), py::arg("direct_component"), + py::arg("diffuse_component") = + std::optional()) + .def(py::init(), + py::arg("wavelength_microns"), py::arg("direct_transmittance"), + py::arg("direct_reflectance_front"), + py::arg("direct_reflectance_back")) + .def(py::init(), + py::arg("wavelength_microns"), py::arg("direct_transmittance_front"), + py::arg("diffuse_transmittance_front"), + py::arg("direct_transmittance_back"), + py::arg("diffuse_transmittance_back"), + py::arg("direct_reflectance_front"), + py::arg("diffuse_reflectance_front"), + py::arg("direct_reflectance_back"), + py::arg("diffuse_reflectance_back")) + .def_readwrite("wavelength", &OpticsParser::WLData::wavelength) + .def_readwrite("direct_component", &OpticsParser::WLData::directComponent) + .def_readwrite("diffuse_component", + &OpticsParser::WLData::diffuseComponent) + .def_readwrite("pv_component", &OpticsParser::WLData::pvComponent); + + py::class_>(m, + "ProductGeometry"); + + py::class_>( + m, "ParsedVenetianGeometry") + .def(py::init(), + py::arg("slat_width"), py::arg("slat_spacing"), + py::arg("slat_curvature"), py::arg("slat_tilt") = 0, + py::arg("tilt_choice") = "0", py::arg("number_segments") = 5) + .def_readwrite("slat_width", &OpticsParser::VenetianGeometry::slatWidth) + .def_readwrite("slat_spacing", + &OpticsParser::VenetianGeometry::slatSpacing) + .def_readwrite("slat_curvature", + &OpticsParser::VenetianGeometry::slatCurvature) + .def_readwrite("slat_tilt", &OpticsParser::VenetianGeometry::slatTilt) + .def_readwrite("number_segments", + &OpticsParser::VenetianGeometry::numberSegments); + + py::class_>( + m, "ParsedWovenGeometry") + .def(py::init()) + .def_readwrite("thread_diameter", + &OpticsParser::WovenGeometry::threadDiameter) + .def_readwrite("thread_spacing", + &OpticsParser::WovenGeometry::threadSpacing) + .def_readwrite("shade_thickness", + &OpticsParser::WovenGeometry::shadeThickness); + + py::class_>( + m, "ParsedPerforatedGeometry") + .def(py::init(), + py::arg("spacing_x_meters"), py::arg("spacing_y_meters"), + py::arg("dimension_x_meters"), py::arg("dimension_y_meters"), + py::arg("perforation_type")) + .def_readwrite("spacing_x", &OpticsParser::PerforatedGeometry::spacingX) + .def_readwrite("spacing_y", &OpticsParser::PerforatedGeometry::spacingY) + .def_readwrite("dimension_x", + &OpticsParser::PerforatedGeometry::dimensionX) + .def_readwrite("dimension_y", + &OpticsParser::PerforatedGeometry::dimensionY) + .def_readwrite("perforation_type", + &OpticsParser::PerforatedGeometry::perforationType); + + py::class_(m, "BSDF") + .def_readwrite("data", &OpticsParser::BSDF::data) + .def_readwrite("row_angle_basis_name", + &OpticsParser::BSDF::rowAngleBasisName) + .def_readwrite("column_angle_basis_name", + &OpticsParser::BSDF::columnAngleBasisName); + + py::class_(m, "WavelengthBSDFs") + .def_readwrite("transmittance_front", &OpticsParser::WavelengthBSDFs::tf) + .def_readwrite("transmittance_back", &OpticsParser::WavelengthBSDFs::tb) + .def_readwrite("reflectance_front", &OpticsParser::WavelengthBSDFs::rf) + .def_readwrite("reflectance_back", &OpticsParser::WavelengthBSDFs::rb); + + py::class_(m, "DualBandBSDF") + .def_readwrite("solar", &OpticsParser::DualBandBSDF::solar) + .def_readwrite("visible", &OpticsParser::DualBandBSDF::visible); + + py::class_(m, "PVPowerProperty") + .def(py::init(), py::arg("jsc"), py::arg("voc"), + py::arg("ff")) + .def_readwrite("jsc", &OpticsParser::PVPowerProperty::jsc) + .def_readwrite("voc", &OpticsParser::PVPowerProperty::voc) + .def_readwrite("ff", &OpticsParser::PVPowerProperty::ff); + + py::class_>(m, "ProductData") + .def_readwrite("product_name", &OpticsParser::ProductData::productName) + .def_readwrite("product_type", &OpticsParser::ProductData::productType) + .def_readwrite("product_subtype", + &OpticsParser::ProductData::productSubtype) + .def_readwrite("nfrc_id", &OpticsParser::ProductData::nfrcid) + .def_readwrite("thickness", &OpticsParser::ProductData::thickness) + .def_readwrite("conductivity", &OpticsParser::ProductData::conductivity) + .def_readwrite("coating_name", &OpticsParser::ProductData::coatingName) + .def_readwrite("coated_side", &OpticsParser::ProductData::coatedSide) + .def_readwrite("ir_transmittance", + &OpticsParser::ProductData::IRTransmittance) + .def_readwrite("emissivity_front", + &OpticsParser::ProductData::frontEmissivity) + .def_readwrite("emissivity_back", + &OpticsParser::ProductData::backEmissivity) + .def_readwrite("measurements", &OpticsParser::ProductData::measurements) + .def_readwrite("permeability_factor", + &OpticsParser::ProductData::permeabilityFactor) + .def_readwrite("density", &OpticsParser::ProductData::density) + .def_readwrite("youngs_modulus", + &OpticsParser::ProductData::youngsModulus) + .def_readwrite("pv_power_properties", + &OpticsParser::ProductData::pvPowerProperties) + .def_readwrite("composition", &OpticsParser::ProductData::composition); + + py::class_>( + m, "ProductComposistionData") + .def(py::init, + std::shared_ptr>(), + py::arg("solid_layers"), py::arg("product_geometry")) + .def_readwrite("material", + &OpticsParser::CompositionInformation::material) + .def_readwrite("geometry", + &OpticsParser::CompositionInformation::geometry); + + py::enum_(m, "SpectrumType", + py::arithmetic()) + .value("NONE", window_standards::Spectrum_Type::NONE) + .value("FILE", window_standards::Spectrum_Type::FILE) + .value("BLACKBODY", window_standards::Spectrum_Type::BLACKBODY) + .value("UV_ACTION", window_standards::Spectrum_Type::UV_ACTION) + .value("KROCHMANN", window_standards::Spectrum_Type::KROCHMANN); + + py::class_(m, "Spectrum") + .def_readwrite("type", &window_standards::Spectrum::type) + .def_readwrite("description", &window_standards::Spectrum::description) + .def_readwrite("t", &window_standards::Spectrum::t) + .def_readwrite("a", &window_standards::Spectrum::a) + .def_readwrite("b", &window_standards::Spectrum::b) + .def_readwrite("values", &window_standards::Spectrum::values); + + py::enum_(m, "WavelengthSetType", + py::arithmetic()) + .value("FILE", window_standards::Wavelength_Set_Type::FILE) + .value("SOURCE", window_standards::Wavelength_Set_Type::SOURCE) + .value("DATA", window_standards::Wavelength_Set_Type::DATA); + + py::class_(m, "WavelengthSet") + .def_readwrite("type", &window_standards::Wavelength_Set::type) + .def_readwrite("description", + &window_standards::Wavelength_Set::description) + .def_readwrite("values", &window_standards::Wavelength_Set::values); + + py::enum_( + m, "WavelengthBoundaryType", py::arithmetic()) + .value("NUMBER", window_standards::Wavelength_Boundary_Type::NUMBER) + .value("WAVELENGTH_SET", + window_standards::Wavelength_Boundary_Type::WAVELENGTH_SET); + + py::class_(m, "WavelengthBoundary") + .def_readwrite("type", &window_standards::Wavelength_Boundary::type) + .def_readwrite("value", &window_standards::Wavelength_Boundary::value); + + py::enum_(m, "IntegrationRuleType", + py::arithmetic()) + .value("TRAPEZOIDAL", + window_standards::Integration_Rule_Type::TRAPEZOIDAL) + .value("RECTANGULAR", + window_standards::Integration_Rule_Type::RECTANGULAR) + .value("TABLE", window_standards::Integration_Rule_Type::TABLE); + + py::class_(m, "IntegrationRule") + .def_readwrite("type", &window_standards::Integration_Rule::type) + .def_readwrite("k", &window_standards::Integration_Rule::k); + + py::class_(m, + "OpticalStandardMethod") + .def_readwrite("name", &window_standards::Optical_Standard_Method::name) + .def_readwrite("description", + &window_standards::Optical_Standard_Method::description) + .def_readwrite( + "source_spectrum", + &window_standards::Optical_Standard_Method::source_spectrum) + .def_readwrite( + "detector_spectrum", + &window_standards::Optical_Standard_Method::detector_spectrum) + .def_readwrite("wavelength_set", + &window_standards::Optical_Standard_Method::wavelength_set) + .def_readwrite( + "integration_rule", + &window_standards::Optical_Standard_Method::integration_rule) + .def_readwrite("min_wavelength", + &window_standards::Optical_Standard_Method::min_wavelength) + .def_readwrite( + "max_wavelength", + &window_standards::Optical_Standard_Method::max_wavelength); + + py::class_(m, "OpticalStandard") + .def_readwrite("name", &window_standards::Optical_Standard::name) + .def_readwrite("description", + &window_standards::Optical_Standard::description) + .def_readwrite("file", &window_standards::Optical_Standard::file) + .def_readwrite("methods", &window_standards::Optical_Standard::methods); + + py::class_(m, "Trichromatic") + .def_readwrite("X", &wincalc::Trichromatic::X) + .def_readwrite("Y", &wincalc::Trichromatic::Y) + .def_readwrite("Z", &wincalc::Trichromatic::Z); + + py::class_(m, "RGB") + .def_readwrite("R", &wincalc::WinCalc_RGB::R) + .def_readwrite("G", &wincalc::WinCalc_RGB::G) + .def_readwrite("B", &wincalc::WinCalc_RGB::B); + + py::class_(m, "Lab") + .def_readwrite("L", &wincalc::Lab::L) + .def_readwrite("a", &wincalc::Lab::a) + .def_readwrite("b", &wincalc::Lab::b); + + py::class_(m, "ColorResult") + .def_readwrite("trichromatic", &wincalc::Color_Result::trichromatic) + .def_readwrite("rgb", &wincalc::Color_Result::rgb) + .def_readwrite("lab", &wincalc::Color_Result::lab); + + declare_wce_optical_results_template(m, ""); + declare_wce_optical_results_template(m, "Color"); + + py::enum_( + m, "BoundaryConditionsCoefficientModelType", py::arithmetic()) + .value("CALCULATED_H", + Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH) + .value("H_PRESCRIBED", + Tarcog::ISO15099::BoundaryConditionsCoeffModel::HPrescribed) + .value("HC_PRESCRIBED", + Tarcog::ISO15099::BoundaryConditionsCoeffModel::HcPrescribed); + + py::enum_( + m, "AirHorizontalDirection", py::arithmetic()) + .value("NONE", Tarcog::ISO15099::AirHorizontalDirection::None) + .value("LEEWARD", Tarcog::ISO15099::AirHorizontalDirection::Leeward) + .value("WINDWARD", Tarcog::ISO15099::AirHorizontalDirection::Windward); + + py::class_(m, "Environment") + .def(py::init(), + py::arg("air_temperature"), py::arg("pressure"), + py::arg("convection_coefficient"), py::arg("coefficient_model"), + py::arg("radiation_temperature"), py::arg("emissivity"), + py::arg("air_speed") = 0, + py::arg("air_direction") = + Tarcog::ISO15099::AirHorizontalDirection::None, + py::arg("direct_solar_radiation") = 0) + .def_readwrite("air_temperature", &wincalc::Environment::air_temperature) + .def_readwrite("pressure", &wincalc::Environment::pressure) + .def_readwrite("convection_coefficient", + &wincalc::Environment::convection_coefficient) + .def_readwrite("coefficient_model", + &wincalc::Environment::coefficient_model) + .def_readwrite("radiation_temperature", + &wincalc::Environment::radiation_temperature) + .def_readwrite("emissivity", &wincalc::Environment::emissivity) + .def_readwrite("air_speed", &wincalc::Environment::air_speed) + .def_readwrite("air_direction", &wincalc::Environment::air_direction) + .def_readwrite("direct_solar_radiation", + &wincalc::Environment::direct_solar_radiation); + + py::class_(m, "Environments") + .def(py::init(), + py::arg("outside"), py::arg("inside")) + .def_readwrite("outside", &wincalc::Environments::outside) + .def_readwrite("inside", &wincalc::Environments::inside); + + m.def("nfrc_u_environments", &wincalc::nfrc_u_environments, + "Returns the default environments for running a NFRC U-Value " + "calculation."); + m.def( + "nfrc_shgc_environments", &wincalc::nfrc_shgc_environments, + "Returns the default environments for running a NFRC SHGC calculation."); + + py::class_>( + m, "FlippableSolidLayer") + .def(py::init(), py::arg("thickness_meters"), + py::arg("flipped") = false) + .def_readwrite("thickness_meters", + &wincalc::Flippable_Solid_Layer::thickness_meters) + .def_readwrite("flipped", &wincalc::Flippable_Solid_Layer::flipped); + + py::class_>( + m, "ProductDataThermal") + .def(py::init(), + py::arg("conductivity"), py::arg("thickness_meters"), + py::arg("flipped") = false, py::arg("opening_top") = 0, + py::arg("opening_bottom") = 0, py::arg("opening_left") = 0, + py::arg("opening_right") = 0, py::arg("opening_front") = 0) + .def_readwrite("conductivity", + &wincalc::Product_Data_Thermal::conductivity) + .def_readwrite("opening_top", &wincalc::Product_Data_Thermal::opening_top) + .def_readwrite("opening_bottom", + &wincalc::Product_Data_Thermal::opening_bottom) + .def_readwrite("opening_left", + &wincalc::Product_Data_Thermal::opening_left) + .def_readwrite("opening_right", + &wincalc::Product_Data_Thermal::opening_right) + .def_readwrite("opening_front", + &wincalc::Product_Data_Thermal::opening_front) + .def_readwrite("youngs_modulus", + &wincalc::Product_Data_Thermal::youngs_modulus) + .def_readwrite("density", &wincalc::Product_Data_Thermal::density); + + py::class_>( + m, "ProductDataOptical") + .def(py::init, std::optional, + std::optional, std::optional, double, + bool>(), + py::arg("thickness_meters"), + py::arg("ir_transmittance_front") = std::optional(), + py::arg("ir_transmittance_back") = std::optional(), + py::arg("emissivity_front") = std::optional(), + py::arg("emissivity_back") = std::optional(), + py::arg("permeability_factor") = 0.0, py::arg("flipped") = false) + .def("effective_thermal_values", + &wincalc::Product_Data_Optical::effective_thermal_values) + .def("wavelengths", &wincalc::Product_Data_Optical::wavelengths) + .def_readwrite("ir_transmittance_front", + &wincalc::Product_Data_Optical::ir_transmittance_front) + .def_readwrite("ir_transmittance_back", + &wincalc::Product_Data_Optical::ir_transmittance_back) + .def_readwrite("emissivity_front", + &wincalc::Product_Data_Optical::emissivity_front) + .def_readwrite("emissivity_back", + &wincalc::Product_Data_Optical::emissivity_back) + .def_readwrite("permeability_factor", + &wincalc::Product_Data_Optical::permeability_factor); + + py::enum_(m, "MaterialType", + py::arithmetic()) + .value("APPLIED_FILM", FenestrationCommon::MaterialType::AppliedFilm) + .value("COATED", FenestrationCommon::MaterialType::Coated) + .value("ELECTROCHROMIC", FenestrationCommon::MaterialType::Electrochromic) + .value("FILM", FenestrationCommon::MaterialType::Film) + .value("INTERLAYER", FenestrationCommon::MaterialType::Interlayer) + .value("LAMINATE", FenestrationCommon::MaterialType::Laminate) + .value("MONOLITHIC", FenestrationCommon::MaterialType::Monolithic) + .value("THERMOCHROMIC", FenestrationCommon::MaterialType::Thermochromic); + + py::enum_(m, "CoatedSide", py::arithmetic()) + .value("FRONT", wincalc::CoatedSide::FRONT) + .value("BACK", wincalc::CoatedSide::BACK) + .value("BOTH", wincalc::CoatedSide::BOTH) + .value("NEITHER", wincalc::CoatedSide::NEITHER); + + py::class_>( + m, "ProductDataOpticalNBand") + .def(py::init, + std::optional, std::optional, + std::optional, std::optional, + std::optional, double, bool>(), + py::arg("material_type"), py::arg("thickness_meters"), + py::arg("wavelength_data"), + py::arg("coated_side") = std::optional(), + py::arg("ir_transmittance_front") = std::optional(), + py::arg("ir_transmittance_back") = std::optional(), + py::arg("emissivity_front") = std::optional(), + py::arg("emissivity_back") = std::optional(), + py::arg("permeability_factor") = 0, py::arg("flipped") = false) + .def("wavelengths", &wincalc::Product_Data_N_Band_Optical::wavelengths) + .def_readwrite("material_type", + &wincalc::Product_Data_N_Band_Optical::material_type) + .def_readwrite("wavelength_data", + &wincalc::Product_Data_N_Band_Optical::wavelength_data); + + py::class_>( + m, "ProductDataOpticalDualBand") + .def(py::init, std::optional, + std::optional, std::optional, double, + bool>(), + py::arg("thickness_meters"), + py::arg("ir_transmittance_front") = std::optional(), + py::arg("ir_transmittance_back") = std::optional(), + py::arg("emissivity_front") = std::optional(), + py::arg("emissivity_back") = std::optional(), + py::arg("permeability_factor") = 0.0, py::arg("flipped") = false) + .def("wavelengths", + &wincalc::Product_Data_Dual_Band_Optical::wavelengths); + + py::class_< + wincalc::Product_Data_Dual_Band_Optical_Hemispheric, + wincalc::Product_Data_Dual_Band_Optical, + std::shared_ptr>( + m, "ProductDataOpticalDualBandHemispheric") + .def(py::init, + std::optional, std::optional, + std::optional, double, bool>(), + py::arg("solar_transmittance_front"), + py::arg("solar_transmittance_back"), + py::arg("solar_reflectance_front"), + py::arg("solar_reflectance_back"), + py::arg("visible_transmittance_front"), + py::arg("visible_transmittance_back"), + py::arg("visible_reflectance_front"), + py::arg("visible_reflectance_back"), py::arg("thickness_meters"), + py::arg("ir_transmittance_front") = std::optional(), + py::arg("ir_transmittance_back") = std::optional(), + py::arg("emissivity_front") = std::optional(), + py::arg("emissivity_back") = std::optional(), + py::arg("permeability_factor") = 0.0, py::arg("flipped") = false) + .def_readwrite( + "solar_transmittance_front", + &wincalc::Product_Data_Dual_Band_Optical_Hemispheric::tf_solar) + .def_readwrite( + "solar_transmittance_back", + &wincalc::Product_Data_Dual_Band_Optical_Hemispheric::tb_solar) + .def_readwrite( + "solar_reflectance_front", + &wincalc::Product_Data_Dual_Band_Optical_Hemispheric::rf_solar) + .def_readwrite( + "solar_reflectance_back", + &wincalc::Product_Data_Dual_Band_Optical_Hemispheric::rb_solar) + .def_readwrite( + "visible_transmittance_front", + &wincalc::Product_Data_Dual_Band_Optical_Hemispheric::tf_visible) + .def_readwrite( + "visible_transmittance_back", + &wincalc::Product_Data_Dual_Band_Optical_Hemispheric::tb_visible) + .def_readwrite( + "visible_reflectance_front", + &wincalc::Product_Data_Dual_Band_Optical_Hemispheric::rf_visible) + .def_readwrite( + "visible_reflectance_back", + &wincalc::Product_Data_Dual_Band_Optical_Hemispheric::rb_visible); + + py::class_>( + m, "ProductDataOpticalDualBandBSDF") + .def(py::init> const &, + std::vector> const &, + std::vector> const &, + std::vector> const &, + std::vector> const &, + std::vector> const &, + std::vector> const &, + std::vector> const &, + SingleLayerOptics::BSDFHemisphere const &, double, + std::optional, std::optional, + std::optional, std::optional, double, + bool>(), + py::arg("solar_transmittance_front"), + py::arg("solar_transmittance_back"), + py::arg("solar_reflectance_front"), + py::arg("solar_reflectance_back"), + py::arg("visible_transmittance_front"), + py::arg("visible_transmittance_back"), + py::arg("visible_reflectance_front"), + py::arg("visible_reflectance_back"), py::arg("bsdf_hemisphere"), + py::arg("thickness_meters"), + py::arg("ir_transmittance_front") = std::optional(), + py::arg("ir_transmittance_back") = std::optional(), + py::arg("emissivity_front") = std::optional(), + py::arg("emissivity_back") = std::optional(), + py::arg("permeability_factor") = 0.0, py::arg("flipped") = false) + .def_readwrite("solar_transmittance_front", + &wincalc::Product_Data_Dual_Band_Optical_BSDF::tf_solar) + .def_readwrite("solar_transmittance_back", + &wincalc::Product_Data_Dual_Band_Optical_BSDF::tb_solar) + .def_readwrite("solar_reflectance_front", + &wincalc::Product_Data_Dual_Band_Optical_BSDF::rf_solar) + .def_readwrite("solar_reflectance_back", + &wincalc::Product_Data_Dual_Band_Optical_BSDF::rb_solar) + .def_readwrite("visible_transmittance_front", + &wincalc::Product_Data_Dual_Band_Optical_BSDF::tf_visible) + .def_readwrite("visible_transmittance_back", + &wincalc::Product_Data_Dual_Band_Optical_BSDF::tb_visible) + .def_readwrite("visible_reflectance_front", + &wincalc::Product_Data_Dual_Band_Optical_BSDF::rf_visible) + .def_readwrite("visible_reflectance_back", + &wincalc::Product_Data_Dual_Band_Optical_BSDF::rb_visible) + .def("effective_thermal_values", + &wincalc::Product_Data_Dual_Band_Optical_BSDF:: + effective_thermal_values); + + py::class_>( + m, "ProductDataOpticalWithMaterial") + .def(py::init const &>(), + py::arg("product_data_optical")) + .def("optical_data", + &wincalc::Product_Data_Optical_With_Material::optical_data) + .def("wavelengths", + &wincalc::Product_Data_Optical_With_Material::wavelengths) + .def_readwrite( + "material_optical_data", + &wincalc::Product_Data_Optical_With_Material::material_optical_data); + + py::enum_(m, "DistributionMethodType", py::arithmetic()) - .value("TRAPEZOIDAL", - window_standards::Integration_Rule_Type::TRAPEZOIDAL) - .value("RECTANGULAR", - window_standards::Integration_Rule_Type::RECTANGULAR) - .value("TABLE", window_standards::Integration_Rule_Type::TABLE); - - py::class_(m, "IntegrationRule") - .def_readwrite("type", &window_standards::Integration_Rule::type) - .def_readwrite("k", &window_standards::Integration_Rule::k); - - py::class_(m, - "OpticalStandardMethod") - .def_readwrite("name", &window_standards::Optical_Standard_Method::name) - .def_readwrite("description", - &window_standards::Optical_Standard_Method::description) - .def_readwrite( - "source_spectrum", - &window_standards::Optical_Standard_Method::source_spectrum) - .def_readwrite( - "detector_spectrum", - &window_standards::Optical_Standard_Method::detector_spectrum) - .def_readwrite("wavelength_set", - &window_standards::Optical_Standard_Method::wavelength_set) - .def_readwrite( - "integration_rule", - &window_standards::Optical_Standard_Method::integration_rule) - .def_readwrite("min_wavelength", - &window_standards::Optical_Standard_Method::min_wavelength) - .def_readwrite( - "max_wavelength", - &window_standards::Optical_Standard_Method::max_wavelength); - - py::class_(m, "OpticalStandard") - .def_readwrite("name", &window_standards::Optical_Standard::name) - .def_readwrite("description", - &window_standards::Optical_Standard::description) - .def_readwrite("file", &window_standards::Optical_Standard::file) - .def_readwrite("methods", &window_standards::Optical_Standard::methods); - - py::class_(m, "Trichromatic") - .def_readwrite("X", &wincalc::Trichromatic::X) - .def_readwrite("Y", &wincalc::Trichromatic::Y) - .def_readwrite("Z", &wincalc::Trichromatic::Z); - - py::class_(m, "RGB") - .def_readwrite("R", &wincalc::WinCalc_RGB::R) - .def_readwrite("G", &wincalc::WinCalc_RGB::G) - .def_readwrite("B", &wincalc::WinCalc_RGB::B); - - py::class_(m, "Lab") - .def_readwrite("L", &wincalc::Lab::L) - .def_readwrite("a", &wincalc::Lab::a) - .def_readwrite("b", &wincalc::Lab::b); - - py::class_(m, "ColorResult") - .def_readwrite("trichromatic", &wincalc::Color_Result::trichromatic) - .def_readwrite("rgb", &wincalc::Color_Result::rgb) - .def_readwrite("lab", &wincalc::Color_Result::lab); - - declare_wce_optical_results_template(m, ""); - declare_wce_optical_results_template(m, "Color"); - - py::enum_( - m, "BoundaryConditionsCoefficientModelType", py::arithmetic()) - .value("CALCULATED_H", - Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH) - .value("H_PRESCRIBED", - Tarcog::ISO15099::BoundaryConditionsCoeffModel::HPrescribed) - .value("HC_PRESCRIBED", - Tarcog::ISO15099::BoundaryConditionsCoeffModel::HcPrescribed); - - py::enum_( - m, "AirHorizontalDirection", py::arithmetic()) - .value("NONE", Tarcog::ISO15099::AirHorizontalDirection::None) - .value("LEEWARD", Tarcog::ISO15099::AirHorizontalDirection::Leeward) - .value("WINDWARD", Tarcog::ISO15099::AirHorizontalDirection::Windward); - - py::class_(m, "Environment") - .def(py::init(), - py::arg("air_temperature"), py::arg("pressure"), - py::arg("convection_coefficient"), py::arg("coefficient_model"), - py::arg("radiation_temperature"), py::arg("emissivity"), - py::arg("air_speed") = 0, - py::arg("air_direction") = - Tarcog::ISO15099::AirHorizontalDirection::None, - py::arg("direct_solar_radiation") = 0) - .def_readwrite("air_temperature", &wincalc::Environment::air_temperature) - .def_readwrite("pressure", &wincalc::Environment::pressure) - .def_readwrite("convection_coefficient", - &wincalc::Environment::convection_coefficient) - .def_readwrite("coefficient_model", - &wincalc::Environment::coefficient_model) - .def_readwrite("radiation_temperature", - &wincalc::Environment::radiation_temperature) - .def_readwrite("emissivity", &wincalc::Environment::emissivity) - .def_readwrite("air_speed", &wincalc::Environment::air_speed) - .def_readwrite("air_direction", &wincalc::Environment::air_direction) - .def_readwrite("direct_solar_radiation", - &wincalc::Environment::direct_solar_radiation); - - py::class_(m, "Environments") - .def(py::init(), - py::arg("outside"), py::arg("inside")) - .def_readwrite("outside", &wincalc::Environments::outside) - .def_readwrite("inside", &wincalc::Environments::inside); - - m.def("nfrc_u_environments", &wincalc::nfrc_u_environments, - "Returns the default environments for running a NFRC U-Value " - "calculation."); - m.def( - "nfrc_shgc_environments", &wincalc::nfrc_shgc_environments, - "Returns the default environments for running a NFRC SHGC calculation."); - - py::class_>( - m, "FlippableSolidLayer") - .def(py::init(), py::arg("thickness_meters"), - py::arg("flipped") = false) - .def_readwrite("thickness_meters", - &wincalc::Flippable_Solid_Layer::thickness_meters) - .def_readwrite("flipped", &wincalc::Flippable_Solid_Layer::flipped); - - py::class_>( - m, "ProductDataThermal") - .def(py::init(), - py::arg("conductivity"), py::arg("thickness_meters"), - py::arg("flipped") = false, py::arg("opening_top") = 0, - py::arg("opening_bottom") = 0, py::arg("opening_left") = 0, - py::arg("opening_right") = 0, py::arg("opening_front") = 0) - .def_readwrite("conductivity", - &wincalc::Product_Data_Thermal::conductivity) - .def_readwrite("opening_top", &wincalc::Product_Data_Thermal::opening_top) - .def_readwrite("opening_bottom", - &wincalc::Product_Data_Thermal::opening_bottom) - .def_readwrite("opening_left", - &wincalc::Product_Data_Thermal::opening_left) - .def_readwrite("opening_right", - &wincalc::Product_Data_Thermal::opening_right) - .def_readwrite("opening_front", - &wincalc::Product_Data_Thermal::opening_front) - .def_readwrite("youngs_modulus", - &wincalc::Product_Data_Thermal::youngs_modulus) - .def_readwrite("density", &wincalc::Product_Data_Thermal::density); - - py::class_>( - m, "ProductDataOptical") - .def(py::init, std::optional, - std::optional, std::optional, double, - bool>(), - py::arg("thickness_meters"), - py::arg("ir_transmittance_front") = std::optional(), - py::arg("ir_transmittance_back") = std::optional(), - py::arg("emissivity_front") = std::optional(), - py::arg("emissivity_back") = std::optional(), - py::arg("permeability_factor") = 0.0, py::arg("flipped") = false) - .def("effective_thermal_values", - &wincalc::Product_Data_Optical::effective_thermal_values) - .def("wavelengths", &wincalc::Product_Data_Optical::wavelengths) - .def_readwrite("ir_transmittance_front", - &wincalc::Product_Data_Optical::ir_transmittance_front) - .def_readwrite("ir_transmittance_back", - &wincalc::Product_Data_Optical::ir_transmittance_back) - .def_readwrite("emissivity_front", - &wincalc::Product_Data_Optical::emissivity_front) - .def_readwrite("emissivity_back", - &wincalc::Product_Data_Optical::emissivity_back) - .def_readwrite("permeability_factor", - &wincalc::Product_Data_Optical::permeability_factor); - - py::enum_(m, "MaterialType", - py::arithmetic()) - .value("APPLIED_FILM", FenestrationCommon::MaterialType::AppliedFilm) - .value("COATED", FenestrationCommon::MaterialType::Coated) - .value("ELECTROCHROMIC", FenestrationCommon::MaterialType::Electrochromic) - .value("FILM", FenestrationCommon::MaterialType::Film) - .value("INTERLAYER", FenestrationCommon::MaterialType::Interlayer) - .value("LAMINATE", FenestrationCommon::MaterialType::Laminate) - .value("MONOLITHIC", FenestrationCommon::MaterialType::Monolithic) - .value("THERMOCHROMIC", FenestrationCommon::MaterialType::Thermochromic); - - py::enum_(m, "CoatedSide", py::arithmetic()) - .value("FRONT", wincalc::CoatedSide::FRONT) - .value("BACK", wincalc::CoatedSide::BACK) - .value("BOTH", wincalc::CoatedSide::BOTH) - .value("NEITHER", wincalc::CoatedSide::NEITHER); - - py::class_>( - m, "ProductDataOpticalNBand") - .def(py::init, - std::optional, std::optional, - std::optional, std::optional, - std::optional, double, bool>(), - py::arg("material_type"), py::arg("thickness_meters"), - py::arg("wavelength_data"), - py::arg("coated_side") = std::optional(), - py::arg("ir_transmittance_front") = std::optional(), - py::arg("ir_transmittance_back") = std::optional(), - py::arg("emissivity_front") = std::optional(), - py::arg("emissivity_back") = std::optional(), - py::arg("permeability_factor") = 0, py::arg("flipped") = false) - .def("wavelengths", &wincalc::Product_Data_N_Band_Optical::wavelengths) - .def_readwrite("material_type", - &wincalc::Product_Data_N_Band_Optical::material_type) - .def_readwrite("wavelength_data", - &wincalc::Product_Data_N_Band_Optical::wavelength_data); - - py::class_>( - m, "ProductDataOpticalDualBand") - .def(py::init, std::optional, - std::optional, std::optional, double, - bool>(), - py::arg("thickness_meters"), - py::arg("ir_transmittance_front") = std::optional(), - py::arg("ir_transmittance_back") = std::optional(), - py::arg("emissivity_front") = std::optional(), - py::arg("emissivity_back") = std::optional(), - py::arg("permeability_factor") = 0.0, py::arg("flipped") = false) - .def("wavelengths", - &wincalc::Product_Data_Dual_Band_Optical::wavelengths); - - py::class_< - wincalc::Product_Data_Dual_Band_Optical_Hemispheric, - wincalc::Product_Data_Dual_Band_Optical, - std::shared_ptr>( - m, "ProductDataOpticalDualBandHemispheric") - .def(py::init, - std::optional, std::optional, - std::optional, double, bool>(), - py::arg("solar_transmittance_front"), - py::arg("solar_transmittance_back"), - py::arg("solar_reflectance_front"), - py::arg("solar_reflectance_back"), - py::arg("visible_transmittance_front"), - py::arg("visible_transmittance_back"), - py::arg("visible_reflectance_front"), - py::arg("visible_reflectance_back"), py::arg("thickness_meters"), - py::arg("ir_transmittance_front") = std::optional(), - py::arg("ir_transmittance_back") = std::optional(), - py::arg("emissivity_front") = std::optional(), - py::arg("emissivity_back") = std::optional(), - py::arg("permeability_factor") = 0.0, py::arg("flipped") = false) - .def_readwrite( - "solar_transmittance_front", - &wincalc::Product_Data_Dual_Band_Optical_Hemispheric::tf_solar) - .def_readwrite( - "solar_transmittance_back", - &wincalc::Product_Data_Dual_Band_Optical_Hemispheric::tb_solar) - .def_readwrite( - "solar_reflectance_front", - &wincalc::Product_Data_Dual_Band_Optical_Hemispheric::rf_solar) - .def_readwrite( - "solar_reflectance_back", - &wincalc::Product_Data_Dual_Band_Optical_Hemispheric::rb_solar) - .def_readwrite( - "visible_transmittance_front", - &wincalc::Product_Data_Dual_Band_Optical_Hemispheric::tf_visible) - .def_readwrite( - "visible_transmittance_back", - &wincalc::Product_Data_Dual_Band_Optical_Hemispheric::tb_visible) - .def_readwrite( - "visible_reflectance_front", - &wincalc::Product_Data_Dual_Band_Optical_Hemispheric::rf_visible) - .def_readwrite( - "visible_reflectance_back", - &wincalc::Product_Data_Dual_Band_Optical_Hemispheric::rb_visible); - - py::class_>( - m, "ProductDataOpticalDualBandBSDF") - .def(py::init> const &, - std::vector> const &, - std::vector> const &, - std::vector> const &, - std::vector> const &, - std::vector> const &, - std::vector> const &, - std::vector> const &, - SingleLayerOptics::BSDFHemisphere const &, double, - std::optional, std::optional, - std::optional, std::optional, double, - bool>(), - py::arg("solar_transmittance_front"), - py::arg("solar_transmittance_back"), - py::arg("solar_reflectance_front"), - py::arg("solar_reflectance_back"), - py::arg("visible_transmittance_front"), - py::arg("visible_transmittance_back"), - py::arg("visible_reflectance_front"), - py::arg("visible_reflectance_back"), py::arg("bsdf_hemisphere"), - py::arg("thickness_meters"), - py::arg("ir_transmittance_front") = std::optional(), - py::arg("ir_transmittance_back") = std::optional(), - py::arg("emissivity_front") = std::optional(), - py::arg("emissivity_back") = std::optional(), - py::arg("permeability_factor") = 0.0, py::arg("flipped") = false) - .def_readwrite("solar_transmittance_front", - &wincalc::Product_Data_Dual_Band_Optical_BSDF::tf_solar) - .def_readwrite("solar_transmittance_back", - &wincalc::Product_Data_Dual_Band_Optical_BSDF::tb_solar) - .def_readwrite("solar_reflectance_front", - &wincalc::Product_Data_Dual_Band_Optical_BSDF::rf_solar) - .def_readwrite("solar_reflectance_back", - &wincalc::Product_Data_Dual_Band_Optical_BSDF::rb_solar) - .def_readwrite("visible_transmittance_front", - &wincalc::Product_Data_Dual_Band_Optical_BSDF::tf_visible) - .def_readwrite("visible_transmittance_back", - &wincalc::Product_Data_Dual_Band_Optical_BSDF::tb_visible) - .def_readwrite("visible_reflectance_front", - &wincalc::Product_Data_Dual_Band_Optical_BSDF::rf_visible) - .def_readwrite("visible_reflectance_back", - &wincalc::Product_Data_Dual_Band_Optical_BSDF::rb_visible) - .def("effective_thermal_values", - &wincalc::Product_Data_Dual_Band_Optical_BSDF:: - effective_thermal_values); - - py::class_>( - m, "ProductDataOpticalWithMaterial") - .def(py::init const &>(), - py::arg("product_data_optical")) - .def("optical_data", - &wincalc::Product_Data_Optical_With_Material::optical_data) - .def("wavelengths", - &wincalc::Product_Data_Optical_With_Material::wavelengths) - .def_readwrite( - "material_optical_data", - &wincalc::Product_Data_Optical_With_Material::material_optical_data); - - py::enum_(m, "DistributionMethodType", - py::arithmetic()) - .value("UNIFORM_DIFFUSE", - SingleLayerOptics::DistributionMethod::UniformDiffuse) - .value("DIRECTIONAL_DIFFUSE", - SingleLayerOptics::DistributionMethod::DirectionalDiffuse); - - py::class_>(m, "VenetianGeometry") - .def(py::init(), - py::arg("slat_tilt_degrees"), py::arg("slat_width_meters"), - py::arg("slat_spacing_meters"), py::arg("slat_curvature_meters"), - py::arg("is_horizontal") = true, - py::arg("distribution_method") = - SingleLayerOptics::DistributionMethod::DirectionalDiffuse, - py::arg("number_slat_segments") = 5) - .def_readwrite("slat_tilt", &wincalc::Venetian_Geometry::slat_tilt) - .def_readwrite("slat_width", &wincalc::Venetian_Geometry::slat_width) - .def_readwrite("slat_spacing", &wincalc::Venetian_Geometry::slat_spacing) - .def_readwrite("slat_curvature", - &wincalc::Venetian_Geometry::slat_curvature) - .def_readwrite("number_slat_segments", - &wincalc::Venetian_Geometry::number_slat_segments) - .def_readwrite("distribution_method", - &wincalc::Venetian_Geometry::distribution_method) - .def_readwrite("is_horizontal", - &wincalc::Venetian_Geometry::is_horizontal); - - py::class_>( - m, "ProductDataOpticalVenetian") - .def(py::init const &, - wincalc::Venetian_Geometry const &>(), - py::arg("product_data_optical"), py::arg("geometry")) - .def_readwrite("geometry", - &wincalc::Product_Data_Optical_Venetian::geometry); - - py::class_>( - m, "WovenGeometry") - .def(py::init(), py::arg("thread_diamater"), - py::arg("thread_spacing"), py::arg("shade_thickness")) - .def_readwrite("thread_diameter", - &wincalc::Woven_Geometry::thread_diameter) - .def_readwrite("thread_spacing", &wincalc::Woven_Geometry::thread_spacing) - .def_readwrite("shade_thickness", - &wincalc::Woven_Geometry::shade_thickness); - - py::class_>( - m, "ProductDataOpticalWovenShade") - .def(py::init const &, - wincalc::Woven_Geometry const &>(), - py::arg("material_product_data_optical"), py::arg("geometry")) - .def_readwrite("geometry", - &wincalc::Product_Data_Optical_Woven_Shade::geometry); - - py::class_> - perforated_geometry(m, "PerforatedGeometry"); - - perforated_geometry - .def(py::init(), - py::arg("spacing_x"), py::arg("spacing_y"), py::arg("dimension_x"), - py::arg("dimension_y"), py::arg("perforation_type")) - .def_readwrite("spacing_x", &wincalc::Perforated_Geometry::spacing_x) - .def_readwrite("spacing_y", &wincalc::Perforated_Geometry::spacing_y) - .def_readwrite("dimension_x", &wincalc::Perforated_Geometry::dimension_x) - .def_readwrite("dimension_y", &wincalc::Perforated_Geometry::dimension_y) - .def_readwrite("perforation_type", - &wincalc::Perforated_Geometry::perforation_type); - - py::enum_(perforated_geometry, "Type") - .value("CIRCULAR", wincalc::Perforated_Geometry::Type::CIRCULAR) - .value("RECTANGULAR", wincalc::Perforated_Geometry::Type::RECTANGULAR) - .value("SQUARE", wincalc::Perforated_Geometry::Type::SQUARE); - - py::class_>( - m, "ProductDataOpticalPerforatedScreen") - .def(py::init const &, - wincalc::Perforated_Geometry const &>(), - py::arg("material_product_data_optical"), py::arg("geometry")) - .def_readwrite( - "geometry", - &wincalc::Product_Data_Optical_Perforated_Screen::geometry); - - py::class_( - m, "ProductDataOpticalAndThermal") - .def(py::init, - std::shared_ptr>(), - py::arg("product_data_optical"), py::arg("product_data_thermal")) - .def_readwrite("optical_data", - &wincalc::Product_Data_Optical_Thermal::optical_data) - .def_readwrite("thermal_data", - &wincalc::Product_Data_Optical_Thermal::thermal_data); - - py::enum_(m, "BSDFBasisType", py::arithmetic()) - .value("SMALL", SingleLayerOptics::BSDFBasis::Small) - .value("QUARTER", SingleLayerOptics::BSDFBasis::Quarter) - .value("HALF", SingleLayerOptics::BSDFBasis::Half) - .value("FULL", SingleLayerOptics::BSDFBasis::Full); - - py::class_(m, "BSDFHemisphere") - .def_static("create", - py::overload_cast( - &SingleLayerOptics::BSDFHemisphere::create), - py::arg("bsdf_basis")) - .def("get_directions", &SingleLayerOptics::BSDFHemisphere::getDirections); - - py::enum_(m, "TarcogSystemType", py::arithmetic()) - .value("U", Tarcog::ISO15099::System::Uvalue) - .value("SHGC", Tarcog::ISO15099::System::SHGC); - - py::enum_( - m, "SpectalDataWavelengthRangeMethodType", py::arithmetic()) - .value("FULL", wincalc::Spectal_Data_Wavelength_Range_Method::FULL) - .value("ISO_9050", - wincalc::Spectal_Data_Wavelength_Range_Method::ISO_9050) - .value("CONDENSED", - wincalc::Spectal_Data_Wavelength_Range_Method::CONDENSED); - - m.def("nfrc_u_environments", &wincalc::nfrc_u_environments); - m.def("nfrc_shgc_environments", &wincalc::nfrc_shgc_environments); - - py::class_(m, "DeflectionResults") - .def_readwrite("layer_deflection_max", - &wincalc::Deflection_Results::layer_deflection_max) - .def_readwrite("layer_deflection_mean", - &wincalc::Deflection_Results::layer_deflection_mean) - .def_readwrite("panes_load", &wincalc::Deflection_Results::panes_load) - .def_readwrite("gap_width_max", - &wincalc::Deflection_Results::gap_width_max) - .def_readwrite("gap_width_mean", - &wincalc::Deflection_Results::gap_width_mean); - - py::class_(m, "GlazingSystem") - .def( - py::init const &, - std::vector< - std::shared_ptr> const &, - double, double, double, wincalc::Environments const &, - std::optional const &, - wincalc::Spectal_Data_Wavelength_Range_Method const &, int, - int>(), - py::arg("optical_standard"), py::arg("solid_layers"), - py::arg("gap_layers") = - std::vector>(), - py::arg("width_meters") = 1.0, py::arg("height_meters") = 1.0, - py::arg("tilt_degrees") = 90, - py::arg("environment") = wincalc::nfrc_u_environments(), - py::arg("bsdf_hemisphere") = - std::optional(), - py::arg("spectral_data_wavelength_range_method") = - wincalc::Spectal_Data_Wavelength_Range_Method::FULL, - py::arg("number_visible_bands") = 5, - py::arg("number_solar_bands") = 10) - .def( - py::init const &, - std::vector< - std::shared_ptr> const &, - double, double, double, wincalc::Environments const &, - std::optional const &, - wincalc::Spectal_Data_Wavelength_Range_Method const &, int, - int>(), - py::arg("optical_standard"), py::arg("solid_layers"), - py::arg("gap_layers") = - std::vector>(), - py::arg("width_meters") = 1.0, py::arg("height_meters") = 1.0, - py::arg("tilt_degrees") = 90, - py::arg("environment") = wincalc::nfrc_u_environments(), - py::arg("bsdf_hemisphere") = - std::optional(), - py::arg("spectral_data_wavelength_range_method") = - wincalc::Spectal_Data_Wavelength_Range_Method::FULL, - py::arg("number_visible_bands") = 5, - py::arg("number_solar_bands") = 10) - .def( - py::init< - window_standards::Optical_Standard const &, - std::vector< - std::variant> const &, - std::vector> const - &, - double, double, double, wincalc::Environments const &, - std::optional const &, - wincalc::Spectal_Data_Wavelength_Range_Method const &, int, - int>(), - py::arg("optical_standard"), py::arg("solid_layers"), - py::arg("gap_layers") = - std::vector>(), - py::arg("width_meters") = 1.0, py::arg("height_meters") = 1.0, - py::arg("tilt_degrees") = 90, - py::arg("environment") = wincalc::nfrc_u_environments(), - py::arg("bsdf_hemisphere") = - std::optional(), - py::arg("spectral_data_wavelength_range_method") = - wincalc::Spectal_Data_Wavelength_Range_Method::FULL, - py::arg("number_visible_bands") = 5, - py::arg("number_solar_bands") = 10) - .def("u", &wincalc::Glazing_System::u, py::arg("theta") = 0, - py::arg("phi") = 0) - .def("shgc", &wincalc::Glazing_System::shgc, py::arg("theta") = 0, - py::arg("phi") = 0) - .def("layer_temperatures", &wincalc::Glazing_System::layer_temperatures, - py::arg("system_type"), py::arg("theta") = 0, py::arg("phi") = 0) - .def("optical_method_results", - &wincalc::Glazing_System::optical_method_results, - py::arg("method_name"), py::arg("theta") = 0, py::arg("phi") = 0) - .def("color", &wincalc::Glazing_System::color, py::arg("theta") = 0, - py::arg("phi") = 0, - py::arg("tristimulus_x_method") = "COLOR_TRISTIMX", - py::arg("tristimulus_y_method") = "COLOR_TRISTIMY", - py::arg("tristimulus_z_method") = "COLOR_TRISTIMZ") - .def("solid_layers_effective_conductivities", - &wincalc::Glazing_System::solid_layers_effective_conductivities, - py::arg("system_type"), py::arg("theta") = 0, py::arg("phi") = 0) - .def("gap_layers_effective_conductivities", - &wincalc::Glazing_System::gap_layers_effective_conductivities, - py::arg("system_type"), py::arg("theta") = 0, py::arg("phi") = 0) - .def("system_effective_conductivity", - &wincalc::Glazing_System::system_effective_conductivity, - py::arg("system_type"), py::arg("theta") = 0, py::arg("phi") = 0) - .def("relative_heat_gain", &wincalc::Glazing_System::relative_heat_gain, - py::arg("theta") = 0, py::arg("phi") = 0) - .def("environments", - py::overload_cast( - &wincalc::Glazing_System::environments), - py::arg("environments")) - .def("environments", - py::overload_cast<>(&wincalc::Glazing_System::environments, - py::const_)) - .def("enable_deflection", &wincalc::Glazing_System::enable_deflection, - py::arg("enable")) - .def("set_deflection_properties", - py::overload_cast( - &wincalc::Glazing_System::set_deflection_properties), - py::arg("temperature_at_construction"), - py::arg("pressure_at_construction")) - .def("set_deflection_properties", - py::overload_cast const &>( - &wincalc::Glazing_System::set_deflection_properties), - py::arg("measured_deflected_gaps")) - .def("calc_deflection_properties", - &wincalc::Glazing_System::calc_deflection_properties, - py::arg("system_type"), py::arg("theta") = 0, py::arg("phi") = 0) - .def("set_applied_loads", &wincalc::Glazing_System::set_applied_loads, - py::arg("loads")) - .def("set_height", &wincalc::Glazing_System::set_height, - py::arg("height_meters")) - .def("set_width", &wincalc::Glazing_System::set_width, - py::arg("width_meters")) - .def("set_tilt", &wincalc::Glazing_System::set_tilt, - py::arg("tilt_degrees")) - .def("flip_layer", &wincalc::Glazing_System::flip_layer, - py::arg("layer_index"), py::arg("flipped")) - .def("solid_layers", - py::overload_cast< - std::vector const &>( - &wincalc::Glazing_System::solid_layers), - py::arg("solid_layers")) - .def("solid_layers", - py::overload_cast<>(&wincalc::Glazing_System::solid_layers, - py::const_)); - - m.def("convert_to_solid_layer", &wincalc::convert_to_solid_layer, - "Convert product data into a solid layer that can be used in glazing " - "systems."); - - m.def("convert_to_solid_layers", &wincalc::convert_to_solid_layers, - "Convert a list of product data into a solid layer that can be used in " - "glazing systems."); - - m.def("load_standard", - py::overload_cast( - &window_standards::load_optical_standard), - "Load standard from .std file"); - m.def("parse_json", &OpticsParser::parseJSONString, - "Load product data from json string"); - m.def("parse_json_file", &OpticsParser::parseJSONFile, - "Load product data from json file"); - m.def("parse_optics_file", &OpticsParser::parseOpticsFile, - "Load product data from optics file"); - m.def("parse_bsdf_xml_file", &OpticsParser::parseBSDFXMLFile, - "Load product data from BSDF xml file"); - m.def("parse_bsdf_xml_string", &OpticsParser::parseBSDFXMLString, - "Load product data from BSDF xml string"); - m.def("parse_thmx_file", &thmxParser::parseFile, "Parse a THERM thmx file"); - m.def("parse_thmx_string", &thmxParser::parseString, - "Parse THERM thmx format from a string"); - - m.def("create_gas", &wincalc::create_gas, py::arg("components"), - "Create a gas mixture from components: a list of pairs where the first " - "in each item is the percent of the total and the second is the gas."); - - m.def("create_venetian_blind", - py::overload_cast( - &wincalc::create_venetian_blind), - py::arg("geometry"), py::arg("material"), - "Create a venetian blind from a geometry and parsed material."); - - m.def("create_venetian_blind", - py::overload_cast, - std::shared_ptr>( - &wincalc::create_venetian_blind), - py::arg("geometry"), py::arg("material_data_optical"), - py::arg("material_data_thermal").none(true), - "Create a venetian blind from a geometry and material optical and " - "thermal data."); - - m.def("create_woven_shade", - py::overload_cast( - &wincalc::create_woven_shade), - py::arg("geometry"), py::arg("material"), - "Create a woven shade from a geometry and parsed material."); - - m.def("create_woven_shade", - py::overload_cast, - std::shared_ptr>( - &wincalc::create_woven_shade), - py::arg("geometry"), py::arg("material_data_optical"), - py::arg("material_data_thermal").none(true), - "Create a woven shade from a geometry and material optical and " - "thermal data."); - - m.def("create_perforated_screen", - py::overload_cast( - &wincalc::create_perforated_screen), - py::arg("geometry"), py::arg("material"), - "Create a perforated screen from a geometry and parsed material."); - - m.def("create_perforated_screen", - py::overload_cast, - std::shared_ptr>( - &wincalc::create_perforated_screen), - py::arg("geometry"), py::arg("material_data_optical"), - py::arg("material_data_thermal").none(true), - "Create a perforated screen from a geometry and material optical and " - "thermal data."); - - py::class_(m, "ThmxMeshParameters") - .def_readwrite("quad_tree_mesh_level", - &thmxParser::MeshParameters::quadTreeMeshLevel) - .def_readwrite("error_check_flag", - &thmxParser::MeshParameters::errorCheckFlag) - .def_readwrite("error_limit", &thmxParser::MeshParameters::errorLimit) - .def_readwrite("max_iterations", - &thmxParser::MeshParameters::maxIterations) - .def_readwrite("cma_flag", &thmxParser::MeshParameters::cmaFlag); - - py::class_(m, "ThmxRGB") - .def_readwrite("r", &thmxParser::ColorRGB::r) - .def_readwrite("g", &thmxParser::ColorRGB::g) - .def_readwrite("b", &thmxParser::ColorRGB::b); - - py::class_(m, "ThmxMaterial") - .def_readwrite("name", &thmxParser::Material::name) - .def_readwrite("type", &thmxParser::Material::type) - .def_readwrite("conductivity", &thmxParser::Material::conductivity) - .def_readwrite("emissivity_front", &thmxParser::Material::emissivityFront) - .def_readwrite("emissivity_back", &thmxParser::Material::emissivityBack) - .def_readwrite("tir", &thmxParser::Material::tir) - .def_readwrite("color", &thmxParser::Material::color) - .def_readwrite("cavity_model", &thmxParser::Material::cavityModel) - .def_readwrite("transmittances", &thmxParser::Material::transmittances) - .def_readwrite("reflectances", &thmxParser::Material::reflectances); - - py::class_(m, "ThmxBoundaryCondition") - .def_readwrite("name", &thmxParser::BoundaryCondition::name) - .def_readwrite("type", &thmxParser::BoundaryCondition::type) - .def_readwrite("H", &thmxParser::BoundaryCondition::H) - .def_readwrite("heat_flux", &thmxParser::BoundaryCondition::heatFlux) - .def_readwrite("temperature", &thmxParser::BoundaryCondition::temperature) - .def_readwrite("color", &thmxParser::BoundaryCondition::color) - .def_readwrite("Tr", &thmxParser::BoundaryCondition::Tr) - .def_readwrite("Hr", &thmxParser::BoundaryCondition::Hr) - .def_readwrite("Ei", &thmxParser::BoundaryCondition::Ei) - .def_readwrite("view_factor", &thmxParser::BoundaryCondition::viewFactor) - .def_readwrite("radiation_model", - &thmxParser::BoundaryCondition::radiationModel) - .def_readwrite("convection_flag", - &thmxParser::BoundaryCondition::convectionFlag) - .def_readwrite("flux_flag", &thmxParser::BoundaryCondition::fluxFlag) - .def_readwrite("radiation_flag", - &thmxParser::BoundaryCondition::radiationFlag) - .def_readwrite("constant_temperature_flag", - &thmxParser::BoundaryCondition::constantTemperatureFlag) - .def_readwrite("emissivity_modifier", - &thmxParser::BoundaryCondition::emissivityModifier); - - py::class_(m, "ThmxPolygonPoint") - .def_readwrite("index", &thmxParser::PolygonPoint::index) - .def_readwrite("x", &thmxParser::PolygonPoint::x) - .def_readwrite("y", &thmxParser::PolygonPoint::y); - - py::class_(m, "ThmxPolygon") - .def_readwrite("id", &thmxParser::Polygon::id) - .def_readwrite("material", &thmxParser::Polygon::material) - .def_readwrite("points", &thmxParser::Polygon::points); - - py::class_( - m, "ThmxBoundaryConditionPolygon") - .def_readwrite("id", &thmxParser::BoundaryConditionPolygon::id) - .def_readwrite("name", &thmxParser::BoundaryConditionPolygon::name) - .def_readwrite("polygon_id", - &thmxParser::BoundaryConditionPolygon::polygonId) - .def_readwrite("enclosure_id", - &thmxParser::BoundaryConditionPolygon::enclosureId) - .def_readwrite("ufactor_tag", - &thmxParser::BoundaryConditionPolygon::ufactorTag) - .def_readwrite("ratation_model", - &thmxParser::BoundaryConditionPolygon::ratationModel) - .def_readwrite("emissivity", - &thmxParser::BoundaryConditionPolygon::emissivity) - .def_readwrite("surfaceSide", - &thmxParser::BoundaryConditionPolygon::surfaceSide) - .def_readwrite("illuminated_surface", - &thmxParser::BoundaryConditionPolygon::illuminatedSurface) - .def_readwrite("points", &thmxParser::BoundaryConditionPolygon::points); - - py::class_(m, "ThmxCMABestWorstOption") - .def_readwrite("option", &thmxParser::CMABestWorstOption::option) - .def_readwrite( - "inside_convective_film_coefficient", - &thmxParser::CMABestWorstOption::insideConvectiveFilmCoefficient) - .def_readwrite( - "outside_convective_film_coefficient", - &thmxParser::CMABestWorstOption::outsideConvectiveFilmCoefficient) - .def_readwrite("glazing_gap_conductance", - &thmxParser::CMABestWorstOption::glazingGapConductance) - .def_readwrite("spacer_conductance", - &thmxParser::CMABestWorstOption::spacerConductance); - - py::class_(m, "ThmxCMAOptions") - .def_readwrite("interior_layer_conductivity", - &thmxParser::CMAOptions::interiorLayerConductivity) - .def_readwrite("interior_layer_thickness", - &thmxParser::CMAOptions::interiorLayerThickness) - .def_readwrite("interior_layer_emissivity", - &thmxParser::CMAOptions::interiorLayerEmissivity) - .def_readwrite("exterior_layer_conductivity", - &thmxParser::CMAOptions::exteriorLayerConductivity) - .def_readwrite("exterior_layer_thickness", - &thmxParser::CMAOptions::exteriorLayerThickness) - .def_readwrite("exterior_layer_emissivity", - &thmxParser::CMAOptions::exteriorLayerEmissivity) - .def_readwrite("interior_temperature", - &thmxParser::CMAOptions::interiorTemperature) - .def_readwrite("exterior_temperature", - &thmxParser::CMAOptions::exteriorTemperature) - .def_readwrite("best_worst_options", - &thmxParser::CMAOptions::bestWorstOptions); - - py::class_(m, - "ThmxUFactorProjectionResult") - .def_readwrite("length_type", - &thmxParser::UFactorProjectionResult::lengthType) - .def_readwrite("length_units", - &thmxParser::UFactorProjectionResult::lengthUnits) - .def_readwrite("length", &thmxParser::UFactorProjectionResult::length) - .def_readwrite("ufactor_units", - &thmxParser::UFactorProjectionResult::ufactorUnits) - .def_readwrite("ufactor", &thmxParser::UFactorProjectionResult::ufactor); - - py::class_(m, "ThmxUFactorResults") - .def_readwrite("tag", &thmxParser::UFactorResults::tag) - .def_readwrite("delta_t_units", &thmxParser::UFactorResults::deltaTUnits) - .def_readwrite("delta_t", &thmxParser::UFactorResults::deltaT) - .def_readwrite("projection_results", - &thmxParser::UFactorResults::projectionResults); - - py::class_(m, "ThmxResult") - .def_readwrite("model_type", &thmxParser::Result::modelType) - .def_readwrite("glazing_case", &thmxParser::Result::glazingCase) - .def_readwrite("spacer_case", &thmxParser::Result::spacerCase) - .def_readwrite("ufactor_results", &thmxParser::Result::ufactorResults); - - py::class_(m, "ThmxFileContents") - .def_readwrite("file_version", &thmxParser::ThmxFileContents::fileVersion) - .def_readwrite("mesh_parameters", - &thmxParser::ThmxFileContents::meshParameters) - .def_readwrite("materials", &thmxParser::ThmxFileContents::materials) - .def_readwrite("boundary_conditions", - &thmxParser::ThmxFileContents::boundaryConditions) - .def_readwrite("polygons", &thmxParser::ThmxFileContents::polygons) - .def_readwrite("boundary_condition_polygons", - &thmxParser::ThmxFileContents::boundaryConditionPolygons) - .def_readwrite("cma_options", &thmxParser::ThmxFileContents::cmaOptions) - .def_readwrite("results", &thmxParser::ThmxFileContents::results); - - py::class_(m, "GlazingSystemDimensions") - .def_readwrite("width", &Tarcog::IGUDimensions::width) - .def_readwrite("height", &Tarcog::IGUDimensions::height); - - py::class_>(m, "CMAWindow") - .def("u", &CMA::ICMAWindow::uValue) - .def("shgc", &CMA::ICMAWindow::shgc) - .def("vt", &CMA::ICMAWindow::vt) - .def("glazing_system_dimensions", &CMA::ICMAWindow::getIGUDimensions); - - py::class_>(m, - "CMABestWorstUFactors") - .def(py::init<>()) - .def(py::init()) - .def(py::init>(m, "VenetianGeometry") + .def(py::init(), + py::arg("slat_tilt_degrees"), py::arg("slat_width_meters"), + py::arg("slat_spacing_meters"), py::arg("slat_curvature_meters"), + py::arg("is_horizontal") = true, + py::arg("distribution_method") = + SingleLayerOptics::DistributionMethod::DirectionalDiffuse, + py::arg("number_slat_segments") = 5) + .def_readwrite("slat_tilt", &wincalc::Venetian_Geometry::slat_tilt) + .def_readwrite("slat_width", &wincalc::Venetian_Geometry::slat_width) + .def_readwrite("slat_spacing", &wincalc::Venetian_Geometry::slat_spacing) + .def_readwrite("slat_curvature", + &wincalc::Venetian_Geometry::slat_curvature) + .def_readwrite("number_slat_segments", + &wincalc::Venetian_Geometry::number_slat_segments) + .def_readwrite("distribution_method", + &wincalc::Venetian_Geometry::distribution_method) + .def_readwrite("is_horizontal", + &wincalc::Venetian_Geometry::is_horizontal); + + py::class_>( + m, "ProductDataOpticalVenetian") + .def(py::init const &, + wincalc::Venetian_Geometry const &>(), + py::arg("product_data_optical"), py::arg("geometry")) + .def_readwrite("geometry", + &wincalc::Product_Data_Optical_Venetian::geometry); + + py::class_>( + m, "WovenGeometry") + .def(py::init(), py::arg("thread_diamater"), + py::arg("thread_spacing"), py::arg("shade_thickness")) + .def_readwrite("thread_diameter", + &wincalc::Woven_Geometry::thread_diameter) + .def_readwrite("thread_spacing", &wincalc::Woven_Geometry::thread_spacing) + .def_readwrite("shade_thickness", + &wincalc::Woven_Geometry::shade_thickness); + + py::class_>( + m, "ProductDataOpticalWovenShade") + .def(py::init const &, + wincalc::Woven_Geometry const &>(), + py::arg("material_product_data_optical"), py::arg("geometry")) + .def_readwrite("geometry", + &wincalc::Product_Data_Optical_Woven_Shade::geometry); + + py::class_> + perforated_geometry(m, "PerforatedGeometry"); + + perforated_geometry + .def(py::init(), + py::arg("spacing_x"), py::arg("spacing_y"), py::arg("dimension_x"), + py::arg("dimension_y"), py::arg("perforation_type")) + .def_readwrite("spacing_x", &wincalc::Perforated_Geometry::spacing_x) + .def_readwrite("spacing_y", &wincalc::Perforated_Geometry::spacing_y) + .def_readwrite("dimension_x", &wincalc::Perforated_Geometry::dimension_x) + .def_readwrite("dimension_y", &wincalc::Perforated_Geometry::dimension_y) + .def_readwrite("perforation_type", + &wincalc::Perforated_Geometry::perforation_type); + + py::enum_(perforated_geometry, "Type") + .value("CIRCULAR", wincalc::Perforated_Geometry::Type::CIRCULAR) + .value("RECTANGULAR", wincalc::Perforated_Geometry::Type::RECTANGULAR) + .value("SQUARE", wincalc::Perforated_Geometry::Type::SQUARE); + + py::class_>( + m, "ProductDataOpticalPerforatedScreen") + .def(py::init const &, + wincalc::Perforated_Geometry const &>(), + py::arg("material_product_data_optical"), py::arg("geometry")) + .def_readwrite( + "geometry", + &wincalc::Product_Data_Optical_Perforated_Screen::geometry); + + py::class_( + m, "ProductDataOpticalAndThermal") + .def(py::init, + std::shared_ptr>(), + py::arg("product_data_optical"), py::arg("product_data_thermal")) + .def_readwrite("optical_data", + &wincalc::Product_Data_Optical_Thermal::optical_data) + .def_readwrite("thermal_data", + &wincalc::Product_Data_Optical_Thermal::thermal_data); + + py::enum_(m, "BSDFBasisType", py::arithmetic()) + .value("SMALL", SingleLayerOptics::BSDFBasis::Small) + .value("QUARTER", SingleLayerOptics::BSDFBasis::Quarter) + .value("HALF", SingleLayerOptics::BSDFBasis::Half) + .value("FULL", SingleLayerOptics::BSDFBasis::Full); + + py::class_(m, "BSDFHemisphere") + .def_static("create", + py::overload_cast( + &SingleLayerOptics::BSDFHemisphere::create), + py::arg("bsdf_basis")) + .def("get_directions", &SingleLayerOptics::BSDFHemisphere::getDirections); + + py::enum_(m, "TarcogSystemType", py::arithmetic()) + .value("U", Tarcog::ISO15099::System::Uvalue) + .value("SHGC", Tarcog::ISO15099::System::SHGC); + + py::enum_( + m, "SpectalDataWavelengthRangeMethodType", py::arithmetic()) + .value("FULL", wincalc::Spectal_Data_Wavelength_Range_Method::FULL) + .value("ISO_9050", + wincalc::Spectal_Data_Wavelength_Range_Method::ISO_9050) + .value("CONDENSED", + wincalc::Spectal_Data_Wavelength_Range_Method::CONDENSED); + + m.def("nfrc_u_environments", &wincalc::nfrc_u_environments); + m.def("nfrc_shgc_environments", &wincalc::nfrc_shgc_environments); + + py::class_(m, "DeflectionResults") + .def_readwrite("layer_deflection_max", + &wincalc::Deflection_Results::layer_deflection_max) + .def_readwrite("layer_deflection_mean", + &wincalc::Deflection_Results::layer_deflection_mean) + .def_readwrite("panes_load", &wincalc::Deflection_Results::panes_load) + .def_readwrite("gap_width_max", + &wincalc::Deflection_Results::gap_width_max) + .def_readwrite("gap_width_mean", + &wincalc::Deflection_Results::gap_width_mean); + + py::class_(m, "GlazingSystem") + .def( + py::init const &, + std::vector< + std::shared_ptr> const &, + double, double, double, wincalc::Environments const &, + std::optional const &, + wincalc::Spectal_Data_Wavelength_Range_Method const &, int, + int>(), + py::arg("optical_standard"), py::arg("solid_layers"), + py::arg("gap_layers") = + std::vector>(), + py::arg("width_meters") = 1.0, py::arg("height_meters") = 1.0, + py::arg("tilt_degrees") = 90, + py::arg("environment") = wincalc::nfrc_u_environments(), + py::arg("bsdf_hemisphere") = + std::optional(), + py::arg("spectral_data_wavelength_range_method") = + wincalc::Spectal_Data_Wavelength_Range_Method::FULL, + py::arg("number_visible_bands") = 5, + py::arg("number_solar_bands") = 10) + .def( + py::init const &, + std::vector< + std::shared_ptr> const &, + double, double, double, wincalc::Environments const &, + std::optional const &, + wincalc::Spectal_Data_Wavelength_Range_Method const &, int, + int>(), + py::arg("optical_standard"), py::arg("solid_layers"), + py::arg("gap_layers") = + std::vector>(), + py::arg("width_meters") = 1.0, py::arg("height_meters") = 1.0, + py::arg("tilt_degrees") = 90, + py::arg("environment") = wincalc::nfrc_u_environments(), + py::arg("bsdf_hemisphere") = + std::optional(), + py::arg("spectral_data_wavelength_range_method") = + wincalc::Spectal_Data_Wavelength_Range_Method::FULL, + py::arg("number_visible_bands") = 5, + py::arg("number_solar_bands") = 10) + .def( + py::init< + window_standards::Optical_Standard const &, + std::vector< + std::variant> const &, + std::vector> const + &, + double, double, double, wincalc::Environments const &, + std::optional const &, + wincalc::Spectal_Data_Wavelength_Range_Method const &, int, + int>(), + py::arg("optical_standard"), py::arg("solid_layers"), + py::arg("gap_layers") = + std::vector>(), + py::arg("width_meters") = 1.0, py::arg("height_meters") = 1.0, + py::arg("tilt_degrees") = 90, + py::arg("environment") = wincalc::nfrc_u_environments(), + py::arg("bsdf_hemisphere") = + std::optional(), + py::arg("spectral_data_wavelength_range_method") = + wincalc::Spectal_Data_Wavelength_Range_Method::FULL, + py::arg("number_visible_bands") = 5, + py::arg("number_solar_bands") = 10) + .def("u", &wincalc::Glazing_System::u, py::arg("theta") = 0, + py::arg("phi") = 0) + .def("shgc", &wincalc::Glazing_System::shgc, py::arg("theta") = 0, + py::arg("phi") = 0) + .def("layer_temperatures", &wincalc::Glazing_System::layer_temperatures, + py::arg("system_type"), py::arg("theta") = 0, py::arg("phi") = 0) + .def("optical_method_results", + &wincalc::Glazing_System::optical_method_results, + py::arg("method_name"), py::arg("theta") = 0, py::arg("phi") = 0) + .def("color", &wincalc::Glazing_System::color, py::arg("theta") = 0, + py::arg("phi") = 0, + py::arg("tristimulus_x_method") = "COLOR_TRISTIMX", + py::arg("tristimulus_y_method") = "COLOR_TRISTIMY", + py::arg("tristimulus_z_method") = "COLOR_TRISTIMZ") + .def("solid_layers_effective_conductivities", + &wincalc::Glazing_System::solid_layers_effective_conductivities, + py::arg("system_type"), py::arg("theta") = 0, py::arg("phi") = 0) + .def("gap_layers_effective_conductivities", + &wincalc::Glazing_System::gap_layers_effective_conductivities, + py::arg("system_type"), py::arg("theta") = 0, py::arg("phi") = 0) + .def("system_effective_conductivity", + &wincalc::Glazing_System::system_effective_conductivity, + py::arg("system_type"), py::arg("theta") = 0, py::arg("phi") = 0) + .def("relative_heat_gain", &wincalc::Glazing_System::relative_heat_gain, + py::arg("theta") = 0, py::arg("phi") = 0) + .def("environments", + py::overload_cast( + &wincalc::Glazing_System::environments), + py::arg("environments")) + .def("environments", + py::overload_cast<>(&wincalc::Glazing_System::environments, + py::const_)) + .def("enable_deflection", &wincalc::Glazing_System::enable_deflection, + py::arg("enable")) + .def("set_deflection_properties", + py::overload_cast( + &wincalc::Glazing_System::set_deflection_properties), + py::arg("temperature_at_construction"), + py::arg("pressure_at_construction")) + .def("set_deflection_properties", + py::overload_cast const &>( + &wincalc::Glazing_System::set_deflection_properties), + py::arg("measured_deflected_gaps")) + .def("calc_deflection_properties", + &wincalc::Glazing_System::calc_deflection_properties, + py::arg("system_type"), py::arg("theta") = 0, py::arg("phi") = 0) + .def("set_applied_loads", &wincalc::Glazing_System::set_applied_loads, + py::arg("loads")) + .def("set_height", &wincalc::Glazing_System::set_height, + py::arg("height_meters")) + .def("set_width", &wincalc::Glazing_System::set_width, + py::arg("width_meters")) + .def("set_tilt", &wincalc::Glazing_System::set_tilt, + py::arg("tilt_degrees")) + .def("flip_layer", &wincalc::Glazing_System::flip_layer, + py::arg("layer_index"), py::arg("flipped")) + .def("solid_layers", + py::overload_cast< + std::vector const &>( + &wincalc::Glazing_System::solid_layers), + py::arg("solid_layers")) + .def("solid_layers", + py::overload_cast<>(&wincalc::Glazing_System::solid_layers, + py::const_)); + + m.def("convert_to_solid_layer", &wincalc::convert_to_solid_layer, + "Convert product data into a solid layer that can be used in glazing " + "systems."); + + m.def("convert_to_solid_layers", &wincalc::convert_to_solid_layers, + "Convert a list of product data into a solid layer that can be used in " + "glazing systems."); + + m.def("load_standard", + py::overload_cast( + &window_standards::load_optical_standard), + "Load standard from .std file"); + m.def("parse_json", &OpticsParser::parseJSONString, + "Load product data from json string"); + m.def("parse_json_file", &OpticsParser::parseJSONFile, + "Load product data from json file"); + m.def("parse_optics_file", &OpticsParser::parseOpticsFile, + "Load product data from optics file"); + m.def("parse_bsdf_xml_file", &OpticsParser::parseBSDFXMLFile, + "Load product data from BSDF xml file"); + m.def("parse_bsdf_xml_string", &OpticsParser::parseBSDFXMLString, + "Load product data from BSDF xml string"); + m.def("parse_thmx_file", &thmxParser::parseFile, "Parse a THERM thmx file"); + m.def("parse_thmx_string", &thmxParser::parseString, + "Parse THERM thmx format from a string"); + + m.def("create_gas", &wincalc::create_gas, py::arg("components"), + "Create a gas mixture from components: a list of pairs where the first " + "in each item is the percent of the total and the second is the gas."); + + m.def("create_venetian_blind", + py::overload_cast( + &wincalc::create_venetian_blind), + py::arg("geometry"), py::arg("material"), + "Create a venetian blind from a geometry and parsed material."); + + m.def("create_venetian_blind", + py::overload_cast, + std::shared_ptr>( + &wincalc::create_venetian_blind), + py::arg("geometry"), py::arg("material_data_optical"), + py::arg("material_data_thermal").none(true), + "Create a venetian blind from a geometry and material optical and " + "thermal data."); + + m.def("create_woven_shade", + py::overload_cast( + &wincalc::create_woven_shade), + py::arg("geometry"), py::arg("material"), + "Create a woven shade from a geometry and parsed material."); + + m.def("create_woven_shade", + py::overload_cast, + std::shared_ptr>( + &wincalc::create_woven_shade), + py::arg("geometry"), py::arg("material_data_optical"), + py::arg("material_data_thermal").none(true), + "Create a woven shade from a geometry and material optical and " + "thermal data."); + + m.def("create_perforated_screen", + py::overload_cast( + &wincalc::create_perforated_screen), + py::arg("geometry"), py::arg("material"), + "Create a perforated screen from a geometry and parsed material."); + + m.def("create_perforated_screen", + py::overload_cast, + std::shared_ptr>( + &wincalc::create_perforated_screen), + py::arg("geometry"), py::arg("material_data_optical"), + py::arg("material_data_thermal").none(true), + "Create a perforated screen from a geometry and material optical and " + "thermal data."); + + py::class_(m, "ThmxMeshParameters") + .def_readwrite("quad_tree_mesh_level", + &thmxParser::MeshParameters::quadTreeMeshLevel) + .def_readwrite("error_check_flag", + &thmxParser::MeshParameters::errorCheckFlag) + .def_readwrite("error_limit", &thmxParser::MeshParameters::errorLimit) + .def_readwrite("max_iterations", + &thmxParser::MeshParameters::maxIterations) + .def_readwrite("cma_flag", &thmxParser::MeshParameters::cmaFlag); + + py::class_(m, "ThmxRGB") + .def_readwrite("r", &thmxParser::ColorRGB::r) + .def_readwrite("g", &thmxParser::ColorRGB::g) + .def_readwrite("b", &thmxParser::ColorRGB::b); + + py::class_(m, "ThmxMaterial") + .def_readwrite("name", &thmxParser::Material::name) + .def_readwrite("type", &thmxParser::Material::type) + .def_readwrite("conductivity", &thmxParser::Material::conductivity) + .def_readwrite("emissivity_front", &thmxParser::Material::emissivityFront) + .def_readwrite("emissivity_back", &thmxParser::Material::emissivityBack) + .def_readwrite("tir", &thmxParser::Material::tir) + .def_readwrite("color", &thmxParser::Material::color) + .def_readwrite("cavity_model", &thmxParser::Material::cavityModel) + .def_readwrite("transmittances", &thmxParser::Material::transmittances) + .def_readwrite("reflectances", &thmxParser::Material::reflectances); + + py::class_(m, "ThmxBoundaryCondition") + .def_readwrite("name", &thmxParser::BoundaryCondition::name) + .def_readwrite("type", &thmxParser::BoundaryCondition::type) + .def_readwrite("H", &thmxParser::BoundaryCondition::H) + .def_readwrite("heat_flux", &thmxParser::BoundaryCondition::heatFlux) + .def_readwrite("temperature", &thmxParser::BoundaryCondition::temperature) + .def_readwrite("color", &thmxParser::BoundaryCondition::color) + .def_readwrite("Tr", &thmxParser::BoundaryCondition::Tr) + .def_readwrite("Hr", &thmxParser::BoundaryCondition::Hr) + .def_readwrite("Ei", &thmxParser::BoundaryCondition::Ei) + .def_readwrite("view_factor", &thmxParser::BoundaryCondition::viewFactor) + .def_readwrite("radiation_model", + &thmxParser::BoundaryCondition::radiationModel) + .def_readwrite("convection_flag", + &thmxParser::BoundaryCondition::convectionFlag) + .def_readwrite("flux_flag", &thmxParser::BoundaryCondition::fluxFlag) + .def_readwrite("radiation_flag", + &thmxParser::BoundaryCondition::radiationFlag) + .def_readwrite("constant_temperature_flag", + &thmxParser::BoundaryCondition::constantTemperatureFlag) + .def_readwrite("emissivity_modifier", + &thmxParser::BoundaryCondition::emissivityModifier); + + py::class_(m, "ThmxPolygonPoint") + .def_readwrite("index", &thmxParser::PolygonPoint::index) + .def_readwrite("x", &thmxParser::PolygonPoint::x) + .def_readwrite("y", &thmxParser::PolygonPoint::y); + + py::class_(m, "ThmxPolygon") + .def_readwrite("id", &thmxParser::Polygon::id) + .def_readwrite("material", &thmxParser::Polygon::material) + .def_readwrite("points", &thmxParser::Polygon::points); + + py::class_( + m, "ThmxBoundaryConditionPolygon") + .def_readwrite("id", &thmxParser::BoundaryConditionPolygon::id) + .def_readwrite("name", &thmxParser::BoundaryConditionPolygon::name) + .def_readwrite("polygon_id", + &thmxParser::BoundaryConditionPolygon::polygonId) + .def_readwrite("enclosure_id", + &thmxParser::BoundaryConditionPolygon::enclosureId) + .def_readwrite("ufactor_tag", + &thmxParser::BoundaryConditionPolygon::ufactorTag) + .def_readwrite("ratation_model", + &thmxParser::BoundaryConditionPolygon::ratationModel) + .def_readwrite("emissivity", + &thmxParser::BoundaryConditionPolygon::emissivity) + .def_readwrite("surfaceSide", + &thmxParser::BoundaryConditionPolygon::surfaceSide) + .def_readwrite("illuminated_surface", + &thmxParser::BoundaryConditionPolygon::illuminatedSurface) + .def_readwrite("points", &thmxParser::BoundaryConditionPolygon::points); + + py::class_(m, "ThmxCMABestWorstOption") + .def_readwrite("option", &thmxParser::CMABestWorstOption::option) + .def_readwrite( + "inside_convective_film_coefficient", + &thmxParser::CMABestWorstOption::insideConvectiveFilmCoefficient) + .def_readwrite( + "outside_convective_film_coefficient", + &thmxParser::CMABestWorstOption::outsideConvectiveFilmCoefficient) + .def_readwrite("glazing_gap_conductance", + &thmxParser::CMABestWorstOption::glazingGapConductance) + .def_readwrite("spacer_conductance", + &thmxParser::CMABestWorstOption::spacerConductance); + + py::class_(m, "ThmxCMAOptions") + .def_readwrite("interior_layer_conductivity", + &thmxParser::CMAOptions::interiorLayerConductivity) + .def_readwrite("interior_layer_thickness", + &thmxParser::CMAOptions::interiorLayerThickness) + .def_readwrite("interior_layer_emissivity", + &thmxParser::CMAOptions::interiorLayerEmissivity) + .def_readwrite("exterior_layer_conductivity", + &thmxParser::CMAOptions::exteriorLayerConductivity) + .def_readwrite("exterior_layer_thickness", + &thmxParser::CMAOptions::exteriorLayerThickness) + .def_readwrite("exterior_layer_emissivity", + &thmxParser::CMAOptions::exteriorLayerEmissivity) + .def_readwrite("interior_temperature", + &thmxParser::CMAOptions::interiorTemperature) + .def_readwrite("exterior_temperature", + &thmxParser::CMAOptions::exteriorTemperature) + .def_readwrite("best_worst_options", + &thmxParser::CMAOptions::bestWorstOptions); + + py::class_(m, + "ThmxUFactorProjectionResult") + .def_readwrite("length_type", + &thmxParser::UFactorProjectionResult::lengthType) + .def_readwrite("length_units", + &thmxParser::UFactorProjectionResult::lengthUnits) + .def_readwrite("length", &thmxParser::UFactorProjectionResult::length) + .def_readwrite("ufactor_units", + &thmxParser::UFactorProjectionResult::ufactorUnits) + .def_readwrite("ufactor", &thmxParser::UFactorProjectionResult::ufactor); + + py::class_(m, "ThmxUFactorResults") + .def_readwrite("tag", &thmxParser::UFactorResults::tag) + .def_readwrite("delta_t_units", &thmxParser::UFactorResults::deltaTUnits) + .def_readwrite("delta_t", &thmxParser::UFactorResults::deltaT) + .def_readwrite("projection_results", + &thmxParser::UFactorResults::projectionResults); + + py::class_(m, "ThmxResult") + .def_readwrite("model_type", &thmxParser::Result::modelType) + .def_readwrite("glazing_case", &thmxParser::Result::glazingCase) + .def_readwrite("spacer_case", &thmxParser::Result::spacerCase) + .def_readwrite("ufactor_results", &thmxParser::Result::ufactorResults); + + py::class_(m, "ThmxFileContents") + .def_readwrite("file_version", &thmxParser::ThmxFileContents::fileVersion) + .def_readwrite("mesh_parameters", + &thmxParser::ThmxFileContents::meshParameters) + .def_readwrite("materials", &thmxParser::ThmxFileContents::materials) + .def_readwrite("boundary_conditions", + &thmxParser::ThmxFileContents::boundaryConditions) + .def_readwrite("polygons", &thmxParser::ThmxFileContents::polygons) + .def_readwrite("boundary_condition_polygons", + &thmxParser::ThmxFileContents::boundaryConditionPolygons) + .def_readwrite("cma_options", &thmxParser::ThmxFileContents::cmaOptions) + .def_readwrite("results", &thmxParser::ThmxFileContents::results); + + py::class_(m, "GlazingSystemDimensions") + .def_readwrite("width", &Tarcog::IGUDimensions::width) + .def_readwrite("height", &Tarcog::IGUDimensions::height); + + py::class_>(m, "CMAWindow") + .def("u", &CMA::ICMAWindow::uValue) + .def("shgc", &CMA::ICMAWindow::shgc) + .def("vt", &CMA::ICMAWindow::vt) + .def("glazing_system_dimensions", &CMA::ICMAWindow::getIGUDimensions); + + py::class_>(m, + "CMABestWorstUFactors") + .def(py::init<>()) + .def(py::init()) + .def(py::init()) - .def("u", &CMA::CMABestWorstUFactors::uValue) - .def("hc_out", &CMA::CMABestWorstUFactors::hcout); - - m.def("create_best_worst_u_factor_option", - &CMA::CreateBestWorstUFactorOption); - - py::class_>( - m, "CMAWindowSingleVision") - .def(py::init(), - py::arg("width"), py::arg("height"), - py::arg("spacer_best_keff") = 0.01, - py::arg("spacer_worst_keff") = 10.0, - py::arg("best_u_factor_options") = - CMA::CreateBestWorstUFactorOption(CMA::Option::Best), - py::arg("worst_u_factor_options") = - CMA::CreateBestWorstUFactorOption(CMA::Option::Worst)) - .def("set_frame_top", &CMA::CMAWindowSingleVision::setFrameTop) - .def("set_frame_bottom", &CMA::CMAWindowSingleVision::setFrameBottom) - .def("set_frame_left", &CMA::CMAWindowSingleVision::setFrameLeft) - .def("set_frame_right", &CMA::CMAWindowSingleVision::setFrameRight) - .def("set_dividers", &CMA::CMAWindowSingleVision::setDividers); - - py::class_>( - m, "CMAWindowDualVisionHorizontal") - .def(py::init(), - py::arg("width"), py::arg("height"), - py::arg("spacer_best_keff") = 0.01, - py::arg("spacer_worst_keff") = 10.0, - py::arg("best_u_factor_options") = - CMA::CreateBestWorstUFactorOption(CMA::Option::Best), - py::arg("worst_u_factor_options") = - CMA::CreateBestWorstUFactorOption(CMA::Option::Worst)) - .def("set_frame_top_left", - &CMA::CMAWindowDualVisionHorizontal::setFrameTopLeft) - .def("set_frame_top_right", - &CMA::CMAWindowDualVisionHorizontal::setFrameTopRight) - .def("set_frame_bottom_left", - &CMA::CMAWindowDualVisionHorizontal::setFrameBottomLeft) - .def("set_frame_bottom_right", - &CMA::CMAWindowDualVisionHorizontal::setFrameBottomRight) - .def("set_frame_left", &CMA::CMAWindowDualVisionHorizontal::setFrameLeft) - .def("set_frame_right", - &CMA::CMAWindowDualVisionHorizontal::setFrameRight) - .def("set_frame_meeting_rail", - &CMA::CMAWindowDualVisionHorizontal::setFrameMeetingRail) - .def("set_dividers", &CMA::CMAWindowDualVisionHorizontal::setDividers); - - py::class_>( - m, "CMAWindowDualVisionVertical") - .def(py::init(), - py::arg("width"), py::arg("height"), - py::arg("spacer_best_keff") = 0.01, - py::arg("spacer_worst_keff") = 10.0, - py::arg("best_u_factor_options") = - CMA::CreateBestWorstUFactorOption(CMA::Option::Best), - py::arg("worst_u_factor_options") = - CMA::CreateBestWorstUFactorOption(CMA::Option::Worst)) - .def("set_frame_top", &CMA::CMAWindowDualVisionVertical::setFrameTop) - .def("set_frame_bottom", - &CMA::CMAWindowDualVisionVertical::setFrameBottom) - .def("set_frame_top_left", - &CMA::CMAWindowDualVisionVertical::setFrameTopLeft) - .def("set_frame_top_right", - &CMA::CMAWindowDualVisionVertical::setFrameTopRight) - .def("set_frame_bottom_left", - &CMA::CMAWindowDualVisionVertical::setFrameBottomLeft) - .def("set_frame_bottom_right", - &CMA::CMAWindowDualVisionVertical::setFrameBottomRight) - .def("set_frame_meeting_rail", - &CMA::CMAWindowDualVisionVertical::setFrameMeetingRail) - .def("set_dividers", &CMA::CMAWindowDualVisionVertical::setDividers); - - py::class_(m, "ThermalIRResults") - .def_readwrite( - "transmittance_front_diffuse_diffuse", - &wincalc::ThermalIRResults::transmittance_front_diffuse_diffuse) - .def_readwrite( - "transmittance_back_diffuse_diffuse", - &wincalc::ThermalIRResults::transmittance_back_diffuse_diffuse) - .def_readwrite("emissivity_front_hemispheric", - &wincalc::ThermalIRResults::emissivity_front_hemispheric) - .def_readwrite("emissivity_back_hemispheric", - &wincalc::ThermalIRResults::emissivity_back_hemispheric); - - m.def("calc_thermal_ir", &wincalc::calc_thermal_ir, - py::arg("optical_standard"), py::arg("product_data")); - - m.def("get_spacer_keff", &wincalc::get_spacer_keff, - "Calculate the effective conductivity of a spacer from a THERM thmx " - "file."); - m.def("get_cma_window_single_vision", - py::overload_cast( - &wincalc::get_cma_window_single_vision), - "Get the CMA template for a single vision window."); - m.def( - "get_cma_window_single_vision", - py::overload_cast< - CMA::CMAFrame const &, CMA::CMAFrame const &, CMA::CMAFrame const &, - CMA::CMAFrame const &, double, double, double, double, - CMA::CMABestWorstUFactors const &, CMA::CMABestWorstUFactors const &>( - &wincalc::get_cma_window_single_vision), - "Get the CMA template for a single vision window."); - m.def("get_cma_window_double_vision_vertical", - py::overload_cast( - &wincalc::get_cma_window_double_vision_vertical), - "Get the CMA template for a double vision vertical window."); - m.def( - "get_cma_window_double_vision_vertical", - py::overload_cast< - CMA::CMAFrame const &, CMA::CMAFrame const &, CMA::CMAFrame const &, - CMA::CMAFrame const &, CMA::CMAFrame const &, CMA::CMAFrame const &, - CMA::CMAFrame const &, double, double, double, double, - CMA::CMABestWorstUFactors const &, CMA::CMABestWorstUFactors const &>( - &wincalc::get_cma_window_double_vision_vertical), - "Get the CMA template for a double vision vertical window."); - m.def("get_cma_window_double_vision_horizontal", - py::overload_cast( - &wincalc::get_cma_window_double_vision_horizontal), - "Get the CMA template for a double vision horizontal window."); - m.def( - "get_cma_window_double_vision_horizontal", - py::overload_cast< - CMA::CMAFrame const &, CMA::CMAFrame const &, CMA::CMAFrame const &, - CMA::CMAFrame const &, CMA::CMAFrame const &, CMA::CMAFrame const &, - CMA::CMAFrame const &, double, double, double, double, - CMA::CMABestWorstUFactors const &, CMA::CMABestWorstUFactors const &>( - &wincalc::get_cma_window_double_vision_horizontal), - "Get the CMA template for a double vision horizontal window."); - - py::class_(m, "CMAResult") - .def_readwrite("u", &wincalc::CMAResult::u) - .def_readwrite("shgc", &wincalc::CMAResult::shgc) - .def_readwrite("vt", &wincalc::CMAResult::vt); - - m.def("calc_cma", &wincalc::calc_cma, "Get CMA results."); - - py::enum_(m, "BSDFDirection", - py::arithmetic()) - .value("Incoming", SingleLayerOptics::BSDFDirection::Incoming) - .value("Outgoing", SingleLayerOptics::BSDFDirection::Outgoing); - - py::enum_(m, "Side", py::arithmetic()) - .value("Front", FenestrationCommon::Side::Front) - .value("Back", FenestrationCommon::Side::Back); - - py::enum_(m, "PropertySimple", + .def("u", &CMA::CMABestWorstUFactors::uValue) + .def("hc_out", &CMA::CMABestWorstUFactors::hcout); + + m.def("create_best_worst_u_factor_option", + &CMA::CreateBestWorstUFactorOption); + + py::class_>( + m, "CMAWindowSingleVision") + .def(py::init(), + py::arg("width"), py::arg("height"), + py::arg("spacer_best_keff") = 0.01, + py::arg("spacer_worst_keff") = 10.0, + py::arg("best_u_factor_options") = + CMA::CreateBestWorstUFactorOption(CMA::Option::Best), + py::arg("worst_u_factor_options") = + CMA::CreateBestWorstUFactorOption(CMA::Option::Worst)) + .def("set_frame_top", &CMA::CMAWindowSingleVision::setFrameTop) + .def("set_frame_bottom", &CMA::CMAWindowSingleVision::setFrameBottom) + .def("set_frame_left", &CMA::CMAWindowSingleVision::setFrameLeft) + .def("set_frame_right", &CMA::CMAWindowSingleVision::setFrameRight) + .def("set_dividers", &CMA::CMAWindowSingleVision::setDividers); + + py::class_>( + m, "CMAWindowDualVisionHorizontal") + .def(py::init(), + py::arg("width"), py::arg("height"), + py::arg("spacer_best_keff") = 0.01, + py::arg("spacer_worst_keff") = 10.0, + py::arg("best_u_factor_options") = + CMA::CreateBestWorstUFactorOption(CMA::Option::Best), + py::arg("worst_u_factor_options") = + CMA::CreateBestWorstUFactorOption(CMA::Option::Worst)) + .def("set_frame_top_left", + &CMA::CMAWindowDualVisionHorizontal::setFrameTopLeft) + .def("set_frame_top_right", + &CMA::CMAWindowDualVisionHorizontal::setFrameTopRight) + .def("set_frame_bottom_left", + &CMA::CMAWindowDualVisionHorizontal::setFrameBottomLeft) + .def("set_frame_bottom_right", + &CMA::CMAWindowDualVisionHorizontal::setFrameBottomRight) + .def("set_frame_left", &CMA::CMAWindowDualVisionHorizontal::setFrameLeft) + .def("set_frame_right", + &CMA::CMAWindowDualVisionHorizontal::setFrameRight) + .def("set_frame_meeting_rail", + &CMA::CMAWindowDualVisionHorizontal::setFrameMeetingRail) + .def("set_dividers", &CMA::CMAWindowDualVisionHorizontal::setDividers); + + py::class_>( + m, "CMAWindowDualVisionVertical") + .def(py::init(), + py::arg("width"), py::arg("height"), + py::arg("spacer_best_keff") = 0.01, + py::arg("spacer_worst_keff") = 10.0, + py::arg("best_u_factor_options") = + CMA::CreateBestWorstUFactorOption(CMA::Option::Best), + py::arg("worst_u_factor_options") = + CMA::CreateBestWorstUFactorOption(CMA::Option::Worst)) + .def("set_frame_top", &CMA::CMAWindowDualVisionVertical::setFrameTop) + .def("set_frame_bottom", + &CMA::CMAWindowDualVisionVertical::setFrameBottom) + .def("set_frame_top_left", + &CMA::CMAWindowDualVisionVertical::setFrameTopLeft) + .def("set_frame_top_right", + &CMA::CMAWindowDualVisionVertical::setFrameTopRight) + .def("set_frame_bottom_left", + &CMA::CMAWindowDualVisionVertical::setFrameBottomLeft) + .def("set_frame_bottom_right", + &CMA::CMAWindowDualVisionVertical::setFrameBottomRight) + .def("set_frame_meeting_rail", + &CMA::CMAWindowDualVisionVertical::setFrameMeetingRail) + .def("set_dividers", &CMA::CMAWindowDualVisionVertical::setDividers); + + py::class_(m, "ThermalIRResults") + .def_readwrite( + "transmittance_front_diffuse_diffuse", + &wincalc::ThermalIRResults::transmittance_front_diffuse_diffuse) + .def_readwrite( + "transmittance_back_diffuse_diffuse", + &wincalc::ThermalIRResults::transmittance_back_diffuse_diffuse) + .def_readwrite("emissivity_front_hemispheric", + &wincalc::ThermalIRResults::emissivity_front_hemispheric) + .def_readwrite("emissivity_back_hemispheric", + &wincalc::ThermalIRResults::emissivity_back_hemispheric); + + m.def("calc_thermal_ir", &wincalc::calc_thermal_ir, + py::arg("optical_standard"), py::arg("product_data")); + + m.def("get_spacer_keff", &wincalc::get_spacer_keff, + "Calculate the effective conductivity of a spacer from a THERM thmx " + "file."); + m.def("get_cma_window_single_vision", + py::overload_cast( + &wincalc::get_cma_window_single_vision), + "Get the CMA template for a single vision window."); + m.def( + "get_cma_window_single_vision", + py::overload_cast< + CMA::CMAFrame const &, CMA::CMAFrame const &, CMA::CMAFrame const &, + CMA::CMAFrame const &, double, double, double, double, + CMA::CMABestWorstUFactors const &, CMA::CMABestWorstUFactors const &>( + &wincalc::get_cma_window_single_vision), + "Get the CMA template for a single vision window."); + m.def("get_cma_window_double_vision_vertical", + py::overload_cast( + &wincalc::get_cma_window_double_vision_vertical), + "Get the CMA template for a double vision vertical window."); + m.def( + "get_cma_window_double_vision_vertical", + py::overload_cast< + CMA::CMAFrame const &, CMA::CMAFrame const &, CMA::CMAFrame const &, + CMA::CMAFrame const &, CMA::CMAFrame const &, CMA::CMAFrame const &, + CMA::CMAFrame const &, double, double, double, double, + CMA::CMABestWorstUFactors const &, CMA::CMABestWorstUFactors const &>( + &wincalc::get_cma_window_double_vision_vertical), + "Get the CMA template for a double vision vertical window."); + m.def("get_cma_window_double_vision_horizontal", + py::overload_cast( + &wincalc::get_cma_window_double_vision_horizontal), + "Get the CMA template for a double vision horizontal window."); + m.def( + "get_cma_window_double_vision_horizontal", + py::overload_cast< + CMA::CMAFrame const &, CMA::CMAFrame const &, CMA::CMAFrame const &, + CMA::CMAFrame const &, CMA::CMAFrame const &, CMA::CMAFrame const &, + CMA::CMAFrame const &, double, double, double, double, + CMA::CMABestWorstUFactors const &, CMA::CMABestWorstUFactors const &>( + &wincalc::get_cma_window_double_vision_horizontal), + "Get the CMA template for a double vision horizontal window."); + + py::class_(m, "CMAResult") + .def_readwrite("u", &wincalc::CMAResult::u) + .def_readwrite("shgc", &wincalc::CMAResult::shgc) + .def_readwrite("vt", &wincalc::CMAResult::vt); + + m.def("calc_cma", &wincalc::calc_cma, "Get CMA results."); + + py::enum_(m, "BSDFDirection", py::arithmetic()) - .value("T", FenestrationCommon::PropertySimple::T) - .value("R", FenestrationCommon::PropertySimple::R); - - py::class_(m, "SquareMatrix") - .def(py::init> const &>(), - py::arg("input")) - .def("size", &FenestrationCommon::SquareMatrix::size) - .def("set_zeros", &FenestrationCommon::SquareMatrix::setZeros) - .def("set_identity", &FenestrationCommon::SquareMatrix::setIdentity) - .def("set_diagonal", &FenestrationCommon::SquareMatrix::setDiagonal) - .def("make_upper_triangular", - &FenestrationCommon::SquareMatrix::makeUpperTriangular) - .def("inverse", &FenestrationCommon::SquareMatrix::inverse) - .def("mmult_rows", &FenestrationCommon::SquareMatrix::mmultRows) - .def("get_matrix", &FenestrationCommon::SquareMatrix::getMatrix); - - py::class_(m, "BSDFDirections") - .def(py::init<>()) - .def(py::init const &, - SingleLayerOptics::BSDFDirection>(), - py::arg("definitions"), py::arg("side")) - .def("lambda_vector", &SingleLayerOptics::BSDFDirections::lambdaVector) - .def("profile_angles", &SingleLayerOptics::BSDFDirections::profileAngles) - .def("lambda_matrix", &SingleLayerOptics::BSDFDirections::lambdaMatrix) - .def("get_nearest_beam_index", - &SingleLayerOptics::BSDFDirections::getNearestBeamIndex); - - py::class_(m, "BSDFIntegrator") - .def(py::init(), - py::arg("directions")) - .def("get_matrix", &SingleLayerOptics::BSDFIntegrator::getMatrix) - .def("at", &SingleLayerOptics::BSDFIntegrator::at) - .def("set_matrices", &SingleLayerOptics::BSDFIntegrator::setMatrices) - .def( - "direct_direct", - py::overload_cast(m, "Side", py::arithmetic()) + .value("Front", FenestrationCommon::Side::Front) + .value("Back", FenestrationCommon::Side::Back); + + py::enum_(m, "PropertySimple", + py::arithmetic()) + .value("T", FenestrationCommon::PropertySimple::T) + .value("R", FenestrationCommon::PropertySimple::R); + + py::class_(m, "SquareMatrix") + .def(py::init> const &>(), + py::arg("input")) + .def("size", &FenestrationCommon::SquareMatrix::size) + .def("set_zeros", &FenestrationCommon::SquareMatrix::setZeros) + .def("set_identity", &FenestrationCommon::SquareMatrix::setIdentity) + .def("set_diagonal", &FenestrationCommon::SquareMatrix::setDiagonal) + .def("make_upper_triangular", + &FenestrationCommon::SquareMatrix::makeUpperTriangular) + .def("inverse", &FenestrationCommon::SquareMatrix::inverse) + .def("mmult_rows", &FenestrationCommon::SquareMatrix::mmultRows) + .def("get_matrix", &FenestrationCommon::SquareMatrix::getMatrix); + + py::class_(m, "BSDFDirections") + .def(py::init<>()) + .def(py::init const &, + SingleLayerOptics::BSDFDirection>(), + py::arg("definitions"), py::arg("side")) + .def("lambda_vector", &SingleLayerOptics::BSDFDirections::lambdaVector) + .def("profile_angles", &SingleLayerOptics::BSDFDirections::profileAngles) + .def("lambda_matrix", &SingleLayerOptics::BSDFDirections::lambdaMatrix) + .def("get_nearest_beam_index", + &SingleLayerOptics::BSDFDirections::getNearestBeamIndex); + + py::class_(m, "BSDFIntegrator") + .def(py::init(), + py::arg("directions")) + .def("get_matrix", &SingleLayerOptics::BSDFIntegrator::getMatrix) + .def("at", &SingleLayerOptics::BSDFIntegrator::at) + .def("set_matrices", &SingleLayerOptics::BSDFIntegrator::setMatrices) + .def( + "direct_direct", + py::overload_cast( - &SingleLayerOptics::BSDFIntegrator::DirDir, py::const_)) - .def("direct_direct", - py::overload_cast( - &SingleLayerOptics::BSDFIntegrator::DirDir, py::const_)) - .def("direct_hemispheric", - py::overload_cast( - &SingleLayerOptics::BSDFIntegrator::DirHem)) - .def( - "direct_hemispheric", - py::overload_cast( + &SingleLayerOptics::BSDFIntegrator::DirDir, py::const_)) + .def("direct_hemispheric", + py::overload_cast( + &SingleLayerOptics::BSDFIntegrator::DirHem)) + .def( + "direct_hemispheric", + py::overload_cast( - &SingleLayerOptics::BSDFIntegrator::DirHem)) - .def("absorptance", py::overload_cast( - &SingleLayerOptics::BSDFIntegrator::Abs)) - .def("absorptance", - py::overload_cast( - &SingleLayerOptics::BSDFIntegrator::Abs)) - .def("absorptance", py::overload_cast( - &SingleLayerOptics::BSDFIntegrator::Abs)) - .def("diffuse_diffuse", &SingleLayerOptics::BSDFIntegrator::DiffDiff) - .def("absorptance_diffuse_diffuse", - &SingleLayerOptics::BSDFIntegrator::AbsDiffDiff) - .def("lambda_vector", &SingleLayerOptics::BSDFIntegrator::lambdaVector) - .def("lambda_matrix", &SingleLayerOptics::BSDFIntegrator::lambdaMatrix) - .def("get_nearest_beam_index", - &SingleLayerOptics::BSDFIntegrator::getNearestBeamIndex); - - py::class_(m, "EffectiveOpenness") - .def(py::init(), - py::arg("ah"), py::arg("al"), py::arg("ar"), py::arg("atop"), - py::arg("abot"), py::arg("front_porosity")) - .def("is_closed", &EffectiveLayers::EffectiveOpenness::isClosed) - .def_readwrite("ah", &EffectiveLayers::EffectiveOpenness::Ah) - .def_readwrite("al", &EffectiveLayers::EffectiveOpenness::Al) - .def_readwrite("ar", &EffectiveLayers::EffectiveOpenness::Ar) - .def_readwrite("atop", &EffectiveLayers::EffectiveOpenness::Atop) - .def_readwrite("abot", &EffectiveLayers::EffectiveOpenness::Abot) - .def_readwrite("front_porosity", - &EffectiveLayers::EffectiveOpenness::FrontPorosity); - - py::class_(m, "Layers") - .def_static("solid", &Tarcog::ISO15099::Layers::solid, - "Factory method for creating a solid Tarcog layer", - py::arg("thickness"), py::arg("conductivity"), - py::arg("frontEmissivity") = 0.84, - py::arg("frontIRTransmittance") = 0.0, - py::arg("backEmissivity") = 0.84, - py::arg("backIRTransmittance") = 0.0) - .def_static("update_material_data", - &Tarcog::ISO15099::Layers::updateMaterialData, - "Static method for updating the material information for a " - "solid Tarcog layer.", - py::arg("layer"), - py::arg("density") = Tarcog::MaterialConstants::GLASSDENSITY, - py::arg("youngs_modulus") = - Tarcog::DeflectionConstants::YOUNGSMODULUS) - .def_static("shading", &Tarcog::ISO15099::Layers::shading, - "Factory function to create a Tarcog shading layer.", - py::arg("thickness"), py::arg("conductivity"), - py::arg("effective_openness") = - EffectiveLayers::EffectiveOpenness(0, 0, 0, 0, 0, 0), - py::arg("front_emissivity") = 0.84, - py::arg("front_transmittance") = 0.0, - py::arg("back_emissivity") = 0.84, - py::arg("back_transmittance") = 0.0) - .def_static( - "gap", - py::overload_cast(&Tarcog::ISO15099::Layers::gap), - "Factory function to create a Tarcog air gap", py::arg("thickness"), - py::arg("pressure") = 101325) - .def_static("gap", - py::overload_cast( - &Tarcog::ISO15099::Layers::gap), - "Factory function to create a Tarcog gap from a gas", - py::arg("thickness"), py::arg("gas"), - py::arg("pressure") = 101325) - .def_static( - "create_pillar", - py::overload_cast( + &SingleLayerOptics::BSDFIntegrator::Abs)) + .def("absorptance", + py::overload_cast( + &SingleLayerOptics::BSDFIntegrator::Abs)) + .def("absorptance", py::overload_cast( + &SingleLayerOptics::BSDFIntegrator::Abs)) + .def("diffuse_diffuse", &SingleLayerOptics::BSDFIntegrator::DiffDiff) + .def("absorptance_diffuse_diffuse", + &SingleLayerOptics::BSDFIntegrator::AbsDiffDiff) + .def("lambda_vector", &SingleLayerOptics::BSDFIntegrator::lambdaVector) + .def("lambda_matrix", &SingleLayerOptics::BSDFIntegrator::lambdaMatrix) + .def("get_nearest_beam_index", + &SingleLayerOptics::BSDFIntegrator::getNearestBeamIndex); + + py::class_(m, "EffectiveOpenness") + .def(py::init(), + py::arg("ah"), py::arg("al"), py::arg("ar"), py::arg("atop"), + py::arg("abot"), py::arg("front_porosity")) + .def("is_closed", &EffectiveLayers::EffectiveOpenness::isClosed) + .def_readwrite("ah", &EffectiveLayers::EffectiveOpenness::Ah) + .def_readwrite("al", &EffectiveLayers::EffectiveOpenness::Al) + .def_readwrite("ar", &EffectiveLayers::EffectiveOpenness::Ar) + .def_readwrite("atop", &EffectiveLayers::EffectiveOpenness::Atop) + .def_readwrite("abot", &EffectiveLayers::EffectiveOpenness::Abot) + .def_readwrite("front_porosity", + &EffectiveLayers::EffectiveOpenness::FrontPorosity); + + py::class_(m, "Layers") + .def_static("solid", &Tarcog::ISO15099::Layers::solid, + "Factory method for creating a solid Tarcog layer", + py::arg("thickness"), py::arg("conductivity"), + py::arg("frontEmissivity") = 0.84, + py::arg("frontIRTransmittance") = 0.0, + py::arg("backEmissivity") = 0.84, + py::arg("backIRTransmittance") = 0.0) + .def_static("update_material_data", + &Tarcog::ISO15099::Layers::updateMaterialData, + "Static method for updating the material information for a " + "solid Tarcog layer.", + py::arg("layer"), + py::arg("density") = Tarcog::MaterialConstants::GLASSDENSITY, + py::arg("youngs_modulus") = + Tarcog::DeflectionConstants::YOUNGSMODULUS) + .def_static("shading", &Tarcog::ISO15099::Layers::shading, + "Factory function to create a Tarcog shading layer.", + py::arg("thickness"), py::arg("conductivity"), + py::arg("effective_openness") = + EffectiveLayers::EffectiveOpenness(0, 0, 0, 0, 0, 0), + py::arg("front_emissivity") = 0.84, + py::arg("front_transmittance") = 0.0, + py::arg("back_emissivity") = 0.84, + py::arg("back_transmittance") = 0.0) + .def_static( + "gap", + py::overload_cast(&Tarcog::ISO15099::Layers::gap), + "Factory function to create a Tarcog air gap", py::arg("thickness"), + py::arg("pressure") = 101325) + .def_static("gap", + py::overload_cast( + &Tarcog::ISO15099::Layers::gap), + "Factory function to create a Tarcog gap from a gas", + py::arg("thickness"), py::arg("gas"), + py::arg("pressure") = 101325) + .def_static( + "create_pillar", + py::overload_cast(&Tarcog::ISO15099::Layers::createPillar), + "Static function to add a cylindrical pillar to a Tarcog gap", + py::arg("pillar"), py::arg("pressure")) + .def_static( + "create_pillar", + py::overload_cast(&Tarcog::ISO15099::Layers::createPillar), + "Static function to add a spherical pillar to a Tarcog gap", + py::arg("pillar"), py::arg("pressure")) + .def_static( + "create_pillar", + py::overload_cast(&Tarcog::ISO15099::Layers::createPillar), + "Static function to add a rectangular pillar to a Tarcog gap", + py::arg("pillar"), py::arg("pressure")) + .def_static( + "create_pillar", + py::overload_cast(&Tarcog::ISO15099::Layers::createPillar), - "Static function to add a cylindrical pillar to a Tarcog gap", - py::arg("pillar"), py::arg("pressure")); + "Static function to add a rectangular pillar to a Tarcog gap", + py::arg("pillar"), py::arg("pressure")); } From 2d3988465d27a71f74b30813298d970900a381cf Mon Sep 17 00:00:00 2001 From: Simon Vidanovic Date: Thu, 7 Dec 2023 15:55:02 -0800 Subject: [PATCH 04/27] All mathematical pillars added. --- pywincalc/__init__.py | 5 ++- src/wincalcbindings.cpp | 71 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 74 insertions(+), 2 deletions(-) diff --git a/pywincalc/__init__.py b/pywincalc/__init__.py index 4ac266d..2e5a749 100644 --- a/pywincalc/__init__.py +++ b/pywincalc/__init__.py @@ -30,7 +30,10 @@ from wincalcbindings import AirHorizontalDirection, BSDF, BSDFBasisType, BSDFDirection, BSDFDirections, BSDFHemisphere, \ BSDFIntegrator, BoundaryConditionsCoefficientModelType, CMABestWorstUFactors, CMAResult, CMAWindow, \ CMAWindowDualVisionHorizontal, CMAWindowDualVisionVertical, CMAWindowSingleVision, CellSpacingType, PolygonType, pillar_cell_area, \ - PillarData, CylindricalPillar, SphericalPillar, RectangularPillar, PolygonalPillar, UniversalSupportPillar, CylindricalPillarLayer, SphericalPillarLayer, RectangularPillarLayer, TriangularPillarLayer, PentagonPillarLayer, HexagonPillarLayer, CoatedSide, \ + PillarData, CylindricalPillar, SphericalPillar, RectangularPillar, PolygonalPillar, LinearBearingPillar, TruncatedConePillar, \ + AnnulusCylinderPillar, UniversalSupportPillar, CylindricalPillarLayer, SphericalPillarLayer, RectangularPillarLayer, \ + TriangularPillarLayer, PentagonPillarLayer, HexagonPillarLayer, LinearBearingPillarLayer, TruncatedConePillarLayer, \ + AnnulusCylinderPillarLayer, CoatedSide, \ ColorResult, DeflectionResults, DistributionMethodType, DualBandBSDF, EffectiveOpenness, Environment, Environments, \ FlippableSolidLayer, Gas, GasCoefficients, GasData, GlazingSystem as _GlazingSystem, GlazingSystemDimensions, \ IGUGapLayer, IntegrationRule, IntegrationRuleType, Lab, Layers, MaterialType, \ diff --git a/src/wincalcbindings.cpp b/src/wincalcbindings.cpp index b1c7ad5..a1a90f5 100644 --- a/src/wincalcbindings.cpp +++ b/src/wincalcbindings.cpp @@ -292,6 +292,57 @@ PYBIND11_MODULE(wincalcbindings, m) { Tarcog::ISO15099::PolygonalPillar const &>(), py::arg("gap_layer"), py::arg("polygon_pillar")); + py::class_>( + m, "LinearBearingPillar") + .def(py::init(), + py::arg("height"), py::arg("material_conductivity"), py::arg("cell_area"), py::arg("length"), + py::arg("width")) + .def_readwrite("length", &Tarcog::ISO15099::LinearBearingPillar::length) + .def_readwrite("width", &Tarcog::ISO15099::LinearBearingPillar::width); + + py::class_>( + m, "LinearBearingPillarLayer") + .def(py::init(), + py::arg("gap_layer"), py::arg("linear_bearing_pillar")); + + py::class_>( + m, "TruncatedConePillar") + .def(py::init(), + py::arg("height"), py::arg("material_conductivity"), py::arg("cell_area"), py::arg("radius_1"), + py::arg("radius_2")) + .def_readwrite("radius_1", &Tarcog::ISO15099::TruncatedConePillar::radius1) + .def_readwrite("radius_2", &Tarcog::ISO15099::TruncatedConePillar::radius2); + + py::class_>( + m, "TruncatedConePillarLayer") + .def(py::init(), + py::arg("gap_layer"), py::arg("truncated_cone_pillar")); + + py::class_>( + m, "AnnulusCylinderPillar") + .def(py::init(), + py::arg("height"), py::arg("material_conductivity"), py::arg("cell_area"), py::arg("inner_radius"), + py::arg("outer_radius")) + .def_readwrite("inner_radius", &Tarcog::ISO15099::AnnulusCylinderPillar::innerRadius) + .def_readwrite("outer_radius", &Tarcog::ISO15099::AnnulusCylinderPillar::outerRadius); + + py::class_>( + m, "AnnulusCylinderPillarLayer") + .def(py::init(), + py::arg("gap_layer"), py::arg("annulus_cylinder_pillar")); + // py::class_>( @@ -1706,6 +1757,24 @@ PYBIND11_MODULE(wincalcbindings, m) { "create_pillar", py::overload_cast(&Tarcog::ISO15099::Layers::createPillar), - "Static function to add a rectangular pillar to a Tarcog gap", + "Static function to add a polygonal pillar to a Tarcog gap", + py::arg("pillar"), py::arg("pressure")) + .def_static( + "create_pillar", + py::overload_cast(&Tarcog::ISO15099::Layers::createPillar), + "Static function to add a linear bearing pillar to a Tarcog gap", + py::arg("pillar"), py::arg("pressure")) + .def_static( + "create_pillar", + py::overload_cast(&Tarcog::ISO15099::Layers::createPillar), + "Static function to add a truncated cone pillar to a Tarcog gap", + py::arg("pillar"), py::arg("pressure")) + .def_static( + "create_pillar", + py::overload_cast(&Tarcog::ISO15099::Layers::createPillar), + "Static function to add a annulus cylinder pillar to a Tarcog gap", py::arg("pillar"), py::arg("pressure")); } From 84ab9e9758fa503cd63c1770afed0c646497ff5f Mon Sep 17 00:00:00 2001 From: Simon Vidanovic Date: Fri, 8 Dec 2023 09:51:10 -0800 Subject: [PATCH 05/27] Measured pillar added. --- pywincalc/__init__.py | 4 +- src/wincalcbindings.cpp | 3502 ++++++++++++++++++++------------------- 2 files changed, 1780 insertions(+), 1726 deletions(-) diff --git a/pywincalc/__init__.py b/pywincalc/__init__.py index 2e5a749..c7fd635 100644 --- a/pywincalc/__init__.py +++ b/pywincalc/__init__.py @@ -30,10 +30,10 @@ from wincalcbindings import AirHorizontalDirection, BSDF, BSDFBasisType, BSDFDirection, BSDFDirections, BSDFHemisphere, \ BSDFIntegrator, BoundaryConditionsCoefficientModelType, CMABestWorstUFactors, CMAResult, CMAWindow, \ CMAWindowDualVisionHorizontal, CMAWindowDualVisionVertical, CMAWindowSingleVision, CellSpacingType, PolygonType, pillar_cell_area, \ - PillarData, CylindricalPillar, SphericalPillar, RectangularPillar, PolygonalPillar, LinearBearingPillar, TruncatedConePillar, \ + PillarData, CylindricalPillar, SphericalPillar, RectangularPillar, PolygonalPillar, LinearBearingPillar, TruncatedConePillar, Glass, PillarMeasurement, \ AnnulusCylinderPillar, UniversalSupportPillar, CylindricalPillarLayer, SphericalPillarLayer, RectangularPillarLayer, \ TriangularPillarLayer, PentagonPillarLayer, HexagonPillarLayer, LinearBearingPillarLayer, TruncatedConePillarLayer, \ - AnnulusCylinderPillarLayer, CoatedSide, \ + AnnulusCylinderPillarLayer, MeasuredPillarLayer, CoatedSide, \ ColorResult, DeflectionResults, DistributionMethodType, DualBandBSDF, EffectiveOpenness, Environment, Environments, \ FlippableSolidLayer, Gas, GasCoefficients, GasData, GlazingSystem as _GlazingSystem, GlazingSystemDimensions, \ IGUGapLayer, IntegrationRule, IntegrationRuleType, Lab, Layers, MaterialType, \ diff --git a/src/wincalcbindings.cpp b/src/wincalcbindings.cpp index a1a90f5..53d1902 100644 --- a/src/wincalcbindings.cpp +++ b/src/wincalcbindings.cpp @@ -7,1774 +7,1828 @@ namespace py = pybind11; using namespace pybind11::literals; -template +template void declare_wce_optical_result_simple(py::module &m, std::string typestr) { - using Class = wincalc::WCE_Optical_Result_Simple; - std::string pyclass_name = std::string("OpticalResultFluxType") + typestr; - py::class_(m, pyclass_name.c_str(), py::buffer_protocol(), - py::dynamic_attr()) - .def_readwrite("direct_direct", &Class::direct_direct) - .def_readwrite("direct_diffuse", &Class::direct_diffuse) - .def_readwrite("diffuse_diffuse", &Class::diffuse_diffuse) - .def_readwrite("direct_hemispherical", &Class::direct_hemispherical) - .def_readwrite("matrix", &Class::matrix); + using Class = wincalc::WCE_Optical_Result_Simple; + std::string pyclass_name = std::string("OpticalResultFluxType") + typestr; + py::class_(m, pyclass_name.c_str(), py::buffer_protocol(), + py::dynamic_attr()) + .def_readwrite("direct_direct", &Class::direct_direct) + .def_readwrite("direct_diffuse", &Class::direct_diffuse) + .def_readwrite("diffuse_diffuse", &Class::diffuse_diffuse) + .def_readwrite("direct_hemispherical", &Class::direct_hemispherical) + .def_readwrite("matrix", &Class::matrix); } -template +template void declare_wce_optical_result_absorptance(py::module &m, std::string typestr) { - using Class = wincalc::WCE_Optical_Result_Absorptance; - std::string pyclass_name = std::string("OpticalResultAbsorptance") + typestr; - py::class_(m, pyclass_name.c_str(), py::buffer_protocol(), - py::dynamic_attr()) - .def_readwrite("direct", &Class::total_direct) - .def_readwrite("diffuse", &Class::total_diffuse) - .def_readwrite("total_direct", &Class::total_direct) - .def_readwrite("total_diffuse", &Class::total_diffuse) - .def_readwrite("heat_direct", &Class::heat_direct) - .def_readwrite("heat_diffuse", &Class::heat_diffuse) - .def_readwrite("electricity_direct", &Class::electricity_direct) - .def_readwrite("electricity_diffuse", &Class::electricity_diffuse) - .def_readwrite("angular_total", &Class::angular_total) - .def_readwrite("angular_heat", &Class::angular_heat) - .def_readwrite("angular_electricity", &Class::angular_electricity); + using Class = wincalc::WCE_Optical_Result_Absorptance; + std::string pyclass_name = std::string("OpticalResultAbsorptance") + typestr; + py::class_(m, pyclass_name.c_str(), py::buffer_protocol(), + py::dynamic_attr()) + .def_readwrite("direct", &Class::total_direct) + .def_readwrite("diffuse", &Class::total_diffuse) + .def_readwrite("total_direct", &Class::total_direct) + .def_readwrite("total_diffuse", &Class::total_diffuse) + .def_readwrite("heat_direct", &Class::heat_direct) + .def_readwrite("heat_diffuse", &Class::heat_diffuse) + .def_readwrite("electricity_direct", &Class::electricity_direct) + .def_readwrite("electricity_diffuse", &Class::electricity_diffuse) + .def_readwrite("angular_total", &Class::angular_total) + .def_readwrite("angular_heat", &Class::angular_heat) + .def_readwrite("angular_electricity", &Class::angular_electricity); } -template +template void declare_wce_optical_result_layer(py::module &m, std::string typestr) { - using Class = wincalc::WCE_Optical_Result_Layer; - declare_wce_optical_result_absorptance(m, typestr); - std::string pyclass_name = std::string("OpticalResultLayer") + typestr; - py::class_(m, pyclass_name.c_str(), py::buffer_protocol(), - py::dynamic_attr()) - .def_readwrite("absorptance", &Class::absorptance); + using Class = wincalc::WCE_Optical_Result_Layer; + declare_wce_optical_result_absorptance(m, typestr); + std::string pyclass_name = std::string("OpticalResultLayer") + typestr; + py::class_(m, pyclass_name.c_str(), py::buffer_protocol(), + py::dynamic_attr()) + .def_readwrite("absorptance", &Class::absorptance); } -template +template void declare_wce_optical_transmission_result(py::module &m, std::string typestr) { - using Class = wincalc::WCE_Optical_Transmission_Result; - std::string pyclass_name = std::string("OpticalResultTransmission") + typestr; - py::class_(m, pyclass_name.c_str(), py::buffer_protocol(), - py::dynamic_attr()) - .def_readwrite("transmittance", &Class::transmittance) - .def_readwrite("reflectance", &Class::reflectance); + using Class = wincalc::WCE_Optical_Transmission_Result; + std::string pyclass_name = std::string("OpticalResultTransmission") + typestr; + py::class_(m, pyclass_name.c_str(), py::buffer_protocol(), + py::dynamic_attr()) + .def_readwrite("transmittance", &Class::transmittance) + .def_readwrite("reflectance", &Class::reflectance); } -template +template void declare_wce_optical_result_by_side(py::module &m, std::string typestr) { - using Class = wincalc::WCE_Optical_Result_By_Side; - std::string pyclass_name = std::string("OpticalResultSide") + typestr; - py::class_(m, pyclass_name.c_str(), py::buffer_protocol(), - py::dynamic_attr()) - .def_readwrite("front", &Class::front) - .def_readwrite("back", &Class::back); + using Class = wincalc::WCE_Optical_Result_By_Side; + std::string pyclass_name = std::string("OpticalResultSide") + typestr; + py::class_(m, pyclass_name.c_str(), py::buffer_protocol(), + py::dynamic_attr()) + .def_readwrite("front", &Class::front) + .def_readwrite("back", &Class::back); } -template +template void declare_wce_optical_results_template(py::module &m, std::string typestr) { - using Class = wincalc::WCE_Optical_Results_Template; - declare_wce_optical_result_simple(m, typestr); - declare_wce_optical_transmission_result< - wincalc::WCE_Optical_Result_Simple>(m, typestr); - declare_wce_optical_result_by_side>>(m, typestr); - declare_wce_optical_result_layer(m, typestr); - declare_wce_optical_result_by_side>( - m, typestr + "_Layer"); - std::string pyclass_name = std::string("OpticalResults") + typestr; - py::class_(m, pyclass_name.c_str(), py::buffer_protocol(), - py::dynamic_attr()) - .def_readwrite("system_results", &Class::system_results, - "Results for the entire system.") - .def_readwrite("layer_results", &Class::layer_results, - "A list of results where each item in the list contains " - "the results for one layer in the system."); + using Class = wincalc::WCE_Optical_Results_Template; + declare_wce_optical_result_simple(m, typestr); + declare_wce_optical_transmission_result< + wincalc::WCE_Optical_Result_Simple>(m, typestr); + declare_wce_optical_result_by_side>>(m, typestr); + declare_wce_optical_result_layer(m, typestr); + declare_wce_optical_result_by_side>( + m, typestr + "_Layer"); + std::string pyclass_name = std::string("OpticalResults") + typestr; + py::class_(m, pyclass_name.c_str(), py::buffer_protocol(), + py::dynamic_attr()) + .def_readwrite("system_results", &Class::system_results, + "Results for the entire system.") + .def_readwrite("layer_results", &Class::layer_results, + "A list of results where each item in the list contains " + "the results for one layer in the system."); } -template<> +template <> void declare_wce_optical_results_template( - py::module &m, std::string typestr) { - using Class = wincalc::WCE_Optical_Results_Template; - declare_wce_optical_result_simple(m, typestr); - declare_wce_optical_transmission_result< - wincalc::WCE_Optical_Result_Simple>(m, typestr); - declare_wce_optical_result_by_side>>(m, typestr); - std::string pyclass_name = std::string("OpticalResults") + typestr; - py::class_(m, pyclass_name.c_str(), py::buffer_protocol(), - py::dynamic_attr()) - .def_readwrite("system_results", &Class::system_results, - "Results for the entire system. Layer results for colors " - "are not currently supported."); + py::module &m, std::string typestr) { + using Class = wincalc::WCE_Optical_Results_Template; + declare_wce_optical_result_simple(m, typestr); + declare_wce_optical_transmission_result< + wincalc::WCE_Optical_Result_Simple>(m, typestr); + declare_wce_optical_result_by_side>>(m, typestr); + std::string pyclass_name = std::string("OpticalResults") + typestr; + py::class_(m, pyclass_name.c_str(), py::buffer_protocol(), + py::dynamic_attr()) + .def_readwrite("system_results", &Class::system_results, + "Results for the entire system. Layer results for colors " + "are not currently supported."); } class Py_Product_Data_Optical : public wincalc::Product_Data_Optical //_Base { public: - using wincalc::Product_Data_Optical::Product_Data_Optical; // Inherit - // constructors - std::vector wavelengths() const override { - PYBIND11_OVERRIDE_PURE(std::vector, wincalc::Product_Data_Optical, - wavelengths,); - } + using wincalc::Product_Data_Optical::Product_Data_Optical; // Inherit + // constructors + std::vector wavelengths() const override { + PYBIND11_OVERRIDE_PURE(std::vector, wincalc::Product_Data_Optical, + wavelengths, ); + } }; class Py_UniversalSupportPillar - : public Tarcog::ISO15099::UniversalSupportPillar { + : public Tarcog::ISO15099::UniversalSupportPillar { public: - using Tarcog::ISO15099::UniversalSupportPillar::UniversalSupportPillar; + using Tarcog::ISO15099::UniversalSupportPillar::UniversalSupportPillar; protected: - double areaOfContact() override { - PYBIND11_OVERRIDE_PURE(double, Tarcog::ISO15099::UniversalSupportPillar, - areaOfContact,); - } + double areaOfContact() override { + PYBIND11_OVERRIDE_PURE(double, Tarcog::ISO15099::UniversalSupportPillar, + areaOfContact, ); + } }; PYBIND11_MODULE(wincalcbindings, m) { - m.doc() = "Python bindings for WinCalc"; - - py::enum_(m, "PredefinedGasType", py::arithmetic()) - .value("AIR", Gases::GasDef::Air) - .value("ARGON", Gases::GasDef::Argon) - .value("KRYPTON", Gases::GasDef::Krypton) - .value("XENON", Gases::GasDef::Xenon); - - py::class_(m, "GasCoefficients") - .def(py::init(), py::arg("A"), - py::arg("B"), py::arg("C")); - - py::class_(m, "GasData") - .def(py::init(), - py::arg("name"), py::arg("molecular_weight"), - py::arg("specific_heat_ratio"), py::arg("Cp"), - py::arg("thermal_conductivity"), py::arg("viscosity")) - .def("get_molecular_weight", &Gases::CGasData::getMolecularWeight) - .def("get_property_value", &Gases::CGasData::getPropertyValue, - py::arg("type"), py::arg("temperature")) - .def("get_specific_heat_ratio", &Gases::CGasData::getSpecificHeatRatio) - .def("name", &Gases::CGasData::name); - - py::class_(m, "Gas") - .def(py::init const &>(), py::arg("gases")) - .def("get_simple_gas_properties", &Gases::CGas::getSimpleGasProperties) - .def("get_gas_properties", &Gases::CGas::getGasProperties) - .def("set_temperature_and_pressure", - &Gases::CGas::setTemperatureAndPressure) - .def("gas_items", &Gases::CGas::gasItems) - .def("total_percent", &Gases::CGas::totalPercent) - .def("add_gas_items", &Gases::CGas::addGasItems) - .def("add_gas_item", - py::overload_cast( - &Gases::CGas::addGasItem), - py::arg("percent"), py::arg("gas_data")) - .def("add_gas_item", - py::overload_cast(&Gases::CGas::addGasItem), - py::arg("percent"), py::arg("predefined_gas")); - - py::class_>(m, "IGUGapLayer") - .def(py::init(), py::arg("thickness"), - py::arg("pressure")) - .def(py::init(), - py::arg("thickness"), py::arg("pressure"), py::arg("gas")); - - py::enum_(m, "CellSpacingType", py::arithmetic()) - .value("SQUARE", Tarcog::ISO15099::CellSpacingType::Square) - .value("SHIFTEDSQUARE", Tarcog::ISO15099::CellSpacingType::ShiftedSquare) - .value("SHIFTEDROTATEDSQUARE", Tarcog::ISO15099::CellSpacingType::ShiftedRotatedSquare); - - m.def("pillar_cell_area", Tarcog::ISO15099::pillarCellArea, py::arg("cell_spacing_type"), py::arg("sp")); - - py::enum_(m, "PolygonType", py::arithmetic()) - .value("TRIANGLE", Tarcog::ISO15099::PolygonType::Triangle) - .value("PENTAGON", Tarcog::ISO15099::PolygonType::Pentagon) - .value("HEXAGON", Tarcog::ISO15099::PolygonType::Hexagon); - - py::class_>( - m, "UniversalSupportPillar") - .def(py::init(), - py::arg("gap_layer"), py::arg("material_conductivity"), - py::arg("cell_area")); - - py::class_>(m, "PillarData") - .def(py::init(), - py::arg("height"), py::arg("material_conductivity"), py::arg("cell_area")) - .def_readwrite("height", &Tarcog::ISO15099::PillarData::height) - .def_readwrite("material_conductivity", - &Tarcog::ISO15099::PillarData::materialConductivity) - .def_readwrite("cell_area", &Tarcog::ISO15099::PillarData::cellArea); - - py::class_>( - m, "CylindricalPillar") - .def(py::init(), - py::arg("height"), py::arg("material_conductivity"), py::arg("cell_area"), py::arg("radius")) - .def_readwrite("radius", &Tarcog::ISO15099::CylindricalPillar::radius); - - py::class_>( - m, "CylindricalPillarLayer") - .def(py::init(), - py::arg("gap_layer"), py::arg("cylindrical_pillar")); - - py::class_>( - m, "SphericalPillar") - .def(py::init(), - py::arg("height"), py::arg("material_conductivity"), py::arg("cell_area"), - py::arg("radius_of_contact")) - .def_readwrite("radius_of_contact", &Tarcog::ISO15099::SphericalPillar::radiusOfContact); - - py::class_>( - m, "SphericalPillarLayer") - .def(py::init(), - py::arg("gap_layer"), py::arg("spherical_pillar")); - - py::class_>( - m, "RectangularPillar") - .def(py::init(), - py::arg("height"), py::arg("material_conductivity"), py::arg("cell_area"), py::arg("length"), - py::arg("width")) - .def_readwrite("length", &Tarcog::ISO15099::RectangularPillar::length) - .def_readwrite("width", &Tarcog::ISO15099::RectangularPillar::width); - - py::class_>( - m, "RectangularPillarLayer") - .def(py::init(), - py::arg("gap_layer"), py::arg("rectangular_pillar")); - - py::class_>( - m, "PolygonalPillar") - .def(py::init(), - py::arg("height"), py::arg("material_conductivity"), py::arg("cell_area"), py::arg("length"), - py::arg("polygon_type")) - .def_readwrite("length", &Tarcog::ISO15099::PolygonalPillar::length) - .def_readwrite("polygon_type", &Tarcog::ISO15099::PolygonalPillar::type); - - py::class_>( - m, "TriangularPillarLayer") - .def(py::init(), - py::arg("gap_layer"), py::arg("polygon_pillar")); - - py::class_>( - m, "PentagonPillarLayer") - .def(py::init(), - py::arg("gap_layer"), py::arg("polygon_pillar")); - - py::class_>( - m, "HexagonPillarLayer") - .def(py::init(), - py::arg("gap_layer"), py::arg("polygon_pillar")); - - py::class_>( - m, "LinearBearingPillar") - .def(py::init(), - py::arg("height"), py::arg("material_conductivity"), py::arg("cell_area"), py::arg("length"), - py::arg("width")) - .def_readwrite("length", &Tarcog::ISO15099::LinearBearingPillar::length) - .def_readwrite("width", &Tarcog::ISO15099::LinearBearingPillar::width); - - py::class_>( - m, "LinearBearingPillarLayer") - .def(py::init(), - py::arg("gap_layer"), py::arg("linear_bearing_pillar")); - - py::class_>( - m, "TruncatedConePillar") - .def(py::init(), - py::arg("height"), py::arg("material_conductivity"), py::arg("cell_area"), py::arg("radius_1"), - py::arg("radius_2")) - .def_readwrite("radius_1", &Tarcog::ISO15099::TruncatedConePillar::radius1) - .def_readwrite("radius_2", &Tarcog::ISO15099::TruncatedConePillar::radius2); - - py::class_>( - m, "TruncatedConePillarLayer") - .def(py::init(), - py::arg("gap_layer"), py::arg("truncated_cone_pillar")); - - py::class_>( - m, "AnnulusCylinderPillar") - .def(py::init(), - py::arg("height"), py::arg("material_conductivity"), py::arg("cell_area"), py::arg("inner_radius"), - py::arg("outer_radius")) - .def_readwrite("inner_radius", &Tarcog::ISO15099::AnnulusCylinderPillar::innerRadius) - .def_readwrite("outer_radius", &Tarcog::ISO15099::AnnulusCylinderPillar::outerRadius); - - py::class_>( - m, "AnnulusCylinderPillarLayer") - .def(py::init(), - py::arg("gap_layer"), py::arg("annulus_cylinder_pillar")); - - // py::class_>( - // m, "CircularPillar") - // .def(py::init(), - // py::arg("gap_layer"), py::arg("conductivity"), - // py::arg("spacing"), py::arg("radius")); - - py::class_>( - m, "IGUVentilatedGapLayer") - .def(py::init const &>(), - py::arg("gap_layer")) - .def(py::init, double, - double>(), - py::arg("gap_layer"), py::arg("inlet_temperature"), - py::arg("inlet_speed")) - .def("layer_temperature", - &Tarcog::ISO15099::CIGUVentilatedGapLayer::averageLayerTemperature) - .def("set_flow_geometry", - &Tarcog::ISO15099::CIGUVentilatedGapLayer::setFlowGeometry, - py::arg("a_in"), py::arg("a_out")) - .def("set_inlet_temperature", - &Tarcog::ISO15099::CIGUVentilatedGapLayer::setInletTemperature, - py::arg("inlet_temperature")) - .def("set_flow_temperatures", - &Tarcog::ISO15099::CIGUVentilatedGapLayer::setFlowTemperatures, - py::arg("inlet_temperature"), py::arg("outlet_temperature")) - .def("set_flow_speed", - &Tarcog::ISO15099::CIGUVentilatedGapLayer::setFlowSpeed, - py::arg("speed")) - .def("smooth_energy_gain", - &Tarcog::ISO15099::CIGUVentilatedGapLayer::smoothEnergyGain, - py::arg("qv1"), py::arg("qv2")) - .def( - "calculate_ventilated_airflow", - &Tarcog::ISO15099::CIGUVentilatedGapLayer::calculateVentilatedAirflow, - py::arg("inlet_temperature")) - .def("calculate_thermally_driven_airflow_with_adjacent_gap", - &Tarcog::ISO15099::CIGUVentilatedGapLayer:: - calculateThermallyDrivenAirflowWithAdjacentGap, - py::arg("adjacent_gap")) - .def("clone", &Tarcog::ISO15099::CIGUVentilatedGapLayer::clone); - - m.def("forced_ventilation_gap", - Tarcog::ISO15099::Layers::forcedVentilationGap, py::arg("gap"), - py::arg("forced_ventilation_air_speed"), - py::arg("forced_ventilation_air_temperature")); - - py::class_(m, - "OpticalMeasurementComponent") - .def(py::init(), - py::arg("transmittance_front"), py::arg("transmittance_back"), - py::arg("reflectance_front"), py::arg("reflectance_back")) - .def_readwrite("transmittance_front", - &OpticsParser::MeasurementComponent::tf) - .def_readwrite("transmittance_back", - &OpticsParser::MeasurementComponent::tb) - .def_readwrite("reflectance_front", - &OpticsParser::MeasurementComponent::rf) - .def_readwrite("reflectance_back", - &OpticsParser::MeasurementComponent::rb); - - py::class_(m, "PVWavelengthData") - .def(py::init(), py::arg("eqe_front"), - py::arg("eqe_back")) - .def_readwrite("eqq_front", &OpticsParser::PVWavelengthData::eqef) - .def_readwrite("eqe_back", &OpticsParser::PVWavelengthData::eqeb); - - py::class_(m, "WavelengthData") - .def(py::init>(), - py::arg("wavelength_microns"), py::arg("direct_component"), - py::arg("diffuse_component") = - std::optional()) - .def(py::init(), - py::arg("wavelength_microns"), py::arg("direct_transmittance"), - py::arg("direct_reflectance_front"), - py::arg("direct_reflectance_back")) - .def(py::init(), - py::arg("wavelength_microns"), py::arg("direct_transmittance_front"), - py::arg("diffuse_transmittance_front"), - py::arg("direct_transmittance_back"), - py::arg("diffuse_transmittance_back"), - py::arg("direct_reflectance_front"), - py::arg("diffuse_reflectance_front"), - py::arg("direct_reflectance_back"), - py::arg("diffuse_reflectance_back")) - .def_readwrite("wavelength", &OpticsParser::WLData::wavelength) - .def_readwrite("direct_component", &OpticsParser::WLData::directComponent) - .def_readwrite("diffuse_component", - &OpticsParser::WLData::diffuseComponent) - .def_readwrite("pv_component", &OpticsParser::WLData::pvComponent); - - py::class_>(m, - "ProductGeometry"); - - py::class_>( - m, "ParsedVenetianGeometry") - .def(py::init(), - py::arg("slat_width"), py::arg("slat_spacing"), - py::arg("slat_curvature"), py::arg("slat_tilt") = 0, - py::arg("tilt_choice") = "0", py::arg("number_segments") = 5) - .def_readwrite("slat_width", &OpticsParser::VenetianGeometry::slatWidth) - .def_readwrite("slat_spacing", - &OpticsParser::VenetianGeometry::slatSpacing) - .def_readwrite("slat_curvature", - &OpticsParser::VenetianGeometry::slatCurvature) - .def_readwrite("slat_tilt", &OpticsParser::VenetianGeometry::slatTilt) - .def_readwrite("number_segments", - &OpticsParser::VenetianGeometry::numberSegments); - - py::class_>( - m, "ParsedWovenGeometry") - .def(py::init()) - .def_readwrite("thread_diameter", - &OpticsParser::WovenGeometry::threadDiameter) - .def_readwrite("thread_spacing", - &OpticsParser::WovenGeometry::threadSpacing) - .def_readwrite("shade_thickness", - &OpticsParser::WovenGeometry::shadeThickness); - - py::class_>( - m, "ParsedPerforatedGeometry") - .def(py::init(), - py::arg("spacing_x_meters"), py::arg("spacing_y_meters"), - py::arg("dimension_x_meters"), py::arg("dimension_y_meters"), - py::arg("perforation_type")) - .def_readwrite("spacing_x", &OpticsParser::PerforatedGeometry::spacingX) - .def_readwrite("spacing_y", &OpticsParser::PerforatedGeometry::spacingY) - .def_readwrite("dimension_x", - &OpticsParser::PerforatedGeometry::dimensionX) - .def_readwrite("dimension_y", - &OpticsParser::PerforatedGeometry::dimensionY) - .def_readwrite("perforation_type", - &OpticsParser::PerforatedGeometry::perforationType); - - py::class_(m, "BSDF") - .def_readwrite("data", &OpticsParser::BSDF::data) - .def_readwrite("row_angle_basis_name", - &OpticsParser::BSDF::rowAngleBasisName) - .def_readwrite("column_angle_basis_name", - &OpticsParser::BSDF::columnAngleBasisName); - - py::class_(m, "WavelengthBSDFs") - .def_readwrite("transmittance_front", &OpticsParser::WavelengthBSDFs::tf) - .def_readwrite("transmittance_back", &OpticsParser::WavelengthBSDFs::tb) - .def_readwrite("reflectance_front", &OpticsParser::WavelengthBSDFs::rf) - .def_readwrite("reflectance_back", &OpticsParser::WavelengthBSDFs::rb); - - py::class_(m, "DualBandBSDF") - .def_readwrite("solar", &OpticsParser::DualBandBSDF::solar) - .def_readwrite("visible", &OpticsParser::DualBandBSDF::visible); - - py::class_(m, "PVPowerProperty") - .def(py::init(), py::arg("jsc"), py::arg("voc"), - py::arg("ff")) - .def_readwrite("jsc", &OpticsParser::PVPowerProperty::jsc) - .def_readwrite("voc", &OpticsParser::PVPowerProperty::voc) - .def_readwrite("ff", &OpticsParser::PVPowerProperty::ff); - - py::class_>(m, "ProductData") - .def_readwrite("product_name", &OpticsParser::ProductData::productName) - .def_readwrite("product_type", &OpticsParser::ProductData::productType) - .def_readwrite("product_subtype", - &OpticsParser::ProductData::productSubtype) - .def_readwrite("nfrc_id", &OpticsParser::ProductData::nfrcid) - .def_readwrite("thickness", &OpticsParser::ProductData::thickness) - .def_readwrite("conductivity", &OpticsParser::ProductData::conductivity) - .def_readwrite("coating_name", &OpticsParser::ProductData::coatingName) - .def_readwrite("coated_side", &OpticsParser::ProductData::coatedSide) - .def_readwrite("ir_transmittance", - &OpticsParser::ProductData::IRTransmittance) - .def_readwrite("emissivity_front", - &OpticsParser::ProductData::frontEmissivity) - .def_readwrite("emissivity_back", - &OpticsParser::ProductData::backEmissivity) - .def_readwrite("measurements", &OpticsParser::ProductData::measurements) - .def_readwrite("permeability_factor", - &OpticsParser::ProductData::permeabilityFactor) - .def_readwrite("density", &OpticsParser::ProductData::density) - .def_readwrite("youngs_modulus", - &OpticsParser::ProductData::youngsModulus) - .def_readwrite("pv_power_properties", - &OpticsParser::ProductData::pvPowerProperties) - .def_readwrite("composition", &OpticsParser::ProductData::composition); - - py::class_>( - m, "ProductComposistionData") - .def(py::init, - std::shared_ptr>(), - py::arg("solid_layers"), py::arg("product_geometry")) - .def_readwrite("material", - &OpticsParser::CompositionInformation::material) - .def_readwrite("geometry", - &OpticsParser::CompositionInformation::geometry); - - py::enum_(m, "SpectrumType", + m.doc() = "Python bindings for WinCalc"; + + py::enum_(m, "PredefinedGasType", py::arithmetic()) + .value("AIR", Gases::GasDef::Air) + .value("ARGON", Gases::GasDef::Argon) + .value("KRYPTON", Gases::GasDef::Krypton) + .value("XENON", Gases::GasDef::Xenon); + + py::class_(m, "GasCoefficients") + .def(py::init(), py::arg("A"), + py::arg("B"), py::arg("C")); + + py::class_(m, "GasData") + .def(py::init(), + py::arg("name"), py::arg("molecular_weight"), + py::arg("specific_heat_ratio"), py::arg("Cp"), + py::arg("thermal_conductivity"), py::arg("viscosity")) + .def("get_molecular_weight", &Gases::CGasData::getMolecularWeight) + .def("get_property_value", &Gases::CGasData::getPropertyValue, + py::arg("type"), py::arg("temperature")) + .def("get_specific_heat_ratio", &Gases::CGasData::getSpecificHeatRatio) + .def("name", &Gases::CGasData::name); + + py::class_(m, "Gas") + .def(py::init const &>(), py::arg("gases")) + .def("get_simple_gas_properties", &Gases::CGas::getSimpleGasProperties) + .def("get_gas_properties", &Gases::CGas::getGasProperties) + .def("set_temperature_and_pressure", + &Gases::CGas::setTemperatureAndPressure) + .def("gas_items", &Gases::CGas::gasItems) + .def("total_percent", &Gases::CGas::totalPercent) + .def("add_gas_items", &Gases::CGas::addGasItems) + .def("add_gas_item", + py::overload_cast( + &Gases::CGas::addGasItem), + py::arg("percent"), py::arg("gas_data")) + .def("add_gas_item", + py::overload_cast(&Gases::CGas::addGasItem), + py::arg("percent"), py::arg("predefined_gas")); + + py::class_>(m, "IGUGapLayer") + .def(py::init(), py::arg("thickness"), + py::arg("pressure")) + .def(py::init(), + py::arg("thickness"), py::arg("pressure"), py::arg("gas")); + + py::enum_(m, "CellSpacingType", py::arithmetic()) - .value("NONE", window_standards::Spectrum_Type::NONE) - .value("FILE", window_standards::Spectrum_Type::FILE) - .value("BLACKBODY", window_standards::Spectrum_Type::BLACKBODY) - .value("UV_ACTION", window_standards::Spectrum_Type::UV_ACTION) - .value("KROCHMANN", window_standards::Spectrum_Type::KROCHMANN); - - py::class_(m, "Spectrum") - .def_readwrite("type", &window_standards::Spectrum::type) - .def_readwrite("description", &window_standards::Spectrum::description) - .def_readwrite("t", &window_standards::Spectrum::t) - .def_readwrite("a", &window_standards::Spectrum::a) - .def_readwrite("b", &window_standards::Spectrum::b) - .def_readwrite("values", &window_standards::Spectrum::values); - - py::enum_(m, "WavelengthSetType", + .value("SQUARE", Tarcog::ISO15099::CellSpacingType::Square) + .value("SHIFTEDSQUARE", Tarcog::ISO15099::CellSpacingType::ShiftedSquare) + .value("SHIFTEDROTATEDSQUARE", + Tarcog::ISO15099::CellSpacingType::ShiftedRotatedSquare); + + m.def("pillar_cell_area", Tarcog::ISO15099::pillarCellArea, + py::arg("cell_spacing_type"), py::arg("sp")); + + py::enum_(m, "PolygonType", py::arithmetic()) + .value("TRIANGLE", Tarcog::ISO15099::PolygonType::Triangle) + .value("PENTAGON", Tarcog::ISO15099::PolygonType::Pentagon) + .value("HEXAGON", Tarcog::ISO15099::PolygonType::Hexagon); + + py::class_>( + m, "UniversalSupportPillar") + .def(py::init(), + py::arg("gap_layer"), py::arg("material_conductivity"), + py::arg("cell_area")); + + py::class_>(m, "PillarData") + .def(py::init(), py::arg("height"), + py::arg("material_conductivity"), py::arg("cell_area")) + .def_readwrite("height", &Tarcog::ISO15099::PillarData::height) + .def_readwrite("material_conductivity", + &Tarcog::ISO15099::PillarData::materialConductivity) + .def_readwrite("cell_area", &Tarcog::ISO15099::PillarData::cellArea); + + py::class_>( + m, "CylindricalPillar") + .def(py::init(), py::arg("height"), + py::arg("material_conductivity"), py::arg("cell_area"), + py::arg("radius")) + .def_readwrite("radius", &Tarcog::ISO15099::CylindricalPillar::radius); + + py::class_>( + m, "CylindricalPillarLayer") + .def(py::init(), + py::arg("gap_layer"), py::arg("cylindrical_pillar")); + + py::class_>( + m, "SphericalPillar") + .def(py::init(), py::arg("height"), + py::arg("material_conductivity"), py::arg("cell_area"), + py::arg("radius_of_contact")) + .def_readwrite("radius_of_contact", + &Tarcog::ISO15099::SphericalPillar::radiusOfContact); + + py::class_>( + m, "SphericalPillarLayer") + .def(py::init(), + py::arg("gap_layer"), py::arg("spherical_pillar")); + + py::class_>( + m, "RectangularPillar") + .def(py::init(), + py::arg("height"), py::arg("material_conductivity"), + py::arg("cell_area"), py::arg("length"), py::arg("width")) + .def_readwrite("length", &Tarcog::ISO15099::RectangularPillar::length) + .def_readwrite("width", &Tarcog::ISO15099::RectangularPillar::width); + + py::class_>( + m, "RectangularPillarLayer") + .def(py::init(), + py::arg("gap_layer"), py::arg("rectangular_pillar")); + + py::class_>( + m, "PolygonalPillar") + .def(py::init(), + py::arg("height"), py::arg("material_conductivity"), + py::arg("cell_area"), py::arg("length"), py::arg("polygon_type")) + .def_readwrite("length", &Tarcog::ISO15099::PolygonalPillar::length) + .def_readwrite("polygon_type", &Tarcog::ISO15099::PolygonalPillar::type); + + py::class_>( + m, "TriangularPillarLayer") + .def(py::init(), + py::arg("gap_layer"), py::arg("polygon_pillar")); + + py::class_>( + m, "PentagonPillarLayer") + .def(py::init(), + py::arg("gap_layer"), py::arg("polygon_pillar")); + + py::class_>( + m, "HexagonPillarLayer") + .def(py::init(), + py::arg("gap_layer"), py::arg("polygon_pillar")); + + py::class_>( + m, "LinearBearingPillar") + .def(py::init(), + py::arg("height"), py::arg("material_conductivity"), + py::arg("cell_area"), py::arg("length"), py::arg("width")) + .def_readwrite("length", &Tarcog::ISO15099::LinearBearingPillar::length) + .def_readwrite("width", &Tarcog::ISO15099::LinearBearingPillar::width); + + py::class_>( + m, "LinearBearingPillarLayer") + .def(py::init(), + py::arg("gap_layer"), py::arg("linear_bearing_pillar")); + + py::class_>( + m, "TruncatedConePillar") + .def(py::init(), + py::arg("height"), py::arg("material_conductivity"), + py::arg("cell_area"), py::arg("radius_1"), py::arg("radius_2")) + .def_readwrite("radius_1", + &Tarcog::ISO15099::TruncatedConePillar::radius1) + .def_readwrite("radius_2", + &Tarcog::ISO15099::TruncatedConePillar::radius2); + + py::class_>( + m, "TruncatedConePillarLayer") + .def(py::init(), + py::arg("gap_layer"), py::arg("truncated_cone_pillar")); + + py::class_>( + m, "AnnulusCylinderPillar") + .def(py::init(), + py::arg("height"), py::arg("material_conductivity"), + py::arg("cell_area"), py::arg("inner_radius"), + py::arg("outer_radius")) + .def_readwrite("inner_radius", + &Tarcog::ISO15099::AnnulusCylinderPillar::innerRadius) + .def_readwrite("outer_radius", + &Tarcog::ISO15099::AnnulusCylinderPillar::outerRadius); + + py::class_>( + m, "AnnulusCylinderPillarLayer") + .def(py::init(), + py::arg("gap_layer"), py::arg("annulus_cylinder_pillar")); + + py::class_>( + m, "Glass") + .def(py::init(), py::arg("thickness"), + py::arg("conductivity"), py::arg("emissivity")) + .def_readwrite("thickness", &Tarcog::ISO15099::Glass::thickness) + .def_readwrite("conductivity", &Tarcog::ISO15099::Glass::conductivity) + .def_readwrite("emissivity", &Tarcog::ISO15099::Glass::emissivity); + + py::class_>( + m, "PillarMeasurement") + .def(py::init(), + py::arg("total_thickness"), py::arg("conductivity"), + py::arg("temperature_surface_1"), py::arg("temperature_surface_4"), + py::arg("glass_1"), py::arg("glass_2")) + .def_readwrite("total_thickness", + &Tarcog::ISO15099::PillarMeasurement::totalThickness) + .def_readwrite("conductivity", + &Tarcog::ISO15099::PillarMeasurement::conductivity) + .def_readwrite("temperature_surface_1", + &Tarcog::ISO15099::PillarMeasurement::temperatureSurface1) + .def_readwrite("temperature_surface_4", + &Tarcog::ISO15099::PillarMeasurement::temperatureSurface4) + .def_readwrite("glass_1", &Tarcog::ISO15099::PillarMeasurement::glass1) + .def_readwrite("glass_2", &Tarcog::ISO15099::PillarMeasurement::glass2); + + py::class_>( + m, "MeasuredPillarLayer") + .def(py::init(), + py::arg("pillar")); + + // py::class_>( + // m, "CircularPillar") + // .def(py::init(), + // py::arg("gap_layer"), py::arg("conductivity"), + // py::arg("spacing"), py::arg("radius")); + + py::class_>( + m, "IGUVentilatedGapLayer") + .def(py::init const &>(), + py::arg("gap_layer")) + .def(py::init, double, + double>(), + py::arg("gap_layer"), py::arg("inlet_temperature"), + py::arg("inlet_speed")) + .def("layer_temperature", + &Tarcog::ISO15099::CIGUVentilatedGapLayer::averageLayerTemperature) + .def("set_flow_geometry", + &Tarcog::ISO15099::CIGUVentilatedGapLayer::setFlowGeometry, + py::arg("a_in"), py::arg("a_out")) + .def("set_inlet_temperature", + &Tarcog::ISO15099::CIGUVentilatedGapLayer::setInletTemperature, + py::arg("inlet_temperature")) + .def("set_flow_temperatures", + &Tarcog::ISO15099::CIGUVentilatedGapLayer::setFlowTemperatures, + py::arg("inlet_temperature"), py::arg("outlet_temperature")) + .def("set_flow_speed", + &Tarcog::ISO15099::CIGUVentilatedGapLayer::setFlowSpeed, + py::arg("speed")) + .def("smooth_energy_gain", + &Tarcog::ISO15099::CIGUVentilatedGapLayer::smoothEnergyGain, + py::arg("qv1"), py::arg("qv2")) + .def( + "calculate_ventilated_airflow", + &Tarcog::ISO15099::CIGUVentilatedGapLayer::calculateVentilatedAirflow, + py::arg("inlet_temperature")) + .def("calculate_thermally_driven_airflow_with_adjacent_gap", + &Tarcog::ISO15099::CIGUVentilatedGapLayer:: + calculateThermallyDrivenAirflowWithAdjacentGap, + py::arg("adjacent_gap")) + .def("clone", &Tarcog::ISO15099::CIGUVentilatedGapLayer::clone); + + m.def("forced_ventilation_gap", + Tarcog::ISO15099::Layers::forcedVentilationGap, py::arg("gap"), + py::arg("forced_ventilation_air_speed"), + py::arg("forced_ventilation_air_temperature")); + + py::class_(m, + "OpticalMeasurementComponent") + .def(py::init(), + py::arg("transmittance_front"), py::arg("transmittance_back"), + py::arg("reflectance_front"), py::arg("reflectance_back")) + .def_readwrite("transmittance_front", + &OpticsParser::MeasurementComponent::tf) + .def_readwrite("transmittance_back", + &OpticsParser::MeasurementComponent::tb) + .def_readwrite("reflectance_front", + &OpticsParser::MeasurementComponent::rf) + .def_readwrite("reflectance_back", + &OpticsParser::MeasurementComponent::rb); + + py::class_(m, "PVWavelengthData") + .def(py::init(), py::arg("eqe_front"), + py::arg("eqe_back")) + .def_readwrite("eqq_front", &OpticsParser::PVWavelengthData::eqef) + .def_readwrite("eqe_back", &OpticsParser::PVWavelengthData::eqeb); + + py::class_(m, "WavelengthData") + .def(py::init>(), + py::arg("wavelength_microns"), py::arg("direct_component"), + py::arg("diffuse_component") = + std::optional()) + .def(py::init(), + py::arg("wavelength_microns"), py::arg("direct_transmittance"), + py::arg("direct_reflectance_front"), + py::arg("direct_reflectance_back")) + .def(py::init(), + py::arg("wavelength_microns"), py::arg("direct_transmittance_front"), + py::arg("diffuse_transmittance_front"), + py::arg("direct_transmittance_back"), + py::arg("diffuse_transmittance_back"), + py::arg("direct_reflectance_front"), + py::arg("diffuse_reflectance_front"), + py::arg("direct_reflectance_back"), + py::arg("diffuse_reflectance_back")) + .def_readwrite("wavelength", &OpticsParser::WLData::wavelength) + .def_readwrite("direct_component", &OpticsParser::WLData::directComponent) + .def_readwrite("diffuse_component", + &OpticsParser::WLData::diffuseComponent) + .def_readwrite("pv_component", &OpticsParser::WLData::pvComponent); + + py::class_>(m, + "ProductGeometry"); + + py::class_>( + m, "ParsedVenetianGeometry") + .def(py::init(), + py::arg("slat_width"), py::arg("slat_spacing"), + py::arg("slat_curvature"), py::arg("slat_tilt") = 0, + py::arg("tilt_choice") = "0", py::arg("number_segments") = 5) + .def_readwrite("slat_width", &OpticsParser::VenetianGeometry::slatWidth) + .def_readwrite("slat_spacing", + &OpticsParser::VenetianGeometry::slatSpacing) + .def_readwrite("slat_curvature", + &OpticsParser::VenetianGeometry::slatCurvature) + .def_readwrite("slat_tilt", &OpticsParser::VenetianGeometry::slatTilt) + .def_readwrite("number_segments", + &OpticsParser::VenetianGeometry::numberSegments); + + py::class_>( + m, "ParsedWovenGeometry") + .def(py::init()) + .def_readwrite("thread_diameter", + &OpticsParser::WovenGeometry::threadDiameter) + .def_readwrite("thread_spacing", + &OpticsParser::WovenGeometry::threadSpacing) + .def_readwrite("shade_thickness", + &OpticsParser::WovenGeometry::shadeThickness); + + py::class_>( + m, "ParsedPerforatedGeometry") + .def(py::init(), + py::arg("spacing_x_meters"), py::arg("spacing_y_meters"), + py::arg("dimension_x_meters"), py::arg("dimension_y_meters"), + py::arg("perforation_type")) + .def_readwrite("spacing_x", &OpticsParser::PerforatedGeometry::spacingX) + .def_readwrite("spacing_y", &OpticsParser::PerforatedGeometry::spacingY) + .def_readwrite("dimension_x", + &OpticsParser::PerforatedGeometry::dimensionX) + .def_readwrite("dimension_y", + &OpticsParser::PerforatedGeometry::dimensionY) + .def_readwrite("perforation_type", + &OpticsParser::PerforatedGeometry::perforationType); + + py::class_(m, "BSDF") + .def_readwrite("data", &OpticsParser::BSDF::data) + .def_readwrite("row_angle_basis_name", + &OpticsParser::BSDF::rowAngleBasisName) + .def_readwrite("column_angle_basis_name", + &OpticsParser::BSDF::columnAngleBasisName); + + py::class_(m, "WavelengthBSDFs") + .def_readwrite("transmittance_front", &OpticsParser::WavelengthBSDFs::tf) + .def_readwrite("transmittance_back", &OpticsParser::WavelengthBSDFs::tb) + .def_readwrite("reflectance_front", &OpticsParser::WavelengthBSDFs::rf) + .def_readwrite("reflectance_back", &OpticsParser::WavelengthBSDFs::rb); + + py::class_(m, "DualBandBSDF") + .def_readwrite("solar", &OpticsParser::DualBandBSDF::solar) + .def_readwrite("visible", &OpticsParser::DualBandBSDF::visible); + + py::class_(m, "PVPowerProperty") + .def(py::init(), py::arg("jsc"), py::arg("voc"), + py::arg("ff")) + .def_readwrite("jsc", &OpticsParser::PVPowerProperty::jsc) + .def_readwrite("voc", &OpticsParser::PVPowerProperty::voc) + .def_readwrite("ff", &OpticsParser::PVPowerProperty::ff); + + py::class_>(m, "ProductData") + .def_readwrite("product_name", &OpticsParser::ProductData::productName) + .def_readwrite("product_type", &OpticsParser::ProductData::productType) + .def_readwrite("product_subtype", + &OpticsParser::ProductData::productSubtype) + .def_readwrite("nfrc_id", &OpticsParser::ProductData::nfrcid) + .def_readwrite("thickness", &OpticsParser::ProductData::thickness) + .def_readwrite("conductivity", &OpticsParser::ProductData::conductivity) + .def_readwrite("coating_name", &OpticsParser::ProductData::coatingName) + .def_readwrite("coated_side", &OpticsParser::ProductData::coatedSide) + .def_readwrite("ir_transmittance", + &OpticsParser::ProductData::IRTransmittance) + .def_readwrite("emissivity_front", + &OpticsParser::ProductData::frontEmissivity) + .def_readwrite("emissivity_back", + &OpticsParser::ProductData::backEmissivity) + .def_readwrite("measurements", &OpticsParser::ProductData::measurements) + .def_readwrite("permeability_factor", + &OpticsParser::ProductData::permeabilityFactor) + .def_readwrite("density", &OpticsParser::ProductData::density) + .def_readwrite("youngs_modulus", + &OpticsParser::ProductData::youngsModulus) + .def_readwrite("pv_power_properties", + &OpticsParser::ProductData::pvPowerProperties) + .def_readwrite("composition", &OpticsParser::ProductData::composition); + + py::class_>( + m, "ProductComposistionData") + .def(py::init, + std::shared_ptr>(), + py::arg("solid_layers"), py::arg("product_geometry")) + .def_readwrite("material", + &OpticsParser::CompositionInformation::material) + .def_readwrite("geometry", + &OpticsParser::CompositionInformation::geometry); + + py::enum_(m, "SpectrumType", + py::arithmetic()) + .value("NONE", window_standards::Spectrum_Type::NONE) + .value("FILE", window_standards::Spectrum_Type::FILE) + .value("BLACKBODY", window_standards::Spectrum_Type::BLACKBODY) + .value("UV_ACTION", window_standards::Spectrum_Type::UV_ACTION) + .value("KROCHMANN", window_standards::Spectrum_Type::KROCHMANN); + + py::class_(m, "Spectrum") + .def_readwrite("type", &window_standards::Spectrum::type) + .def_readwrite("description", &window_standards::Spectrum::description) + .def_readwrite("t", &window_standards::Spectrum::t) + .def_readwrite("a", &window_standards::Spectrum::a) + .def_readwrite("b", &window_standards::Spectrum::b) + .def_readwrite("values", &window_standards::Spectrum::values); + + py::enum_(m, "WavelengthSetType", + py::arithmetic()) + .value("FILE", window_standards::Wavelength_Set_Type::FILE) + .value("SOURCE", window_standards::Wavelength_Set_Type::SOURCE) + .value("DATA", window_standards::Wavelength_Set_Type::DATA); + + py::class_(m, "WavelengthSet") + .def_readwrite("type", &window_standards::Wavelength_Set::type) + .def_readwrite("description", + &window_standards::Wavelength_Set::description) + .def_readwrite("values", &window_standards::Wavelength_Set::values); + + py::enum_( + m, "WavelengthBoundaryType", py::arithmetic()) + .value("NUMBER", window_standards::Wavelength_Boundary_Type::NUMBER) + .value("WAVELENGTH_SET", + window_standards::Wavelength_Boundary_Type::WAVELENGTH_SET); + + py::class_(m, "WavelengthBoundary") + .def_readwrite("type", &window_standards::Wavelength_Boundary::type) + .def_readwrite("value", &window_standards::Wavelength_Boundary::value); + + py::enum_(m, "IntegrationRuleType", py::arithmetic()) - .value("FILE", window_standards::Wavelength_Set_Type::FILE) - .value("SOURCE", window_standards::Wavelength_Set_Type::SOURCE) - .value("DATA", window_standards::Wavelength_Set_Type::DATA); - - py::class_(m, "WavelengthSet") - .def_readwrite("type", &window_standards::Wavelength_Set::type) - .def_readwrite("description", - &window_standards::Wavelength_Set::description) - .def_readwrite("values", &window_standards::Wavelength_Set::values); - - py::enum_( - m, "WavelengthBoundaryType", py::arithmetic()) - .value("NUMBER", window_standards::Wavelength_Boundary_Type::NUMBER) - .value("WAVELENGTH_SET", - window_standards::Wavelength_Boundary_Type::WAVELENGTH_SET); - - py::class_(m, "WavelengthBoundary") - .def_readwrite("type", &window_standards::Wavelength_Boundary::type) - .def_readwrite("value", &window_standards::Wavelength_Boundary::value); - - py::enum_(m, "IntegrationRuleType", - py::arithmetic()) - .value("TRAPEZOIDAL", - window_standards::Integration_Rule_Type::TRAPEZOIDAL) - .value("RECTANGULAR", - window_standards::Integration_Rule_Type::RECTANGULAR) - .value("TABLE", window_standards::Integration_Rule_Type::TABLE); - - py::class_(m, "IntegrationRule") - .def_readwrite("type", &window_standards::Integration_Rule::type) - .def_readwrite("k", &window_standards::Integration_Rule::k); - - py::class_(m, - "OpticalStandardMethod") - .def_readwrite("name", &window_standards::Optical_Standard_Method::name) - .def_readwrite("description", - &window_standards::Optical_Standard_Method::description) - .def_readwrite( - "source_spectrum", - &window_standards::Optical_Standard_Method::source_spectrum) - .def_readwrite( - "detector_spectrum", - &window_standards::Optical_Standard_Method::detector_spectrum) - .def_readwrite("wavelength_set", - &window_standards::Optical_Standard_Method::wavelength_set) - .def_readwrite( - "integration_rule", - &window_standards::Optical_Standard_Method::integration_rule) - .def_readwrite("min_wavelength", - &window_standards::Optical_Standard_Method::min_wavelength) - .def_readwrite( - "max_wavelength", - &window_standards::Optical_Standard_Method::max_wavelength); - - py::class_(m, "OpticalStandard") - .def_readwrite("name", &window_standards::Optical_Standard::name) - .def_readwrite("description", - &window_standards::Optical_Standard::description) - .def_readwrite("file", &window_standards::Optical_Standard::file) - .def_readwrite("methods", &window_standards::Optical_Standard::methods); - - py::class_(m, "Trichromatic") - .def_readwrite("X", &wincalc::Trichromatic::X) - .def_readwrite("Y", &wincalc::Trichromatic::Y) - .def_readwrite("Z", &wincalc::Trichromatic::Z); - - py::class_(m, "RGB") - .def_readwrite("R", &wincalc::WinCalc_RGB::R) - .def_readwrite("G", &wincalc::WinCalc_RGB::G) - .def_readwrite("B", &wincalc::WinCalc_RGB::B); - - py::class_(m, "Lab") - .def_readwrite("L", &wincalc::Lab::L) - .def_readwrite("a", &wincalc::Lab::a) - .def_readwrite("b", &wincalc::Lab::b); - - py::class_(m, "ColorResult") - .def_readwrite("trichromatic", &wincalc::Color_Result::trichromatic) - .def_readwrite("rgb", &wincalc::Color_Result::rgb) - .def_readwrite("lab", &wincalc::Color_Result::lab); - - declare_wce_optical_results_template(m, ""); - declare_wce_optical_results_template(m, "Color"); - - py::enum_( - m, "BoundaryConditionsCoefficientModelType", py::arithmetic()) - .value("CALCULATED_H", - Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH) - .value("H_PRESCRIBED", - Tarcog::ISO15099::BoundaryConditionsCoeffModel::HPrescribed) - .value("HC_PRESCRIBED", - Tarcog::ISO15099::BoundaryConditionsCoeffModel::HcPrescribed); - - py::enum_( - m, "AirHorizontalDirection", py::arithmetic()) - .value("NONE", Tarcog::ISO15099::AirHorizontalDirection::None) - .value("LEEWARD", Tarcog::ISO15099::AirHorizontalDirection::Leeward) - .value("WINDWARD", Tarcog::ISO15099::AirHorizontalDirection::Windward); - - py::class_(m, "Environment") - .def(py::init(), - py::arg("air_temperature"), py::arg("pressure"), - py::arg("convection_coefficient"), py::arg("coefficient_model"), - py::arg("radiation_temperature"), py::arg("emissivity"), - py::arg("air_speed") = 0, - py::arg("air_direction") = - Tarcog::ISO15099::AirHorizontalDirection::None, - py::arg("direct_solar_radiation") = 0) - .def_readwrite("air_temperature", &wincalc::Environment::air_temperature) - .def_readwrite("pressure", &wincalc::Environment::pressure) - .def_readwrite("convection_coefficient", - &wincalc::Environment::convection_coefficient) - .def_readwrite("coefficient_model", - &wincalc::Environment::coefficient_model) - .def_readwrite("radiation_temperature", - &wincalc::Environment::radiation_temperature) - .def_readwrite("emissivity", &wincalc::Environment::emissivity) - .def_readwrite("air_speed", &wincalc::Environment::air_speed) - .def_readwrite("air_direction", &wincalc::Environment::air_direction) - .def_readwrite("direct_solar_radiation", - &wincalc::Environment::direct_solar_radiation); - - py::class_(m, "Environments") - .def(py::init(), - py::arg("outside"), py::arg("inside")) - .def_readwrite("outside", &wincalc::Environments::outside) - .def_readwrite("inside", &wincalc::Environments::inside); - - m.def("nfrc_u_environments", &wincalc::nfrc_u_environments, - "Returns the default environments for running a NFRC U-Value " - "calculation."); - m.def( - "nfrc_shgc_environments", &wincalc::nfrc_shgc_environments, - "Returns the default environments for running a NFRC SHGC calculation."); - - py::class_>( - m, "FlippableSolidLayer") - .def(py::init(), py::arg("thickness_meters"), - py::arg("flipped") = false) - .def_readwrite("thickness_meters", - &wincalc::Flippable_Solid_Layer::thickness_meters) - .def_readwrite("flipped", &wincalc::Flippable_Solid_Layer::flipped); - - py::class_>( - m, "ProductDataThermal") - .def(py::init(), - py::arg("conductivity"), py::arg("thickness_meters"), - py::arg("flipped") = false, py::arg("opening_top") = 0, - py::arg("opening_bottom") = 0, py::arg("opening_left") = 0, - py::arg("opening_right") = 0, py::arg("opening_front") = 0) - .def_readwrite("conductivity", - &wincalc::Product_Data_Thermal::conductivity) - .def_readwrite("opening_top", &wincalc::Product_Data_Thermal::opening_top) - .def_readwrite("opening_bottom", - &wincalc::Product_Data_Thermal::opening_bottom) - .def_readwrite("opening_left", - &wincalc::Product_Data_Thermal::opening_left) - .def_readwrite("opening_right", - &wincalc::Product_Data_Thermal::opening_right) - .def_readwrite("opening_front", - &wincalc::Product_Data_Thermal::opening_front) - .def_readwrite("youngs_modulus", - &wincalc::Product_Data_Thermal::youngs_modulus) - .def_readwrite("density", &wincalc::Product_Data_Thermal::density); - - py::class_>( - m, "ProductDataOptical") - .def(py::init, std::optional, - std::optional, std::optional, double, - bool>(), - py::arg("thickness_meters"), - py::arg("ir_transmittance_front") = std::optional(), - py::arg("ir_transmittance_back") = std::optional(), - py::arg("emissivity_front") = std::optional(), - py::arg("emissivity_back") = std::optional(), - py::arg("permeability_factor") = 0.0, py::arg("flipped") = false) - .def("effective_thermal_values", - &wincalc::Product_Data_Optical::effective_thermal_values) - .def("wavelengths", &wincalc::Product_Data_Optical::wavelengths) - .def_readwrite("ir_transmittance_front", - &wincalc::Product_Data_Optical::ir_transmittance_front) - .def_readwrite("ir_transmittance_back", - &wincalc::Product_Data_Optical::ir_transmittance_back) - .def_readwrite("emissivity_front", - &wincalc::Product_Data_Optical::emissivity_front) - .def_readwrite("emissivity_back", - &wincalc::Product_Data_Optical::emissivity_back) - .def_readwrite("permeability_factor", - &wincalc::Product_Data_Optical::permeability_factor); - - py::enum_(m, "MaterialType", - py::arithmetic()) - .value("APPLIED_FILM", FenestrationCommon::MaterialType::AppliedFilm) - .value("COATED", FenestrationCommon::MaterialType::Coated) - .value("ELECTROCHROMIC", FenestrationCommon::MaterialType::Electrochromic) - .value("FILM", FenestrationCommon::MaterialType::Film) - .value("INTERLAYER", FenestrationCommon::MaterialType::Interlayer) - .value("LAMINATE", FenestrationCommon::MaterialType::Laminate) - .value("MONOLITHIC", FenestrationCommon::MaterialType::Monolithic) - .value("THERMOCHROMIC", FenestrationCommon::MaterialType::Thermochromic); - - py::enum_(m, "CoatedSide", py::arithmetic()) - .value("FRONT", wincalc::CoatedSide::FRONT) - .value("BACK", wincalc::CoatedSide::BACK) - .value("BOTH", wincalc::CoatedSide::BOTH) - .value("NEITHER", wincalc::CoatedSide::NEITHER); - - py::class_>( - m, "ProductDataOpticalNBand") - .def(py::init, - std::optional, std::optional, - std::optional, std::optional, - std::optional, double, bool>(), - py::arg("material_type"), py::arg("thickness_meters"), - py::arg("wavelength_data"), - py::arg("coated_side") = std::optional(), - py::arg("ir_transmittance_front") = std::optional(), - py::arg("ir_transmittance_back") = std::optional(), - py::arg("emissivity_front") = std::optional(), - py::arg("emissivity_back") = std::optional(), - py::arg("permeability_factor") = 0, py::arg("flipped") = false) - .def("wavelengths", &wincalc::Product_Data_N_Band_Optical::wavelengths) - .def_readwrite("material_type", - &wincalc::Product_Data_N_Band_Optical::material_type) - .def_readwrite("wavelength_data", - &wincalc::Product_Data_N_Band_Optical::wavelength_data); - - py::class_>( - m, "ProductDataOpticalDualBand") - .def(py::init, std::optional, - std::optional, std::optional, double, - bool>(), - py::arg("thickness_meters"), - py::arg("ir_transmittance_front") = std::optional(), - py::arg("ir_transmittance_back") = std::optional(), - py::arg("emissivity_front") = std::optional(), - py::arg("emissivity_back") = std::optional(), - py::arg("permeability_factor") = 0.0, py::arg("flipped") = false) - .def("wavelengths", - &wincalc::Product_Data_Dual_Band_Optical::wavelengths); - - py::class_< - wincalc::Product_Data_Dual_Band_Optical_Hemispheric, - wincalc::Product_Data_Dual_Band_Optical, - std::shared_ptr>( - m, "ProductDataOpticalDualBandHemispheric") - .def(py::init, - std::optional, std::optional, - std::optional, double, bool>(), - py::arg("solar_transmittance_front"), - py::arg("solar_transmittance_back"), - py::arg("solar_reflectance_front"), - py::arg("solar_reflectance_back"), - py::arg("visible_transmittance_front"), - py::arg("visible_transmittance_back"), - py::arg("visible_reflectance_front"), - py::arg("visible_reflectance_back"), py::arg("thickness_meters"), - py::arg("ir_transmittance_front") = std::optional(), - py::arg("ir_transmittance_back") = std::optional(), - py::arg("emissivity_front") = std::optional(), - py::arg("emissivity_back") = std::optional(), - py::arg("permeability_factor") = 0.0, py::arg("flipped") = false) - .def_readwrite( - "solar_transmittance_front", - &wincalc::Product_Data_Dual_Band_Optical_Hemispheric::tf_solar) - .def_readwrite( - "solar_transmittance_back", - &wincalc::Product_Data_Dual_Band_Optical_Hemispheric::tb_solar) - .def_readwrite( - "solar_reflectance_front", - &wincalc::Product_Data_Dual_Band_Optical_Hemispheric::rf_solar) - .def_readwrite( - "solar_reflectance_back", - &wincalc::Product_Data_Dual_Band_Optical_Hemispheric::rb_solar) - .def_readwrite( - "visible_transmittance_front", - &wincalc::Product_Data_Dual_Band_Optical_Hemispheric::tf_visible) - .def_readwrite( - "visible_transmittance_back", - &wincalc::Product_Data_Dual_Band_Optical_Hemispheric::tb_visible) - .def_readwrite( - "visible_reflectance_front", - &wincalc::Product_Data_Dual_Band_Optical_Hemispheric::rf_visible) - .def_readwrite( - "visible_reflectance_back", - &wincalc::Product_Data_Dual_Band_Optical_Hemispheric::rb_visible); - - py::class_>( - m, "ProductDataOpticalDualBandBSDF") - .def(py::init> const &, - std::vector> const &, - std::vector> const &, - std::vector> const &, - std::vector> const &, - std::vector> const &, - std::vector> const &, - std::vector> const &, - SingleLayerOptics::BSDFHemisphere const &, double, - std::optional, std::optional, - std::optional, std::optional, double, - bool>(), - py::arg("solar_transmittance_front"), - py::arg("solar_transmittance_back"), - py::arg("solar_reflectance_front"), - py::arg("solar_reflectance_back"), - py::arg("visible_transmittance_front"), - py::arg("visible_transmittance_back"), - py::arg("visible_reflectance_front"), - py::arg("visible_reflectance_back"), py::arg("bsdf_hemisphere"), - py::arg("thickness_meters"), - py::arg("ir_transmittance_front") = std::optional(), - py::arg("ir_transmittance_back") = std::optional(), - py::arg("emissivity_front") = std::optional(), - py::arg("emissivity_back") = std::optional(), - py::arg("permeability_factor") = 0.0, py::arg("flipped") = false) - .def_readwrite("solar_transmittance_front", - &wincalc::Product_Data_Dual_Band_Optical_BSDF::tf_solar) - .def_readwrite("solar_transmittance_back", - &wincalc::Product_Data_Dual_Band_Optical_BSDF::tb_solar) - .def_readwrite("solar_reflectance_front", - &wincalc::Product_Data_Dual_Band_Optical_BSDF::rf_solar) - .def_readwrite("solar_reflectance_back", - &wincalc::Product_Data_Dual_Band_Optical_BSDF::rb_solar) - .def_readwrite("visible_transmittance_front", - &wincalc::Product_Data_Dual_Band_Optical_BSDF::tf_visible) - .def_readwrite("visible_transmittance_back", - &wincalc::Product_Data_Dual_Band_Optical_BSDF::tb_visible) - .def_readwrite("visible_reflectance_front", - &wincalc::Product_Data_Dual_Band_Optical_BSDF::rf_visible) - .def_readwrite("visible_reflectance_back", - &wincalc::Product_Data_Dual_Band_Optical_BSDF::rb_visible) - .def("effective_thermal_values", - &wincalc::Product_Data_Dual_Band_Optical_BSDF:: - effective_thermal_values); - - py::class_>( - m, "ProductDataOpticalWithMaterial") - .def(py::init const &>(), - py::arg("product_data_optical")) - .def("optical_data", - &wincalc::Product_Data_Optical_With_Material::optical_data) - .def("wavelengths", - &wincalc::Product_Data_Optical_With_Material::wavelengths) - .def_readwrite( - "material_optical_data", - &wincalc::Product_Data_Optical_With_Material::material_optical_data); - - py::enum_(m, "DistributionMethodType", - py::arithmetic()) - .value("UNIFORM_DIFFUSE", - SingleLayerOptics::DistributionMethod::UniformDiffuse) - .value("DIRECTIONAL_DIFFUSE", - SingleLayerOptics::DistributionMethod::DirectionalDiffuse); - - py::class_>(m, "VenetianGeometry") - .def(py::init(), - py::arg("slat_tilt_degrees"), py::arg("slat_width_meters"), - py::arg("slat_spacing_meters"), py::arg("slat_curvature_meters"), - py::arg("is_horizontal") = true, - py::arg("distribution_method") = - SingleLayerOptics::DistributionMethod::DirectionalDiffuse, - py::arg("number_slat_segments") = 5) - .def_readwrite("slat_tilt", &wincalc::Venetian_Geometry::slat_tilt) - .def_readwrite("slat_width", &wincalc::Venetian_Geometry::slat_width) - .def_readwrite("slat_spacing", &wincalc::Venetian_Geometry::slat_spacing) - .def_readwrite("slat_curvature", - &wincalc::Venetian_Geometry::slat_curvature) - .def_readwrite("number_slat_segments", - &wincalc::Venetian_Geometry::number_slat_segments) - .def_readwrite("distribution_method", - &wincalc::Venetian_Geometry::distribution_method) - .def_readwrite("is_horizontal", - &wincalc::Venetian_Geometry::is_horizontal); - - py::class_>( - m, "ProductDataOpticalVenetian") - .def(py::init const &, - wincalc::Venetian_Geometry const &>(), - py::arg("product_data_optical"), py::arg("geometry")) - .def_readwrite("geometry", - &wincalc::Product_Data_Optical_Venetian::geometry); - - py::class_>( - m, "WovenGeometry") - .def(py::init(), py::arg("thread_diamater"), - py::arg("thread_spacing"), py::arg("shade_thickness")) - .def_readwrite("thread_diameter", - &wincalc::Woven_Geometry::thread_diameter) - .def_readwrite("thread_spacing", &wincalc::Woven_Geometry::thread_spacing) - .def_readwrite("shade_thickness", - &wincalc::Woven_Geometry::shade_thickness); - - py::class_>( - m, "ProductDataOpticalWovenShade") - .def(py::init const &, - wincalc::Woven_Geometry const &>(), - py::arg("material_product_data_optical"), py::arg("geometry")) - .def_readwrite("geometry", - &wincalc::Product_Data_Optical_Woven_Shade::geometry); - - py::class_> - perforated_geometry(m, "PerforatedGeometry"); - - perforated_geometry - .def(py::init(), - py::arg("spacing_x"), py::arg("spacing_y"), py::arg("dimension_x"), - py::arg("dimension_y"), py::arg("perforation_type")) - .def_readwrite("spacing_x", &wincalc::Perforated_Geometry::spacing_x) - .def_readwrite("spacing_y", &wincalc::Perforated_Geometry::spacing_y) - .def_readwrite("dimension_x", &wincalc::Perforated_Geometry::dimension_x) - .def_readwrite("dimension_y", &wincalc::Perforated_Geometry::dimension_y) - .def_readwrite("perforation_type", - &wincalc::Perforated_Geometry::perforation_type); - - py::enum_(perforated_geometry, "Type") - .value("CIRCULAR", wincalc::Perforated_Geometry::Type::CIRCULAR) - .value("RECTANGULAR", wincalc::Perforated_Geometry::Type::RECTANGULAR) - .value("SQUARE", wincalc::Perforated_Geometry::Type::SQUARE); - - py::class_>( - m, "ProductDataOpticalPerforatedScreen") - .def(py::init const &, - wincalc::Perforated_Geometry const &>(), - py::arg("material_product_data_optical"), py::arg("geometry")) - .def_readwrite( - "geometry", - &wincalc::Product_Data_Optical_Perforated_Screen::geometry); - - py::class_( - m, "ProductDataOpticalAndThermal") - .def(py::init, - std::shared_ptr>(), - py::arg("product_data_optical"), py::arg("product_data_thermal")) - .def_readwrite("optical_data", - &wincalc::Product_Data_Optical_Thermal::optical_data) - .def_readwrite("thermal_data", - &wincalc::Product_Data_Optical_Thermal::thermal_data); - - py::enum_(m, "BSDFBasisType", py::arithmetic()) - .value("SMALL", SingleLayerOptics::BSDFBasis::Small) - .value("QUARTER", SingleLayerOptics::BSDFBasis::Quarter) - .value("HALF", SingleLayerOptics::BSDFBasis::Half) - .value("FULL", SingleLayerOptics::BSDFBasis::Full); - - py::class_(m, "BSDFHemisphere") - .def_static("create", - py::overload_cast( - &SingleLayerOptics::BSDFHemisphere::create), - py::arg("bsdf_basis")) - .def("get_directions", &SingleLayerOptics::BSDFHemisphere::getDirections); - - py::enum_(m, "TarcogSystemType", py::arithmetic()) - .value("U", Tarcog::ISO15099::System::Uvalue) - .value("SHGC", Tarcog::ISO15099::System::SHGC); - - py::enum_( - m, "SpectalDataWavelengthRangeMethodType", py::arithmetic()) - .value("FULL", wincalc::Spectal_Data_Wavelength_Range_Method::FULL) - .value("ISO_9050", - wincalc::Spectal_Data_Wavelength_Range_Method::ISO_9050) - .value("CONDENSED", - wincalc::Spectal_Data_Wavelength_Range_Method::CONDENSED); - - m.def("nfrc_u_environments", &wincalc::nfrc_u_environments); - m.def("nfrc_shgc_environments", &wincalc::nfrc_shgc_environments); - - py::class_(m, "DeflectionResults") - .def_readwrite("layer_deflection_max", - &wincalc::Deflection_Results::layer_deflection_max) - .def_readwrite("layer_deflection_mean", - &wincalc::Deflection_Results::layer_deflection_mean) - .def_readwrite("panes_load", &wincalc::Deflection_Results::panes_load) - .def_readwrite("gap_width_max", - &wincalc::Deflection_Results::gap_width_max) - .def_readwrite("gap_width_mean", - &wincalc::Deflection_Results::gap_width_mean); - - py::class_(m, "GlazingSystem") - .def( - py::init const &, - std::vector< - std::shared_ptr> const &, - double, double, double, wincalc::Environments const &, - std::optional const &, - wincalc::Spectal_Data_Wavelength_Range_Method const &, int, - int>(), - py::arg("optical_standard"), py::arg("solid_layers"), - py::arg("gap_layers") = - std::vector>(), - py::arg("width_meters") = 1.0, py::arg("height_meters") = 1.0, - py::arg("tilt_degrees") = 90, - py::arg("environment") = wincalc::nfrc_u_environments(), - py::arg("bsdf_hemisphere") = - std::optional(), - py::arg("spectral_data_wavelength_range_method") = - wincalc::Spectal_Data_Wavelength_Range_Method::FULL, - py::arg("number_visible_bands") = 5, - py::arg("number_solar_bands") = 10) - .def( - py::init const &, - std::vector< - std::shared_ptr> const &, - double, double, double, wincalc::Environments const &, - std::optional const &, - wincalc::Spectal_Data_Wavelength_Range_Method const &, int, - int>(), - py::arg("optical_standard"), py::arg("solid_layers"), - py::arg("gap_layers") = - std::vector>(), - py::arg("width_meters") = 1.0, py::arg("height_meters") = 1.0, - py::arg("tilt_degrees") = 90, - py::arg("environment") = wincalc::nfrc_u_environments(), - py::arg("bsdf_hemisphere") = - std::optional(), - py::arg("spectral_data_wavelength_range_method") = - wincalc::Spectal_Data_Wavelength_Range_Method::FULL, - py::arg("number_visible_bands") = 5, - py::arg("number_solar_bands") = 10) - .def( - py::init< - window_standards::Optical_Standard const &, - std::vector< - std::variant> const &, - std::vector> const - &, - double, double, double, wincalc::Environments const &, - std::optional const &, - wincalc::Spectal_Data_Wavelength_Range_Method const &, int, - int>(), - py::arg("optical_standard"), py::arg("solid_layers"), - py::arg("gap_layers") = - std::vector>(), - py::arg("width_meters") = 1.0, py::arg("height_meters") = 1.0, - py::arg("tilt_degrees") = 90, - py::arg("environment") = wincalc::nfrc_u_environments(), - py::arg("bsdf_hemisphere") = - std::optional(), - py::arg("spectral_data_wavelength_range_method") = - wincalc::Spectal_Data_Wavelength_Range_Method::FULL, - py::arg("number_visible_bands") = 5, - py::arg("number_solar_bands") = 10) - .def("u", &wincalc::Glazing_System::u, py::arg("theta") = 0, - py::arg("phi") = 0) - .def("shgc", &wincalc::Glazing_System::shgc, py::arg("theta") = 0, - py::arg("phi") = 0) - .def("layer_temperatures", &wincalc::Glazing_System::layer_temperatures, - py::arg("system_type"), py::arg("theta") = 0, py::arg("phi") = 0) - .def("optical_method_results", - &wincalc::Glazing_System::optical_method_results, - py::arg("method_name"), py::arg("theta") = 0, py::arg("phi") = 0) - .def("color", &wincalc::Glazing_System::color, py::arg("theta") = 0, - py::arg("phi") = 0, - py::arg("tristimulus_x_method") = "COLOR_TRISTIMX", - py::arg("tristimulus_y_method") = "COLOR_TRISTIMY", - py::arg("tristimulus_z_method") = "COLOR_TRISTIMZ") - .def("solid_layers_effective_conductivities", - &wincalc::Glazing_System::solid_layers_effective_conductivities, - py::arg("system_type"), py::arg("theta") = 0, py::arg("phi") = 0) - .def("gap_layers_effective_conductivities", - &wincalc::Glazing_System::gap_layers_effective_conductivities, - py::arg("system_type"), py::arg("theta") = 0, py::arg("phi") = 0) - .def("system_effective_conductivity", - &wincalc::Glazing_System::system_effective_conductivity, - py::arg("system_type"), py::arg("theta") = 0, py::arg("phi") = 0) - .def("relative_heat_gain", &wincalc::Glazing_System::relative_heat_gain, - py::arg("theta") = 0, py::arg("phi") = 0) - .def("environments", - py::overload_cast( - &wincalc::Glazing_System::environments), - py::arg("environments")) - .def("environments", - py::overload_cast<>(&wincalc::Glazing_System::environments, - py::const_)) - .def("enable_deflection", &wincalc::Glazing_System::enable_deflection, - py::arg("enable")) - .def("set_deflection_properties", - py::overload_cast( - &wincalc::Glazing_System::set_deflection_properties), - py::arg("temperature_at_construction"), - py::arg("pressure_at_construction")) - .def("set_deflection_properties", - py::overload_cast const &>( - &wincalc::Glazing_System::set_deflection_properties), - py::arg("measured_deflected_gaps")) - .def("calc_deflection_properties", - &wincalc::Glazing_System::calc_deflection_properties, - py::arg("system_type"), py::arg("theta") = 0, py::arg("phi") = 0) - .def("set_applied_loads", &wincalc::Glazing_System::set_applied_loads, - py::arg("loads")) - .def("set_height", &wincalc::Glazing_System::set_height, - py::arg("height_meters")) - .def("set_width", &wincalc::Glazing_System::set_width, - py::arg("width_meters")) - .def("set_tilt", &wincalc::Glazing_System::set_tilt, - py::arg("tilt_degrees")) - .def("flip_layer", &wincalc::Glazing_System::flip_layer, - py::arg("layer_index"), py::arg("flipped")) - .def("solid_layers", - py::overload_cast< - std::vector const &>( - &wincalc::Glazing_System::solid_layers), - py::arg("solid_layers")) - .def("solid_layers", - py::overload_cast<>(&wincalc::Glazing_System::solid_layers, - py::const_)); - - m.def("convert_to_solid_layer", &wincalc::convert_to_solid_layer, - "Convert product data into a solid layer that can be used in glazing " - "systems."); - - m.def("convert_to_solid_layers", &wincalc::convert_to_solid_layers, - "Convert a list of product data into a solid layer that can be used in " - "glazing systems."); - - m.def("load_standard", - py::overload_cast( - &window_standards::load_optical_standard), - "Load standard from .std file"); - m.def("parse_json", &OpticsParser::parseJSONString, - "Load product data from json string"); - m.def("parse_json_file", &OpticsParser::parseJSONFile, - "Load product data from json file"); - m.def("parse_optics_file", &OpticsParser::parseOpticsFile, - "Load product data from optics file"); - m.def("parse_bsdf_xml_file", &OpticsParser::parseBSDFXMLFile, - "Load product data from BSDF xml file"); - m.def("parse_bsdf_xml_string", &OpticsParser::parseBSDFXMLString, - "Load product data from BSDF xml string"); - m.def("parse_thmx_file", &thmxParser::parseFile, "Parse a THERM thmx file"); - m.def("parse_thmx_string", &thmxParser::parseString, - "Parse THERM thmx format from a string"); - - m.def("create_gas", &wincalc::create_gas, py::arg("components"), - "Create a gas mixture from components: a list of pairs where the first " - "in each item is the percent of the total and the second is the gas."); - - m.def("create_venetian_blind", - py::overload_cast( - &wincalc::create_venetian_blind), - py::arg("geometry"), py::arg("material"), - "Create a venetian blind from a geometry and parsed material."); - - m.def("create_venetian_blind", - py::overload_cast, - std::shared_ptr>( - &wincalc::create_venetian_blind), - py::arg("geometry"), py::arg("material_data_optical"), - py::arg("material_data_thermal").none(true), - "Create a venetian blind from a geometry and material optical and " - "thermal data."); - - m.def("create_woven_shade", - py::overload_cast( - &wincalc::create_woven_shade), - py::arg("geometry"), py::arg("material"), - "Create a woven shade from a geometry and parsed material."); - - m.def("create_woven_shade", - py::overload_cast, - std::shared_ptr>( - &wincalc::create_woven_shade), - py::arg("geometry"), py::arg("material_data_optical"), - py::arg("material_data_thermal").none(true), - "Create a woven shade from a geometry and material optical and " - "thermal data."); - - m.def("create_perforated_screen", - py::overload_cast( - &wincalc::create_perforated_screen), - py::arg("geometry"), py::arg("material"), - "Create a perforated screen from a geometry and parsed material."); - - m.def("create_perforated_screen", - py::overload_cast, - std::shared_ptr>( - &wincalc::create_perforated_screen), - py::arg("geometry"), py::arg("material_data_optical"), - py::arg("material_data_thermal").none(true), - "Create a perforated screen from a geometry and material optical and " - "thermal data."); - - py::class_(m, "ThmxMeshParameters") - .def_readwrite("quad_tree_mesh_level", - &thmxParser::MeshParameters::quadTreeMeshLevel) - .def_readwrite("error_check_flag", - &thmxParser::MeshParameters::errorCheckFlag) - .def_readwrite("error_limit", &thmxParser::MeshParameters::errorLimit) - .def_readwrite("max_iterations", - &thmxParser::MeshParameters::maxIterations) - .def_readwrite("cma_flag", &thmxParser::MeshParameters::cmaFlag); - - py::class_(m, "ThmxRGB") - .def_readwrite("r", &thmxParser::ColorRGB::r) - .def_readwrite("g", &thmxParser::ColorRGB::g) - .def_readwrite("b", &thmxParser::ColorRGB::b); - - py::class_(m, "ThmxMaterial") - .def_readwrite("name", &thmxParser::Material::name) - .def_readwrite("type", &thmxParser::Material::type) - .def_readwrite("conductivity", &thmxParser::Material::conductivity) - .def_readwrite("emissivity_front", &thmxParser::Material::emissivityFront) - .def_readwrite("emissivity_back", &thmxParser::Material::emissivityBack) - .def_readwrite("tir", &thmxParser::Material::tir) - .def_readwrite("color", &thmxParser::Material::color) - .def_readwrite("cavity_model", &thmxParser::Material::cavityModel) - .def_readwrite("transmittances", &thmxParser::Material::transmittances) - .def_readwrite("reflectances", &thmxParser::Material::reflectances); - - py::class_(m, "ThmxBoundaryCondition") - .def_readwrite("name", &thmxParser::BoundaryCondition::name) - .def_readwrite("type", &thmxParser::BoundaryCondition::type) - .def_readwrite("H", &thmxParser::BoundaryCondition::H) - .def_readwrite("heat_flux", &thmxParser::BoundaryCondition::heatFlux) - .def_readwrite("temperature", &thmxParser::BoundaryCondition::temperature) - .def_readwrite("color", &thmxParser::BoundaryCondition::color) - .def_readwrite("Tr", &thmxParser::BoundaryCondition::Tr) - .def_readwrite("Hr", &thmxParser::BoundaryCondition::Hr) - .def_readwrite("Ei", &thmxParser::BoundaryCondition::Ei) - .def_readwrite("view_factor", &thmxParser::BoundaryCondition::viewFactor) - .def_readwrite("radiation_model", - &thmxParser::BoundaryCondition::radiationModel) - .def_readwrite("convection_flag", - &thmxParser::BoundaryCondition::convectionFlag) - .def_readwrite("flux_flag", &thmxParser::BoundaryCondition::fluxFlag) - .def_readwrite("radiation_flag", - &thmxParser::BoundaryCondition::radiationFlag) - .def_readwrite("constant_temperature_flag", - &thmxParser::BoundaryCondition::constantTemperatureFlag) - .def_readwrite("emissivity_modifier", - &thmxParser::BoundaryCondition::emissivityModifier); - - py::class_(m, "ThmxPolygonPoint") - .def_readwrite("index", &thmxParser::PolygonPoint::index) - .def_readwrite("x", &thmxParser::PolygonPoint::x) - .def_readwrite("y", &thmxParser::PolygonPoint::y); - - py::class_(m, "ThmxPolygon") - .def_readwrite("id", &thmxParser::Polygon::id) - .def_readwrite("material", &thmxParser::Polygon::material) - .def_readwrite("points", &thmxParser::Polygon::points); - - py::class_( - m, "ThmxBoundaryConditionPolygon") - .def_readwrite("id", &thmxParser::BoundaryConditionPolygon::id) - .def_readwrite("name", &thmxParser::BoundaryConditionPolygon::name) - .def_readwrite("polygon_id", - &thmxParser::BoundaryConditionPolygon::polygonId) - .def_readwrite("enclosure_id", - &thmxParser::BoundaryConditionPolygon::enclosureId) - .def_readwrite("ufactor_tag", - &thmxParser::BoundaryConditionPolygon::ufactorTag) - .def_readwrite("ratation_model", - &thmxParser::BoundaryConditionPolygon::ratationModel) - .def_readwrite("emissivity", - &thmxParser::BoundaryConditionPolygon::emissivity) - .def_readwrite("surfaceSide", - &thmxParser::BoundaryConditionPolygon::surfaceSide) - .def_readwrite("illuminated_surface", - &thmxParser::BoundaryConditionPolygon::illuminatedSurface) - .def_readwrite("points", &thmxParser::BoundaryConditionPolygon::points); - - py::class_(m, "ThmxCMABestWorstOption") - .def_readwrite("option", &thmxParser::CMABestWorstOption::option) - .def_readwrite( - "inside_convective_film_coefficient", - &thmxParser::CMABestWorstOption::insideConvectiveFilmCoefficient) - .def_readwrite( - "outside_convective_film_coefficient", - &thmxParser::CMABestWorstOption::outsideConvectiveFilmCoefficient) - .def_readwrite("glazing_gap_conductance", - &thmxParser::CMABestWorstOption::glazingGapConductance) - .def_readwrite("spacer_conductance", - &thmxParser::CMABestWorstOption::spacerConductance); - - py::class_(m, "ThmxCMAOptions") - .def_readwrite("interior_layer_conductivity", - &thmxParser::CMAOptions::interiorLayerConductivity) - .def_readwrite("interior_layer_thickness", - &thmxParser::CMAOptions::interiorLayerThickness) - .def_readwrite("interior_layer_emissivity", - &thmxParser::CMAOptions::interiorLayerEmissivity) - .def_readwrite("exterior_layer_conductivity", - &thmxParser::CMAOptions::exteriorLayerConductivity) - .def_readwrite("exterior_layer_thickness", - &thmxParser::CMAOptions::exteriorLayerThickness) - .def_readwrite("exterior_layer_emissivity", - &thmxParser::CMAOptions::exteriorLayerEmissivity) - .def_readwrite("interior_temperature", - &thmxParser::CMAOptions::interiorTemperature) - .def_readwrite("exterior_temperature", - &thmxParser::CMAOptions::exteriorTemperature) - .def_readwrite("best_worst_options", - &thmxParser::CMAOptions::bestWorstOptions); - - py::class_(m, - "ThmxUFactorProjectionResult") - .def_readwrite("length_type", - &thmxParser::UFactorProjectionResult::lengthType) - .def_readwrite("length_units", - &thmxParser::UFactorProjectionResult::lengthUnits) - .def_readwrite("length", &thmxParser::UFactorProjectionResult::length) - .def_readwrite("ufactor_units", - &thmxParser::UFactorProjectionResult::ufactorUnits) - .def_readwrite("ufactor", &thmxParser::UFactorProjectionResult::ufactor); - - py::class_(m, "ThmxUFactorResults") - .def_readwrite("tag", &thmxParser::UFactorResults::tag) - .def_readwrite("delta_t_units", &thmxParser::UFactorResults::deltaTUnits) - .def_readwrite("delta_t", &thmxParser::UFactorResults::deltaT) - .def_readwrite("projection_results", - &thmxParser::UFactorResults::projectionResults); - - py::class_(m, "ThmxResult") - .def_readwrite("model_type", &thmxParser::Result::modelType) - .def_readwrite("glazing_case", &thmxParser::Result::glazingCase) - .def_readwrite("spacer_case", &thmxParser::Result::spacerCase) - .def_readwrite("ufactor_results", &thmxParser::Result::ufactorResults); - - py::class_(m, "ThmxFileContents") - .def_readwrite("file_version", &thmxParser::ThmxFileContents::fileVersion) - .def_readwrite("mesh_parameters", - &thmxParser::ThmxFileContents::meshParameters) - .def_readwrite("materials", &thmxParser::ThmxFileContents::materials) - .def_readwrite("boundary_conditions", - &thmxParser::ThmxFileContents::boundaryConditions) - .def_readwrite("polygons", &thmxParser::ThmxFileContents::polygons) - .def_readwrite("boundary_condition_polygons", - &thmxParser::ThmxFileContents::boundaryConditionPolygons) - .def_readwrite("cma_options", &thmxParser::ThmxFileContents::cmaOptions) - .def_readwrite("results", &thmxParser::ThmxFileContents::results); - - py::class_(m, "GlazingSystemDimensions") - .def_readwrite("width", &Tarcog::IGUDimensions::width) - .def_readwrite("height", &Tarcog::IGUDimensions::height); - - py::class_>(m, "CMAWindow") - .def("u", &CMA::ICMAWindow::uValue) - .def("shgc", &CMA::ICMAWindow::shgc) - .def("vt", &CMA::ICMAWindow::vt) - .def("glazing_system_dimensions", &CMA::ICMAWindow::getIGUDimensions); - - py::class_>(m, - "CMABestWorstUFactors") - .def(py::init<>()) - .def(py::init()) - .def(py::init(m, "IntegrationRule") + .def_readwrite("type", &window_standards::Integration_Rule::type) + .def_readwrite("k", &window_standards::Integration_Rule::k); + + py::class_(m, + "OpticalStandardMethod") + .def_readwrite("name", &window_standards::Optical_Standard_Method::name) + .def_readwrite("description", + &window_standards::Optical_Standard_Method::description) + .def_readwrite( + "source_spectrum", + &window_standards::Optical_Standard_Method::source_spectrum) + .def_readwrite( + "detector_spectrum", + &window_standards::Optical_Standard_Method::detector_spectrum) + .def_readwrite("wavelength_set", + &window_standards::Optical_Standard_Method::wavelength_set) + .def_readwrite( + "integration_rule", + &window_standards::Optical_Standard_Method::integration_rule) + .def_readwrite("min_wavelength", + &window_standards::Optical_Standard_Method::min_wavelength) + .def_readwrite( + "max_wavelength", + &window_standards::Optical_Standard_Method::max_wavelength); + + py::class_(m, "OpticalStandard") + .def_readwrite("name", &window_standards::Optical_Standard::name) + .def_readwrite("description", + &window_standards::Optical_Standard::description) + .def_readwrite("file", &window_standards::Optical_Standard::file) + .def_readwrite("methods", &window_standards::Optical_Standard::methods); + + py::class_(m, "Trichromatic") + .def_readwrite("X", &wincalc::Trichromatic::X) + .def_readwrite("Y", &wincalc::Trichromatic::Y) + .def_readwrite("Z", &wincalc::Trichromatic::Z); + + py::class_(m, "RGB") + .def_readwrite("R", &wincalc::WinCalc_RGB::R) + .def_readwrite("G", &wincalc::WinCalc_RGB::G) + .def_readwrite("B", &wincalc::WinCalc_RGB::B); + + py::class_(m, "Lab") + .def_readwrite("L", &wincalc::Lab::L) + .def_readwrite("a", &wincalc::Lab::a) + .def_readwrite("b", &wincalc::Lab::b); + + py::class_(m, "ColorResult") + .def_readwrite("trichromatic", &wincalc::Color_Result::trichromatic) + .def_readwrite("rgb", &wincalc::Color_Result::rgb) + .def_readwrite("lab", &wincalc::Color_Result::lab); + + declare_wce_optical_results_template(m, ""); + declare_wce_optical_results_template(m, "Color"); + + py::enum_( + m, "BoundaryConditionsCoefficientModelType", py::arithmetic()) + .value("CALCULATED_H", + Tarcog::ISO15099::BoundaryConditionsCoeffModel::CalculateH) + .value("H_PRESCRIBED", + Tarcog::ISO15099::BoundaryConditionsCoeffModel::HPrescribed) + .value("HC_PRESCRIBED", + Tarcog::ISO15099::BoundaryConditionsCoeffModel::HcPrescribed); + + py::enum_( + m, "AirHorizontalDirection", py::arithmetic()) + .value("NONE", Tarcog::ISO15099::AirHorizontalDirection::None) + .value("LEEWARD", Tarcog::ISO15099::AirHorizontalDirection::Leeward) + .value("WINDWARD", Tarcog::ISO15099::AirHorizontalDirection::Windward); + + py::class_(m, "Environment") + .def(py::init(), + py::arg("air_temperature"), py::arg("pressure"), + py::arg("convection_coefficient"), py::arg("coefficient_model"), + py::arg("radiation_temperature"), py::arg("emissivity"), + py::arg("air_speed") = 0, + py::arg("air_direction") = + Tarcog::ISO15099::AirHorizontalDirection::None, + py::arg("direct_solar_radiation") = 0) + .def_readwrite("air_temperature", &wincalc::Environment::air_temperature) + .def_readwrite("pressure", &wincalc::Environment::pressure) + .def_readwrite("convection_coefficient", + &wincalc::Environment::convection_coefficient) + .def_readwrite("coefficient_model", + &wincalc::Environment::coefficient_model) + .def_readwrite("radiation_temperature", + &wincalc::Environment::radiation_temperature) + .def_readwrite("emissivity", &wincalc::Environment::emissivity) + .def_readwrite("air_speed", &wincalc::Environment::air_speed) + .def_readwrite("air_direction", &wincalc::Environment::air_direction) + .def_readwrite("direct_solar_radiation", + &wincalc::Environment::direct_solar_radiation); + + py::class_(m, "Environments") + .def(py::init(), + py::arg("outside"), py::arg("inside")) + .def_readwrite("outside", &wincalc::Environments::outside) + .def_readwrite("inside", &wincalc::Environments::inside); + + m.def("nfrc_u_environments", &wincalc::nfrc_u_environments, + "Returns the default environments for running a NFRC U-Value " + "calculation."); + m.def( + "nfrc_shgc_environments", &wincalc::nfrc_shgc_environments, + "Returns the default environments for running a NFRC SHGC calculation."); + + py::class_>( + m, "FlippableSolidLayer") + .def(py::init(), py::arg("thickness_meters"), + py::arg("flipped") = false) + .def_readwrite("thickness_meters", + &wincalc::Flippable_Solid_Layer::thickness_meters) + .def_readwrite("flipped", &wincalc::Flippable_Solid_Layer::flipped); + + py::class_>( + m, "ProductDataThermal") + .def(py::init(), + py::arg("conductivity"), py::arg("thickness_meters"), + py::arg("flipped") = false, py::arg("opening_top") = 0, + py::arg("opening_bottom") = 0, py::arg("opening_left") = 0, + py::arg("opening_right") = 0, py::arg("opening_front") = 0) + .def_readwrite("conductivity", + &wincalc::Product_Data_Thermal::conductivity) + .def_readwrite("opening_top", &wincalc::Product_Data_Thermal::opening_top) + .def_readwrite("opening_bottom", + &wincalc::Product_Data_Thermal::opening_bottom) + .def_readwrite("opening_left", + &wincalc::Product_Data_Thermal::opening_left) + .def_readwrite("opening_right", + &wincalc::Product_Data_Thermal::opening_right) + .def_readwrite("opening_front", + &wincalc::Product_Data_Thermal::opening_front) + .def_readwrite("youngs_modulus", + &wincalc::Product_Data_Thermal::youngs_modulus) + .def_readwrite("density", &wincalc::Product_Data_Thermal::density); + + py::class_>( + m, "ProductDataOptical") + .def(py::init, std::optional, + std::optional, std::optional, double, + bool>(), + py::arg("thickness_meters"), + py::arg("ir_transmittance_front") = std::optional(), + py::arg("ir_transmittance_back") = std::optional(), + py::arg("emissivity_front") = std::optional(), + py::arg("emissivity_back") = std::optional(), + py::arg("permeability_factor") = 0.0, py::arg("flipped") = false) + .def("effective_thermal_values", + &wincalc::Product_Data_Optical::effective_thermal_values) + .def("wavelengths", &wincalc::Product_Data_Optical::wavelengths) + .def_readwrite("ir_transmittance_front", + &wincalc::Product_Data_Optical::ir_transmittance_front) + .def_readwrite("ir_transmittance_back", + &wincalc::Product_Data_Optical::ir_transmittance_back) + .def_readwrite("emissivity_front", + &wincalc::Product_Data_Optical::emissivity_front) + .def_readwrite("emissivity_back", + &wincalc::Product_Data_Optical::emissivity_back) + .def_readwrite("permeability_factor", + &wincalc::Product_Data_Optical::permeability_factor); + + py::enum_(m, "MaterialType", + py::arithmetic()) + .value("APPLIED_FILM", FenestrationCommon::MaterialType::AppliedFilm) + .value("COATED", FenestrationCommon::MaterialType::Coated) + .value("ELECTROCHROMIC", FenestrationCommon::MaterialType::Electrochromic) + .value("FILM", FenestrationCommon::MaterialType::Film) + .value("INTERLAYER", FenestrationCommon::MaterialType::Interlayer) + .value("LAMINATE", FenestrationCommon::MaterialType::Laminate) + .value("MONOLITHIC", FenestrationCommon::MaterialType::Monolithic) + .value("THERMOCHROMIC", FenestrationCommon::MaterialType::Thermochromic); + + py::enum_(m, "CoatedSide", py::arithmetic()) + .value("FRONT", wincalc::CoatedSide::FRONT) + .value("BACK", wincalc::CoatedSide::BACK) + .value("BOTH", wincalc::CoatedSide::BOTH) + .value("NEITHER", wincalc::CoatedSide::NEITHER); + + py::class_>( + m, "ProductDataOpticalNBand") + .def(py::init, + std::optional, std::optional, + std::optional, std::optional, + std::optional, double, bool>(), + py::arg("material_type"), py::arg("thickness_meters"), + py::arg("wavelength_data"), + py::arg("coated_side") = std::optional(), + py::arg("ir_transmittance_front") = std::optional(), + py::arg("ir_transmittance_back") = std::optional(), + py::arg("emissivity_front") = std::optional(), + py::arg("emissivity_back") = std::optional(), + py::arg("permeability_factor") = 0, py::arg("flipped") = false) + .def("wavelengths", &wincalc::Product_Data_N_Band_Optical::wavelengths) + .def_readwrite("material_type", + &wincalc::Product_Data_N_Band_Optical::material_type) + .def_readwrite("wavelength_data", + &wincalc::Product_Data_N_Band_Optical::wavelength_data); + + py::class_>( + m, "ProductDataOpticalDualBand") + .def(py::init, std::optional, + std::optional, std::optional, double, + bool>(), + py::arg("thickness_meters"), + py::arg("ir_transmittance_front") = std::optional(), + py::arg("ir_transmittance_back") = std::optional(), + py::arg("emissivity_front") = std::optional(), + py::arg("emissivity_back") = std::optional(), + py::arg("permeability_factor") = 0.0, py::arg("flipped") = false) + .def("wavelengths", + &wincalc::Product_Data_Dual_Band_Optical::wavelengths); + + py::class_< + wincalc::Product_Data_Dual_Band_Optical_Hemispheric, + wincalc::Product_Data_Dual_Band_Optical, + std::shared_ptr>( + m, "ProductDataOpticalDualBandHemispheric") + .def(py::init, + std::optional, std::optional, + std::optional, double, bool>(), + py::arg("solar_transmittance_front"), + py::arg("solar_transmittance_back"), + py::arg("solar_reflectance_front"), + py::arg("solar_reflectance_back"), + py::arg("visible_transmittance_front"), + py::arg("visible_transmittance_back"), + py::arg("visible_reflectance_front"), + py::arg("visible_reflectance_back"), py::arg("thickness_meters"), + py::arg("ir_transmittance_front") = std::optional(), + py::arg("ir_transmittance_back") = std::optional(), + py::arg("emissivity_front") = std::optional(), + py::arg("emissivity_back") = std::optional(), + py::arg("permeability_factor") = 0.0, py::arg("flipped") = false) + .def_readwrite( + "solar_transmittance_front", + &wincalc::Product_Data_Dual_Band_Optical_Hemispheric::tf_solar) + .def_readwrite( + "solar_transmittance_back", + &wincalc::Product_Data_Dual_Band_Optical_Hemispheric::tb_solar) + .def_readwrite( + "solar_reflectance_front", + &wincalc::Product_Data_Dual_Band_Optical_Hemispheric::rf_solar) + .def_readwrite( + "solar_reflectance_back", + &wincalc::Product_Data_Dual_Band_Optical_Hemispheric::rb_solar) + .def_readwrite( + "visible_transmittance_front", + &wincalc::Product_Data_Dual_Band_Optical_Hemispheric::tf_visible) + .def_readwrite( + "visible_transmittance_back", + &wincalc::Product_Data_Dual_Band_Optical_Hemispheric::tb_visible) + .def_readwrite( + "visible_reflectance_front", + &wincalc::Product_Data_Dual_Band_Optical_Hemispheric::rf_visible) + .def_readwrite( + "visible_reflectance_back", + &wincalc::Product_Data_Dual_Band_Optical_Hemispheric::rb_visible); + + py::class_>( + m, "ProductDataOpticalDualBandBSDF") + .def(py::init> const &, + std::vector> const &, + std::vector> const &, + std::vector> const &, + std::vector> const &, + std::vector> const &, + std::vector> const &, + std::vector> const &, + SingleLayerOptics::BSDFHemisphere const &, double, + std::optional, std::optional, + std::optional, std::optional, double, + bool>(), + py::arg("solar_transmittance_front"), + py::arg("solar_transmittance_back"), + py::arg("solar_reflectance_front"), + py::arg("solar_reflectance_back"), + py::arg("visible_transmittance_front"), + py::arg("visible_transmittance_back"), + py::arg("visible_reflectance_front"), + py::arg("visible_reflectance_back"), py::arg("bsdf_hemisphere"), + py::arg("thickness_meters"), + py::arg("ir_transmittance_front") = std::optional(), + py::arg("ir_transmittance_back") = std::optional(), + py::arg("emissivity_front") = std::optional(), + py::arg("emissivity_back") = std::optional(), + py::arg("permeability_factor") = 0.0, py::arg("flipped") = false) + .def_readwrite("solar_transmittance_front", + &wincalc::Product_Data_Dual_Band_Optical_BSDF::tf_solar) + .def_readwrite("solar_transmittance_back", + &wincalc::Product_Data_Dual_Band_Optical_BSDF::tb_solar) + .def_readwrite("solar_reflectance_front", + &wincalc::Product_Data_Dual_Band_Optical_BSDF::rf_solar) + .def_readwrite("solar_reflectance_back", + &wincalc::Product_Data_Dual_Band_Optical_BSDF::rb_solar) + .def_readwrite("visible_transmittance_front", + &wincalc::Product_Data_Dual_Band_Optical_BSDF::tf_visible) + .def_readwrite("visible_transmittance_back", + &wincalc::Product_Data_Dual_Band_Optical_BSDF::tb_visible) + .def_readwrite("visible_reflectance_front", + &wincalc::Product_Data_Dual_Band_Optical_BSDF::rf_visible) + .def_readwrite("visible_reflectance_back", + &wincalc::Product_Data_Dual_Band_Optical_BSDF::rb_visible) + .def("effective_thermal_values", + &wincalc::Product_Data_Dual_Band_Optical_BSDF:: + effective_thermal_values); + + py::class_>( + m, "ProductDataOpticalWithMaterial") + .def(py::init const &>(), + py::arg("product_data_optical")) + .def("optical_data", + &wincalc::Product_Data_Optical_With_Material::optical_data) + .def("wavelengths", + &wincalc::Product_Data_Optical_With_Material::wavelengths) + .def_readwrite( + "material_optical_data", + &wincalc::Product_Data_Optical_With_Material::material_optical_data); + + py::enum_(m, "DistributionMethodType", + py::arithmetic()) + .value("UNIFORM_DIFFUSE", + SingleLayerOptics::DistributionMethod::UniformDiffuse) + .value("DIRECTIONAL_DIFFUSE", + SingleLayerOptics::DistributionMethod::DirectionalDiffuse); + + py::class_>(m, "VenetianGeometry") + .def(py::init(), + py::arg("slat_tilt_degrees"), py::arg("slat_width_meters"), + py::arg("slat_spacing_meters"), py::arg("slat_curvature_meters"), + py::arg("is_horizontal") = true, + py::arg("distribution_method") = + SingleLayerOptics::DistributionMethod::DirectionalDiffuse, + py::arg("number_slat_segments") = 5) + .def_readwrite("slat_tilt", &wincalc::Venetian_Geometry::slat_tilt) + .def_readwrite("slat_width", &wincalc::Venetian_Geometry::slat_width) + .def_readwrite("slat_spacing", &wincalc::Venetian_Geometry::slat_spacing) + .def_readwrite("slat_curvature", + &wincalc::Venetian_Geometry::slat_curvature) + .def_readwrite("number_slat_segments", + &wincalc::Venetian_Geometry::number_slat_segments) + .def_readwrite("distribution_method", + &wincalc::Venetian_Geometry::distribution_method) + .def_readwrite("is_horizontal", + &wincalc::Venetian_Geometry::is_horizontal); + + py::class_>( + m, "ProductDataOpticalVenetian") + .def(py::init const &, + wincalc::Venetian_Geometry const &>(), + py::arg("product_data_optical"), py::arg("geometry")) + .def_readwrite("geometry", + &wincalc::Product_Data_Optical_Venetian::geometry); + + py::class_>( + m, "WovenGeometry") + .def(py::init(), py::arg("thread_diamater"), + py::arg("thread_spacing"), py::arg("shade_thickness")) + .def_readwrite("thread_diameter", + &wincalc::Woven_Geometry::thread_diameter) + .def_readwrite("thread_spacing", &wincalc::Woven_Geometry::thread_spacing) + .def_readwrite("shade_thickness", + &wincalc::Woven_Geometry::shade_thickness); + + py::class_>( + m, "ProductDataOpticalWovenShade") + .def(py::init const &, + wincalc::Woven_Geometry const &>(), + py::arg("material_product_data_optical"), py::arg("geometry")) + .def_readwrite("geometry", + &wincalc::Product_Data_Optical_Woven_Shade::geometry); + + py::class_> + perforated_geometry(m, "PerforatedGeometry"); + + perforated_geometry + .def(py::init(), + py::arg("spacing_x"), py::arg("spacing_y"), py::arg("dimension_x"), + py::arg("dimension_y"), py::arg("perforation_type")) + .def_readwrite("spacing_x", &wincalc::Perforated_Geometry::spacing_x) + .def_readwrite("spacing_y", &wincalc::Perforated_Geometry::spacing_y) + .def_readwrite("dimension_x", &wincalc::Perforated_Geometry::dimension_x) + .def_readwrite("dimension_y", &wincalc::Perforated_Geometry::dimension_y) + .def_readwrite("perforation_type", + &wincalc::Perforated_Geometry::perforation_type); + + py::enum_(perforated_geometry, "Type") + .value("CIRCULAR", wincalc::Perforated_Geometry::Type::CIRCULAR) + .value("RECTANGULAR", wincalc::Perforated_Geometry::Type::RECTANGULAR) + .value("SQUARE", wincalc::Perforated_Geometry::Type::SQUARE); + + py::class_>( + m, "ProductDataOpticalPerforatedScreen") + .def(py::init const &, + wincalc::Perforated_Geometry const &>(), + py::arg("material_product_data_optical"), py::arg("geometry")) + .def_readwrite( + "geometry", + &wincalc::Product_Data_Optical_Perforated_Screen::geometry); + + py::class_( + m, "ProductDataOpticalAndThermal") + .def(py::init, + std::shared_ptr>(), + py::arg("product_data_optical"), py::arg("product_data_thermal")) + .def_readwrite("optical_data", + &wincalc::Product_Data_Optical_Thermal::optical_data) + .def_readwrite("thermal_data", + &wincalc::Product_Data_Optical_Thermal::thermal_data); + + py::enum_(m, "BSDFBasisType", py::arithmetic()) + .value("SMALL", SingleLayerOptics::BSDFBasis::Small) + .value("QUARTER", SingleLayerOptics::BSDFBasis::Quarter) + .value("HALF", SingleLayerOptics::BSDFBasis::Half) + .value("FULL", SingleLayerOptics::BSDFBasis::Full); + + py::class_(m, "BSDFHemisphere") + .def_static("create", + py::overload_cast( + &SingleLayerOptics::BSDFHemisphere::create), + py::arg("bsdf_basis")) + .def("get_directions", &SingleLayerOptics::BSDFHemisphere::getDirections); + + py::enum_(m, "TarcogSystemType", py::arithmetic()) + .value("U", Tarcog::ISO15099::System::Uvalue) + .value("SHGC", Tarcog::ISO15099::System::SHGC); + + py::enum_( + m, "SpectalDataWavelengthRangeMethodType", py::arithmetic()) + .value("FULL", wincalc::Spectal_Data_Wavelength_Range_Method::FULL) + .value("ISO_9050", + wincalc::Spectal_Data_Wavelength_Range_Method::ISO_9050) + .value("CONDENSED", + wincalc::Spectal_Data_Wavelength_Range_Method::CONDENSED); + + m.def("nfrc_u_environments", &wincalc::nfrc_u_environments); + m.def("nfrc_shgc_environments", &wincalc::nfrc_shgc_environments); + + py::class_(m, "DeflectionResults") + .def_readwrite("layer_deflection_max", + &wincalc::Deflection_Results::layer_deflection_max) + .def_readwrite("layer_deflection_mean", + &wincalc::Deflection_Results::layer_deflection_mean) + .def_readwrite("panes_load", &wincalc::Deflection_Results::panes_load) + .def_readwrite("gap_width_max", + &wincalc::Deflection_Results::gap_width_max) + .def_readwrite("gap_width_mean", + &wincalc::Deflection_Results::gap_width_mean); + + py::class_(m, "GlazingSystem") + .def( + py::init const &, + std::vector< + std::shared_ptr> const &, + double, double, double, wincalc::Environments const &, + std::optional const &, + wincalc::Spectal_Data_Wavelength_Range_Method const &, int, + int>(), + py::arg("optical_standard"), py::arg("solid_layers"), + py::arg("gap_layers") = + std::vector>(), + py::arg("width_meters") = 1.0, py::arg("height_meters") = 1.0, + py::arg("tilt_degrees") = 90, + py::arg("environment") = wincalc::nfrc_u_environments(), + py::arg("bsdf_hemisphere") = + std::optional(), + py::arg("spectral_data_wavelength_range_method") = + wincalc::Spectal_Data_Wavelength_Range_Method::FULL, + py::arg("number_visible_bands") = 5, + py::arg("number_solar_bands") = 10) + .def( + py::init const &, + std::vector< + std::shared_ptr> const &, + double, double, double, wincalc::Environments const &, + std::optional const &, + wincalc::Spectal_Data_Wavelength_Range_Method const &, int, + int>(), + py::arg("optical_standard"), py::arg("solid_layers"), + py::arg("gap_layers") = + std::vector>(), + py::arg("width_meters") = 1.0, py::arg("height_meters") = 1.0, + py::arg("tilt_degrees") = 90, + py::arg("environment") = wincalc::nfrc_u_environments(), + py::arg("bsdf_hemisphere") = + std::optional(), + py::arg("spectral_data_wavelength_range_method") = + wincalc::Spectal_Data_Wavelength_Range_Method::FULL, + py::arg("number_visible_bands") = 5, + py::arg("number_solar_bands") = 10) + .def( + py::init< + window_standards::Optical_Standard const &, + std::vector< + std::variant> const &, + std::vector> const + &, + double, double, double, wincalc::Environments const &, + std::optional const &, + wincalc::Spectal_Data_Wavelength_Range_Method const &, int, + int>(), + py::arg("optical_standard"), py::arg("solid_layers"), + py::arg("gap_layers") = + std::vector>(), + py::arg("width_meters") = 1.0, py::arg("height_meters") = 1.0, + py::arg("tilt_degrees") = 90, + py::arg("environment") = wincalc::nfrc_u_environments(), + py::arg("bsdf_hemisphere") = + std::optional(), + py::arg("spectral_data_wavelength_range_method") = + wincalc::Spectal_Data_Wavelength_Range_Method::FULL, + py::arg("number_visible_bands") = 5, + py::arg("number_solar_bands") = 10) + .def("u", &wincalc::Glazing_System::u, py::arg("theta") = 0, + py::arg("phi") = 0) + .def("shgc", &wincalc::Glazing_System::shgc, py::arg("theta") = 0, + py::arg("phi") = 0) + .def("layer_temperatures", &wincalc::Glazing_System::layer_temperatures, + py::arg("system_type"), py::arg("theta") = 0, py::arg("phi") = 0) + .def("optical_method_results", + &wincalc::Glazing_System::optical_method_results, + py::arg("method_name"), py::arg("theta") = 0, py::arg("phi") = 0) + .def("color", &wincalc::Glazing_System::color, py::arg("theta") = 0, + py::arg("phi") = 0, + py::arg("tristimulus_x_method") = "COLOR_TRISTIMX", + py::arg("tristimulus_y_method") = "COLOR_TRISTIMY", + py::arg("tristimulus_z_method") = "COLOR_TRISTIMZ") + .def("solid_layers_effective_conductivities", + &wincalc::Glazing_System::solid_layers_effective_conductivities, + py::arg("system_type"), py::arg("theta") = 0, py::arg("phi") = 0) + .def("gap_layers_effective_conductivities", + &wincalc::Glazing_System::gap_layers_effective_conductivities, + py::arg("system_type"), py::arg("theta") = 0, py::arg("phi") = 0) + .def("system_effective_conductivity", + &wincalc::Glazing_System::system_effective_conductivity, + py::arg("system_type"), py::arg("theta") = 0, py::arg("phi") = 0) + .def("relative_heat_gain", &wincalc::Glazing_System::relative_heat_gain, + py::arg("theta") = 0, py::arg("phi") = 0) + .def("environments", + py::overload_cast( + &wincalc::Glazing_System::environments), + py::arg("environments")) + .def("environments", + py::overload_cast<>(&wincalc::Glazing_System::environments, + py::const_)) + .def("enable_deflection", &wincalc::Glazing_System::enable_deflection, + py::arg("enable")) + .def("set_deflection_properties", + py::overload_cast( + &wincalc::Glazing_System::set_deflection_properties), + py::arg("temperature_at_construction"), + py::arg("pressure_at_construction")) + .def("set_deflection_properties", + py::overload_cast const &>( + &wincalc::Glazing_System::set_deflection_properties), + py::arg("measured_deflected_gaps")) + .def("calc_deflection_properties", + &wincalc::Glazing_System::calc_deflection_properties, + py::arg("system_type"), py::arg("theta") = 0, py::arg("phi") = 0) + .def("set_applied_loads", &wincalc::Glazing_System::set_applied_loads, + py::arg("loads")) + .def("set_height", &wincalc::Glazing_System::set_height, + py::arg("height_meters")) + .def("set_width", &wincalc::Glazing_System::set_width, + py::arg("width_meters")) + .def("set_tilt", &wincalc::Glazing_System::set_tilt, + py::arg("tilt_degrees")) + .def("flip_layer", &wincalc::Glazing_System::flip_layer, + py::arg("layer_index"), py::arg("flipped")) + .def("solid_layers", + py::overload_cast< + std::vector const &>( + &wincalc::Glazing_System::solid_layers), + py::arg("solid_layers")) + .def("solid_layers", + py::overload_cast<>(&wincalc::Glazing_System::solid_layers, + py::const_)); + + m.def("convert_to_solid_layer", &wincalc::convert_to_solid_layer, + "Convert product data into a solid layer that can be used in glazing " + "systems."); + + m.def("convert_to_solid_layers", &wincalc::convert_to_solid_layers, + "Convert a list of product data into a solid layer that can be used in " + "glazing systems."); + + m.def("load_standard", + py::overload_cast( + &window_standards::load_optical_standard), + "Load standard from .std file"); + m.def("parse_json", &OpticsParser::parseJSONString, + "Load product data from json string"); + m.def("parse_json_file", &OpticsParser::parseJSONFile, + "Load product data from json file"); + m.def("parse_optics_file", &OpticsParser::parseOpticsFile, + "Load product data from optics file"); + m.def("parse_bsdf_xml_file", &OpticsParser::parseBSDFXMLFile, + "Load product data from BSDF xml file"); + m.def("parse_bsdf_xml_string", &OpticsParser::parseBSDFXMLString, + "Load product data from BSDF xml string"); + m.def("parse_thmx_file", &thmxParser::parseFile, "Parse a THERM thmx file"); + m.def("parse_thmx_string", &thmxParser::parseString, + "Parse THERM thmx format from a string"); + + m.def("create_gas", &wincalc::create_gas, py::arg("components"), + "Create a gas mixture from components: a list of pairs where the first " + "in each item is the percent of the total and the second is the gas."); + + m.def("create_venetian_blind", + py::overload_cast( + &wincalc::create_venetian_blind), + py::arg("geometry"), py::arg("material"), + "Create a venetian blind from a geometry and parsed material."); + + m.def("create_venetian_blind", + py::overload_cast, + std::shared_ptr>( + &wincalc::create_venetian_blind), + py::arg("geometry"), py::arg("material_data_optical"), + py::arg("material_data_thermal").none(true), + "Create a venetian blind from a geometry and material optical and " + "thermal data."); + + m.def("create_woven_shade", + py::overload_cast( + &wincalc::create_woven_shade), + py::arg("geometry"), py::arg("material"), + "Create a woven shade from a geometry and parsed material."); + + m.def("create_woven_shade", + py::overload_cast, + std::shared_ptr>( + &wincalc::create_woven_shade), + py::arg("geometry"), py::arg("material_data_optical"), + py::arg("material_data_thermal").none(true), + "Create a woven shade from a geometry and material optical and " + "thermal data."); + + m.def("create_perforated_screen", + py::overload_cast( + &wincalc::create_perforated_screen), + py::arg("geometry"), py::arg("material"), + "Create a perforated screen from a geometry and parsed material."); + + m.def("create_perforated_screen", + py::overload_cast, + std::shared_ptr>( + &wincalc::create_perforated_screen), + py::arg("geometry"), py::arg("material_data_optical"), + py::arg("material_data_thermal").none(true), + "Create a perforated screen from a geometry and material optical and " + "thermal data."); + + py::class_(m, "ThmxMeshParameters") + .def_readwrite("quad_tree_mesh_level", + &thmxParser::MeshParameters::quadTreeMeshLevel) + .def_readwrite("error_check_flag", + &thmxParser::MeshParameters::errorCheckFlag) + .def_readwrite("error_limit", &thmxParser::MeshParameters::errorLimit) + .def_readwrite("max_iterations", + &thmxParser::MeshParameters::maxIterations) + .def_readwrite("cma_flag", &thmxParser::MeshParameters::cmaFlag); + + py::class_(m, "ThmxRGB") + .def_readwrite("r", &thmxParser::ColorRGB::r) + .def_readwrite("g", &thmxParser::ColorRGB::g) + .def_readwrite("b", &thmxParser::ColorRGB::b); + + py::class_(m, "ThmxMaterial") + .def_readwrite("name", &thmxParser::Material::name) + .def_readwrite("type", &thmxParser::Material::type) + .def_readwrite("conductivity", &thmxParser::Material::conductivity) + .def_readwrite("emissivity_front", &thmxParser::Material::emissivityFront) + .def_readwrite("emissivity_back", &thmxParser::Material::emissivityBack) + .def_readwrite("tir", &thmxParser::Material::tir) + .def_readwrite("color", &thmxParser::Material::color) + .def_readwrite("cavity_model", &thmxParser::Material::cavityModel) + .def_readwrite("transmittances", &thmxParser::Material::transmittances) + .def_readwrite("reflectances", &thmxParser::Material::reflectances); + + py::class_(m, "ThmxBoundaryCondition") + .def_readwrite("name", &thmxParser::BoundaryCondition::name) + .def_readwrite("type", &thmxParser::BoundaryCondition::type) + .def_readwrite("H", &thmxParser::BoundaryCondition::H) + .def_readwrite("heat_flux", &thmxParser::BoundaryCondition::heatFlux) + .def_readwrite("temperature", &thmxParser::BoundaryCondition::temperature) + .def_readwrite("color", &thmxParser::BoundaryCondition::color) + .def_readwrite("Tr", &thmxParser::BoundaryCondition::Tr) + .def_readwrite("Hr", &thmxParser::BoundaryCondition::Hr) + .def_readwrite("Ei", &thmxParser::BoundaryCondition::Ei) + .def_readwrite("view_factor", &thmxParser::BoundaryCondition::viewFactor) + .def_readwrite("radiation_model", + &thmxParser::BoundaryCondition::radiationModel) + .def_readwrite("convection_flag", + &thmxParser::BoundaryCondition::convectionFlag) + .def_readwrite("flux_flag", &thmxParser::BoundaryCondition::fluxFlag) + .def_readwrite("radiation_flag", + &thmxParser::BoundaryCondition::radiationFlag) + .def_readwrite("constant_temperature_flag", + &thmxParser::BoundaryCondition::constantTemperatureFlag) + .def_readwrite("emissivity_modifier", + &thmxParser::BoundaryCondition::emissivityModifier); + + py::class_(m, "ThmxPolygonPoint") + .def_readwrite("index", &thmxParser::PolygonPoint::index) + .def_readwrite("x", &thmxParser::PolygonPoint::x) + .def_readwrite("y", &thmxParser::PolygonPoint::y); + + py::class_(m, "ThmxPolygon") + .def_readwrite("id", &thmxParser::Polygon::id) + .def_readwrite("material", &thmxParser::Polygon::material) + .def_readwrite("points", &thmxParser::Polygon::points); + + py::class_( + m, "ThmxBoundaryConditionPolygon") + .def_readwrite("id", &thmxParser::BoundaryConditionPolygon::id) + .def_readwrite("name", &thmxParser::BoundaryConditionPolygon::name) + .def_readwrite("polygon_id", + &thmxParser::BoundaryConditionPolygon::polygonId) + .def_readwrite("enclosure_id", + &thmxParser::BoundaryConditionPolygon::enclosureId) + .def_readwrite("ufactor_tag", + &thmxParser::BoundaryConditionPolygon::ufactorTag) + .def_readwrite("ratation_model", + &thmxParser::BoundaryConditionPolygon::ratationModel) + .def_readwrite("emissivity", + &thmxParser::BoundaryConditionPolygon::emissivity) + .def_readwrite("surfaceSide", + &thmxParser::BoundaryConditionPolygon::surfaceSide) + .def_readwrite("illuminated_surface", + &thmxParser::BoundaryConditionPolygon::illuminatedSurface) + .def_readwrite("points", &thmxParser::BoundaryConditionPolygon::points); + + py::class_(m, "ThmxCMABestWorstOption") + .def_readwrite("option", &thmxParser::CMABestWorstOption::option) + .def_readwrite( + "inside_convective_film_coefficient", + &thmxParser::CMABestWorstOption::insideConvectiveFilmCoefficient) + .def_readwrite( + "outside_convective_film_coefficient", + &thmxParser::CMABestWorstOption::outsideConvectiveFilmCoefficient) + .def_readwrite("glazing_gap_conductance", + &thmxParser::CMABestWorstOption::glazingGapConductance) + .def_readwrite("spacer_conductance", + &thmxParser::CMABestWorstOption::spacerConductance); + + py::class_(m, "ThmxCMAOptions") + .def_readwrite("interior_layer_conductivity", + &thmxParser::CMAOptions::interiorLayerConductivity) + .def_readwrite("interior_layer_thickness", + &thmxParser::CMAOptions::interiorLayerThickness) + .def_readwrite("interior_layer_emissivity", + &thmxParser::CMAOptions::interiorLayerEmissivity) + .def_readwrite("exterior_layer_conductivity", + &thmxParser::CMAOptions::exteriorLayerConductivity) + .def_readwrite("exterior_layer_thickness", + &thmxParser::CMAOptions::exteriorLayerThickness) + .def_readwrite("exterior_layer_emissivity", + &thmxParser::CMAOptions::exteriorLayerEmissivity) + .def_readwrite("interior_temperature", + &thmxParser::CMAOptions::interiorTemperature) + .def_readwrite("exterior_temperature", + &thmxParser::CMAOptions::exteriorTemperature) + .def_readwrite("best_worst_options", + &thmxParser::CMAOptions::bestWorstOptions); + + py::class_(m, + "ThmxUFactorProjectionResult") + .def_readwrite("length_type", + &thmxParser::UFactorProjectionResult::lengthType) + .def_readwrite("length_units", + &thmxParser::UFactorProjectionResult::lengthUnits) + .def_readwrite("length", &thmxParser::UFactorProjectionResult::length) + .def_readwrite("ufactor_units", + &thmxParser::UFactorProjectionResult::ufactorUnits) + .def_readwrite("ufactor", &thmxParser::UFactorProjectionResult::ufactor); + + py::class_(m, "ThmxUFactorResults") + .def_readwrite("tag", &thmxParser::UFactorResults::tag) + .def_readwrite("delta_t_units", &thmxParser::UFactorResults::deltaTUnits) + .def_readwrite("delta_t", &thmxParser::UFactorResults::deltaT) + .def_readwrite("projection_results", + &thmxParser::UFactorResults::projectionResults); + + py::class_(m, "ThmxResult") + .def_readwrite("model_type", &thmxParser::Result::modelType) + .def_readwrite("glazing_case", &thmxParser::Result::glazingCase) + .def_readwrite("spacer_case", &thmxParser::Result::spacerCase) + .def_readwrite("ufactor_results", &thmxParser::Result::ufactorResults); + + py::class_(m, "ThmxFileContents") + .def_readwrite("file_version", &thmxParser::ThmxFileContents::fileVersion) + .def_readwrite("mesh_parameters", + &thmxParser::ThmxFileContents::meshParameters) + .def_readwrite("materials", &thmxParser::ThmxFileContents::materials) + .def_readwrite("boundary_conditions", + &thmxParser::ThmxFileContents::boundaryConditions) + .def_readwrite("polygons", &thmxParser::ThmxFileContents::polygons) + .def_readwrite("boundary_condition_polygons", + &thmxParser::ThmxFileContents::boundaryConditionPolygons) + .def_readwrite("cma_options", &thmxParser::ThmxFileContents::cmaOptions) + .def_readwrite("results", &thmxParser::ThmxFileContents::results); + + py::class_(m, "GlazingSystemDimensions") + .def_readwrite("width", &Tarcog::IGUDimensions::width) + .def_readwrite("height", &Tarcog::IGUDimensions::height); + + py::class_>(m, "CMAWindow") + .def("u", &CMA::ICMAWindow::uValue) + .def("shgc", &CMA::ICMAWindow::shgc) + .def("vt", &CMA::ICMAWindow::vt) + .def("glazing_system_dimensions", &CMA::ICMAWindow::getIGUDimensions); + + py::class_>(m, + "CMABestWorstUFactors") + .def(py::init<>()) + .def(py::init()) + .def(py::init()) - .def("u", &CMA::CMABestWorstUFactors::uValue) - .def("hc_out", &CMA::CMABestWorstUFactors::hcout); - - m.def("create_best_worst_u_factor_option", - &CMA::CreateBestWorstUFactorOption); - - py::class_>( - m, "CMAWindowSingleVision") - .def(py::init(), - py::arg("width"), py::arg("height"), - py::arg("spacer_best_keff") = 0.01, - py::arg("spacer_worst_keff") = 10.0, - py::arg("best_u_factor_options") = - CMA::CreateBestWorstUFactorOption(CMA::Option::Best), - py::arg("worst_u_factor_options") = - CMA::CreateBestWorstUFactorOption(CMA::Option::Worst)) - .def("set_frame_top", &CMA::CMAWindowSingleVision::setFrameTop) - .def("set_frame_bottom", &CMA::CMAWindowSingleVision::setFrameBottom) - .def("set_frame_left", &CMA::CMAWindowSingleVision::setFrameLeft) - .def("set_frame_right", &CMA::CMAWindowSingleVision::setFrameRight) - .def("set_dividers", &CMA::CMAWindowSingleVision::setDividers); - - py::class_>( - m, "CMAWindowDualVisionHorizontal") - .def(py::init(), - py::arg("width"), py::arg("height"), - py::arg("spacer_best_keff") = 0.01, - py::arg("spacer_worst_keff") = 10.0, - py::arg("best_u_factor_options") = - CMA::CreateBestWorstUFactorOption(CMA::Option::Best), - py::arg("worst_u_factor_options") = - CMA::CreateBestWorstUFactorOption(CMA::Option::Worst)) - .def("set_frame_top_left", - &CMA::CMAWindowDualVisionHorizontal::setFrameTopLeft) - .def("set_frame_top_right", - &CMA::CMAWindowDualVisionHorizontal::setFrameTopRight) - .def("set_frame_bottom_left", - &CMA::CMAWindowDualVisionHorizontal::setFrameBottomLeft) - .def("set_frame_bottom_right", - &CMA::CMAWindowDualVisionHorizontal::setFrameBottomRight) - .def("set_frame_left", &CMA::CMAWindowDualVisionHorizontal::setFrameLeft) - .def("set_frame_right", - &CMA::CMAWindowDualVisionHorizontal::setFrameRight) - .def("set_frame_meeting_rail", - &CMA::CMAWindowDualVisionHorizontal::setFrameMeetingRail) - .def("set_dividers", &CMA::CMAWindowDualVisionHorizontal::setDividers); - - py::class_>( - m, "CMAWindowDualVisionVertical") - .def(py::init(), - py::arg("width"), py::arg("height"), - py::arg("spacer_best_keff") = 0.01, - py::arg("spacer_worst_keff") = 10.0, - py::arg("best_u_factor_options") = - CMA::CreateBestWorstUFactorOption(CMA::Option::Best), - py::arg("worst_u_factor_options") = - CMA::CreateBestWorstUFactorOption(CMA::Option::Worst)) - .def("set_frame_top", &CMA::CMAWindowDualVisionVertical::setFrameTop) - .def("set_frame_bottom", - &CMA::CMAWindowDualVisionVertical::setFrameBottom) - .def("set_frame_top_left", - &CMA::CMAWindowDualVisionVertical::setFrameTopLeft) - .def("set_frame_top_right", - &CMA::CMAWindowDualVisionVertical::setFrameTopRight) - .def("set_frame_bottom_left", - &CMA::CMAWindowDualVisionVertical::setFrameBottomLeft) - .def("set_frame_bottom_right", - &CMA::CMAWindowDualVisionVertical::setFrameBottomRight) - .def("set_frame_meeting_rail", - &CMA::CMAWindowDualVisionVertical::setFrameMeetingRail) - .def("set_dividers", &CMA::CMAWindowDualVisionVertical::setDividers); - - py::class_(m, "ThermalIRResults") - .def_readwrite( - "transmittance_front_diffuse_diffuse", - &wincalc::ThermalIRResults::transmittance_front_diffuse_diffuse) - .def_readwrite( - "transmittance_back_diffuse_diffuse", - &wincalc::ThermalIRResults::transmittance_back_diffuse_diffuse) - .def_readwrite("emissivity_front_hemispheric", - &wincalc::ThermalIRResults::emissivity_front_hemispheric) - .def_readwrite("emissivity_back_hemispheric", - &wincalc::ThermalIRResults::emissivity_back_hemispheric); - - m.def("calc_thermal_ir", &wincalc::calc_thermal_ir, - py::arg("optical_standard"), py::arg("product_data")); - - m.def("get_spacer_keff", &wincalc::get_spacer_keff, - "Calculate the effective conductivity of a spacer from a THERM thmx " - "file."); - m.def("get_cma_window_single_vision", - py::overload_cast( - &wincalc::get_cma_window_single_vision), - "Get the CMA template for a single vision window."); - m.def( - "get_cma_window_single_vision", - py::overload_cast< - CMA::CMAFrame const &, CMA::CMAFrame const &, CMA::CMAFrame const &, - CMA::CMAFrame const &, double, double, double, double, - CMA::CMABestWorstUFactors const &, CMA::CMABestWorstUFactors const &>( - &wincalc::get_cma_window_single_vision), - "Get the CMA template for a single vision window."); - m.def("get_cma_window_double_vision_vertical", - py::overload_cast( - &wincalc::get_cma_window_double_vision_vertical), - "Get the CMA template for a double vision vertical window."); - m.def( - "get_cma_window_double_vision_vertical", - py::overload_cast< - CMA::CMAFrame const &, CMA::CMAFrame const &, CMA::CMAFrame const &, - CMA::CMAFrame const &, CMA::CMAFrame const &, CMA::CMAFrame const &, - CMA::CMAFrame const &, double, double, double, double, - CMA::CMABestWorstUFactors const &, CMA::CMABestWorstUFactors const &>( - &wincalc::get_cma_window_double_vision_vertical), - "Get the CMA template for a double vision vertical window."); - m.def("get_cma_window_double_vision_horizontal", - py::overload_cast( - &wincalc::get_cma_window_double_vision_horizontal), - "Get the CMA template for a double vision horizontal window."); - m.def( - "get_cma_window_double_vision_horizontal", - py::overload_cast< - CMA::CMAFrame const &, CMA::CMAFrame const &, CMA::CMAFrame const &, - CMA::CMAFrame const &, CMA::CMAFrame const &, CMA::CMAFrame const &, - CMA::CMAFrame const &, double, double, double, double, - CMA::CMABestWorstUFactors const &, CMA::CMABestWorstUFactors const &>( - &wincalc::get_cma_window_double_vision_horizontal), - "Get the CMA template for a double vision horizontal window."); - - py::class_(m, "CMAResult") - .def_readwrite("u", &wincalc::CMAResult::u) - .def_readwrite("shgc", &wincalc::CMAResult::shgc) - .def_readwrite("vt", &wincalc::CMAResult::vt); - - m.def("calc_cma", &wincalc::calc_cma, "Get CMA results."); - - py::enum_(m, "BSDFDirection", + .def("u", &CMA::CMABestWorstUFactors::uValue) + .def("hc_out", &CMA::CMABestWorstUFactors::hcout); + + m.def("create_best_worst_u_factor_option", + &CMA::CreateBestWorstUFactorOption); + + py::class_>( + m, "CMAWindowSingleVision") + .def(py::init(), + py::arg("width"), py::arg("height"), + py::arg("spacer_best_keff") = 0.01, + py::arg("spacer_worst_keff") = 10.0, + py::arg("best_u_factor_options") = + CMA::CreateBestWorstUFactorOption(CMA::Option::Best), + py::arg("worst_u_factor_options") = + CMA::CreateBestWorstUFactorOption(CMA::Option::Worst)) + .def("set_frame_top", &CMA::CMAWindowSingleVision::setFrameTop) + .def("set_frame_bottom", &CMA::CMAWindowSingleVision::setFrameBottom) + .def("set_frame_left", &CMA::CMAWindowSingleVision::setFrameLeft) + .def("set_frame_right", &CMA::CMAWindowSingleVision::setFrameRight) + .def("set_dividers", &CMA::CMAWindowSingleVision::setDividers); + + py::class_>( + m, "CMAWindowDualVisionHorizontal") + .def(py::init(), + py::arg("width"), py::arg("height"), + py::arg("spacer_best_keff") = 0.01, + py::arg("spacer_worst_keff") = 10.0, + py::arg("best_u_factor_options") = + CMA::CreateBestWorstUFactorOption(CMA::Option::Best), + py::arg("worst_u_factor_options") = + CMA::CreateBestWorstUFactorOption(CMA::Option::Worst)) + .def("set_frame_top_left", + &CMA::CMAWindowDualVisionHorizontal::setFrameTopLeft) + .def("set_frame_top_right", + &CMA::CMAWindowDualVisionHorizontal::setFrameTopRight) + .def("set_frame_bottom_left", + &CMA::CMAWindowDualVisionHorizontal::setFrameBottomLeft) + .def("set_frame_bottom_right", + &CMA::CMAWindowDualVisionHorizontal::setFrameBottomRight) + .def("set_frame_left", &CMA::CMAWindowDualVisionHorizontal::setFrameLeft) + .def("set_frame_right", + &CMA::CMAWindowDualVisionHorizontal::setFrameRight) + .def("set_frame_meeting_rail", + &CMA::CMAWindowDualVisionHorizontal::setFrameMeetingRail) + .def("set_dividers", &CMA::CMAWindowDualVisionHorizontal::setDividers); + + py::class_>( + m, "CMAWindowDualVisionVertical") + .def(py::init(), + py::arg("width"), py::arg("height"), + py::arg("spacer_best_keff") = 0.01, + py::arg("spacer_worst_keff") = 10.0, + py::arg("best_u_factor_options") = + CMA::CreateBestWorstUFactorOption(CMA::Option::Best), + py::arg("worst_u_factor_options") = + CMA::CreateBestWorstUFactorOption(CMA::Option::Worst)) + .def("set_frame_top", &CMA::CMAWindowDualVisionVertical::setFrameTop) + .def("set_frame_bottom", + &CMA::CMAWindowDualVisionVertical::setFrameBottom) + .def("set_frame_top_left", + &CMA::CMAWindowDualVisionVertical::setFrameTopLeft) + .def("set_frame_top_right", + &CMA::CMAWindowDualVisionVertical::setFrameTopRight) + .def("set_frame_bottom_left", + &CMA::CMAWindowDualVisionVertical::setFrameBottomLeft) + .def("set_frame_bottom_right", + &CMA::CMAWindowDualVisionVertical::setFrameBottomRight) + .def("set_frame_meeting_rail", + &CMA::CMAWindowDualVisionVertical::setFrameMeetingRail) + .def("set_dividers", &CMA::CMAWindowDualVisionVertical::setDividers); + + py::class_(m, "ThermalIRResults") + .def_readwrite( + "transmittance_front_diffuse_diffuse", + &wincalc::ThermalIRResults::transmittance_front_diffuse_diffuse) + .def_readwrite( + "transmittance_back_diffuse_diffuse", + &wincalc::ThermalIRResults::transmittance_back_diffuse_diffuse) + .def_readwrite("emissivity_front_hemispheric", + &wincalc::ThermalIRResults::emissivity_front_hemispheric) + .def_readwrite("emissivity_back_hemispheric", + &wincalc::ThermalIRResults::emissivity_back_hemispheric); + + m.def("calc_thermal_ir", &wincalc::calc_thermal_ir, + py::arg("optical_standard"), py::arg("product_data")); + + m.def("get_spacer_keff", &wincalc::get_spacer_keff, + "Calculate the effective conductivity of a spacer from a THERM thmx " + "file."); + m.def("get_cma_window_single_vision", + py::overload_cast( + &wincalc::get_cma_window_single_vision), + "Get the CMA template for a single vision window."); + m.def( + "get_cma_window_single_vision", + py::overload_cast< + CMA::CMAFrame const &, CMA::CMAFrame const &, CMA::CMAFrame const &, + CMA::CMAFrame const &, double, double, double, double, + CMA::CMABestWorstUFactors const &, CMA::CMABestWorstUFactors const &>( + &wincalc::get_cma_window_single_vision), + "Get the CMA template for a single vision window."); + m.def("get_cma_window_double_vision_vertical", + py::overload_cast( + &wincalc::get_cma_window_double_vision_vertical), + "Get the CMA template for a double vision vertical window."); + m.def( + "get_cma_window_double_vision_vertical", + py::overload_cast< + CMA::CMAFrame const &, CMA::CMAFrame const &, CMA::CMAFrame const &, + CMA::CMAFrame const &, CMA::CMAFrame const &, CMA::CMAFrame const &, + CMA::CMAFrame const &, double, double, double, double, + CMA::CMABestWorstUFactors const &, CMA::CMABestWorstUFactors const &>( + &wincalc::get_cma_window_double_vision_vertical), + "Get the CMA template for a double vision vertical window."); + m.def("get_cma_window_double_vision_horizontal", + py::overload_cast( + &wincalc::get_cma_window_double_vision_horizontal), + "Get the CMA template for a double vision horizontal window."); + m.def( + "get_cma_window_double_vision_horizontal", + py::overload_cast< + CMA::CMAFrame const &, CMA::CMAFrame const &, CMA::CMAFrame const &, + CMA::CMAFrame const &, CMA::CMAFrame const &, CMA::CMAFrame const &, + CMA::CMAFrame const &, double, double, double, double, + CMA::CMABestWorstUFactors const &, CMA::CMABestWorstUFactors const &>( + &wincalc::get_cma_window_double_vision_horizontal), + "Get the CMA template for a double vision horizontal window."); + + py::class_(m, "CMAResult") + .def_readwrite("u", &wincalc::CMAResult::u) + .def_readwrite("shgc", &wincalc::CMAResult::shgc) + .def_readwrite("vt", &wincalc::CMAResult::vt); + + m.def("calc_cma", &wincalc::calc_cma, "Get CMA results."); + + py::enum_(m, "BSDFDirection", + py::arithmetic()) + .value("Incoming", SingleLayerOptics::BSDFDirection::Incoming) + .value("Outgoing", SingleLayerOptics::BSDFDirection::Outgoing); + + py::enum_(m, "Side", py::arithmetic()) + .value("Front", FenestrationCommon::Side::Front) + .value("Back", FenestrationCommon::Side::Back); + + py::enum_(m, "PropertySimple", py::arithmetic()) - .value("Incoming", SingleLayerOptics::BSDFDirection::Incoming) - .value("Outgoing", SingleLayerOptics::BSDFDirection::Outgoing); - - py::enum_(m, "Side", py::arithmetic()) - .value("Front", FenestrationCommon::Side::Front) - .value("Back", FenestrationCommon::Side::Back); - - py::enum_(m, "PropertySimple", - py::arithmetic()) - .value("T", FenestrationCommon::PropertySimple::T) - .value("R", FenestrationCommon::PropertySimple::R); - - py::class_(m, "SquareMatrix") - .def(py::init> const &>(), - py::arg("input")) - .def("size", &FenestrationCommon::SquareMatrix::size) - .def("set_zeros", &FenestrationCommon::SquareMatrix::setZeros) - .def("set_identity", &FenestrationCommon::SquareMatrix::setIdentity) - .def("set_diagonal", &FenestrationCommon::SquareMatrix::setDiagonal) - .def("make_upper_triangular", - &FenestrationCommon::SquareMatrix::makeUpperTriangular) - .def("inverse", &FenestrationCommon::SquareMatrix::inverse) - .def("mmult_rows", &FenestrationCommon::SquareMatrix::mmultRows) - .def("get_matrix", &FenestrationCommon::SquareMatrix::getMatrix); - - py::class_(m, "BSDFDirections") - .def(py::init<>()) - .def(py::init const &, - SingleLayerOptics::BSDFDirection>(), - py::arg("definitions"), py::arg("side")) - .def("lambda_vector", &SingleLayerOptics::BSDFDirections::lambdaVector) - .def("profile_angles", &SingleLayerOptics::BSDFDirections::profileAngles) - .def("lambda_matrix", &SingleLayerOptics::BSDFDirections::lambdaMatrix) - .def("get_nearest_beam_index", - &SingleLayerOptics::BSDFDirections::getNearestBeamIndex); - - py::class_(m, "BSDFIntegrator") - .def(py::init(), - py::arg("directions")) - .def("get_matrix", &SingleLayerOptics::BSDFIntegrator::getMatrix) - .def("at", &SingleLayerOptics::BSDFIntegrator::at) - .def("set_matrices", &SingleLayerOptics::BSDFIntegrator::setMatrices) - .def( - "direct_direct", - py::overload_cast(m, "SquareMatrix") + .def(py::init> const &>(), + py::arg("input")) + .def("size", &FenestrationCommon::SquareMatrix::size) + .def("set_zeros", &FenestrationCommon::SquareMatrix::setZeros) + .def("set_identity", &FenestrationCommon::SquareMatrix::setIdentity) + .def("set_diagonal", &FenestrationCommon::SquareMatrix::setDiagonal) + .def("make_upper_triangular", + &FenestrationCommon::SquareMatrix::makeUpperTriangular) + .def("inverse", &FenestrationCommon::SquareMatrix::inverse) + .def("mmult_rows", &FenestrationCommon::SquareMatrix::mmultRows) + .def("get_matrix", &FenestrationCommon::SquareMatrix::getMatrix); + + py::class_(m, "BSDFDirections") + .def(py::init<>()) + .def(py::init const &, + SingleLayerOptics::BSDFDirection>(), + py::arg("definitions"), py::arg("side")) + .def("lambda_vector", &SingleLayerOptics::BSDFDirections::lambdaVector) + .def("profile_angles", &SingleLayerOptics::BSDFDirections::profileAngles) + .def("lambda_matrix", &SingleLayerOptics::BSDFDirections::lambdaMatrix) + .def("get_nearest_beam_index", + &SingleLayerOptics::BSDFDirections::getNearestBeamIndex); + + py::class_(m, "BSDFIntegrator") + .def(py::init(), + py::arg("directions")) + .def("get_matrix", &SingleLayerOptics::BSDFIntegrator::getMatrix) + .def("at", &SingleLayerOptics::BSDFIntegrator::at) + .def("set_matrices", &SingleLayerOptics::BSDFIntegrator::setMatrices) + .def( + "direct_direct", + py::overload_cast( - &SingleLayerOptics::BSDFIntegrator::DirDir, py::const_)) - .def("direct_direct", - py::overload_cast( - &SingleLayerOptics::BSDFIntegrator::DirDir, py::const_)) - .def("direct_hemispheric", - py::overload_cast( - &SingleLayerOptics::BSDFIntegrator::DirHem)) - .def( - "direct_hemispheric", - py::overload_cast( + &SingleLayerOptics::BSDFIntegrator::DirDir, py::const_)) + .def("direct_hemispheric", + py::overload_cast( + &SingleLayerOptics::BSDFIntegrator::DirHem)) + .def( + "direct_hemispheric", + py::overload_cast( - &SingleLayerOptics::BSDFIntegrator::DirHem)) - .def("absorptance", py::overload_cast( - &SingleLayerOptics::BSDFIntegrator::Abs)) - .def("absorptance", - py::overload_cast( - &SingleLayerOptics::BSDFIntegrator::Abs)) - .def("absorptance", py::overload_cast( - &SingleLayerOptics::BSDFIntegrator::Abs)) - .def("diffuse_diffuse", &SingleLayerOptics::BSDFIntegrator::DiffDiff) - .def("absorptance_diffuse_diffuse", - &SingleLayerOptics::BSDFIntegrator::AbsDiffDiff) - .def("lambda_vector", &SingleLayerOptics::BSDFIntegrator::lambdaVector) - .def("lambda_matrix", &SingleLayerOptics::BSDFIntegrator::lambdaMatrix) - .def("get_nearest_beam_index", - &SingleLayerOptics::BSDFIntegrator::getNearestBeamIndex); - - py::class_(m, "EffectiveOpenness") - .def(py::init(), - py::arg("ah"), py::arg("al"), py::arg("ar"), py::arg("atop"), - py::arg("abot"), py::arg("front_porosity")) - .def("is_closed", &EffectiveLayers::EffectiveOpenness::isClosed) - .def_readwrite("ah", &EffectiveLayers::EffectiveOpenness::Ah) - .def_readwrite("al", &EffectiveLayers::EffectiveOpenness::Al) - .def_readwrite("ar", &EffectiveLayers::EffectiveOpenness::Ar) - .def_readwrite("atop", &EffectiveLayers::EffectiveOpenness::Atop) - .def_readwrite("abot", &EffectiveLayers::EffectiveOpenness::Abot) - .def_readwrite("front_porosity", - &EffectiveLayers::EffectiveOpenness::FrontPorosity); - - py::class_(m, "Layers") - .def_static("solid", &Tarcog::ISO15099::Layers::solid, - "Factory method for creating a solid Tarcog layer", - py::arg("thickness"), py::arg("conductivity"), - py::arg("frontEmissivity") = 0.84, - py::arg("frontIRTransmittance") = 0.0, - py::arg("backEmissivity") = 0.84, - py::arg("backIRTransmittance") = 0.0) - .def_static("update_material_data", - &Tarcog::ISO15099::Layers::updateMaterialData, - "Static method for updating the material information for a " - "solid Tarcog layer.", - py::arg("layer"), - py::arg("density") = Tarcog::MaterialConstants::GLASSDENSITY, - py::arg("youngs_modulus") = - Tarcog::DeflectionConstants::YOUNGSMODULUS) - .def_static("shading", &Tarcog::ISO15099::Layers::shading, - "Factory function to create a Tarcog shading layer.", - py::arg("thickness"), py::arg("conductivity"), - py::arg("effective_openness") = - EffectiveLayers::EffectiveOpenness(0, 0, 0, 0, 0, 0), - py::arg("front_emissivity") = 0.84, - py::arg("front_transmittance") = 0.0, - py::arg("back_emissivity") = 0.84, - py::arg("back_transmittance") = 0.0) - .def_static( - "gap", - py::overload_cast(&Tarcog::ISO15099::Layers::gap), - "Factory function to create a Tarcog air gap", py::arg("thickness"), - py::arg("pressure") = 101325) - .def_static("gap", - py::overload_cast( - &Tarcog::ISO15099::Layers::gap), - "Factory function to create a Tarcog gap from a gas", - py::arg("thickness"), py::arg("gas"), - py::arg("pressure") = 101325) - .def_static( - "create_pillar", - py::overload_cast(&Tarcog::ISO15099::Layers::createPillar), - "Static function to add a cylindrical pillar to a Tarcog gap", - py::arg("pillar"), py::arg("pressure")) - .def_static( - "create_pillar", - py::overload_cast(&Tarcog::ISO15099::Layers::createPillar), - "Static function to add a spherical pillar to a Tarcog gap", - py::arg("pillar"), py::arg("pressure")) - .def_static( - "create_pillar", - py::overload_cast( + &SingleLayerOptics::BSDFIntegrator::Abs)) + .def("absorptance", + py::overload_cast( + &SingleLayerOptics::BSDFIntegrator::Abs)) + .def("absorptance", py::overload_cast( + &SingleLayerOptics::BSDFIntegrator::Abs)) + .def("diffuse_diffuse", &SingleLayerOptics::BSDFIntegrator::DiffDiff) + .def("absorptance_diffuse_diffuse", + &SingleLayerOptics::BSDFIntegrator::AbsDiffDiff) + .def("lambda_vector", &SingleLayerOptics::BSDFIntegrator::lambdaVector) + .def("lambda_matrix", &SingleLayerOptics::BSDFIntegrator::lambdaMatrix) + .def("get_nearest_beam_index", + &SingleLayerOptics::BSDFIntegrator::getNearestBeamIndex); + + py::class_(m, "EffectiveOpenness") + .def(py::init(), + py::arg("ah"), py::arg("al"), py::arg("ar"), py::arg("atop"), + py::arg("abot"), py::arg("front_porosity")) + .def("is_closed", &EffectiveLayers::EffectiveOpenness::isClosed) + .def_readwrite("ah", &EffectiveLayers::EffectiveOpenness::Ah) + .def_readwrite("al", &EffectiveLayers::EffectiveOpenness::Al) + .def_readwrite("ar", &EffectiveLayers::EffectiveOpenness::Ar) + .def_readwrite("atop", &EffectiveLayers::EffectiveOpenness::Atop) + .def_readwrite("abot", &EffectiveLayers::EffectiveOpenness::Abot) + .def_readwrite("front_porosity", + &EffectiveLayers::EffectiveOpenness::FrontPorosity); + + py::class_(m, "Layers") + .def_static("solid", &Tarcog::ISO15099::Layers::solid, + "Factory method for creating a solid Tarcog layer", + py::arg("thickness"), py::arg("conductivity"), + py::arg("frontEmissivity") = 0.84, + py::arg("frontIRTransmittance") = 0.0, + py::arg("backEmissivity") = 0.84, + py::arg("backIRTransmittance") = 0.0) + .def_static("update_material_data", + &Tarcog::ISO15099::Layers::updateMaterialData, + "Static method for updating the material information for a " + "solid Tarcog layer.", + py::arg("layer"), + py::arg("density") = Tarcog::MaterialConstants::GLASSDENSITY, + py::arg("youngs_modulus") = + Tarcog::DeflectionConstants::YOUNGSMODULUS) + .def_static("shading", &Tarcog::ISO15099::Layers::shading, + "Factory function to create a Tarcog shading layer.", + py::arg("thickness"), py::arg("conductivity"), + py::arg("effective_openness") = + EffectiveLayers::EffectiveOpenness(0, 0, 0, 0, 0, 0), + py::arg("front_emissivity") = 0.84, + py::arg("front_transmittance") = 0.0, + py::arg("back_emissivity") = 0.84, + py::arg("back_transmittance") = 0.0) + .def_static( + "gap", + py::overload_cast(&Tarcog::ISO15099::Layers::gap), + "Factory function to create a Tarcog air gap", py::arg("thickness"), + py::arg("pressure") = 101325) + .def_static("gap", + py::overload_cast( + &Tarcog::ISO15099::Layers::gap), + "Factory function to create a Tarcog gap from a gas", + py::arg("thickness"), py::arg("gas"), + py::arg("pressure") = 101325) + .def_static( + "create_pillar", + py::overload_cast(&Tarcog::ISO15099::Layers::createPillar), - "Static function to add a rectangular pillar to a Tarcog gap", - py::arg("pillar"), py::arg("pressure")) - .def_static( - "create_pillar", - py::overload_cast( + &Tarcog::ISO15099::Layers::createPillar), + "Static function to add a spherical pillar to a Tarcog gap", + py::arg("pillar"), py::arg("pressure")) + .def_static( + "create_pillar", + py::overload_cast(&Tarcog::ISO15099::Layers::createPillar), - "Static function to add a polygonal pillar to a Tarcog gap", - py::arg("pillar"), py::arg("pressure")) - .def_static( - "create_pillar", - py::overload_cast( + &Tarcog::ISO15099::Layers::createPillar), + "Static function to add a polygonal pillar to a Tarcog gap", + py::arg("pillar"), py::arg("pressure")) + .def_static( + "create_pillar", + py::overload_cast(&Tarcog::ISO15099::Layers::createPillar), - "Static function to add a linear bearing pillar to a Tarcog gap", - py::arg("pillar"), py::arg("pressure")) - .def_static( - "create_pillar", - py::overload_cast(&Tarcog::ISO15099::Layers::createPillar), - "Static function to add a truncated cone pillar to a Tarcog gap", - py::arg("pillar"), py::arg("pressure")) - .def_static( - "create_pillar", - py::overload_cast(&Tarcog::ISO15099::Layers::createPillar), - "Static function to add a annulus cylinder pillar to a Tarcog gap", - py::arg("pillar"), py::arg("pressure")); + "Static function to add a annulus cylinder pillar to a Tarcog gap", + py::arg("pillar"), py::arg("pressure")) + .def_static( + "create_pillar", + py::overload_cast( + &Tarcog::ISO15099::Layers::createPillar), + "Static function to add a measured pillar to a Tarcog gap", + py::arg("pillar")); } From 355353055ce21484d60ddb1fde05a750d0308892 Mon Sep 17 00:00:00 2001 From: Simon Vidanovic Date: Fri, 8 Dec 2023 10:02:18 -0800 Subject: [PATCH 06/27] Commented lines removed from the wincalcbindings.cpp --- src/wincalcbindings.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/wincalcbindings.cpp b/src/wincalcbindings.cpp index 53d1902..0970ecc 100644 --- a/src/wincalcbindings.cpp +++ b/src/wincalcbindings.cpp @@ -391,16 +391,6 @@ PYBIND11_MODULE(wincalcbindings, m) { .def(py::init(), py::arg("pillar")); - // py::class_>( - // m, "CircularPillar") - // .def(py::init(), - // py::arg("gap_layer"), py::arg("conductivity"), - // py::arg("spacing"), py::arg("radius")); - py::class_>( From 53f639aefa04246695c967500f5c5db844efcd25 Mon Sep 17 00:00:00 2001 From: Simon Vidanovic Date: Fri, 8 Dec 2023 13:01:08 -0800 Subject: [PATCH 07/27] Several pillar examples added. --- examples/gap_annulus_cylinder_pillar.py | 22 ++++++++++++++++++++++ examples/gap_cylindrical_pillar.py | 22 ++++++++++++++++++++++ examples/gap_linear_bearing_pillar.py | 22 ++++++++++++++++++++++ examples/gap_measured_pillar.py | 24 ++++++++++++++++++++++++ examples/gap_pentagon_pillar.py | 22 ++++++++++++++++++++++ examples/gap_rectangular_pillar.py | 22 ++++++++++++++++++++++ examples/gap_spherical_pillar.py | 22 ++++++++++++++++++++++ examples/gap_triangular_pillar.py | 22 ++++++++++++++++++++++ examples/gap_truncated_cone_pillar.py | 22 ++++++++++++++++++++++ 9 files changed, 200 insertions(+) create mode 100644 examples/gap_annulus_cylinder_pillar.py create mode 100644 examples/gap_cylindrical_pillar.py create mode 100644 examples/gap_linear_bearing_pillar.py create mode 100644 examples/gap_measured_pillar.py create mode 100644 examples/gap_pentagon_pillar.py create mode 100644 examples/gap_rectangular_pillar.py create mode 100644 examples/gap_spherical_pillar.py create mode 100644 examples/gap_triangular_pillar.py create mode 100644 examples/gap_truncated_cone_pillar.py diff --git a/examples/gap_annulus_cylinder_pillar.py b/examples/gap_annulus_cylinder_pillar.py new file mode 100644 index 0000000..e69fec9 --- /dev/null +++ b/examples/gap_annulus_cylinder_pillar.py @@ -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}") diff --git a/examples/gap_cylindrical_pillar.py b/examples/gap_cylindrical_pillar.py new file mode 100644 index 0000000..f612022 --- /dev/null +++ b/examples/gap_cylindrical_pillar.py @@ -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}") diff --git a/examples/gap_linear_bearing_pillar.py b/examples/gap_linear_bearing_pillar.py new file mode 100644 index 0000000..e0c314e --- /dev/null +++ b/examples/gap_linear_bearing_pillar.py @@ -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}") diff --git a/examples/gap_measured_pillar.py b/examples/gap_measured_pillar.py new file mode 100644 index 0000000..204fb1d --- /dev/null +++ b/examples/gap_measured_pillar.py @@ -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}") diff --git a/examples/gap_pentagon_pillar.py b/examples/gap_pentagon_pillar.py new file mode 100644 index 0000000..979d97b --- /dev/null +++ b/examples/gap_pentagon_pillar.py @@ -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}") diff --git a/examples/gap_rectangular_pillar.py b/examples/gap_rectangular_pillar.py new file mode 100644 index 0000000..5924e56 --- /dev/null +++ b/examples/gap_rectangular_pillar.py @@ -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}") diff --git a/examples/gap_spherical_pillar.py b/examples/gap_spherical_pillar.py new file mode 100644 index 0000000..97a2245 --- /dev/null +++ b/examples/gap_spherical_pillar.py @@ -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}") diff --git a/examples/gap_triangular_pillar.py b/examples/gap_triangular_pillar.py new file mode 100644 index 0000000..0922eb8 --- /dev/null +++ b/examples/gap_triangular_pillar.py @@ -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}") diff --git a/examples/gap_truncated_cone_pillar.py b/examples/gap_truncated_cone_pillar.py new file mode 100644 index 0000000..8c7dc56 --- /dev/null +++ b/examples/gap_truncated_cone_pillar.py @@ -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}") From 91a6827241214c8f4aa79de48f467877eb3929b3 Mon Sep 17 00:00:00 2001 From: StephenCzarnecki Date: Fri, 8 Dec 2023 18:53:17 -0500 Subject: [PATCH 08/27] Update build_wheels.yml Added python 3.12 to list of python-versions to build wheels for --- .github/workflows/build_wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 0edfd42..1564536 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -12,7 +12,7 @@ jobs: matrix: os: [windows-2019] arch: [x86, x64] - python-version: [3.7, 3.8, 3.9, "3.10", "3.11"] + python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"] steps: - name: Checkout repository @@ -44,7 +44,7 @@ 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.7, 3.8, 3.9, "3.10", "3.11", "3.12"] env: SYSTEM_VERSION_COMPAT: 0 From f0041827b306dcbd8e4f8b8ec6942d805c3e89fe Mon Sep 17 00:00:00 2001 From: StephenCzarnecki Date: Fri, 8 Dec 2023 20:11:08 -0500 Subject: [PATCH 09/27] Update build_wheels.yml Removing reference to python 3.12. Adding it to build matrix caused errors. More investigation required. --- .github/workflows/build_wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 1564536..0edfd42 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -12,7 +12,7 @@ jobs: matrix: os: [windows-2019] arch: [x86, x64] - python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"] + python-version: [3.7, 3.8, 3.9, "3.10", "3.11"] steps: - name: Checkout repository @@ -44,7 +44,7 @@ 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", "3.12"] + python-version: [3.7, 3.8, 3.9, "3.10", "3.11"] env: SYSTEM_VERSION_COMPAT: 0 From 792ebdeca93553be3b827f4cb80da42f51e48635 Mon Sep 17 00:00:00 2001 From: StephenCzarnecki Date: Sat, 9 Dec 2023 14:53:30 -0500 Subject: [PATCH 10/27] Update build_wheels.yml Updating setup-python to v4 --- .github/workflows/build_wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 0edfd42..dd8826e 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -19,7 +19,7 @@ jobs: uses: actions/checkout@v2 - 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 }} @@ -53,7 +53,7 @@ jobs: uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} From 0eef3008ea6565bf87c41c2fd01b5ea7983082e9 Mon Sep 17 00:00:00 2001 From: StephenCzarnecki Date: Sat, 9 Dec 2023 16:54:45 -0500 Subject: [PATCH 11/27] Update build_wheels.yml Trying python 3.12 with updated setup-python --- .github/workflows/build_wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index dd8826e..28dff4c 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -12,7 +12,7 @@ jobs: matrix: os: [windows-2019] arch: [x86, x64] - python-version: [3.7, 3.8, 3.9, "3.10", "3.11"] + python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"] steps: - name: Checkout repository @@ -44,7 +44,7 @@ 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.7, 3.8, 3.9, "3.10", "3.11", "3.12"] env: SYSTEM_VERSION_COMPAT: 0 From f4052f913f6ae0be38bd5017fa667fa780f9ceb6 Mon Sep 17 00:00:00 2001 From: StephenCzarnecki Date: Tue, 12 Dec 2023 14:05:16 -0500 Subject: [PATCH 12/27] Update build_wheels.yml --- .github/workflows/build_wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 28dff4c..279c037 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 @@ -50,7 +50,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 From 62ee06ae4b6c7b5930f7f4507e588019d4a9f5e8 Mon Sep 17 00:00:00 2001 From: StephenCzarnecki Date: Tue, 12 Dec 2023 14:57:42 -0500 Subject: [PATCH 13/27] Update build_wheels.yml --- .github/workflows/build_wheels.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 279c037..680f533 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -25,7 +25,9 @@ jobs: 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 @@ -58,7 +60,9 @@ jobs: 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 From 9ed91595dab0527a28338d4a5c5db2a2adb45ab3 Mon Sep 17 00:00:00 2001 From: StephenCzarnecki Date: Tue, 12 Dec 2023 15:36:09 -0500 Subject: [PATCH 14/27] Update build_wheels.yml --- .github/workflows/build_wheels.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 680f533..3a21382 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -84,6 +84,9 @@ jobs: # Note that at least manylinux2014 is needed to get support for C++17 - name: Build manylinux Python wheels uses: RalfG/python-wheels-manylinux-build@v0.7.1-manylinux2014_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 From eef0037ee1ec60534582d9cfce1c30e221b0e5b7 Mon Sep 17 00:00:00 2001 From: StephenCzarnecki Date: Tue, 19 Dec 2023 13:23:43 -0500 Subject: [PATCH 15/27] Update setup.cfg Incremented version to 3.4.0 --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index a354ba4..6b4bca4 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = pywincalc -version = 3.3.1 +version = 3.4.0 description = A Python library for calculating thermal and optical properties of glazing systems long_description = file: README.md long_description_content_type = text/markdown; charset=UTF-8 From 7b7d32f1872f33f4dbbda2d80a67e17c38f64b51 Mon Sep 17 00:00:00 2001 From: Simon Vidanovic Date: Wed, 12 Jun 2024 14:16:42 -0700 Subject: [PATCH 16/27] Update to bindings definitions for new effective openness and thickenss. --- src/wincalcbindings.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/wincalcbindings.cpp b/src/wincalcbindings.cpp index 0970ecc..aa4b1d1 100644 --- a/src/wincalcbindings.cpp +++ b/src/wincalcbindings.cpp @@ -761,7 +761,7 @@ PYBIND11_MODULE(wincalcbindings, m) { py::arg("conductivity"), py::arg("thickness_meters"), py::arg("flipped") = false, py::arg("opening_top") = 0, py::arg("opening_bottom") = 0, py::arg("opening_left") = 0, - py::arg("opening_right") = 0, py::arg("opening_front") = 0) + py::arg("opening_right") = 0) .def_readwrite("conductivity", &wincalc::Product_Data_Thermal::conductivity) .def_readwrite("opening_top", &wincalc::Product_Data_Thermal::opening_top) @@ -771,8 +771,10 @@ PYBIND11_MODULE(wincalcbindings, m) { &wincalc::Product_Data_Thermal::opening_left) .def_readwrite("opening_right", &wincalc::Product_Data_Thermal::opening_right) - .def_readwrite("opening_front", - &wincalc::Product_Data_Thermal::opening_front) + .def_readwrite("effective_openness", + &wincalc::Product_Data_Thermal::effective_openness) + .def_readwrite("effective_thickness", + &wincalc::Product_Data_Thermal::effective_thickness) .def_readwrite("youngs_modulus", &wincalc::Product_Data_Thermal::youngs_modulus) .def_readwrite("density", &wincalc::Product_Data_Thermal::density); @@ -1728,7 +1730,6 @@ PYBIND11_MODULE(wincalcbindings, m) { .def(py::init(), py::arg("ah"), py::arg("al"), py::arg("ar"), py::arg("atop"), py::arg("abot"), py::arg("front_porosity")) - .def("is_closed", &EffectiveLayers::EffectiveOpenness::isClosed) .def_readwrite("ah", &EffectiveLayers::EffectiveOpenness::Ah) .def_readwrite("al", &EffectiveLayers::EffectiveOpenness::Al) .def_readwrite("ar", &EffectiveLayers::EffectiveOpenness::Ar) @@ -1736,6 +1737,8 @@ PYBIND11_MODULE(wincalcbindings, m) { .def_readwrite("abot", &EffectiveLayers::EffectiveOpenness::Abot) .def_readwrite("front_porosity", &EffectiveLayers::EffectiveOpenness::FrontPorosity); + + m.def("is_closed", &EffectiveLayers::isClosed, py::arg("effective_openness")); py::class_(m, "Layers") .def_static("solid", &Tarcog::ISO15099::Layers::solid, From 1f1336d6a9f3d5b8f833b4fa9570756c2aef4713 Mon Sep 17 00:00:00 2001 From: Simon Vidanovic Date: Wed, 12 Jun 2024 14:25:00 -0700 Subject: [PATCH 17/27] VariableAirflowCoefficients --- CMakeLists-WinCalc.txt.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists-WinCalc.txt.in b/CMakeLists-WinCalc.txt.in index 22f2726..6595301 100644 --- a/CMakeLists-WinCalc.txt.in +++ b/CMakeLists-WinCalc.txt.in @@ -4,7 +4,7 @@ include(ExternalProject) ExternalProject_Add(wincalc GIT_REPOSITORY https://github.com/LBNL-ETA/WinCalc.git - GIT_TAG "VacuumDec2023" + GIT_TAG "VariableAirflowCoefficients" UPDATE_COMMAND "" PATCH_COMMAND "" From 2460649fc86d7d8c508421f246ce8b5618388f9a Mon Sep 17 00:00:00 2001 From: Simon Vidanovic Date: Wed, 12 Jun 2024 15:59:35 -0700 Subject: [PATCH 18/27] Polygonial pillars interface change. --- src/wincalcbindings.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/wincalcbindings.cpp b/src/wincalcbindings.cpp index aa4b1d1..ad0d17b 100644 --- a/src/wincalcbindings.cpp +++ b/src/wincalcbindings.cpp @@ -1796,9 +1796,21 @@ PYBIND11_MODULE(wincalcbindings, m) { py::arg("pillar"), py::arg("pressure")) .def_static( "create_pillar", - py::overload_cast( + py::overload_cast( &Tarcog::ISO15099::Layers::createPillar), - "Static function to add a polygonal pillar to a Tarcog gap", + "Static function to add a triangular pillar to a Tarcog gap", + py::arg("pillar"), py::arg("pressure")) + .def_static( + "create_pillar", + py::overload_cast( + &Tarcog::ISO15099::Layers::createPillar), + "Static function to add a pentagon pillar to a Tarcog gap", + py::arg("pillar"), py::arg("pressure")) + .def_static( + "create_pillar", + py::overload_cast( + &Tarcog::ISO15099::Layers::createPillar), + "Static function to add a hexagon pillar to a Tarcog gap", py::arg("pillar"), py::arg("pressure")) .def_static( "create_pillar", From 75d50cd69c952691ce2e38e02e8f5caca7f6a11e Mon Sep 17 00:00:00 2001 From: Simon Vidanovic Date: Wed, 12 Jun 2024 16:21:47 -0700 Subject: [PATCH 19/27] Project is compiling now and pyd file is produced. --- src/wincalcbindings.cpp | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/wincalcbindings.cpp b/src/wincalcbindings.cpp index ad0d17b..35705bf 100644 --- a/src/wincalcbindings.cpp +++ b/src/wincalcbindings.cpp @@ -264,22 +264,12 @@ PYBIND11_MODULE(wincalcbindings, m) { Tarcog::ISO15099::RectangularPillar const &>(), py::arg("gap_layer"), py::arg("rectangular_pillar")); - py::class_>( - m, "PolygonalPillar") - .def(py::init(), - py::arg("height"), py::arg("material_conductivity"), - py::arg("cell_area"), py::arg("length"), py::arg("polygon_type")) - .def_readwrite("length", &Tarcog::ISO15099::PolygonalPillar::length) - .def_readwrite("polygon_type", &Tarcog::ISO15099::PolygonalPillar::type); - py::class_>( m, "TriangularPillarLayer") .def(py::init(), + Tarcog::ISO15099::TriangularPillar const &>(), py::arg("gap_layer"), py::arg("polygon_pillar")); py::class_>( m, "PentagonPillarLayer") .def(py::init(), + Tarcog::ISO15099::PentagonPillar const &>(), py::arg("gap_layer"), py::arg("polygon_pillar")); py::class_>( m, "HexagonPillarLayer") .def(py::init(), + Tarcog::ISO15099::HexagonPillar const &>(), py::arg("gap_layer"), py::arg("polygon_pillar")); py::class_>( m, "ProductDataThermal") - .def(py::init(), + .def(py::init(), py::arg("conductivity"), py::arg("thickness_meters"), py::arg("flipped") = false, py::arg("opening_top") = 0, py::arg("opening_bottom") = 0, py::arg("opening_left") = 0, From 3bff950318068ba85be27da780526fc1032b0708 Mon Sep 17 00:00:00 2001 From: Simon Vidanovic Date: Thu, 13 Jun 2024 15:06:33 -0700 Subject: [PATCH 20/27] Init file and wincalcbindins.cpp updated with missing pillars data. --- pywincalc/__init__.py | 6 ++-- setup.cfg | 2 +- src/wincalcbindings.cpp | 65 ++++++++++++++++++++++++++++++++++++----- 3 files changed, 61 insertions(+), 12 deletions(-) diff --git a/pywincalc/__init__.py b/pywincalc/__init__.py index c7fd635..2d13a56 100644 --- a/pywincalc/__init__.py +++ b/pywincalc/__init__.py @@ -30,10 +30,10 @@ from wincalcbindings import AirHorizontalDirection, BSDF, BSDFBasisType, BSDFDirection, BSDFDirections, BSDFHemisphere, \ BSDFIntegrator, BoundaryConditionsCoefficientModelType, CMABestWorstUFactors, CMAResult, CMAWindow, \ CMAWindowDualVisionHorizontal, CMAWindowDualVisionVertical, CMAWindowSingleVision, CellSpacingType, PolygonType, pillar_cell_area, \ - PillarData, CylindricalPillar, SphericalPillar, RectangularPillar, PolygonalPillar, LinearBearingPillar, TruncatedConePillar, Glass, PillarMeasurement, \ - AnnulusCylinderPillar, UniversalSupportPillar, CylindricalPillarLayer, SphericalPillarLayer, RectangularPillarLayer, \ + PillarData, CylindricalPillar, SphericalPillar, RectangularPillar, TriangularPillar, PentagonPillar, HexagonPillar, LinearBearingPillar, TruncatedConePillar, Glass, PillarMeasurement, \ + AnnulusCylinderPillar, CShapedCylinderPillar, UniversalSupportPillar, CylindricalPillarLayer, SphericalPillarLayer, RectangularPillarLayer, \ TriangularPillarLayer, PentagonPillarLayer, HexagonPillarLayer, LinearBearingPillarLayer, TruncatedConePillarLayer, \ - AnnulusCylinderPillarLayer, MeasuredPillarLayer, CoatedSide, \ + AnnulusCylinderPillarLayer, CShapedCylinderPillarLayer, MeasuredPillarLayer, CoatedSide, \ ColorResult, DeflectionResults, DistributionMethodType, DualBandBSDF, EffectiveOpenness, Environment, Environments, \ FlippableSolidLayer, Gas, GasCoefficients, GasData, GlazingSystem as _GlazingSystem, GlazingSystemDimensions, \ IGUGapLayer, IntegrationRule, IntegrationRuleType, Lab, Layers, MaterialType, \ diff --git a/setup.cfg b/setup.cfg index 6b4bca4..9bffcf0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = pywincalc -version = 3.4.0 +version = 3.5.0 description = A Python library for calculating thermal and optical properties of glazing systems long_description = file: README.md long_description_content_type = text/markdown; charset=UTF-8 diff --git a/src/wincalcbindings.cpp b/src/wincalcbindings.cpp index 35705bf..0c0efba 100644 --- a/src/wincalcbindings.cpp +++ b/src/wincalcbindings.cpp @@ -263,6 +263,20 @@ PYBIND11_MODULE(wincalcbindings, m) { .def(py::init(), py::arg("gap_layer"), py::arg("rectangular_pillar")); + + py::class_>(m, "PolygonalPillar") + .def(py::init(), py::arg("height"), + py::arg("material_conductivity"), py::arg("cell_area"), py::arg("length")) + .def_readwrite("legnth", &Tarcog::ISO15099::PolygonalPillar::length); + + py::class_>(m, "TriangularPillar") + .def(py::init(), py::arg("height"), + py::arg("material_conductivity"), py::arg("cell_area"), py::arg("length")); py::class_(), py::arg("gap_layer"), py::arg("polygon_pillar")); + + py::class_>(m, "PentagonPillar") + .def(py::init(), py::arg("height"), + py::arg("material_conductivity"), py::arg("cell_area"), py::arg("length")); py::class_(), py::arg("gap_layer"), py::arg("polygon_pillar")); + + py::class_>(m, "HexagonPillar") + .def(py::init(), py::arg("height"), + py::arg("material_conductivity"), py::arg("cell_area"), py::arg("length")); py::class_(), py::arg("gap_layer"), py::arg("annulus_cylinder_pillar")); + + py::class_>( + m, "CShapedCylinderPillar") + .def(py::init(), + py::arg("height"), py::arg("material_conductivity"), + py::arg("cell_area"), py::arg("inner_radius"), + py::arg("outer_radius"), py::arg("fraction_covered")) + .def_readwrite("inner_radius", + &Tarcog::ISO15099::CShapedCylinderPillar::innerRadius) + .def_readwrite("outer_radius", + &Tarcog::ISO15099::CShapedCylinderPillar::outerRadius) + .def_readwrite("fraction_covered", + &Tarcog::ISO15099::CShapedCylinderPillar::fractionCovered); + + py::class_>( + m, "CShapedCylinderPillarLayer") + .def(py::init(), + py::arg("gap_layer"), py::arg("cshaped_cylinder_pillar")); py::class_>( m, "Glass") @@ -746,11 +797,11 @@ PYBIND11_MODULE(wincalcbindings, m) { py::class_>( m, "ProductDataThermal") - .def(py::init(), + .def(py::init(), py::arg("conductivity"), py::arg("thickness_meters"), py::arg("flipped") = false, py::arg("opening_top") = 0, py::arg("opening_bottom") = 0, py::arg("opening_left") = 0, - py::arg("opening_right") = 0) + py::arg("opening_right") = 0, py::arg("opening_front") = 0) .def_readwrite("conductivity", &wincalc::Product_Data_Thermal::conductivity) .def_readwrite("opening_top", &wincalc::Product_Data_Thermal::opening_top) @@ -760,10 +811,6 @@ PYBIND11_MODULE(wincalcbindings, m) { &wincalc::Product_Data_Thermal::opening_left) .def_readwrite("opening_right", &wincalc::Product_Data_Thermal::opening_right) - .def_readwrite("effective_openness", - &wincalc::Product_Data_Thermal::effective_openness) - .def_readwrite("effective_thickness", - &wincalc::Product_Data_Thermal::effective_thickness) .def_readwrite("youngs_modulus", &wincalc::Product_Data_Thermal::youngs_modulus) .def_readwrite("density", &wincalc::Product_Data_Thermal::density); @@ -912,7 +959,7 @@ PYBIND11_MODULE(wincalcbindings, m) { SingleLayerOptics::BSDFHemisphere const &, double, std::optional, std::optional, std::optional, std::optional, double, - bool>(), + bool, bool>(), py::arg("solar_transmittance_front"), py::arg("solar_transmittance_back"), py::arg("solar_reflectance_front"), @@ -926,7 +973,7 @@ PYBIND11_MODULE(wincalcbindings, m) { py::arg("ir_transmittance_back") = std::optional(), py::arg("emissivity_front") = std::optional(), py::arg("emissivity_back") = std::optional(), - py::arg("permeability_factor") = 0.0, py::arg("flipped") = false) + py::arg("permeability_factor") = 0.0, py::arg("flipped") = false, py::arg("user_defined_effective_values") = false) .def_readwrite("solar_transmittance_front", &wincalc::Product_Data_Dual_Band_Optical_BSDF::tf_solar) .def_readwrite("solar_transmittance_back", @@ -943,6 +990,8 @@ PYBIND11_MODULE(wincalcbindings, m) { &wincalc::Product_Data_Dual_Band_Optical_BSDF::rf_visible) .def_readwrite("visible_reflectance_back", &wincalc::Product_Data_Dual_Band_Optical_BSDF::rb_visible) + .def_readwrite("user_defined_effective_values", + &wincalc::Product_Data_Dual_Band_Optical_BSDF::user_defined_effective_values) .def("effective_thermal_values", &wincalc::Product_Data_Dual_Band_Optical_BSDF:: effective_thermal_values); From 06e0e3a4e2fc8ff4f3f68486dcda60ecb06aaee2 Mon Sep 17 00:00:00 2001 From: StephenCzarnecki Date: Mon, 17 Jun 2024 14:05:04 -0400 Subject: [PATCH 21/27] Update build_wheels.yml Removed 3.7 from python-version matrix. Official support for Python 3.7 ended 2023-06-27 --- .github/workflows/build_wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 3a21382..54f0f96 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -12,7 +12,7 @@ jobs: matrix: os: [windows-2019] arch: [x86, x64] - python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"] + python-version: [3.8, 3.9, "3.10", "3.11", "3.12"] steps: - name: Checkout repository @@ -46,7 +46,7 @@ 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", "3.12"] + python-version: [3.8, 3.9, "3.10", "3.11", "3.12"] env: SYSTEM_VERSION_COMPAT: 0 From 06fb1ca39f3c2b1f6630b958a1b45b5e91d94a8b Mon Sep 17 00:00:00 2001 From: Simon Vidanovic Date: Wed, 26 Jun 2024 14:46:52 -0700 Subject: [PATCH 22/27] Creating pillars with new arguments added to the system. Also Layers is now namespace and not class as before. --- CMakeLists-WinCalc.txt.in | 2 +- pywincalc/__init__.py | 94 ++++++---------- src/wincalcbindings.cpp | 229 ++++++++++++++++++++++---------------- 3 files changed, 167 insertions(+), 158 deletions(-) diff --git a/CMakeLists-WinCalc.txt.in b/CMakeLists-WinCalc.txt.in index 6595301..22f2726 100644 --- a/CMakeLists-WinCalc.txt.in +++ b/CMakeLists-WinCalc.txt.in @@ -4,7 +4,7 @@ include(ExternalProject) ExternalProject_Add(wincalc GIT_REPOSITORY https://github.com/LBNL-ETA/WinCalc.git - GIT_TAG "VariableAirflowCoefficients" + GIT_TAG "VacuumDec2023" UPDATE_COMMAND "" PATCH_COMMAND "" diff --git a/pywincalc/__init__.py b/pywincalc/__init__.py index 2d13a56..2e961e0 100644 --- a/pywincalc/__init__.py +++ b/pywincalc/__init__.py @@ -1,68 +1,42 @@ from pathlib import Path import deprecation -# Ideally the following long list would just be `from wincalcbindings import *`. -# But there are a few things that we'd like to provide python versions of -# while keeping the same function name for backwards compatibility. -# So the options seem to be either change the name of the C++ bindings, which is a possiblilty -# or specifically import the functions that should be re-exported and alias them in the process -# -# Currently this seems like a better approach since it allows for future cases if needed. -# Also changing library code because of an issue in the client does not seem like the correct approach in general. -# -# If there were a way to import * and then rename the individual functions that would likely work as well -# and require less maintenance. However so far the only way I have come up with is something like -# -# def prepend_underscore_to_package_item(package, name): -# f = getattr(package, name) -# setattr(package, "_"+name, f) -# delattr(package, name) -# return package -# -# wincalcbindings_pkg = importlib.import_module("wincalcbindings") -# wincalcbindings_pkg = prepend_underscore_to_package_item(wincalcbindings_pkg, "load_standard") -# wincalcbindings_pkg = prepend_underscore_to_package_item(wincalcbindings_pkg, "GlazingSystem") -# globals().update(vars(wincalcbindings_pkg)) -# -# And I don't think I understand the implications of that fully enough to trust it doesn't have -# any other side effets. e.g. __file__ changes after the globals update - -from wincalcbindings import AirHorizontalDirection, BSDF, BSDFBasisType, BSDFDirection, BSDFDirections, BSDFHemisphere, \ - BSDFIntegrator, BoundaryConditionsCoefficientModelType, CMABestWorstUFactors, CMAResult, CMAWindow, \ - CMAWindowDualVisionHorizontal, CMAWindowDualVisionVertical, CMAWindowSingleVision, CellSpacingType, PolygonType, pillar_cell_area, \ - PillarData, CylindricalPillar, SphericalPillar, RectangularPillar, TriangularPillar, PentagonPillar, HexagonPillar, LinearBearingPillar, TruncatedConePillar, Glass, PillarMeasurement, \ - AnnulusCylinderPillar, CShapedCylinderPillar, UniversalSupportPillar, CylindricalPillarLayer, SphericalPillarLayer, RectangularPillarLayer, \ - TriangularPillarLayer, PentagonPillarLayer, HexagonPillarLayer, LinearBearingPillarLayer, TruncatedConePillarLayer, \ - AnnulusCylinderPillarLayer, CShapedCylinderPillarLayer, MeasuredPillarLayer, CoatedSide, \ - ColorResult, DeflectionResults, DistributionMethodType, DualBandBSDF, EffectiveOpenness, Environment, Environments, \ - FlippableSolidLayer, Gas, GasCoefficients, GasData, GlazingSystem as _GlazingSystem, GlazingSystemDimensions, \ - IGUGapLayer, IntegrationRule, IntegrationRuleType, Lab, Layers, MaterialType, \ - OpticalMeasurementComponent, OpticalResultAbsorptance, OpticalResultFluxType, OpticalResultFluxTypeColor, \ - OpticalResultLayer, OpticalResultSide, OpticalResultSideColor, OpticalResultSide_Layer, OpticalResultTransmission, \ - OpticalResultTransmissionColor, OpticalResults, OpticalResultsColor, OpticalStandard, OpticalStandardMethod, \ - PVPowerProperty, PVWavelengthData, ParsedPerforatedGeometry, ParsedVenetianGeometry, ParsedWovenGeometry, \ - PerforatedGeometry, PredefinedGasType, ProductComposistionData, ProductData, \ - ProductDataOptical, ProductDataOpticalAndThermal, ProductDataOpticalDualBand, \ - ProductDataOpticalDualBandBSDF, ProductDataOpticalDualBandHemispheric, ProductDataOpticalNBand, \ - ProductDataOpticalPerforatedScreen, ProductDataOpticalVenetian, ProductDataOpticalWithMaterial, \ - ProductDataOpticalWovenShade, ProductDataThermal, ProductGeometry, PropertySimple, RGB, Side, \ - SpectalDataWavelengthRangeMethodType, Spectrum, SpectrumType, SquareMatrix, TarcogSystemType, \ - ThermalIRResults, ThmxBoundaryCondition, ThmxBoundaryConditionPolygon, ThmxCMABestWorstOption, ThmxCMAOptions, \ - ThmxFileContents, ThmxMaterial, ThmxMeshParameters, ThmxPolygon, ThmxPolygonPoint, ThmxRGB, ThmxResult, \ - ThmxUFactorProjectionResult, ThmxUFactorResults, Trichromatic, VenetianGeometry, WavelengthBSDFs, \ - WavelengthBoundary, WavelengthBoundaryType, WavelengthData, WavelengthSet, WavelengthSetType, WovenGeometry, \ - load_standard as _load_standard, calc_cma, calc_thermal_ir, convert_to_solid_layer, convert_to_solid_layers, \ - create_best_worst_u_factor_option, create_gas, create_perforated_screen, create_venetian_blind, create_woven_shade, \ - get_cma_window_double_vision_horizontal, get_cma_window_double_vision_vertical, get_cma_window_single_vision, \ - get_spacer_keff, nfrc_shgc_environments, nfrc_u_environments, parse_bsdf_xml_file, parse_bsdf_xml_string, \ - parse_json, parse_json_file, parse_optics_file, parse_thmx_file, parse_thmx_string, IGUVentilatedGapLayer, \ - forced_ventilation_gap - - +from wincalcbindings import ( + AirHorizontalDirection, BSDF, BSDFBasisType, BSDFDirection, BSDFDirections, BSDFHemisphere, + BSDFIntegrator, BoundaryConditionsCoefficientModelType, CMABestWorstUFactors, CMAResult, CMAWindow, + CMAWindowDualVisionHorizontal, CMAWindowDualVisionVertical, CMAWindowSingleVision, layers, CellSpacingType, PolygonType, pillar_cell_area, + PillarData, CylindricalPillar, SphericalPillar, RectangularPillar, TriangularPillar, PentagonPillar, HexagonPillar, LinearBearingPillar, TruncatedConePillar, Glass, PillarMeasurement, + AnnulusCylinderPillar, CShapedCylinderPillar, UniversalSupportPillar, CylindricalPillarLayer, SphericalPillarLayer, RectangularPillarLayer, + TriangularPillarLayer, PentagonPillarLayer, HexagonPillarLayer, LinearBearingPillarLayer, TruncatedConePillarLayer, + AnnulusCylinderPillarLayer, CShapedCylinderPillarLayer, MeasuredPillarLayer, CoatedSide, + ColorResult, DeflectionResults, DistributionMethodType, DualBandBSDF, EffectiveOpenness, Environment, Environments, + FlippableSolidLayer, Gas, GasCoefficients, GasData, GlazingSystem as _GlazingSystem, GlazingSystemDimensions, + IGUGapLayer, IntegrationRule, IntegrationRuleType, Lab, MaterialType, + OpticalMeasurementComponent, OpticalResultAbsorptance, OpticalResultFluxType, OpticalResultFluxTypeColor, + OpticalResultLayer, OpticalResultSide, OpticalResultSideColor, OpticalResultSide_Layer, OpticalResultTransmission, + OpticalResultTransmissionColor, OpticalResults, OpticalResultsColor, OpticalStandard, OpticalStandardMethod, + PVPowerProperty, PVWavelengthData, ParsedPerforatedGeometry, ParsedVenetianGeometry, ParsedWovenGeometry, + PerforatedGeometry, PredefinedGasType, ProductComposistionData, ProductData, + ProductDataOptical, ProductDataOpticalAndThermal, ProductDataOpticalDualBand, + ProductDataOpticalDualBandBSDF, ProductDataOpticalDualBandHemispheric, ProductDataOpticalNBand, + ProductDataOpticalPerforatedScreen, ProductDataOpticalVenetian, ProductDataOpticalWithMaterial, + ProductDataOpticalWovenShade, ProductDataThermal, ProductGeometry, PropertySimple, RGB, Side, + SpectalDataWavelengthRangeMethodType, Spectrum, SpectrumType, SquareMatrix, TarcogSystemType, + ThermalIRResults, ThmxBoundaryCondition, ThmxBoundaryConditionPolygon, ThmxCMABestWorstOption, ThmxCMAOptions, + ThmxFileContents, ThmxMaterial, ThmxMeshParameters, ThmxPolygon, ThmxPolygonPoint, ThmxRGB, ThmxResult, + ThmxUFactorProjectionResult, ThmxUFactorResults, Trichromatic, VenetianGeometry, WavelengthBSDFs, + WavelengthBoundary, WavelengthBoundaryType, WavelengthData, WavelengthSet, WavelengthSetType, WovenGeometry, + load_standard as _load_standard, calc_cma, calc_thermal_ir, convert_to_solid_layer, convert_to_solid_layers, + create_best_worst_u_factor_option, create_gas, create_perforated_screen, create_venetian_blind, create_woven_shade, + get_cma_window_double_vision_horizontal, get_cma_window_double_vision_vertical, get_cma_window_single_vision, + get_spacer_keff, nfrc_shgc_environments, nfrc_u_environments, parse_bsdf_xml_file, parse_bsdf_xml_string, + parse_json, parse_json_file, parse_optics_file, parse_thmx_file, parse_thmx_string, IGUVentilatedGapLayer, + forced_ventilation_gap +) @deprecation.deprecated(deprecated_in="3.0.0", removed_in="4.0.0", current_version="3.0.0", - details="Use pywincalc.Layers.gap or pywincalc.create_gas instead") + details="Use pywincalc.layers.gap or pywincalc.create_gas instead") def Gap(gas, thickness): converted_gas = None if type(gas) is list: @@ -72,7 +46,7 @@ def Gap(gas, thickness): else: # otherwise it is just a single component and therefore 100% of the mixture converted_gas = create_gas([[1.0, gas]]) - return Layers.gap(gas=converted_gas, thickness=thickness) + return layers.gap(gas=converted_gas, thickness=thickness) @deprecation.deprecated(deprecated_in="3.0.0", removed_in="4.0.0", diff --git a/src/wincalcbindings.cpp b/src/wincalcbindings.cpp index 0c0efba..1a6bf52 100644 --- a/src/wincalcbindings.cpp +++ b/src/wincalcbindings.cpp @@ -1777,101 +1777,136 @@ PYBIND11_MODULE(wincalcbindings, m) { &EffectiveLayers::EffectiveOpenness::FrontPorosity); m.def("is_closed", &EffectiveLayers::isClosed, py::arg("effective_openness")); - - py::class_(m, "Layers") - .def_static("solid", &Tarcog::ISO15099::Layers::solid, - "Factory method for creating a solid Tarcog layer", - py::arg("thickness"), py::arg("conductivity"), - py::arg("frontEmissivity") = 0.84, - py::arg("frontIRTransmittance") = 0.0, - py::arg("backEmissivity") = 0.84, - py::arg("backIRTransmittance") = 0.0) - .def_static("update_material_data", - &Tarcog::ISO15099::Layers::updateMaterialData, - "Static method for updating the material information for a " - "solid Tarcog layer.", - py::arg("layer"), - py::arg("density") = Tarcog::MaterialConstants::GLASSDENSITY, - py::arg("youngs_modulus") = - Tarcog::DeflectionConstants::YOUNGSMODULUS) - .def_static("shading", &Tarcog::ISO15099::Layers::shading, - "Factory function to create a Tarcog shading layer.", - py::arg("thickness"), py::arg("conductivity"), - py::arg("effective_openness") = - EffectiveLayers::EffectiveOpenness(0, 0, 0, 0, 0, 0), - py::arg("front_emissivity") = 0.84, - py::arg("front_transmittance") = 0.0, - py::arg("back_emissivity") = 0.84, - py::arg("back_transmittance") = 0.0) - .def_static( - "gap", - py::overload_cast(&Tarcog::ISO15099::Layers::gap), - "Factory function to create a Tarcog air gap", py::arg("thickness"), - py::arg("pressure") = 101325) - .def_static("gap", - py::overload_cast( - &Tarcog::ISO15099::Layers::gap), - "Factory function to create a Tarcog gap from a gas", - py::arg("thickness"), py::arg("gas"), - py::arg("pressure") = 101325) - .def_static( - "create_pillar", - py::overload_cast(&Tarcog::ISO15099::Layers::createPillar), - "Static function to add a cylindrical pillar to a Tarcog gap", - py::arg("pillar"), py::arg("pressure")) - .def_static( - "create_pillar", - py::overload_cast( - &Tarcog::ISO15099::Layers::createPillar), - "Static function to add a spherical pillar to a Tarcog gap", - py::arg("pillar"), py::arg("pressure")) - .def_static( - "create_pillar", - py::overload_cast(&Tarcog::ISO15099::Layers::createPillar), - "Static function to add a rectangular pillar to a Tarcog gap", - py::arg("pillar"), py::arg("pressure")) - .def_static( - "create_pillar", - py::overload_cast( - &Tarcog::ISO15099::Layers::createPillar), - "Static function to add a triangular pillar to a Tarcog gap", - py::arg("pillar"), py::arg("pressure")) - .def_static( - "create_pillar", - py::overload_cast( - &Tarcog::ISO15099::Layers::createPillar), - "Static function to add a pentagon pillar to a Tarcog gap", - py::arg("pillar"), py::arg("pressure")) - .def_static( - "create_pillar", - py::overload_cast( - &Tarcog::ISO15099::Layers::createPillar), - "Static function to add a hexagon pillar to a Tarcog gap", - py::arg("pillar"), py::arg("pressure")) - .def_static( - "create_pillar", - py::overload_cast(&Tarcog::ISO15099::Layers::createPillar), - "Static function to add a linear bearing pillar to a Tarcog gap", - py::arg("pillar"), py::arg("pressure")) - .def_static( - "create_pillar", - py::overload_cast(&Tarcog::ISO15099::Layers::createPillar), - "Static function to add a truncated cone pillar to a Tarcog gap", - py::arg("pillar"), py::arg("pressure")) - .def_static( - "create_pillar", - py::overload_cast(&Tarcog::ISO15099::Layers::createPillar), - "Static function to add a annulus cylinder pillar to a Tarcog gap", - py::arg("pillar"), py::arg("pressure")) - .def_static( - "create_pillar", - py::overload_cast( - &Tarcog::ISO15099::Layers::createPillar), - "Static function to add a measured pillar to a Tarcog gap", - py::arg("pillar")); + + py::module_ layers = m.def_submodule("layers", "Submodule for Tarcog Layers"); + + layers.def("solid", py::overload_cast(&Tarcog::ISO15099::Layers::solid), + "Factory method for creating a solid Tarcog layer with basic parameters", + py::arg("thickness"), py::arg("conductivity")); + + layers.def("solid", py::overload_cast(&Tarcog::ISO15099::Layers::solid), + "Factory method for creating a solid Tarcog layer including IR parameters", + py::arg("thickness"), py::arg("conductivity"), + py::arg("frontEmissivity") = 0.84, + py::arg("frontIRTransmittance") = 0.0, + py::arg("backEmissivity") = 0.84, + py::arg("backIRTransmittance") = 0.0); + + layers.def("update_material_data", + &Tarcog::ISO15099::Layers::updateMaterialData, + "Static method for updating the material information for a " + "solid Tarcog layer.", + py::arg("layer"), + py::arg("density") = Tarcog::MaterialConstants::GLASSDENSITY, + py::arg("youngs_modulus") = Tarcog::DeflectionConstants::YOUNGSMODULUS); + + layers.def("shading", &Tarcog::ISO15099::Layers::shading, + "Factory function to create a Tarcog shading layer.", + py::arg("thickness"), py::arg("conductivity"), + py::arg("effective_openness") = EffectiveLayers::EffectiveOpenness(0, 0, 0, 0, 0, 0), + py::arg("front_emissivity") = 0.84, + py::arg("front_transmittance") = 0.0, + py::arg("back_emissivity") = 0.84, + py::arg("back_transmittance") = 0.0); + + layers.def("sealedLayer", &Tarcog::ISO15099::Layers::sealedLayer, + "Factory function to create a Tarcog sealed layer.", + py::arg("thickness"), py::arg("conductivity"), + py::arg("front_emissivity") = 0.84, + py::arg("front_transmittance") = 0.0, + py::arg("back_emissivity") = 0.84, + py::arg("back_transmittance") = 0.0); + + layers.def("gap", py::overload_cast(&Tarcog::ISO15099::Layers::gap), + "Factory function to create a Tarcog gap with basic parameters", + py::arg("thickness")); + + layers.def("gap", py::overload_cast(&Tarcog::ISO15099::Layers::gap), + "Factory function to create a Tarcog gap with thickness and pressure", + py::arg("thickness"), py::arg("pressure") = 101325); + + layers.def("gap", py::overload_cast(&Tarcog::ISO15099::Layers::gap), + "Factory function to create a Tarcog gap with thickness and gas", + py::arg("thickness"), py::arg("gas")); + + layers.def("gap", py::overload_cast(&Tarcog::ISO15099::Layers::gap), + "Factory function to create a Tarcog gap with thickness, pressure and gas", + py::arg("thickness"), py::arg("pressure"), py::arg("gas")); + + layers.def("gap", py::overload_cast(&Tarcog::ISO15099::Layers::gap), + "Factory function to create a Tarcog gap with all parameters", + py::arg("thickness"), py::arg("pressure"), py::arg("gas"), + py::arg("accommodation1"), py::arg("accommodation2")); + + layers.def("forced_ventilation_gap", &Tarcog::ISO15099::Layers::forcedVentilationGap, + "Function to create a forced ventilation Tarcog gap", + py::arg("gap"), py::arg("forcedVentilationAirSpeed"), + py::arg("forcedVentilationAirTemperature")); + + layers.def("default_vacuum_mixture", &Tarcog::ISO15099::Layers::defaultVacuumMixture, + "Function to get the default vacuum mixture"); + + layers.def("create_pillar", py::overload_cast(&Tarcog::ISO15099::Layers::createPillar), + "Static function to add a cylindrical pillar to a Tarcog gap", + py::arg("pillar"), py::arg("pressure"), py::arg("gas") = Tarcog::ISO15099::Layers::defaultVacuumMixture(), + py::arg("accommodation1") = ConstantsData::DEFAULT_SURFACE_ACCOMMODATION_COEFFICIENT, + py::arg("accommodation2") = ConstantsData::DEFAULT_SURFACE_ACCOMMODATION_COEFFICIENT); + + layers.def("create_pillar", py::overload_cast(&Tarcog::ISO15099::Layers::createPillar), + "Static function to add a spherical pillar to a Tarcog gap", + py::arg("pillar"), py::arg("pressure"), py::arg("gas") = Tarcog::ISO15099::Layers::defaultVacuumMixture(), + py::arg("accommodation1") = ConstantsData::DEFAULT_SURFACE_ACCOMMODATION_COEFFICIENT, + py::arg("accommodation2") = ConstantsData::DEFAULT_SURFACE_ACCOMMODATION_COEFFICIENT); + + layers.def("create_pillar", py::overload_cast(&Tarcog::ISO15099::Layers::createPillar), + "Static function to add a rectangular pillar to a Tarcog gap", + py::arg("pillar"), py::arg("pressure"), py::arg("gas") = Tarcog::ISO15099::Layers::defaultVacuumMixture(), + py::arg("accommodation1") = ConstantsData::DEFAULT_SURFACE_ACCOMMODATION_COEFFICIENT, + py::arg("accommodation2") = ConstantsData::DEFAULT_SURFACE_ACCOMMODATION_COEFFICIENT); + + layers.def("create_pillar", py::overload_cast(&Tarcog::ISO15099::Layers::createPillar), + "Static function to add a triangular pillar to a Tarcog gap", + py::arg("pillar"), py::arg("pressure"), py::arg("gas") = Tarcog::ISO15099::Layers::defaultVacuumMixture(), + py::arg("accommodation1") = ConstantsData::DEFAULT_SURFACE_ACCOMMODATION_COEFFICIENT, + py::arg("accommodation2") = ConstantsData::DEFAULT_SURFACE_ACCOMMODATION_COEFFICIENT); + + layers.def("create_pillar", py::overload_cast(&Tarcog::ISO15099::Layers::createPillar), + "Static function to add a pentagon pillar to a Tarcog gap", + py::arg("pillar"), py::arg("pressure"), py::arg("gas") = Tarcog::ISO15099::Layers::defaultVacuumMixture(), + py::arg("accommodation1") = ConstantsData::DEFAULT_SURFACE_ACCOMMODATION_COEFFICIENT, + py::arg("accommodation2") = ConstantsData::DEFAULT_SURFACE_ACCOMMODATION_COEFFICIENT); + + layers.def("create_pillar", py::overload_cast(&Tarcog::ISO15099::Layers::createPillar), + "Static function to add a hexagon pillar to a Tarcog gap", + py::arg("pillar"), py::arg("pressure"), py::arg("gas") = Tarcog::ISO15099::Layers::defaultVacuumMixture(), + py::arg("accommodation1") = ConstantsData::DEFAULT_SURFACE_ACCOMMODATION_COEFFICIENT, + py::arg("accommodation2") = ConstantsData::DEFAULT_SURFACE_ACCOMMODATION_COEFFICIENT); + + layers.def("create_pillar", py::overload_cast(&Tarcog::ISO15099::Layers::createPillar), + "Static function to add a linear bearing pillar to a Tarcog gap", + py::arg("pillar"), py::arg("pressure"), py::arg("gas") = Tarcog::ISO15099::Layers::defaultVacuumMixture(), + py::arg("accommodation1") = ConstantsData::DEFAULT_SURFACE_ACCOMMODATION_COEFFICIENT, + py::arg("accommodation2") = ConstantsData::DEFAULT_SURFACE_ACCOMMODATION_COEFFICIENT); + + layers.def("create_pillar", py::overload_cast(&Tarcog::ISO15099::Layers::createPillar), + "Static function to add a truncated cone pillar to a Tarcog gap", + py::arg("pillar"), py::arg("pressure"), py::arg("gas") = Tarcog::ISO15099::Layers::defaultVacuumMixture(), + py::arg("accommodation1") = ConstantsData::DEFAULT_SURFACE_ACCOMMODATION_COEFFICIENT, + py::arg("accommodation2") = ConstantsData::DEFAULT_SURFACE_ACCOMMODATION_COEFFICIENT); + + layers.def("create_pillar", py::overload_cast(&Tarcog::ISO15099::Layers::createPillar), + "Static function to add an annulus cylinder pillar to a Tarcog gap", + py::arg("pillar"), py::arg("pressure"), py::arg("gas") = Tarcog::ISO15099::Layers::defaultVacuumMixture(), + py::arg("accommodation1") = ConstantsData::DEFAULT_SURFACE_ACCOMMODATION_COEFFICIENT, + py::arg("accommodation2") = ConstantsData::DEFAULT_SURFACE_ACCOMMODATION_COEFFICIENT); + + layers.def("create_pillar", py::overload_cast(&Tarcog::ISO15099::Layers::createPillar), + "Static function to add a C-shaped cylinder pillar to a Tarcog gap", + py::arg("pillar"), py::arg("pressure"), py::arg("gas") = Tarcog::ISO15099::Layers::defaultVacuumMixture(), + py::arg("accommodation1") = ConstantsData::DEFAULT_SURFACE_ACCOMMODATION_COEFFICIENT, + py::arg("accommodation2") = ConstantsData::DEFAULT_SURFACE_ACCOMMODATION_COEFFICIENT); + + layers.def("create_pillar", py::overload_cast(&Tarcog::ISO15099::Layers::createPillar), + "Static function to add a measured pillar to a Tarcog gap", + py::arg("pillar")); } From f448fe474e5800f6a2b0234f2018b178086b640c Mon Sep 17 00:00:00 2001 From: Simon Vidanovic Date: Thu, 27 Jun 2024 10:04:43 -0700 Subject: [PATCH 23/27] Pointing to tagged version of WC. --- CMakeLists-WinCalc.txt.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists-WinCalc.txt.in b/CMakeLists-WinCalc.txt.in index 22f2726..4172d8a 100644 --- a/CMakeLists-WinCalc.txt.in +++ b/CMakeLists-WinCalc.txt.in @@ -4,7 +4,7 @@ include(ExternalProject) ExternalProject_Add(wincalc GIT_REPOSITORY https://github.com/LBNL-ETA/WinCalc.git - GIT_TAG "VacuumDec2023" + GIT_TAG "v2.4.2" UPDATE_COMMAND "" PATCH_COMMAND "" From e37843587a243d39a3da1322c0702f0f3d9c65db Mon Sep 17 00:00:00 2001 From: Simon Vidanovic Date: Thu, 18 Jul 2024 14:59:47 -0700 Subject: [PATCH 24/27] Update change of namespace Layer to layers. --- CMakeLists-WinCalc.txt.in | 2 +- examples/deflection.py | 4 ++-- examples/gap_annulus_cylinder_pillar.py | 2 +- examples/gap_cylindrical_pillar.py | 2 +- examples/gap_linear_bearing_pillar.py | 2 +- examples/gap_measured_pillar.py | 2 +- examples/gap_pentagon_pillar.py | 2 +- examples/gap_rectangular_pillar.py | 2 +- examples/gap_spherical_pillar.py | 2 +- examples/gap_triangular_pillar.py | 2 +- examples/gap_truncated_cone_pillar.py | 2 +- examples/gaps_and_gases.py | 14 +++++++------- examples/glass_double_layer_igsdb_product.py | 2 +- examples/glass_triple_layer_local_file.py | 2 +- 14 files changed, 21 insertions(+), 21 deletions(-) diff --git a/CMakeLists-WinCalc.txt.in b/CMakeLists-WinCalc.txt.in index 4172d8a..22f2726 100644 --- a/CMakeLists-WinCalc.txt.in +++ b/CMakeLists-WinCalc.txt.in @@ -4,7 +4,7 @@ include(ExternalProject) ExternalProject_Add(wincalc GIT_REPOSITORY https://github.com/LBNL-ETA/WinCalc.git - GIT_TAG "v2.4.2" + GIT_TAG "VacuumDec2023" UPDATE_COMMAND "" PATCH_COMMAND "" diff --git a/examples/deflection.py b/examples/deflection.py index 2edd619..08d556c 100644 --- a/examples/deflection.py +++ b/examples/deflection.py @@ -16,8 +16,8 @@ # Solid layers must be separated by gap layers. This example uses two air gaps # See gaps_and_gases.py in examples for more on creating gases -gap_1 = pywincalc.Layers.gap(thickness=.0127) -gap_2 = pywincalc.Layers.gap(thickness=.02) +gap_1 = pywincalc.layers.gap(thickness=.0127) +gap_2 = pywincalc.layers.gap(thickness=.02) # Put all gaps into a list ordered from outside to inside # Note: This is only specifying gaps between solid layers diff --git a/examples/gap_annulus_cylinder_pillar.py b/examples/gap_annulus_cylinder_pillar.py index e69fec9..55f8fea 100644 --- a/examples/gap_annulus_cylinder_pillar.py +++ b/examples/gap_annulus_cylinder_pillar.py @@ -3,7 +3,7 @@ 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) +gap = pywincalc.layers.create_pillar(pillar=pillar, pressure=0.1333) gaps = [gap] diff --git a/examples/gap_cylindrical_pillar.py b/examples/gap_cylindrical_pillar.py index f612022..ef7d891 100644 --- a/examples/gap_cylindrical_pillar.py +++ b/examples/gap_cylindrical_pillar.py @@ -3,7 +3,7 @@ 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) +gap = pywincalc.layers.create_pillar(pillar=pillar, pressure=0.1333) gaps = [gap] diff --git a/examples/gap_linear_bearing_pillar.py b/examples/gap_linear_bearing_pillar.py index e0c314e..18899e2 100644 --- a/examples/gap_linear_bearing_pillar.py +++ b/examples/gap_linear_bearing_pillar.py @@ -3,7 +3,7 @@ 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) +gap = pywincalc.layers.create_pillar(pillar=pillar, pressure=0.1333) gaps = [gap] diff --git a/examples/gap_measured_pillar.py b/examples/gap_measured_pillar.py index 204fb1d..cac295b 100644 --- a/examples/gap_measured_pillar.py +++ b/examples/gap_measured_pillar.py @@ -5,7 +5,7 @@ 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) +gap = pywincalc.layers.create_pillar(pillar=measured_pillar) gaps = [gap] diff --git a/examples/gap_pentagon_pillar.py b/examples/gap_pentagon_pillar.py index 979d97b..20d2d1e 100644 --- a/examples/gap_pentagon_pillar.py +++ b/examples/gap_pentagon_pillar.py @@ -3,7 +3,7 @@ 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) +gap = pywincalc.layers.create_pillar(pillar=pillar, pressure=0.1333) gaps = [gap] diff --git a/examples/gap_rectangular_pillar.py b/examples/gap_rectangular_pillar.py index 5924e56..da5a27a 100644 --- a/examples/gap_rectangular_pillar.py +++ b/examples/gap_rectangular_pillar.py @@ -3,7 +3,7 @@ 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) +gap = pywincalc.layers.create_pillar(pillar=pillar, pressure=0.1333) gaps = [gap] diff --git a/examples/gap_spherical_pillar.py b/examples/gap_spherical_pillar.py index 97a2245..f399053 100644 --- a/examples/gap_spherical_pillar.py +++ b/examples/gap_spherical_pillar.py @@ -3,7 +3,7 @@ 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) +gap = pywincalc.layers.create_pillar(pillar=pillar, pressure=0.1333) gaps = [gap] diff --git a/examples/gap_triangular_pillar.py b/examples/gap_triangular_pillar.py index 0922eb8..6583d02 100644 --- a/examples/gap_triangular_pillar.py +++ b/examples/gap_triangular_pillar.py @@ -3,7 +3,7 @@ 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) +gap = pywincalc.layers.create_pillar(pillar=pillar, pressure=0.1333) gaps = [gap] diff --git a/examples/gap_truncated_cone_pillar.py b/examples/gap_truncated_cone_pillar.py index 8c7dc56..edffda6 100644 --- a/examples/gap_truncated_cone_pillar.py +++ b/examples/gap_truncated_cone_pillar.py @@ -3,7 +3,7 @@ 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) +gap = pywincalc.layers.create_pillar(pillar=pillar, pressure=0.1333) gaps = [gap] diff --git a/examples/gaps_and_gases.py b/examples/gaps_and_gases.py index ee2934e..261811d 100644 --- a/examples/gaps_and_gases.py +++ b/examples/gaps_and_gases.py @@ -4,7 +4,7 @@ # The default way to create a gap. Creates a gap containing air with a given thickness # at a default pressure of 101325 -gap_1 = pywincalc.Layers.gap(thickness=.0127) # .0127 is gap thickness in meters +gap_1 = pywincalc.layers.gap(thickness=.0127) # .0127 is gap thickness in meters # Currently there are four pre-defined gases available: Air, Argon, Krypton, and Xenon # A gas object is created from a list of pairs where the first item is the percentage @@ -14,13 +14,13 @@ gas_2 = pywincalc.create_gas([[1.0, pywincalc.PredefinedGasType.ARGON]]) # Create a gap from this gas by passing it to the gap function. # In this case the gap is given a different pressure as well -gap_2 = pywincalc.Layers.gap(thickness=.0127, gas=gas_2, pressure=101300) +gap_2 = pywincalc.layers.gap(thickness=.0127, gas=gas_2, pressure=101300) # Gaps may also contain a mixture of gases. # Here is a gas that is 70% Krypton and 30% Xenon gas_3 = pywincalc.create_gas([[0.7, pywincalc.PredefinedGasType.KRYPTON], [0.3, pywincalc.PredefinedGasType.XENON]]) # Create a gap from this gas the same as above. Here the pressure is omitted so it uses the default 101325 -gap_3 = pywincalc.Layers.gap(thickness=.0127, gas=gas_3) +gap_3 = pywincalc.layers.gap(thickness=.0127, gas=gas_3) # Custom gases can be created from properties. The following creates sulfur hexafluoride as distributed with WINDOW 7 sulfur_hexafluoride_conductivity_a = 0.013 @@ -53,7 +53,7 @@ # Once a custom gas is created it can either be used by itself gas_4 = pywincalc.create_gas([[1.0, sulfur_hexafluoride]]) -gap_4 = pywincalc.Layers.gap(thickness=.003, gas=gas_4) # 3mm thick gap filled with sulfur hexafluoride +gap_4 = pywincalc.layers.gap(thickness=.003, gas=gas_4) # 3mm thick gap filled with sulfur hexafluoride # Or it can be mixed with either other predefined or custom gases # The following creates a gas that is 80% sulfur hexafluoride, 15% Argon, and 5% Air @@ -62,7 +62,7 @@ [0.15, pywincalc.PredefinedGasType.ARGON], [0.05, pywincalc.PredefinedGasType.AIR]]) # And uses it it a 2.5mm thick gap at pressure = 101500 -gap_5 = pywincalc.Layers.gap(thickness=.0025, gas=gas_5, pressure=101500) +gap_5 = pywincalc.layers.gap(thickness=.0025, gas=gas_5, pressure=101500) # Vacuum gaps are supported by setting a low pressure in the gap and # (optionally) adding support pillars. Currently only circular pillars @@ -71,11 +71,11 @@ 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) +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. -gap_7 = pywincalc.Layers.gap(thickness=.0127) # .0127 is gap thickness in meters +gap_7 = pywincalc.layers.gap(thickness=.0127) # .0127 is gap thickness in meters gap_7 = pywincalc.forced_ventilation_gap(gap=gap_7, forced_ventilation_air_speed=0.3, forced_ventilation_air_temperature=295) gaps = [gap_1, gap_2, gap_3, gap_4, gap_5, gap_6, gap_7] diff --git a/examples/glass_double_layer_igsdb_product.py b/examples/glass_double_layer_igsdb_product.py index 24c84e4..a1782d1 100644 --- a/examples/glass_double_layer_igsdb_product.py +++ b/examples/glass_double_layer_igsdb_product.py @@ -4,7 +4,7 @@ # Define the gap between the shade and the glazing. In this case use a default air gap # that is 12.7mm thick. For more on creating gases and gaps see the gaps_and_gases.py example -gap_1 = pywincalc.Layers.gap(thickness=.0127) +gap_1 = pywincalc.layers.gap(thickness=.0127) # Download some product data from the IGSDB. This example gets a generic single clear 3mm glazing (NFRC 102), # and a generic single clear 6mm glazing (NFRC 103) diff --git a/examples/glass_triple_layer_local_file.py b/examples/glass_triple_layer_local_file.py index 947b7b9..f459220 100644 --- a/examples/glass_triple_layer_local_file.py +++ b/examples/glass_triple_layer_local_file.py @@ -16,7 +16,7 @@ # Define the gap between the layers. In this case use a default air gap # that is 12.7mm thick. For more on creating gases and gaps see the gaps_and_gases.py example -gap = pywincalc.Layers.gap(thickness=.0127) +gap = pywincalc.layers.gap(thickness=.0127) # Put all gaps into a list ordered from outside to inside # Note: This is only specifying gaps between solid layers From 18cccd85b7b0fde5f851d1302d57a4afe832a44d Mon Sep 17 00:00:00 2001 From: Simon Vidanovic Date: Fri, 19 Jul 2024 09:46:18 -0700 Subject: [PATCH 25/27] layers is reverted back to Layers (capital L) and IGSDB numbers were updated for examples to be able to run. (One perforated example need new ID in order to work and it is not available in the database.) --- examples/bsdf_shade_igsdb_product.py | 2 +- examples/deflection.py | 4 +- examples/gap_annulus_cylinder_pillar.py | 2 +- examples/gap_cylindrical_pillar.py | 2 +- examples/gap_linear_bearing_pillar.py | 2 +- examples/gap_measured_pillar.py | 2 +- examples/gap_pentagon_pillar.py | 2 +- examples/gap_rectangular_pillar.py | 2 +- examples/gap_spherical_pillar.py | 2 +- examples/gap_triangular_pillar.py | 2 +- examples/gap_truncated_cone_pillar.py | 2 +- examples/gaps_and_gases.py | 14 ++--- examples/glass_double_layer_igsdb_product.py | 2 +- examples/glass_triple_layer_local_file.py | 2 +- examples/perforated_screen_igsdb_product.py | 56 ++++++++++--------- ...en_user_defined_geometry_igsdb_material.py | 2 +- examples/venetian_blind_igsdb_product.py | 2 +- ...nd_user_defined_geometry_igsdb_material.py | 2 +- ...an_user_defined_geometry_igsdb_material.py | 2 +- ...de_user_defined_geometry_igsdb_material.py | 2 +- pywincalc/__init__.py | 4 +- src/wincalcbindings.cpp | 2 +- 22 files changed, 58 insertions(+), 56 deletions(-) diff --git a/examples/bsdf_shade_igsdb_product.py b/examples/bsdf_shade_igsdb_product.py index 4cf3f5a..47e100d 100644 --- a/examples/bsdf_shade_igsdb_product.py +++ b/examples/bsdf_shade_igsdb_product.py @@ -4,7 +4,7 @@ bsdf_hemisphere = pywincalc.BSDFHemisphere.create(pywincalc.BSDFBasisType.FULL) -bsdf_igsdb_id = 14710 +bsdf_igsdb_id = 17200 bsdf_igsdb_response = requests.get(url_single_product_datafile.format(id=bsdf_igsdb_id), headers=headers) diff --git a/examples/deflection.py b/examples/deflection.py index 08d556c..2edd619 100644 --- a/examples/deflection.py +++ b/examples/deflection.py @@ -16,8 +16,8 @@ # Solid layers must be separated by gap layers. This example uses two air gaps # See gaps_and_gases.py in examples for more on creating gases -gap_1 = pywincalc.layers.gap(thickness=.0127) -gap_2 = pywincalc.layers.gap(thickness=.02) +gap_1 = pywincalc.Layers.gap(thickness=.0127) +gap_2 = pywincalc.Layers.gap(thickness=.02) # Put all gaps into a list ordered from outside to inside # Note: This is only specifying gaps between solid layers diff --git a/examples/gap_annulus_cylinder_pillar.py b/examples/gap_annulus_cylinder_pillar.py index 55f8fea..e69fec9 100644 --- a/examples/gap_annulus_cylinder_pillar.py +++ b/examples/gap_annulus_cylinder_pillar.py @@ -3,7 +3,7 @@ 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) +gap = pywincalc.Layers.create_pillar(pillar=pillar, pressure=0.1333) gaps = [gap] diff --git a/examples/gap_cylindrical_pillar.py b/examples/gap_cylindrical_pillar.py index ef7d891..f612022 100644 --- a/examples/gap_cylindrical_pillar.py +++ b/examples/gap_cylindrical_pillar.py @@ -3,7 +3,7 @@ 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) +gap = pywincalc.Layers.create_pillar(pillar=pillar, pressure=0.1333) gaps = [gap] diff --git a/examples/gap_linear_bearing_pillar.py b/examples/gap_linear_bearing_pillar.py index 18899e2..e0c314e 100644 --- a/examples/gap_linear_bearing_pillar.py +++ b/examples/gap_linear_bearing_pillar.py @@ -3,7 +3,7 @@ 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) +gap = pywincalc.Layers.create_pillar(pillar=pillar, pressure=0.1333) gaps = [gap] diff --git a/examples/gap_measured_pillar.py b/examples/gap_measured_pillar.py index cac295b..204fb1d 100644 --- a/examples/gap_measured_pillar.py +++ b/examples/gap_measured_pillar.py @@ -5,7 +5,7 @@ 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) +gap = pywincalc.Layers.create_pillar(pillar=measured_pillar) gaps = [gap] diff --git a/examples/gap_pentagon_pillar.py b/examples/gap_pentagon_pillar.py index 20d2d1e..979d97b 100644 --- a/examples/gap_pentagon_pillar.py +++ b/examples/gap_pentagon_pillar.py @@ -3,7 +3,7 @@ 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) +gap = pywincalc.Layers.create_pillar(pillar=pillar, pressure=0.1333) gaps = [gap] diff --git a/examples/gap_rectangular_pillar.py b/examples/gap_rectangular_pillar.py index da5a27a..5924e56 100644 --- a/examples/gap_rectangular_pillar.py +++ b/examples/gap_rectangular_pillar.py @@ -3,7 +3,7 @@ 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) +gap = pywincalc.Layers.create_pillar(pillar=pillar, pressure=0.1333) gaps = [gap] diff --git a/examples/gap_spherical_pillar.py b/examples/gap_spherical_pillar.py index f399053..97a2245 100644 --- a/examples/gap_spherical_pillar.py +++ b/examples/gap_spherical_pillar.py @@ -3,7 +3,7 @@ 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) +gap = pywincalc.Layers.create_pillar(pillar=pillar, pressure=0.1333) gaps = [gap] diff --git a/examples/gap_triangular_pillar.py b/examples/gap_triangular_pillar.py index 6583d02..0922eb8 100644 --- a/examples/gap_triangular_pillar.py +++ b/examples/gap_triangular_pillar.py @@ -3,7 +3,7 @@ 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) +gap = pywincalc.Layers.create_pillar(pillar=pillar, pressure=0.1333) gaps = [gap] diff --git a/examples/gap_truncated_cone_pillar.py b/examples/gap_truncated_cone_pillar.py index edffda6..8c7dc56 100644 --- a/examples/gap_truncated_cone_pillar.py +++ b/examples/gap_truncated_cone_pillar.py @@ -3,7 +3,7 @@ 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) +gap = pywincalc.Layers.create_pillar(pillar=pillar, pressure=0.1333) gaps = [gap] diff --git a/examples/gaps_and_gases.py b/examples/gaps_and_gases.py index 261811d..ee2934e 100644 --- a/examples/gaps_and_gases.py +++ b/examples/gaps_and_gases.py @@ -4,7 +4,7 @@ # The default way to create a gap. Creates a gap containing air with a given thickness # at a default pressure of 101325 -gap_1 = pywincalc.layers.gap(thickness=.0127) # .0127 is gap thickness in meters +gap_1 = pywincalc.Layers.gap(thickness=.0127) # .0127 is gap thickness in meters # Currently there are four pre-defined gases available: Air, Argon, Krypton, and Xenon # A gas object is created from a list of pairs where the first item is the percentage @@ -14,13 +14,13 @@ gas_2 = pywincalc.create_gas([[1.0, pywincalc.PredefinedGasType.ARGON]]) # Create a gap from this gas by passing it to the gap function. # In this case the gap is given a different pressure as well -gap_2 = pywincalc.layers.gap(thickness=.0127, gas=gas_2, pressure=101300) +gap_2 = pywincalc.Layers.gap(thickness=.0127, gas=gas_2, pressure=101300) # Gaps may also contain a mixture of gases. # Here is a gas that is 70% Krypton and 30% Xenon gas_3 = pywincalc.create_gas([[0.7, pywincalc.PredefinedGasType.KRYPTON], [0.3, pywincalc.PredefinedGasType.XENON]]) # Create a gap from this gas the same as above. Here the pressure is omitted so it uses the default 101325 -gap_3 = pywincalc.layers.gap(thickness=.0127, gas=gas_3) +gap_3 = pywincalc.Layers.gap(thickness=.0127, gas=gas_3) # Custom gases can be created from properties. The following creates sulfur hexafluoride as distributed with WINDOW 7 sulfur_hexafluoride_conductivity_a = 0.013 @@ -53,7 +53,7 @@ # Once a custom gas is created it can either be used by itself gas_4 = pywincalc.create_gas([[1.0, sulfur_hexafluoride]]) -gap_4 = pywincalc.layers.gap(thickness=.003, gas=gas_4) # 3mm thick gap filled with sulfur hexafluoride +gap_4 = pywincalc.Layers.gap(thickness=.003, gas=gas_4) # 3mm thick gap filled with sulfur hexafluoride # Or it can be mixed with either other predefined or custom gases # The following creates a gas that is 80% sulfur hexafluoride, 15% Argon, and 5% Air @@ -62,7 +62,7 @@ [0.15, pywincalc.PredefinedGasType.ARGON], [0.05, pywincalc.PredefinedGasType.AIR]]) # And uses it it a 2.5mm thick gap at pressure = 101500 -gap_5 = pywincalc.layers.gap(thickness=.0025, gas=gas_5, pressure=101500) +gap_5 = pywincalc.Layers.gap(thickness=.0025, gas=gas_5, pressure=101500) # Vacuum gaps are supported by setting a low pressure in the gap and # (optionally) adding support pillars. Currently only circular pillars @@ -71,11 +71,11 @@ 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) +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. -gap_7 = pywincalc.layers.gap(thickness=.0127) # .0127 is gap thickness in meters +gap_7 = pywincalc.Layers.gap(thickness=.0127) # .0127 is gap thickness in meters gap_7 = pywincalc.forced_ventilation_gap(gap=gap_7, forced_ventilation_air_speed=0.3, forced_ventilation_air_temperature=295) gaps = [gap_1, gap_2, gap_3, gap_4, gap_5, gap_6, gap_7] diff --git a/examples/glass_double_layer_igsdb_product.py b/examples/glass_double_layer_igsdb_product.py index a1782d1..24c84e4 100644 --- a/examples/glass_double_layer_igsdb_product.py +++ b/examples/glass_double_layer_igsdb_product.py @@ -4,7 +4,7 @@ # Define the gap between the shade and the glazing. In this case use a default air gap # that is 12.7mm thick. For more on creating gases and gaps see the gaps_and_gases.py example -gap_1 = pywincalc.layers.gap(thickness=.0127) +gap_1 = pywincalc.Layers.gap(thickness=.0127) # Download some product data from the IGSDB. This example gets a generic single clear 3mm glazing (NFRC 102), # and a generic single clear 6mm glazing (NFRC 103) diff --git a/examples/glass_triple_layer_local_file.py b/examples/glass_triple_layer_local_file.py index f459220..947b7b9 100644 --- a/examples/glass_triple_layer_local_file.py +++ b/examples/glass_triple_layer_local_file.py @@ -16,7 +16,7 @@ # Define the gap between the layers. In this case use a default air gap # that is 12.7mm thick. For more on creating gases and gaps see the gaps_and_gases.py example -gap = pywincalc.layers.gap(thickness=.0127) +gap = pywincalc.Layers.gap(thickness=.0127) # Put all gaps into a list ordered from outside to inside # Note: This is only specifying gaps between solid layers diff --git a/examples/perforated_screen_igsdb_product.py b/examples/perforated_screen_igsdb_product.py index 7bade27..665b247 100644 --- a/examples/perforated_screen_igsdb_product.py +++ b/examples/perforated_screen_igsdb_product.py @@ -1,30 +1,32 @@ -import pywincalc -import requests -from igsdb_interaction import url_single_product, headers +### IGSDB does not cuurently have perforated screens. The below code will work when a valid perforated screen IGSDB ID is available. -# Since these products use at least one layer that requires a BSDF model a BSDF hemisphere must be -# used. In this example a standard quarter basis is used. Other predefined basis include Small, Half, and Full -# Custom BSDF basis is not yet supported in Python. Please contact us if your work requires calculations with -# a custom BSDF basis. -bsdf_hemisphere = pywincalc.BSDFHemisphere.create(pywincalc.BSDFBasisType.QUARTER) - -# Download a perforated screen from igsdb.lbl.gov -thermeshade_perforated_screen_igsdb_id = 14990 - -thermeshade_perforated_screen_igsdb_response = requests.get( - url_single_product.format(id=thermeshade_perforated_screen_igsdb_id), headers=headers) - -thermeshade_perforated_screen = pywincalc.parse_json( - thermeshade_perforated_screen_igsdb_response.content) - -# Create a glazing system. This only shows an example of getting one result from a glazing system -# created using default environmental conditions. +# import pywincalc +# import requests +# from igsdb_interaction import url_single_product, headers # -# For more possible results see optical_results_NFRC.py +# # Since these products use at least one layer that requires a BSDF model a BSDF hemisphere must be +# # used. In this example a standard quarter basis is used. Other predefined basis include Small, Half, and Full +# # Custom BSDF basis is not yet supported in Python. Please contact us if your work requires calculations with +# # a custom BSDF basis. +# bsdf_hemisphere = pywincalc.BSDFHemisphere.create(pywincalc.BSDFBasisType.QUARTER) # -# For more on environmental conditions see environmental_conditions_user_defined.py -glazing_system = pywincalc.GlazingSystem(solid_layers=[thermeshade_perforated_screen], - bsdf_hemisphere=bsdf_hemisphere) - -u_value = glazing_system.u() -print("U-value for a perforated screen downloaded from igsdb.lbl.glv: {v}".format(v=u_value)) +# # Download a perforated screen from igsdb.lbl.gov +# thermeshade_perforated_screen_igsdb_id = 14990 +# +# thermeshade_perforated_screen_igsdb_response = requests.get( +# url_single_product.format(id=thermeshade_perforated_screen_igsdb_id), headers=headers) +# +# thermeshade_perforated_screen = pywincalc.parse_json( +# thermeshade_perforated_screen_igsdb_response.content) +# +# # 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=[thermeshade_perforated_screen], +# bsdf_hemisphere=bsdf_hemisphere) +# +# u_value = glazing_system.u() +# print("U-value for a perforated screen downloaded from igsdb.lbl.glv: {v}".format(v=u_value)) diff --git a/examples/perforated_screen_user_defined_geometry_igsdb_material.py b/examples/perforated_screen_user_defined_geometry_igsdb_material.py index fe978cf..9ffdf0f 100644 --- a/examples/perforated_screen_user_defined_geometry_igsdb_material.py +++ b/examples/perforated_screen_user_defined_geometry_igsdb_material.py @@ -6,7 +6,7 @@ # igsdb.lbl.gov and user-defined perforated geometry. # This is the same material used in the venetian example but could be any material in the igsdb -shade_material_igsdb_id = 14477 +shade_material_igsdb_id = 17935 shade_material_igsdb_response = requests.get( url_single_product.format(id=shade_material_igsdb_id), headers=headers) diff --git a/examples/venetian_blind_igsdb_product.py b/examples/venetian_blind_igsdb_product.py index 04da8f0..4b722cf 100644 --- a/examples/venetian_blind_igsdb_product.py +++ b/examples/venetian_blind_igsdb_product.py @@ -9,7 +9,7 @@ bsdf_hemisphere = pywincalc.BSDFHemisphere.create(pywincalc.BSDFBasisType.QUARTER) # Download a venetian blind from the igsdb.lbl.gov. -slim_white_pella_venetian_blind_igsdb_id = 14684 +slim_white_pella_venetian_blind_igsdb_id = 17186 slim_white_pella_venetian_blind_igsdb_response = requests.get( url_single_product.format(id=slim_white_pella_venetian_blind_igsdb_id), headers=headers) diff --git a/examples/venetian_blind_user_defined_geometry_igsdb_material.py b/examples/venetian_blind_user_defined_geometry_igsdb_material.py index b420d00..6b15b6b 100644 --- a/examples/venetian_blind_user_defined_geometry_igsdb_material.py +++ b/examples/venetian_blind_user_defined_geometry_igsdb_material.py @@ -7,7 +7,7 @@ # This is the same material used in the venetian in the igsdb_exterior_shade_on_cleara_glass.py example # but could be any material in the igsdb -shade_material_igsdb_id = 14477 +shade_material_igsdb_id = 17935 shade_material_igsdb_response = requests.get(url_single_product.format(id=shade_material_igsdb_id), headers=headers) diff --git a/examples/vertical_venetian_user_defined_geometry_igsdb_material.py b/examples/vertical_venetian_user_defined_geometry_igsdb_material.py index 2d20b7f..068d41c 100644 --- a/examples/vertical_venetian_user_defined_geometry_igsdb_material.py +++ b/examples/vertical_venetian_user_defined_geometry_igsdb_material.py @@ -7,7 +7,7 @@ # This is the same material used in the venetian in the igsdb_exterior_shade_on_cleara_glass.py example # but could be any material in the igsdb -shade_material_igsdb_id = 14477 +shade_material_igsdb_id = 17935 shade_material_igsdb_response = requests.get(url_single_product.format(id=shade_material_igsdb_id), headers=headers) diff --git a/examples/woven_shade_user_defined_geometry_igsdb_material.py b/examples/woven_shade_user_defined_geometry_igsdb_material.py index 36dc466..4f33a71 100644 --- a/examples/woven_shade_user_defined_geometry_igsdb_material.py +++ b/examples/woven_shade_user_defined_geometry_igsdb_material.py @@ -3,7 +3,7 @@ from igsdb_interaction import url_single_product, headers # This is the same material used in the venetian example but could be any material in the igsdb -shade_material_igsdb_id = 14477 +shade_material_igsdb_id = 17935 shade_material_igsdb_response = requests.get( url_single_product.format(id=shade_material_igsdb_id), headers=headers) diff --git a/pywincalc/__init__.py b/pywincalc/__init__.py index 2e961e0..8167fba 100644 --- a/pywincalc/__init__.py +++ b/pywincalc/__init__.py @@ -4,7 +4,7 @@ from wincalcbindings import ( AirHorizontalDirection, BSDF, BSDFBasisType, BSDFDirection, BSDFDirections, BSDFHemisphere, BSDFIntegrator, BoundaryConditionsCoefficientModelType, CMABestWorstUFactors, CMAResult, CMAWindow, - CMAWindowDualVisionHorizontal, CMAWindowDualVisionVertical, CMAWindowSingleVision, layers, CellSpacingType, PolygonType, pillar_cell_area, + CMAWindowDualVisionHorizontal, CMAWindowDualVisionVertical, CMAWindowSingleVision, Layers, CellSpacingType, PolygonType, pillar_cell_area, PillarData, CylindricalPillar, SphericalPillar, RectangularPillar, TriangularPillar, PentagonPillar, HexagonPillar, LinearBearingPillar, TruncatedConePillar, Glass, PillarMeasurement, AnnulusCylinderPillar, CShapedCylinderPillar, UniversalSupportPillar, CylindricalPillarLayer, SphericalPillarLayer, RectangularPillarLayer, TriangularPillarLayer, PentagonPillarLayer, HexagonPillarLayer, LinearBearingPillarLayer, TruncatedConePillarLayer, @@ -36,7 +36,7 @@ @deprecation.deprecated(deprecated_in="3.0.0", removed_in="4.0.0", current_version="3.0.0", - details="Use pywincalc.layers.gap or pywincalc.create_gas instead") + details="Use pywincalc.Layers.gap or pywincalc.create_gas instead") def Gap(gas, thickness): converted_gas = None if type(gas) is list: diff --git a/src/wincalcbindings.cpp b/src/wincalcbindings.cpp index 1a6bf52..9580bb6 100644 --- a/src/wincalcbindings.cpp +++ b/src/wincalcbindings.cpp @@ -1778,7 +1778,7 @@ PYBIND11_MODULE(wincalcbindings, m) { m.def("is_closed", &EffectiveLayers::isClosed, py::arg("effective_openness")); - py::module_ layers = m.def_submodule("layers", "Submodule for Tarcog Layers"); + py::module_ layers = m.def_submodule("Layers", "Submodule for Tarcog Layers"); layers.def("solid", py::overload_cast(&Tarcog::ISO15099::Layers::solid), "Factory method for creating a solid Tarcog layer with basic parameters", From 45dc03db9fe706e9b8998a138f525dae9b152d55 Mon Sep 17 00:00:00 2001 From: StephenCzarnecki Date: Tue, 23 Jul 2024 23:51:37 -0400 Subject: [PATCH 26/27] Update CMakeLists-WinCalc.txt.in Updating target version of wincalc to 2.4.3 --- CMakeLists-WinCalc.txt.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists-WinCalc.txt.in b/CMakeLists-WinCalc.txt.in index 22f2726..aec7b81 100644 --- a/CMakeLists-WinCalc.txt.in +++ b/CMakeLists-WinCalc.txt.in @@ -4,7 +4,7 @@ include(ExternalProject) ExternalProject_Add(wincalc GIT_REPOSITORY https://github.com/LBNL-ETA/WinCalc.git - GIT_TAG "VacuumDec2023" + GIT_TAG "v2.4.3" UPDATE_COMMAND "" PATCH_COMMAND "" From c6cb86026e5601f8d1b335563667144c35aa98c6 Mon Sep 17 00:00:00 2001 From: StephenCzarnecki Date: Wed, 24 Jul 2024 15:17:48 -0400 Subject: [PATCH 27/27] Update build_wheels.yml Removed building python 3.7 wheels for Ubuntu. Support for 3.7 ended some time ago. --- .github/workflows/build_wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 54f0f96..98dd770 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -85,7 +85,7 @@ jobs: - name: Build manylinux Python wheels uses: RalfG/python-wheels-manylinux-build@v0.7.1-manylinux2014_x86_64 with: - python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312' + python-versions: 'cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312' build-requirements: 'setuptools' - name: upload wheels