Skip to content

Commit

Permalink
more pytests
Browse files Browse the repository at this point in the history
  • Loading branch information
cdeline committed Sep 20, 2024
1 parent 711323b commit c502f19
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/test_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ def test_moduleFrameandOmegas():
# test cellModulescan (sensorsy = numellsy)
module.glass=True
module.addCellModule(**cellParams)
# re-load the module to make sure all of the params are the same
module2 = bifacial_radiance.ModuleObj(name='test-module')
assert module.text == module2.text
scene = demo.makeScene(module, sceneDict)
analysis = bifacial_radiance.AnalysisObj() # return an analysis object including the scan dimensions for back irradiance
frontscan, backscan = analysis.moduleAnalysis(scene, sensorsy=10) # Gives us the dictionaries with coordinates
Expand All @@ -157,10 +160,9 @@ def test_GlassModule():
module = demo.makeModule(name='test-module', rewriteModulefile=True, glass=True, x=1, y=2)
assert module.text == '! genbox black test-module 1 2 0.001 | xform -t -0.5 -1.0 0 -a 1 -t 0 2.0' +\
' 0\r\n! genbox stock_glass test-module_Glass 1.01 2.01 0.01 | xform -t -0.505 -1.005 -0.005 -a 1 -t 0 2.0 0'
# custom glass=True with .001 absorber and 0.005 glass
module = demo.makeModule(name='test-module', glass=True, x=1, y=2, z=0.005)
# custom glass=True with .001 absorber and 0.005 glass and 0.02 glass edge
module = demo.makeModule(name='test-module', glass=True, x=1, y=2, z=0.005, glassEdge=0.02)
assert module.text == '! genbox black test-module 1 2 0.001 | xform -t -0.5 -1.0 0 -a 1 -t 0 2.0' +\
' 0\r\n! genbox stock_glass test-module_Glass 1.01 2.01 0.005 | xform -t -0.505 -1.005 -0.0025 -a 1 -t 0 2.0 0'

' 0\r\n! genbox stock_glass test-module_Glass 1.02 2.02 0.005 | xform -t -0.51 -1.01 -0.0025 -a 1 -t 0 2.0 0'


0 comments on commit c502f19

Please sign in to comment.