Skip to content

Fix port of old-precision-decimal to present-atol in tests #2082

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pvlib/tests/test_inverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ def test_sandia_float(cec_inverter_parameters):
idcs = 5.5
pdcs = idcs * vdcs
pacs = inverter.sandia(vdcs, pdcs, cec_inverter_parameters)
assert_allclose(pacs, 132.004278, 5)
assert_allclose(pacs, 132.004278, 1e-5)
# test at low power condition
vdcs = 25.
idcs = 0
pdcs = idcs * vdcs
pacs = inverter.sandia(vdcs, pdcs, cec_inverter_parameters)
assert_allclose(pacs, -1. * cec_inverter_parameters['Pnt'], 5)
assert_allclose(pacs, -1. * cec_inverter_parameters['Pnt'], 1e-5)


def test_sandia_Pnt_micro():
Expand Down
2 changes: 1 addition & 1 deletion pvlib/tests/test_irradiance.py
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,7 @@ def test_erbs_all_scalar():
out = irradiance.erbs(ghi, zenith, doy)

for k, v in out.items():
assert_allclose(v, expected[k], 5)
assert_allclose(v, expected[k], 1e-2)


def test_dirindex(times):
Expand Down
6 changes: 3 additions & 3 deletions pvlib/tests/test_pvsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def test_PVSystem_sapm(sapm_module_params, mocker):
out = system.sapm(effective_irradiance, temp_cell)
pvsystem.sapm.assert_called_once_with(effective_irradiance, temp_cell,
sapm_module_params)
assert_allclose(out['p_mp'], 100, atol=100)
assert_allclose(out['p_mp'], 100, 10)


def test_PVSystem_multi_array_sapm(sapm_module_params):
Expand Down Expand Up @@ -487,7 +487,7 @@ def test_PVSystem_faiman_celltemp(mocker):
winds = 1
out = system.get_cell_temperature(irrads, temps, winds, model='faiman')
temperature.faiman.assert_called_once_with(irrads, temps, winds, u0, u1)
assert_allclose(out, 56.4, atol=1)
assert_allclose(out, 56.4, atol=1e-1)


def test_PVSystem_noct_celltemp(mocker):
Expand Down Expand Up @@ -1062,7 +1062,7 @@ def test_PVSystem_calcparams_desoto(cec_module_params, mocker):
dEgdT=module_parameters['dEgdT']
)

assert_allclose(IL, np.array([0.0, 6.036]), atol=1)
assert_allclose(IL, np.array([0.0, 6.036]), atol=1e-1)
assert_allclose(I0, np.array([2.0e-9, 2.0e-9]), atol=1.0e-9)
assert_allclose(Rs, np.array([0.1, 0.1]), atol=0.1)
assert_allclose(Rsh, np.array([np.inf, 20]), atol=1)
Expand Down
8 changes: 4 additions & 4 deletions pvlib/tests/test_temperature.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ def sapm_default():
def test_sapm_cell(sapm_default):
default = temperature.sapm_cell(900, 20, 5, sapm_default['a'],
sapm_default['b'], sapm_default['deltaT'])
assert_allclose(default, 43.509, 3)
assert_allclose(default, 43.509, 1e-3)


def test_sapm_module(sapm_default):
default = temperature.sapm_module(900, 20, 5, sapm_default['a'],
sapm_default['b'])
assert_allclose(default, 40.809, 3)
assert_allclose(default, 40.809, 1e-3)


def test_sapm_cell_from_module(sapm_default):
Expand All @@ -47,8 +47,8 @@ def test_sapm_ndarray(sapm_default):
sapm_default['b'])
expected_cell = np.array([0., 23.06066166, 5.])
expected_module = np.array([0., 21.56066166, 5.])
assert_allclose(expected_cell, cell_temps, 3)
assert_allclose(expected_module, module_temps, 3)
assert_allclose(expected_cell, cell_temps, 1e-3)
assert_allclose(expected_module, module_temps, 1e-3)


def test_sapm_series(sapm_default):
Expand Down
Loading