Skip to content

Commit

Permalink
Move CI to ruff and include 3.12 (#26)
Browse files Browse the repository at this point in the history
* Move CI to ruff and include 3.12

* make ruff happy
  • Loading branch information
vankesteren authored Feb 24, 2024
1 parent 03dce16 commit 4a7f979
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 18 deletions.
25 changes: 7 additions & 18 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package

on:
Expand All @@ -18,14 +15,9 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9, "3.10", "3.11"]
metasyn-version: ["metasyn"]
include:
- metasyn-version: "git+https://github.com/sodascience/metasyn.git@main"
python-version: "3.11"
# - metasyn-version: "metasyn==0.6.0"
# python-version: "3.11"

python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
metasyn-version: [ "git+https://github.com/sodascience/metasyn.git@main" ]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -36,20 +28,17 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install ${{ matrix.metasyn-version }}
python -m pip install pylint pytest pydocstyle mypy nbval
python -m pip install ruff mypy pytest nbval
python -m pip install .
- name: Lint with pylint
run: |
pylint metasyncontrib/disclosure
- name: Check docstrings with pydocstyle
- name: Lint with ruff
run: |
pydocstyle metasyncontrib/disclosure --convention=numpy --add-select=D417 --add-ignore="D102,D105,D406"
ruff metasyncontrib/disclosure
- name: Check types with MyPy
run: |
mypy metasyncontrib/disclosure
- name: Test with pytest
run: |
pytest tests
- name: Check notebook output
- name: Check notebook output with pytest
run: |
pytest --nbval-lax examples
1 change: 1 addition & 0 deletions metasyncontrib/disclosure/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ def metadist_disclosure():
-------
cls:
Class with the appropriate class variables.
"""

def _wrap(cls):
Expand Down
1 change: 1 addition & 0 deletions metasyncontrib/disclosure/privacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class DisclosurePrivacy(BasePrivacy):
n_avg:
Number of elements to aggregate into one bin. Higher values
mean better protected privacy, but lower statistical accuracy.
"""

name = "disclosure"
Expand Down
1 change: 1 addition & 0 deletions metasyncontrib/disclosure/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def micro_aggregate(values: pl.Series, min_bin: int = 11) -> pl.Series:
-------
new_values:
Aggregated values.
"""
assert min_bin > 6, "Please use a bigger minimum bin size, or disclosure control will not work."
cur_settings = [min_bin, 0, 0]
Expand Down

0 comments on commit 4a7f979

Please sign in to comment.