diff --git a/bifacial_radiance/main.py b/bifacial_radiance/main.py index dd922c34..7d40d4a0 100644 --- a/bifacial_radiance/main.py +++ b/bifacial_radiance/main.py @@ -2747,8 +2747,8 @@ def __init__(self, materialOrAlbedo=None, material_file=None, silent=False): f'{self._nonzeromean(self.ReflAvg):0.3f} avg\n' f'{self.ReflAvg[self.ReflAvg != 0].__len__()} nonzero albedo values.') except IndexError as e: - print('albedo.shape should be 3 column (N x 3)') - raise e + raise Exception('albedo.shape needs to be 3 column (N x 3)') + def printGroundMaterials(self, materialString=None): """ @@ -4151,11 +4151,12 @@ def _checkSensors(sensors): else: print ("Module's z not set on sceneDict internal dictionary. Setting to default") modulez = 0.02 - - if frontsurfaceoffset is None: - frontsurfaceoffset = 0.001 - if backsurfaceoffset is None: - backsurfaceoffset = 0.001 + + # cdeline 20241014 remove this check - extraneous + #if frontsurfaceoffset is None: + # frontsurfaceoffset = 0.001 + #if backsurfaceoffset is None: + # backsurfaceoffset = 0.001 # The Sensor routine below needs a "hub-height", not a clearance height. # The below complicated check checks to see if height (deprecated) is passed, diff --git a/tests/ini_cell_level_module.ini b/tests/ini_cell_level_module.ini index b2265a14..0fa63872 100644 --- a/tests/ini_cell_level_module.ini +++ b/tests/ini_cell_level_module.ini @@ -24,8 +24,8 @@ clearance_height = 0.8 hub_height = 0.9 [timeControlParamsDict] -starttime: 06_21_11_00 -endtime: 06_21_12_00 +starttime: 06_21_11 +endtime: 06_21_12 [moduleParamsDict] numpanels = 2 diff --git a/tests/ini_soltec.ini b/tests/ini_soltec.ini index 63cd00ea..f66cd719 100644 --- a/tests/ini_soltec.ini +++ b/tests/ini_soltec.ini @@ -16,8 +16,8 @@ latitude: 37.5 longitude: -77.6 [timeControlParamsDict] -starttime: 06_21_12_00 -endtime: 06_21_12_00 +starttime: 06_21_12 +endtime: 06_21_12 [sceneParamsDict] gcrorpitch: pitch diff --git a/tests/test_bifacial_radiance.py b/tests/test_bifacial_radiance.py index cfa6e60f..842fe447 100644 --- a/tests/test_bifacial_radiance.py +++ b/tests/test_bifacial_radiance.py @@ -605,4 +605,5 @@ def test_raypath(): os.environ['RAYPATH'] = raypath0 + \ No newline at end of file diff --git a/tests/test_groundobj.py b/tests/test_groundobj.py index 88aa5905..99445876 100644 --- a/tests/test_groundobj.py +++ b/tests/test_groundobj.py @@ -63,6 +63,8 @@ def test_RGB_timeseries(): albedo_bad = np.array([[0.2, 0.3, 0.4, 0.5], [0.12, 0.13, 0.26, 0.5]]) # invalid ground = pytest.warns(UserWarning, bifacial_radiance.GroundObj, albedo_bad) np.testing.assert_allclose(_groundtest(ground), testvals_const) + with pytest.raises(Exception): + temp = bifacial_radiance.GroundObj(np.array([[.1,.2],[.1,.2]])) def test_printGroundMaterials(): ground = bifacial_radiance.GroundObj('litesoil') @@ -70,4 +72,10 @@ def test_printGroundMaterials(): def test_albedo_greaterthan_one(): ground = bifacial_radiance.GroundObj(2) - assert ground.ReflAvg[0] == 1 \ No newline at end of file + assert ground.ReflAvg[0] == 1 + +def test_repr_and_normval(): + ground = bifacial_radiance.GroundObj() + groundstr = ground.__repr__() + ground = bifacial_radiance.GroundObj([0.1, 0.2]) + assert ground.normval == pytest.approx([0.10034, 0.20068])