|
1 | 1 | import numpy as np |
2 | 2 | import pandas as pd |
3 | | - |
4 | | -from .conftest import assert_series_equal |
5 | 3 | from numpy.testing import assert_allclose |
6 | 4 |
|
| 5 | +from .conftest import assert_series_equal |
7 | 6 | from .conftest import TESTS_DATA_DIR |
| 7 | +from .conftest import requires_statsmodels |
| 8 | + |
8 | 9 | import pytest |
9 | 10 |
|
10 | 11 | from pvlib import inverter |
@@ -202,17 +203,18 @@ def test_pvwatts_multi(): |
202 | 203 | 'Pso': 10., 'C0': 1e-6, 'C1': 1e-4, 'C2': 1e-2, |
203 | 204 | 'C3': 1e-3, 'Pnt': 1.}), |
204 | 205 | ]) |
205 | | -def test_fit_sandia(infilen, expected): |
| 206 | +def test_fit_sandia_lab(infilen, expected): |
206 | 207 | curves = pd.read_csv(infilen) |
207 | 208 | dc_power = curves['ac_power'] / curves['efficiency'] |
208 | | - result = inverter.fit_sandia(ac_power=curves['ac_power'], |
209 | | - dc_power=dc_power, |
210 | | - dc_voltage=curves['dc_voltage'], |
211 | | - dc_voltage_level=curves['dc_voltage_level'], |
212 | | - p_ac_0=expected['Paco'], p_nt=expected['Pnt']) |
| 209 | + result = inverter.fit_sandia_lab( |
| 210 | + ac_power=curves['ac_power'], dc_power=dc_power, |
| 211 | + dc_voltage=curves['dc_voltage'], |
| 212 | + dc_voltage_level=curves['dc_voltage_level'], |
| 213 | + p_ac_0=expected['Paco'], p_nt=expected['Pnt']) |
213 | 214 | assert expected == pytest.approx(result, rel=1e-3) |
214 | 215 |
|
215 | 216 |
|
| 217 | +@requires_statsmodels |
216 | 218 | def test_fit_sandia_field(): |
217 | 219 | pdc = np.arange(start=100., stop=1300., step=100.) |
218 | 220 | vdc = np.array([550., 600., 650, 550., 600., 650, 550., 600., 650, |
|
0 commit comments