Skip to content

Commit

Permalink
added test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristophGehbauer committed Sep 3, 2024
1 parent 2977fb0 commit f45ae87
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
21 changes: 13 additions & 8 deletions afc/radiance/forecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,19 +597,16 @@ def compute2(self, weather_df, weather_cutoff=75):

return output_df


if __name__ == "__main__":

import warnings
warnings.simplefilter(action='ignore', category=pd.errors.PerformanceWarning)
def test(wwr=0.4, # [0.4, 0.6]
mode='dshade', # ['dshade', 'shade', 'blinds', 'ec']
facade_type='shade' # ['shade', 'blinds', 'ec']
):
"""test funciton for radiance"""

from .configs import get_config
root = os.path.dirname(os.path.abspath(__file__))

# configuration
wwr = 0.4 # [0.4, 0.6]
mode = 'dshade' # ['dshade', 'shade', 'blinds', 'ec']
facade_type = 'shade' # ['shade', 'blinds', 'ec']
print('Running example for:', wwr, mode, facade_type)
filestruct, config_path = get_config(mode, wwr)

Expand Down Expand Up @@ -654,4 +651,12 @@ def compute2(self, weather_df, weather_cutoff=75):
# print(k, v)
print(res)
print(res['wpi_0_6'])
return res

if __name__ == "__main__":

import warnings
warnings.simplefilter(action='ignore', category=pd.errors.PerformanceWarning)

res = test()
res.to_csv('radiance-forecast_new.csv')
2 changes: 1 addition & 1 deletion test/test_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test1():
inputs = make_inputs(parameter, df)

# Query controller
ctrl.do_step(inputs=inputs)
print(ctrl.do_step(inputs=inputs))
df = pd.read_json(io.StringIO(ctrl.get_output(keys=['output-data'])['output-data']))

# check
Expand Down

0 comments on commit f45ae87

Please sign in to comment.