Skip to content

Commit 5058e72

Browse files
authored
Merge pull request #79 from dunnkers/fix-deprecations
Fix deprecations & improve docs
2 parents 10c73e2 + 30224c7 commit 5058e72

File tree

16 files changed

+86
-33
lines changed

16 files changed

+86
-33
lines changed

.github/workflows/python-app.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ${{ matrix.os }}
1515
strategy:
1616
matrix:
17-
python-version: ["3.7", "3.8", "3.9"]
17+
python-version: ["3.7", "3.8", "3.9", "3.10"]
1818
os: [ubuntu-latest, macOS-latest, windows-latest]
1919
name: Python ${{ matrix.python-version }} - ${{ matrix.os }}
2020

@@ -43,6 +43,8 @@ jobs:
4343
WANDB_API_KEY: ${{ secrets.WANDB_API_KEY }}
4444
run: |
4545
pytest tests --cov=./ --cov-report=xml
46+
# The following should only run once per build
47+
# → e.g. we configure it only to trigger for python==3.9 and os==ubuntu
4648
- name: Codecov
47-
uses: codecov/codecov-action@v2.1.0
4849
if: matrix.python-version == '3.9' && matrix.os == 'ubuntu-latest'
50+
uses: codecov/codecov-action@v2.1.0

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,7 @@ artifacts
150150
.DS_Store
151151

152152
# fseval
153-
output
153+
output
154+
155+
# Eggs (deps installed in requirements.txt using `-e`)
156+
src

examples/quick-start-structured-configs/benchmark.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def fit(self, X, y):
3232
cs.store(name="my_config", node=my_config)
3333

3434

35-
@hydra.main(config_path="conf", config_name="my_config")
35+
@hydra.main(config_path="conf", config_name="my_config", version_base="1.1")
3636
def main(cfg: PipelineConfig) -> None:
3737
run_pipeline(cfg)
3838

examples/quick-start-yaml/benchmark.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def fit(self, X, y):
1818
self.feature_importances_ = scores
1919

2020

21-
@hydra.main(config_path="conf", config_name="my_config")
21+
@hydra.main(config_path="conf", config_name="my_config", version_base="1.1")
2222
def main(cfg: PipelineConfig) -> None:
2323
run_pipeline(cfg)
2424

fseval/metrics/feature_importances.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def _build_table(self, feature_vector: np.ndarray):
3737
"class": class_index,
3838
}
3939
)
40-
df = df.append(df_class)
40+
df = pd.concat([df, df_class])
4141

4242
return df
4343

@@ -88,14 +88,14 @@ def score_ranking(
8888
estimated_df = self._build_table(estimated)
8989
estimated_df["group"] = "estimated"
9090
estimated_df["bootstrap_state"] = bootstrap_state
91-
table = table.append(estimated_df)
91+
table = pd.concat([table, estimated_df])
9292

9393
if feature_importances is not None:
9494
ground_truth = self._normalize_feature_importances(feature_importances)
9595
ground_truth_df = self._build_table(ground_truth)
9696
ground_truth_df["group"] = "ground_truth"
9797
ground_truth_df["bootstrap_state"] = bootstrap_state
98-
table = table.append(ground_truth_df)
98+
table = pd.concat([table, ground_truth_df])
9999

100100
if not table.empty:
101101
callbacks.on_table(table, "feature_importances")

fseval/pipelines/_experiment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def postfit(self):
176176
estimator.postfit()
177177

178178
def _aggregate_dataframe_scores(self, a: pd.DataFrame, b: pd.DataFrame):
179-
return a.append(b)
179+
return pd.concat([a, b])
180180

181181
def _aggregate_dict_scores(self, a: Dict, b: Dict):
182182
aggregated = {}

fseval/utils/hydra_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ def _ensure_hydra_initialized(
2020
"""Initializes Hydra only if it is not already initialized."""
2121
gh = GlobalHydra()
2222
if not gh.is_initialized():
23-
initialize_config_module(config_module=config_module, job_name=job_name)
23+
initialize_config_module(
24+
config_module=config_module, job_name=job_name, version_base="1.1"
25+
)
2426

2527

2628
def get_config(

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
hydra-core==1.1.2
2-
hydra-colorlog==1.1.0
1+
hydra-core>=1.1.2
2+
hydra-colorlog>=1.1.0
33
numpy>=1.19
44
pandas>=1.1
55
scikit-learn>=0.24

setup.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
LONG_DESC = fh.read()
77
setup(
88
name="fseval",
9-
version="3.0.2",
9+
version="3.0.3",
1010
packages=find_namespace_packages(include=["hydra_plugins.*"])
1111
+ find_packages(include=["fseval", "fseval.*"]),
1212
entry_points={"console_scripts": ["fseval = fseval.main:main"]},
@@ -28,8 +28,8 @@
2828
},
2929
include_package_data=True,
3030
install_requires=[
31-
"hydra-core==1.1.2",
32-
"hydra-colorlog==1.1.0",
31+
"hydra-core>=1.1.2",
32+
"hydra-colorlog>=1.1.0",
3333
"numpy>=1.19",
3434
"pandas>=1.1",
3535
"scikit-learn>=0.24",
@@ -47,6 +47,7 @@
4747
"Programming Language :: Python :: 3.7",
4848
"Programming Language :: Python :: 3.8",
4949
"Programming Language :: Python :: 3.9",
50+
"Programming Language :: Python :: 3.10",
5051
"Operating System :: POSIX :: Linux",
5152
"Operating System :: MacOS",
5253
"Operating System :: Microsoft :: Windows",

tests/unit/callbacks/test_to_wandb.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from time import sleep
12
import pandas as pd
23
import pytest
34
import wandb
@@ -112,6 +113,18 @@ def test_on_summary(wandb_callback: WandbCallback):
112113
# → assertions in `test_on_end`
113114

114115

116+
@pytest.mark.xfail(
117+
reason="""
118+
The Weights-and-Biases platform has proven to have too large delays to be able to
119+
run integration tests on it consistently. Alhough the WandB platform does
120+
eventually upload all the data that is being sent to it, all logging is queued,
121+
making it hard to rely on it in integration-/ unit test settings.
122+
Therefore this test is marked as optional to prevent unnecessary build failures.
123+
The test is kept in the codebase, however, for convenience in local debugging.
124+
125+
See https://github.com/dunnkers/fseval/issues/78
126+
"""
127+
)
115128
@pytest.mark.dependency(
116129
depends=[
117130
"test_on_begin",

0 commit comments

Comments
 (0)