Skip to content

Commit

Permalink
Dtypes is deprecated/removed in polars 0.20.31 (#41)
Browse files Browse the repository at this point in the history
* Dtypes is deprecated/removed in polars 0.20.31
* Fix NA distribution
  • Loading branch information
qubixes authored Jun 19, 2024
1 parent 0b86b7b commit b3ba743
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 76 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
metasyn-version: [ "git+https://github.com/sodascience/metasyn.git@main"]
include:
- python-version: "3.11"
metasyn-version: "metasyn==1.0.0"
metasyn-version: "metasyn==1.0.1"

steps:
- uses: actions/checkout@v4
Expand Down
144 changes: 73 additions & 71 deletions examples/tutorial.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion metasyncontrib/disclosure/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class DisclosureConstantMixin(BaseDistribution):
"""Mixin class to overload fit method for constant distributions."""

@classmethod
def fit(cls, series, *args, partition_size: int = 11, **kwargs) -> BaseDistribution:
def fit(cls, series, *args, partition_size: int = 11, **kwargs) -> BaseDistribution: #pylint: disable=unused-argument
"""Fit constant distributions with disclosure control rules in place."""
# NB: dominance rule ensures that constant distribution is essentially never
# allowed under formal disclosure control. Always return default distribution.
Expand Down
4 changes: 4 additions & 0 deletions metasyncontrib/disclosure/na.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@
@metadist_disclosure()
class DisclosureNA(NADistribution):
"""Disclosure version of NA distribution."""

@classmethod
def _fit(cls, values, partition_size: int = 11):
return cls.default_distribution()
6 changes: 5 additions & 1 deletion metasyncontrib/disclosure/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@

import numpy as np
import polars as pl
from numpy.core._exceptions import UFuncTypeError

try:
from numpy.core._exceptions import UFuncTypeError # type: ignore
except ImportError:
from numpy._core._exceptions import UFuncTypeError # type: ignore


def _compute_dominance(block_values, reverse=False):
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ classifiers = [
"License :: OSI Approved :: MIT License",
]
dependencies = [
"metasyn>=0.8.0",
"metasyn>=1.0.1",
"polars",
"numpy>=1.20",
"numpy>=1.20,<2.0",
]
dynamic = ["version"]

Expand Down

0 comments on commit b3ba743

Please sign in to comment.