Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: scikit-learn-contrib/hiclass
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: scikit-learn-contrib/hiclass
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: python3.12
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 3 commits
  • 8 files changed
  • 1 contributor

Commits on Nov 25, 2024

  1. Add support for python 3.12

    mirand863 committed Nov 25, 2024
    Copy the full SHA
    46ed16b View commit details
  2. Remove flake8 and pydocstyle from pytest command

    mirand863 committed Nov 25, 2024
    Copy the full SHA
    83ee6e8 View commit details
  3. Add flake8 and pydocstyle to precommit

    mirand863 committed Nov 25, 2024
    Copy the full SHA
    ad5972d View commit details
Showing with 27 additions and 16 deletions.
  1. +4 −2 .github/workflows/deploy-pypi.yml
  2. +4 −2 .github/workflows/test-pr.yml
  3. +9 −0 .pre-commit-config.yaml
  4. +1 −1 CONTRIBUTING.md
  5. +2 −2 hiclass/HierarchicalClassifier.py
  6. +2 −2 hiclass/LocalClassifierPerLevel.py
  7. +1 −1 setup.cfg
  8. +4 −6 setup.py
6 changes: 4 additions & 2 deletions .github/workflows/deploy-pypi.yml
Original file line number Diff line number Diff line change
@@ -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
@@ -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'
6 changes: 4 additions & 2 deletions .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
@@ -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
@@ -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
@@ -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
@@ -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:
4 changes: 2 additions & 2 deletions hiclass/HierarchicalClassifier.py
Original file line number Diff line number Diff line change
@@ -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:
@@ -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:
4 changes: 2 additions & 2 deletions hiclass/LocalClassifierPerLevel.py
Original file line number Diff line number Diff line change
@@ -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:
@@ -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:
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -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
10 changes: 4 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@
URL_ISSUES = "https://github.com/scikit-learn-contrib/hiclass/issues"
EMAIL = "fabio.malchermiranda@hpi.de, Niklas.Koehnecke@student.hpi.uni-potsdam.de"
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?
@@ -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",