Skip to content

Commit

Permalink
BUILD: restore scipy 1.2 support in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
j-ittner committed Apr 14, 2022
1 parent ca8e71e commit c5fab3d
Showing 2 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ requires = [
"numpy >=1.17,<2a",
"packaging >=20",
"pandas >=0.24,<2a",
"scipy ~=1.4",
"scipy ~=1.2",
"shap >=0.34,<0.41a",
"sklearndf ~=2.0.dev3",
]
@@ -76,7 +76,7 @@ numpy = "==1.17.5"
packaging = "~=20.9"
pandas = "~=0.24.2"
python = ">=3.7.12,<3.8a" # cannot use ~= due to conda bug
scipy = "~=1.4.1"
scipy = "~=1.2.3"
shap = "~=0.34.0"
sklearndf = "~=2.0.dev3"
# additional minimum requirements of sklearndf
22 changes: 11 additions & 11 deletions test/test/facet/test_selection.py
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
import numpy as np
import pandas as pd
import pytest
from scipy.stats import loguniform, randint
from scipy.stats import randint, reciprocal
from sklearn import datasets
from sklearn.model_selection import GridSearchCV

@@ -160,8 +160,8 @@ def test_parameter_space(

randint_3_10 = randint(3, 10)
randint_1_32 = randint(1, 32)
loguniform_0_01_0_10 = loguniform(0.01, 0.1)
loguniform_0_05_0_10 = loguniform(0.05, 0.1)
reciprocal_0_01_0_10 = reciprocal(0.01, 0.1)
reciprocal_0_05_0_10 = reciprocal(0.05, 0.1)

# parameter space 1

@@ -171,9 +171,9 @@ def test_parameter_space(
)
ps_1_name = "rf_regressor"
ps_1 = ParameterSpace(pipeline_1, name=ps_1_name)
ps_1.regressor.min_weight_fraction_leaf = loguniform_0_01_0_10
ps_1.regressor.min_weight_fraction_leaf = reciprocal_0_01_0_10
ps_1.regressor.max_depth = randint_3_10
ps_1.regressor.min_samples_leaf = loguniform_0_05_0_10
ps_1.regressor.min_samples_leaf = reciprocal_0_05_0_10

with pytest.raises(
AttributeError,
@@ -239,9 +239,9 @@ def regressor_repr(model: Id):
Id.ParameterSpace(
regressor_repr(Id.RandomForestRegressorDF),
**{
"regressor.min_weight_fraction_leaf": (Id.loguniform(0.01, 0.1)),
"regressor.min_weight_fraction_leaf": (Id.reciprocal(0.01, 0.1)),
"regressor.max_depth": Id.randint(3, 10),
"regressor.min_samples_leaf": (Id.loguniform(0.05, 0.1)),
"regressor.min_samples_leaf": (Id.reciprocal(0.05, 0.1)),
},
),
Id.ParameterSpace(
@@ -261,8 +261,8 @@ def regressor_repr(model: Id):
"candidate": [pipeline_1],
"candidate_name": [ps_1_name],
"candidate__regressor__max_depth": randint_3_10,
"candidate__regressor__min_samples_leaf": loguniform_0_05_0_10,
"candidate__regressor__min_weight_fraction_leaf": loguniform_0_01_0_10,
"candidate__regressor__min_samples_leaf": reciprocal_0_05_0_10,
"candidate__regressor__min_weight_fraction_leaf": reciprocal_0_01_0_10,
},
{
"candidate": [pipeline_2],
@@ -277,10 +277,10 @@ def regressor_repr(model: Id):
"my_prefix__candidate": [pipeline_1],
"my_prefix__candidate_name": [ps_1_name],
"my_prefix__candidate__regressor__max_depth": randint_3_10,
"my_prefix__candidate__regressor__min_samples_leaf": loguniform_0_05_0_10,
"my_prefix__candidate__regressor__min_samples_leaf": reciprocal_0_05_0_10,
(
"my_prefix__candidate__regressor__min_weight_fraction_leaf"
): loguniform_0_01_0_10,
): reciprocal_0_01_0_10,
},
{
"my_prefix__candidate": [pipeline_2],

0 comments on commit c5fab3d

Please sign in to comment.