-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
468 additions
and
258 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
.. _whatsnew_0333: | ||
|
||
v0.3.3.3 (X / X / 2020) | ||
-------------------------- | ||
Release of new version including RGB and time-series albedo options | ||
|
||
|
||
Enhancements | ||
~~~~~~~~~~~~ | ||
* | ||
API Changes | ||
~~~~~~~~~~~ | ||
* Input changed to py:class:`~bifacial_radiance.RadianceObj.gendaylit`, now making metdata an optional input. | ||
|
||
|
||
Bug fixes | ||
~~~~~~~~~ | ||
* | ||
|
||
Testing | ||
~~~~~~~ | ||
* Added pytesting to py:class:`~bifacial_radiance.GroundObj` | ||
|
||
|
||
Documentation | ||
~~~~~~~~~~~~~~ | ||
|
||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
* Chris Deline (:ghuser:`cdeline`) | ||
* Silvana Ayala (:ghuser:`shirubana`) | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Created 2/19/19 | ||
@author: cdeline | ||
Using pytest to create unit tests for GroundObj | ||
to run unit tests, run pytest from the command line in the bifacial_radiance directory | ||
""" | ||
|
||
import bifacial_radiance | ||
import os, pytest | ||
import numpy as np | ||
|
||
# try navigating to tests directory so tests run from here. | ||
try: | ||
os.chdir('tests') | ||
except: | ||
pass | ||
|
||
# also test a dummy TMY3 Boulder file in /tests/ | ||
MET_FILENAME = 'USA_CO_Boulder.724699_TMY2.epw' | ||
MET_FILENAME2 = '724666TYA.CSV' | ||
# return albedo values in GroundObj | ||
def _groundtest(groundobj): | ||
if type(groundobj) != bifacial_radiance.main.GroundObj: | ||
raise TypeError('bifacial_radiance.GroundObj not passed') | ||
|
||
return(groundobj.Rrefl, groundobj.Grefl, groundobj.Brefl, groundobj.ReflAvg) | ||
|
||
|
||
def test_albedo_cases_orig(): | ||
# test 'litesoil', constant albedo | ||
ground = bifacial_radiance.GroundObj('litesoil') | ||
testvals_litesoil = ([.29], [.187], [.163], [.213]) | ||
np.testing.assert_allclose(_groundtest(ground), testvals_litesoil, atol=.001) | ||
|
||
ground = bifacial_radiance.GroundObj(0.2) | ||
testvals_const = ([.2], [.2], [.2], [.2]) | ||
np.testing.assert_allclose(_groundtest(ground), testvals_const, atol=.001) | ||
|
||
def test_albedo_tmy3(): | ||
# test 1xN albedo array | ||
demo = bifacial_radiance.RadianceObj(name = 'test') | ||
demo.readWeatherFile(MET_FILENAME2) | ||
demo.setGround(demo.metdata.albedo) | ||
assert demo.ground.Rrefl.__len__() == 8760 | ||
assert demo.ground.ReflAvg.__len__() == 8760 | ||
|
||
def test_RGB_timeseries(): | ||
# test 3xN albedo array with two timesteps | ||
albedo = np.array([[0.2, 0.3, 0.4], [0.12, 0.13, 0.26]]) # 2 RGB Albedo | ||
ground = bifacial_radiance.GroundObj(albedo) | ||
testval = _groundtest(ground) | ||
testvals_const = ([[.2,.12], [.3, .13], [.4, .26], [.3,.17]]) | ||
np.testing.assert_allclose(testval, testvals_const) | ||
|
||
# test 4xN albedo array which should be trimmed and raise a warning | ||
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) |