Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keep compatible with current python, matplotlib, numpy versions #1193

Merged
merged 11 commits into from
Jan 22, 2025
2 changes: 1 addition & 1 deletion .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: [3.8, 3.9, '3.10', 3.11]
python-version: [3.11, 3.12, 3.13]

steps:
- uses: actions/checkout@v4
Expand Down
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).

## [Unreleased]

## [3.5.4]

## Fixed
- setup.py is now configured to allow numpy 2.x
- contour/contourf artist overloads compatible with matplotlib 3.10

## changed
- actively supporting python 3.11-3.13

## [3.5.3]

### Added
Expand Down Expand Up @@ -397,7 +406,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
### Added
- initial release

[Unreleased]: https://github.com/wright-group/WrightTools/-/compare/3.5.3...master
[Unreleased]: https://github.com/wright-group/WrightTools/-/compare/3.5.4...master
[3.5.4]: https://github.com/wright-group/WrightTools/compare/3.5.3...3.5.4
[3.5.3]: https://github.com/wright-group/WrightTools/compare/3.5.2...3.5.3
[3.5.2]: https://github.com/wright-group/WrightTools/compare/3.5.1...3.5.2
[3.5.1]: https://github.com/wright-group/WrightTools/compare/3.5.0...3.5.1
Expand Down
2 changes: 1 addition & 1 deletion WrightTools/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.5.3
3.5.4
8 changes: 3 additions & 5 deletions WrightTools/artists/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,18 +321,16 @@ def contourf(self, *args, **kwargs):
kwargs["extend"] = "both"
contours = super().contourf(*args, **kwargs)
# fill lines
zorder = contours.collections[0].zorder - 0.1
zorder = contours.zorder - 0.1
levels = (contours.levels[1:] + contours.levels[:-1]) / 2
matplotlib.axes.Axes.contour(
self, *args[:3], levels=levels, cmap=contours.cmap, zorder=zorder
)
# decoration
self.set_facecolor([0.75] * 3)
# PathCollection modifications
for c in contours.collections:
pass
# c.set_rasterized(True)
# c.set_edgecolor('face')
# contours.set_rasterized(True)
# contours.set_edgecolor('face')
return contours

def legend(self, *args, **kwargs):
Expand Down
7 changes: 3 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def read(fname):
"imageio>=2.28.0",
"matplotlib>=3.4.0",
"numexpr",
"numpy>=1.15.0,<2.0",
"numpy>=1.15.0",
"pint",
"python-dateutil",
"scipy",
Expand Down Expand Up @@ -81,10 +81,9 @@ def read(fname):
"Framework :: Matplotlib",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering",
],
)
6 changes: 3 additions & 3 deletions tests/dataset/iadd.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
def test_d1_d2():
p = datasets.COLORS.v0p2_d1_d2_diagonal
data = wt.data.from_COLORS(p)
value = random.randint(-1e5, 1e5)
value = random.randint(-(10**5), 10**5)
original_max = data.ai0.max()
original_min = data.ai0.min()
data.ai0 += value
Expand All @@ -39,7 +39,7 @@ def test_d1_d2_array():
def test_w1():
p = datasets.PyCMDS.w1_000
data = wt.data.from_PyCMDS(p)
value = random.randint(-1e5, 1e5)
value = random.randint(-(10**5), 10**5)
original_max = data.signal.max()
original_min = data.signal.min()
data.signal += value
Expand All @@ -61,7 +61,7 @@ def test_w1_array():
def test_w1_wa():
p = datasets.PyCMDS.w1_wa_000
data = wt.data.from_PyCMDS(p)
value = random.randint(-1e5, 1e5)
value = random.randint(-(10**5), 10**5)
original_max = data.array_signal.max()
original_min = data.array_signal.min()
data.array_signal += value
Expand Down
6 changes: 3 additions & 3 deletions tests/dataset/imul.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
def test_d1_d2():
p = datasets.COLORS.v0p2_d1_d2_diagonal
data = wt.data.from_COLORS(p)
value = random.randint(0, 1e5)
value = random.randint(0, 10**5)
original_max = data.ai0.max()
original_min = data.ai0.min()
data.ai0 *= value
Expand All @@ -39,7 +39,7 @@ def test_d1_d2_array():
def test_w1():
p = datasets.PyCMDS.w1_000
data = wt.data.from_PyCMDS(p)
value = random.randint(0, 1e5)
value = random.randint(0, 10**5)
original_max = data.signal.max()
original_min = data.signal.min()
data.signal *= value
Expand All @@ -61,7 +61,7 @@ def test_w1_array():
def test_w1_wa():
p = datasets.PyCMDS.w1_wa_000
data = wt.data.from_PyCMDS(p)
value = random.randint(0, 1e5)
value = random.randint(0, 10**5)
original_max = data.array_signal.max()
original_min = data.array_signal.min()
data.array_signal *= value
Expand Down
6 changes: 3 additions & 3 deletions tests/dataset/isub.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
def test_d1_d2():
p = datasets.COLORS.v0p2_d1_d2_diagonal
data = wt.data.from_COLORS(p)
value = random.randint(-1e5, 1e5)
value = random.randint(-(10**5), 10**5)
original_max = data.ai0.max()
original_min = data.ai0.min()
data.ai0 -= value
Expand All @@ -39,7 +39,7 @@ def test_d1_d2_array():
def test_w1():
p = datasets.PyCMDS.w1_000
data = wt.data.from_PyCMDS(p)
value = random.randint(-1e5, 1e5)
value = random.randint(-(10**5), 10**5)
original_max = data.signal.max()
original_min = data.signal.min()
data.signal -= value
Expand All @@ -61,7 +61,7 @@ def test_w1_array():
def test_w1_wa():
p = datasets.PyCMDS.w1_wa_000
data = wt.data.from_PyCMDS(p)
value = random.randint(-1e5, 1e5)
value = random.randint(-(10**5), 10**5)
original_max = data.array_signal.max()
original_min = data.array_signal.min()
data.array_signal -= value
Expand Down
6 changes: 3 additions & 3 deletions tests/dataset/itruediv.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
def test_d1_d2():
p = datasets.COLORS.v0p2_d1_d2_diagonal
data = wt.data.from_COLORS(p)
value = random.randint(0, 1e5)
value = random.randint(0, 10**5)
original_max = data.ai0.max()
original_min = data.ai0.min()
data.ai0 /= value
Expand All @@ -39,7 +39,7 @@ def test_d1_d2_array():
def test_w1():
p = datasets.PyCMDS.w1_000
data = wt.data.from_PyCMDS(p)
value = random.randint(0, 1e5)
value = random.randint(0, 10**5)
original_max = data.signal.max()
original_min = data.signal.min()
data.signal /= value
Expand All @@ -61,7 +61,7 @@ def test_w1_array():
def test_w1_wa():
p = datasets.PyCMDS.w1_wa_000
data = wt.data.from_PyCMDS(p)
value = random.randint(0, 1e5)
value = random.randint(0, 10**5)
original_max = data.array_signal.max()
original_min = data.array_signal.min()
data.array_signal /= value
Expand Down
Loading