Skip to content

Commit cd52739

Browse files
Merge pull request #117 from NREL/AidanPyTests
Added a test for Xmin in `test_standards.py` and removed dependency on pvgis.
2 parents 1df6afc + 57f92d6 commit cd52739

File tree

2 files changed

+44
-10
lines changed

2 files changed

+44
-10
lines changed
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
v0.4.2 (2024-09-13)
3+
=======================
4+
5+
Bug Fixes
6+
---------
7+
* Remove duplicate gid's from `pvdeg.geospatial.elevation_stochastic_downselection`
8+
9+
Tests
10+
-----
11+
* Added a test for Xmin in `test_standards.py` and removed dependency on pvgis.
12+
13+
Contributors
14+
~~~~~~~~~~~~
15+
* Martin Springer (:ghuser:`martin-springer`)
16+
* Aidan Wesley (:ghuser:`AidanWesley``)

tests/test_standards.py

+28-10
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,8 @@ def test_eff_gap():
105105
# assert expected_result_l2 == pytest.approx(result_l2, abs=1e-5)
106106

107107

108-
def test_T98():
109-
weather_db = "PVGIS" # This pulls data for most of the world.
110-
weather_id = (24.7136, 46.6753) # Riyadh, Saudi Arabia
111-
# weather_id = (35.6754, 139.65) #Tokyo, Japan
112-
weather_arg = {"map_variables": True}
113-
WEATHER_df, META = pvdeg.weather.get(weather_db, weather_id)
114-
df, meta_data = pvdeg.weather.read(
108+
def test_T98_Xmin():
109+
WEATHER_df, META = pvdeg.weather.read(
115110
os.path.join(TEST_DATA_DIR, "psm3_pytest.csv"), "csv"
116111
)
117112
standoff = pvdeg.standards.standoff(weather_df=WEATHER_df, meta=META)
@@ -128,6 +123,29 @@ def test_T98():
128123
x_0=6.5,
129124
wind_factor=0.33,
130125
)
131-
assert standoff.x[0] == pytest.approx(9.261615)
132-
assert standoff.T98_0[0] == pytest.approx(89.5806502251565)
133-
assert standoff.T98_inf[0] == pytest.approx(63.79827740597881)
126+
assert standoff.x[0] == pytest.approx(2.008636)
127+
assert standoff.T98_0[0] == pytest.approx(77.038644)
128+
assert standoff.T98_inf[0] == pytest.approx(50.561112)
129+
kwarg_x = dict(
130+
sky_model="isotropic",
131+
temp_model="sapm",
132+
conf_0="insulated_back_glass_polymer",
133+
conf_inf="open_rack_glass_polymer",
134+
T98=70,
135+
x_0=6.5,
136+
wind_factor=0.33,
137+
)
138+
x_azimuth_step = 45
139+
x_tilt_step = 45
140+
standoff_series = pvdeg.utilities.tilt_azimuth_scan(
141+
weather_df=WEATHER_df,
142+
meta=META,
143+
tilt_step=x_tilt_step,
144+
azimuth_step=x_azimuth_step,
145+
func=pvdeg.standards.standoff_x,
146+
**kwarg_x,
147+
)
148+
print(standoff_series)
149+
print(WEATHER_df)
150+
print(META)
151+
assert standoff_series[13, 2] == pytest.approx(1.92868166)

0 commit comments

Comments
 (0)