Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11']
python-version: ['3.11', '3.12', '3.13']
os: [macos-latest, ubuntu-latest, windows-latest]
env:
# Display must be available globally for linux to know where xvfb is
Expand Down Expand Up @@ -53,6 +53,7 @@ jobs:
env:
# github token required for testing update.py
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERAGE_CORE: sysmon # for py>=3.12 this is much faster
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would oppose putting coverage configuration in the CI yaml, because:

  1. This has nothing to do with CI and will make CI-debugging hard. -> maintenance burden
  2. The (theoretical) performance boost is negligible for CI pipelines. CI for PyJibe is not running that often anyway.
  3. sysmon will be the default in the future anyway: https://coverage.readthedocs.io/en/7.12.0/config.html#run-core

run: |
coverage run --source=pyjibe -m pytest -x tests
- name: Lint with flake8
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,7 @@ _version_save.py

.idea

pyjibe/_version.py
pyjibe/_version.py

# uv
uv.lock
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
0.16.4
- setup: support latest python versions (#32, #46)
- setup: support latest matplotlib versions (#32, #46)
0.16.3
- setup: bump afmformats to 0.18.6
- setup: bump nanite to 4.2.3
Expand Down
22 changes: 18 additions & 4 deletions pyjibe/fd/mpl_indent.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,27 @@ def update(self, fdist, rescale_x=None, rescale_y=None):
self.plots["residuals"].set_data(fdist["tip position"]*xscale,
(fdist["fit residuals"])*yscale)
# fit range
xy = self.plots["fit range"].get_xy()
fitrange = (fdist[xaxis]*xscale)[fdist["fit range"]]
fitmin = np.min(fitrange)
fitmax = np.max(fitrange)
xy[:, 0] = fitmax
xy[2:4, 0] = fitmin
self.plots["fit range"].set_xy(xy)
fr_patch = self.plots["fit range"]
# Matplotlib changed `Axes.axvspan` from returning a
# Polygon (3.7.x) to returning a Rectangle (>=3.8).
if hasattr(fr_patch, "set_x") and hasattr(fr_patch, "set_width"):
fr_patch.set_x(fitmin)
fr_patch.set_width(fitmax - fitmin)
else:
xy = np.asarray(fr_patch.get_xy(), dtype=float).copy()
if xy.ndim == 2 and xy.shape[1] == 2 and xy.shape[0] >= 4:
# Expected vertex order:
# (xmin,0),(xmin,1),(xmax,1),(xmax,0),...
xy[0, 0] = fitmin
xy[1, 0] = fitmin
xy[2, 0] = fitmax
xy[3, 0] = fitmax
if xy.shape[0] >= 5:
xy[4, 0] = fitmin
fr_patch.set_xy(xy)

self.update_plot(rescale_x=rescale_x,
rescale_y=rescale_y)
Expand Down
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ license = { text = "GPL version 3.0 or later" }
dependencies = [
"afmformats>=0.18.6",
"nanite>=4.2.3",
# https://github.com/AFM-analysis/PyJibe/issues/32
"matplotlib>=3,<3.7.5", # NavigationToolbar2QT mod
"matplotlib>=3,<4",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be >3.7.5? (Does it work with old versions of matplotlib?)

Please keep the # NavigationToolbar2QT mod comment, because we are still doing that (right?).

"packaging", # for version checking during update
"pyqt6",
]
Expand All @@ -51,4 +50,4 @@ packages = ["pyjibe"]

[tool.setuptools_scm]
write_to = "pyjibe/_version.py"
version_scheme = "post-release"
version_scheme = "post-release"
Loading