Skip to content

Commit

Permalink
new tests for addPiles
Browse files Browse the repository at this point in the history
  • Loading branch information
cdeline committed Nov 28, 2023
1 parent 4ae5f3a commit 346aec1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions bifacial_radiance/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2302,6 +2302,7 @@ def printModules(self):
def addPiles(self, spacingPiles=6, pile_lenx=0.2, pile_leny=0.2, pile_height=None):
'''
Function to add support piles at determined intervals throughout the rows.
TODO: enable functionality or check for scenes using 'clearance_height' ?
Parameters
----------
Expand Down
17 changes: 16 additions & 1 deletion tests/test_bifacial_radiance.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,4 +579,19 @@ def test_customTrackerAngles():
trackerdict = demo.set1axis(azimuth=90, useMeasuredTrackerAngle=True)
assert trackerdict[-20]['count'] == 3440
trackerdict = demo.set1axis(azimuth=90, useMeasuredTrackerAngle=False)
assert trackerdict[-20]['count'] == 37
assert trackerdict[-20]['count'] == 37

def test_addPiles():
# Set up initial test with demo.addPiles, but switch to scene.addPiles
# when it gets refactored
name = "_addPiles"
demo = bifacial_radiance.RadianceObj(name)
module = demo.makeModule(name='test', x=1.59, y=0.95)
sceneDict = {'tilt':10,'pitch':1.5,'hub_height':.5,
'azimuth':180, 'nMods': 10, 'nRows': 3}
scene = demo.makeScene(module=module, sceneDict=sceneDict)
demo.addPiles()
assert demo.radfiles[1][-23:] == 'Piles_6_0.2_0.2_0.5.rad'
with open(demo.radfiles[1], 'r') as f:
assert f.read() == '!xform -rx 0 -a 3.0 -t 6 0 0 -a 3 ' + \
'-t 0 1.5 0 -i 1 -t -6.4 -1.5 0 -rz 0 -t 0 0 0 objects\\post.rad'

0 comments on commit 346aec1

Please sign in to comment.