8000 python >= 3.6, add scipy 1.2.0 to min requirements by wholmgren · Pull Request #1035 · pvlib/pvlib-python · GitHub
[go: up one dir, main page]

Skip to content

python >= 3.6, add scipy 1.2.0 to min requirements #1035

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 19 commits into from
Sep 5, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
import cleanup. fix stray requires_scipy
  • Loading branch information
wholmgren committed Sep 4, 2020
commit 926f6daa050c9ebcc435e555b16294edb399c88f
6 changes: 3 additions & 3 deletions pvlib/scaling.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
import numpy as np
import pandas as pd

import scipy.optimize
from scipy.spatial.distance import pdist


def wvm(clearsky_index, positions, cloud_speed, dt=None):
"""
Expand Down Expand Up @@ -59,9 +62,6 @@ def wvm(clearsky_index, positions, cloud_speed, dt=None):

# Added by Joe Ranalli (@jranalli), Penn State Hazleton, 2019

import scipy.optimize
from scipy.spatial.distance import pdist

pos = np.array(positions)
dist = pdist(pos, 'euclidean')
wavelet, tmscales = _compute_wavelet(clearsky_index, dt)
Expand Down
6 changes: 2 additions & 4 deletions pvlib/singlediode.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
from pvlib.tools import _golden_sect_DataFrame

from scipy.optimize import brentq, newton
from scipy.special import lambertw

# set keyword arguments for all uses of newton in this module
newton = partial(newton, tol=1e-6, maxiter=100, fprime2=None)

Expand Down Expand Up @@ -496,8 +498,6 @@ def _prepare_newton_inputs(i_or_v_tup, args, v0):

def _lambertw_v_from_i(resistance_shunt, resistance_series, nNsVth, current,
saturation_current, photocurrent):
from scipy.special import lambertw

# Record if inputs were all scalar
output_is_scalar = all(map(np.isscalar,
[resistance_shunt, resistance_series, nNsVth,
Expand Down Expand Up @@ -575,8 +575,6 @@ def _lambertw_v_from_i(resistance_shunt, resistance_series, nNsVth, current,

def _lambertw_i_from_v(resistance_shunt, resistance_series, nNsVth, voltage,
saturation_current, photocurrent):
from scipy.special import lambertw

# Record if inputs were all scalar
output_is_scalar = all(map(np.isscalar,
[resistance_shunt, resistance_series, nNsVth,
Expand Down
4 changes: 2 additions & 2 deletions pvlib/soiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import datetime
import numpy as np
import pandas as pd
from scipy.special import erf

from pvlib.tools import cosd


Expand Down Expand Up @@ -62,8 +64,6 @@ def hsu(rainfall, cleaning_threshold, tilt, pm2_5, pm10,
Change. J. Seinfeld and S. Pandis. Wiley and Sons 2001.

"""
from scipy.special import erf

# never use mutable input arguments
if depo_veloc is None:
depo_veloc = {'2_5': 0.0009, '10': 0.004}
Expand Down
3 changes: 1 addition & 2 deletions pvlib/solarposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import numpy as np
import pandas as pd
import scipy.optimize as so
import warnings

from pvlib import atmosphere
Expand Down Expand Up @@ -911,8 +912,6 @@ def calc_time(lower_bound, upper_bound, latitude, longitude, attribute, value,
If the given attribute is not an attribute of a
PyEphem.Sun object.
"""
import scipy.optimize as so

obs, sun = _ephem_setup(latitude, longitude, altitude,
pressure, temperature, horizon)

Expand Down
5 changes: 4 additions & 1 deletion pvlib/tests/test_soiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def expected_output():
index=dt)
return expected_no_cleaning


@pytest.fixture
def expected_output_1():
dt = pd.date_range(start=pd.Timestamp(2019, 1, 1, 0, 0, 0),
Expand All @@ -39,6 +40,7 @@ def expected_output_1():
index=dt)
return expected_output_1


@pytest.fixture
def expected_output_2():
dt = pd.date_range(start=pd.Timestamp(2019, 1, 1, 0, 0, 0),
Expand Down Expand Up @@ -69,6 +71,7 @@ def expected_output_3():
index=dt_new)
return expected_output_3


@pytest.fixture
def rainfall_input():

Expand Down Expand Up @@ -123,7 +126,6 @@ def test_hsu_defaults(rainfall_input, expected_output_1):
assert np.allclose(result.values, expected_output_1)


@requires_scipy
def test_hsu_variable_time_intervals(rainfall_input, expected_output_3):
"""
Test Soiling HSU function with variable time intervals.
Expand All @@ -142,6 +144,7 @@ def test_hsu_variable_time_intervals(rainfall_input, expected_output_3):
rain_accum_period=pd.Timedelta('2h'))
assert np.allclose(result, expected_output_3)


@pytest.fixture
def greensboro_rain():
# get TMY3 data with rain
Expand Down
0