Skip to content

Commit

Permalink
Bump to python>3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
has2k1 committed Jul 26, 2024
1 parent 1ec7178 commit 1b04aab
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

strategy:
matrix:
python-version: ["3.11"]
python-version: ["3.12"]

steps:
- name: Checkout Code
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

strategy:
matrix:
python-version: ["3.9", "3.12"]
python-version: ["3.10", "3.13"]

steps:
- name: Checkout Code
Expand Down
7 changes: 7 additions & 0 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changelog
=========

v0.12.0
-------

API Changes
-----------
- mizani now requires python 3.9 and above.

v0.11.4
-------
*2024-05-24*
Expand Down
30 changes: 15 additions & 15 deletions mizani/bounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
-----
Expand Down Expand Up @@ -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(
Expand Down
7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down

0 comments on commit 1b04aab

Please sign in to comment.