Skip to content

Commit

Permalink
Add test for geometric solar temperature conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
p-snft committed Oct 20, 2020
1 parent 2b63982 commit 6f910b5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,20 @@ def test_geometric_angles(self):
assert (plant4.feedin(data_weather_test)[0]
== pytest.approx(89.23768, 1e-5))

# check giving same weather with temperature in Kelvin
data_weather_kelvin = pd.DataFrame(data={'wind_speed': [0],
'temperature': [25+273.15],
'dni': [67.8],
'dhi': [221.1]},
index=pd.date_range(
'1970-02-20 09:43:44',
periods=1,
freq="h", tz='UTC'))

assert (plant4.feedin(data_weather_test)[0]
== plant4.feedin(data_weather_kelvin)[0])

# check if problematic data (dhi > ghi) is detected
erroneous_weather = pd.DataFrame(data={'wind_speed': [5.0],
'temp_air': [10.0],
'dhi': [500],
Expand Down

0 comments on commit 6f910b5

Please sign in to comment.