Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 4 additions & 2 deletions .github/workflows/deploy-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- uses: actions/checkout@v2
Expand All @@ -26,7 +26,9 @@ jobs:
python -m pip install -e ".[dev]"
- name: Test with pytest
run: |
pytest -v --flake8 --pydocstyle --cov=hiclass --cov-fail-under=90 --cov-report html
flake8
pydocstyle hiclass tests
pytest -v --cov=hiclass --cov-fail-under=90 --cov-report html
coverage xml
- name: Upload Coverage to Codecov
if: matrix.os == 'ubuntu-latest'
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- uses: actions/checkout@v2
Expand All @@ -27,7 +27,9 @@ jobs:
python -m pip install -e ".[dev]"
- name: Test with pytest
run: |
pytest -v --flake8 --pydocstyle --cov=hiclass --cov-fail-under=90 --cov-report html
flake8
pydocstyle hiclass tests
pytest -v --cov=hiclass --cov-fail-under=90 --cov-report html
coverage xml
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v2
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,12 @@ repos:
rev: 24.2.0
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 7.1.1
hooks:
- id: flake8
- repo: https://github.com/pycqa/pydocstyle
rev: 6.3.0
hooks:
- id: pydocstyle
files: ^hiclass/
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pip install -e ".[dev]"
To run the tests simply execute:

```
pytest -v --flake8 --pydocstyle --cov=hiclass --cov-fail-under=90 --cov-report html
pytest -v --cov=hiclass --cov-fail-under=90 --cov-report html
```

Lastly, you can set up the git hooks scripts to fix formatting errors locally during commits:
Expand Down
4 changes: 2 additions & 2 deletions hiclass/HierarchicalClassifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ def _fit_node_classifier(
self, nodes, local_mode: bool = False, use_joblib: bool = False
):
def logging_wrapper(func, idx, node, node_length):
self.logger_.info(f"fitting node {idx+1}/{node_length}: {str(node)}")
self.logger_.info(f"fitting node {idx + 1}/{node_length}: {str(node)}")
return func(self, node)

if self.n_jobs > 1:
Expand Down Expand Up @@ -481,7 +481,7 @@ def _fit_node_calibrator(
self, nodes, local_mode: bool = False, use_joblib: bool = False
):
def logging_wrapper(func, idx, node, node_length):
self.logger_.info(f"calibrating node {idx+1}/{node_length}: {str(node)}")
self.logger_.info(f"calibrating node {idx + 1}/{node_length}: {str(node)}")
return func(self, node)

if self.n_jobs > 1:
Expand Down
4 changes: 2 additions & 2 deletions hiclass/LocalClassifierPerLevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ def _fit_digraph(self, local_mode: bool = False, use_joblib: bool = False):
self.logger_.info("Fitting local classifiers")

def logging_wrapper(func, level, separator, max_level):
self.logger_.info(f"fitting level {level+1}/{max_level}")
self.logger_.info(f"fitting level {level + 1}/{max_level}")
return func(self, level, separator)

if self.n_jobs > 1:
Expand Down Expand Up @@ -395,7 +395,7 @@ def _calibrate_digraph(self, local_mode: bool = False, use_joblib: bool = False)
self.logger_.info("Fitting local calibrators")

def logging_wrapper(func, level, separator, max_level):
self.logger_.info(f"calibrating level {level+1}/{max_level}")
self.logger_.info(f"calibrating level {level + 1}/{max_level}")
return func(self, level, separator)

if self.n_jobs > 1:
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ exclude = **/__init__.py, docs/source/conf.py
;file.py: error

[requires]
python_version = ">=3.8,<3.12"
python_version = ">=3.8,<3.13"

# See the docstring in versioneer.py for instructions. Note that you must
# re-run 'versioneer.py setup' after changing this section, and commit the
Expand Down
10 changes: 4 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
URL_ISSUES = "https://github.com/scikit-learn-contrib/hiclass/issues"
EMAIL = "[email protected], [email protected]"
AUTHOR = "Fabio Malcher Miranda, Niklas Koehnecke"
REQUIRES_PYTHON = ">=3.8,<3.12"
REQUIRES_PYTHON = ">=3.8,<3.13"
KEYWORDS = ["hierarchical classification"]
DACS_SOFTWARE = "https://gitlab.com/dacs-hpi"
# What packages are required for this module to be executed?
Expand All @@ -35,11 +35,9 @@
"ray": ["ray>=1.11.0"],
"xai": ["shap==0.44.1", "xarray==2023.1.0"],
"dev": [
"flake8==4.0.1",
"pytest==7.1.2",
"pytest-flake8==1.1.1",
"pydocstyle==6.1.1",
"pytest-pydocstyle==2.3.0",
"flake8",
"pytest",
"pydocstyle",
"pytest-cov==3.0.0",
"pyfakefs==5.3.5",
"black==24.2.0",
Expand Down
Loading