Skip to content

Commit

Permalink
Get docs to build
Browse files Browse the repository at this point in the history
  • Loading branch information
kwinkunks committed Sep 4, 2023
1 parent f3190f3 commit 85d47c4
Show file tree
Hide file tree
Showing 4 changed files with 129 additions and 73 deletions.
176 changes: 112 additions & 64 deletions docs/notebooks/Basic_usage.ipynb

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ dev = [
"pytest-cov",
"sphinx",
"sphinxcontrib-apidoc",
"sphinx_copybutton",
"furo",
"myst_nb",
"jupyter",
Expand Down
18 changes: 12 additions & 6 deletions src/redflag/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,17 @@
from .importance import *
from .outliers import *

# From https://github.com/pypa/setuptools_scm
from importlib.metadata import version, PackageNotFoundError

from pkg_resources import get_distribution, DistributionNotFound
try:
__version__ = version("package-name")
except PackageNotFoundError:
# package is not installed
pass
VERSION = get_distribution(__name__).version
except DistributionNotFound:
try:
from ._version import version as VERSION
except ImportError:
raise ImportError(
"Failed to find (autogenerated) _version.py. "
"This might be because you are installing from GitHub's tarballs, "
"use the PyPI ones."
)
__version__ = VERSION
7 changes: 4 additions & 3 deletions src/redflag/distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,12 +258,13 @@ def wasserstein(X: ArrayLike,
pass

if stacked:
if not is_standard_normal(first.flat):
warnings.warn('First group does not appear to be standardized.', stacklevel=2)
# Not sure this test makes sense any more.
# if not is_standard_normal(first.flat):
# warnings.warn('First group does not appear to be standardized.', stacklevel=2)
groups = np.hstack([len(dataset)*[i] for i, dataset in enumerate(X)])
X = np.vstack(X)

# Now we can certainly treat X as a 2D array.
# Now we can treat X as a 2D array.
X = np.asarray(X)
if X.ndim != 2:
raise ValueError("X must be a 2D array-like.")
Expand Down

0 comments on commit 85d47c4

Please sign in to comment.