Skip to content

Commit 44fbc62

Browse files
pnhuyHuy PhamFábio Malcher Miranda
authored
Fix Compatibility issue (#165)
* Add BaseEstimator inheritance * Format files with new black version * chore: drop Python 3.9 support (require >=3.10) and update CI matrix --------- Co-authored-by: Huy Pham <hpham@talosix.com> Co-authored-by: Fábio Malcher Miranda <fabio.miranda@ifap.edu.br>
1 parent 76f7953 commit 44fbc62

27 files changed

Lines changed: 30 additions & 17 deletions

.github/workflows/test-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
python-version: ["3.9", "3.10", "3.11", "3.12"]
18+
python-version: ["3.10", "3.11", "3.12"]
1919
os: [ubuntu-latest, macOS-latest, windows-latest]
2020
steps:
2121
- uses: actions/checkout@v2

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ repos:
66
- id: end-of-file-fixer
77
- id: trailing-whitespace
88
- repo: https://github.com/psf/black
9-
rev: 24.2.0
9+
rev: 26.3.0
1010
hooks:
1111
- id: black
1212
- repo: https://github.com/pycqa/flake8

benchmarks/consumer_complaints/scripts/data.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python3
22
"""Script to share common functions for data manipulation."""
3+
34
import csv
45
from typing import TextIO
56

benchmarks/consumer_complaints/scripts/metrics.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python3
22
"""Script to compute metrics."""
3+
34
import argparse
45
import sys
56
from argparse import Namespace

benchmarks/consumer_complaints/scripts/predict.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python3
22
"""Script to predict with flat approach."""
3+
34
import argparse
45
import pickle
56
import sys

benchmarks/consumer_complaints/scripts/split_data.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python3
22
"""Script to split train and test data."""
3+
34
import argparse
45
import sys
56
from argparse import Namespace

benchmarks/consumer_complaints/scripts/statistics.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python3
22
"""Script to store basic statistical information."""
3+
34
import argparse
45
import os
56
import sys

benchmarks/consumer_complaints/scripts/train.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python3
22
"""Script to train with flat or hierarchical approaches."""
3+
34
import argparse
45
import pickle
56
import sys

benchmarks/consumer_complaints/scripts/tune.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python3
22
"""Script to perform hyper-parameter tuning for flat and hierarchical approaches."""
3+
34
import hashlib
45
import json
56
import logging
@@ -170,7 +171,7 @@ def load_trial(cfg: DictConfig) -> List[float]:
170171
md5 = compute_md5(hyperparameters)
171172
filename = f"{cfg.output_dir}/{md5}.sav"
172173
if os.path.exists(filename):
173-
(_, scores) = pickle.load(open(filename, "rb"))
174+
_, scores = pickle.load(open(filename, "rb"))
174175
log.info(f"Loaded trial with F-scores {scores}")
175176
return scores
176177
else:

benchmarks/consumer_complaints/scripts/tune_table.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python3
22
"""Script to create table with tuning results for flat and hierarchical approaches."""
3+
34
import argparse
45
import glob
56
import pickle

0 commit comments

Comments
 (0)