Skip to content

Commit b9a6e64

Browse files
committed
fix test and lint issues
1 parent dfb02f8 commit b9a6e64

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

pvlib/pvsystem.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2722,7 +2722,8 @@ def v_from_i(current, photocurrent, saturation_current, resistance_series,
27222722
27232723
method : str
27242724
Method to use: ``'lambertw'``, ``'newton'``, ``'brentq'``, or
2725-
``'chandrupatla'``. *Note*: ``'brentq'`` is limited to non-negative current.
2725+
``'chandrupatla'``. *Note*: ``'brentq'`` is limited to
2726+
non-negative current.
27262727
27272728
.. note::
27282729
``'chandrupatla'`` requires scipy 1.15 or greater.
@@ -2808,7 +2809,8 @@ def i_from_v(voltage, photocurrent, saturation_current, resistance_series,
28082809
28092810
method : str
28102811
Method to use: ``'lambertw'``, ``'newton'``, ``'brentq'``, or
2811-
``'chandrupatla'``. *Note*: ``'brentq'`` is limited to non-negative current.
2812+
``'chandrupatla'``. *Note*: ``'brentq'`` is limited to
2813+
non-negative current.
28122814
28132815
.. note::
28142816
``'chandrupatla'`` requires scipy 1.15 or greater.

tests/conftest.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import warnings
44

55
import pandas as pd
6+
import scipy
67
import os
7-
import sys
88
from packaging.version import Version
99
import pytest
1010
from functools import wraps
@@ -197,10 +197,9 @@ def has_spa_c():
197197

198198
# single-diode equation functions have method=='chandrupatla', which relies
199199
# on scipy.optimize.elementwise.find_root, which is only available in
200-
# scipy>=1.15. That is only available for python 3.10 and above, so
201-
# we need to skip those tests on python 3.9.
202-
# TODO remove this when we drop support for python 3.9.
203-
chandrupatla_available = sys.version_info >= (3, 10)
200+
# scipy>=1.15.
201+
# TODO remove this when our minimum scipy is >=1.15
202+
chandrupatla_available = Version(scipy.__version__) >= Version("1.15.0")
204203
chandrupatla = pytest.param(
205204
"chandrupatla", marks=pytest.mark.skipif(not chandrupatla_available,
206205
reason="needs scipy 1.15")

0 commit comments

Comments
 (0)