diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 33ad893..4c487bf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,7 +20,7 @@ jobs: strategy: matrix: - python-version: ["3.11"] + python-version: ["3.12"] steps: - name: Checkout Code diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 46e6dd0..9d19816 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -19,7 +19,7 @@ jobs: strategy: matrix: - python-version: ["3.9", "3.12"] + python-version: ["3.10", "3.13"] steps: - name: Checkout Code diff --git a/doc/changelog.rst b/doc/changelog.rst index ac26935..ffbe96c 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -1,6 +1,13 @@ Changelog ========= +v0.12.0 +------- + +API Changes +----------- +- mizani now requires python 3.9 and above. + v0.11.4 ------- *2024-05-24* diff --git a/mizani/bounds.py b/mizani/bounds.py index 4b81040..83879b4 100644 --- a/mizani/bounds.py +++ b/mizani/bounds.py @@ -246,10 +246,10 @@ def squish_infinite( -------- >>> arr1 = np.array([0, .5, .25, np.inf, .44]) >>> arr2 = np.array([0, -np.inf, .5, .25, np.inf]) - >>> list(squish_infinite(arr1)) - [0.0, 0.5, 0.25, 1.0, 0.44] - >>> list(squish_infinite(arr2, (-10, 9))) - [0.0, -10.0, 0.5, 0.25, 9.0] + >>> squish_infinite(arr1) + array([0. , 0.5 , 0.25, 1. , 0.44]) + >>> squish_infinite(arr2, (-10, 9)) + array([ 0. , -10. , 0.5 , 0.25, 9. ]) """ _x = np.array(x, copy=True) _x[np.isneginf(_x)] = range[0] @@ -279,11 +279,11 @@ def squish( Examples -------- - >>> list(squish([-1.5, 0.2, 0.8, 1.0, 1.2])) - [0.0, 0.2, 0.8, 1.0, 1.0] + >>> squish([-1.5, 0.2, 0.8, 1.0, 1.2]) + array([0. , 0.2, 0.8, 1. , 1. ]) - >>> list(squish([-np.inf, -1.5, 0.2, 0.8, 1.0, np.inf], only_finite=False)) - [0.0, 0.0, 0.2, 0.8, 1.0, 1.0] + >>> squish([-np.inf, -1.5, 0.2, 0.8, 1.0, np.inf], only_finite=False) + array([0. , 0. , 0.2, 0.8, 1. , 1. ]) """ _x = np.array(x, copy=True) finite = np.isfinite(_x) if only_finite else True @@ -318,12 +318,12 @@ def censor( Examples -------- >>> a = np.array([1, 2, np.inf, 3, 4, -np.inf, 5]) - >>> list(censor(a, (0, 10))) - [1.0, 2.0, inf, 3.0, 4.0, -inf, 5.0] - >>> list(censor(a, (0, 10), False)) - [1.0, 2.0, nan, 3.0, 4.0, nan, 5.0] - >>> list(censor(a, (2, 4))) - [nan, 2.0, inf, 3.0, 4.0, -inf, nan] + >>> censor(a, (0, 10)) + array([ 1., 2., inf, 3., 4., -inf, 5.]) + >>> censor(a, (0, 10), False) + array([ 1., 2., nan, 3., 4., nan, 5.]) + >>> censor(a, (2, 4)) + array([ nan, 2., inf, 3., 4., -inf, nan]) Notes ----- @@ -431,7 +431,7 @@ def zero_range(x: tuple[Any, Any], tol: float = EPSILON * 100) -> bool: if low_abs == 0: return False - return ((high - low) / low_abs) < tol + return bool(((high - low) / low_abs) < tol) def expand_range( diff --git a/pyproject.toml b/pyproject.toml index e718b9c..a5fd0a8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,19 +12,18 @@ classifiers = [ "Intended Audience :: Science/Research", "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Topic :: Scientific/Engineering :: Visualization" ] dependencies = [ - "numpy>=1.23.0", + "numpy>=1.23.5", "scipy>=1.7.0", - "pandas>=2.1.0", + "pandas>=2.2.0", "tzdata;platform_system=='Windows' or platform_system=='Emscripten'" ] -requires-python = ">=3.9" +requires-python = ">=3.10" [project.optional-dependencies] all = [