Skip to content

Commit

Permalink
setup: bump afmformats and nanite and refactor related code
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Aug 2, 2021
1 parent 95f2e4a commit 19f9139
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 12 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
0.9.4
- enh: only show exact sneddon model "sneddon_spher" in developer
mode to avoid confusion
- setup: bump afmformats from 0.15.0 to 0.16.0
- setup: bump nanite from 1.7.6 to 2.0.0
0.9.3
- fix: possible fix for TypeError in InfDoubleSpinBox
- setup: bump afmformats from 0.14.3 to 0.15.0 as well as
Expand Down
3 changes: 1 addition & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ scipy
# sphinx>=1.6.4,<2
sphinxcontrib.bibtex>=2.0
sphinx_rtd_theme
# bullet-points not rendering.
# https://stackoverflow.com/questions/67542699/readthedocs-sphinx-not-rendering-bullet-list-from-rst-file
# https://github.com/readthedocs/sphinx_rtd_theme/issues/1115
docutils==0.16
18 changes: 13 additions & 5 deletions pyjibe/fd/mpl_indent.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import warnings

from matplotlib.figure import Figure
import matplotlib.gridspec as gridspec
from matplotlib.backends.backend_qt5agg import (
FigureCanvasQTAgg as FigureCanvas)
import numpy as np


from .. import units
from ..head import custom_widgets

Expand Down Expand Up @@ -76,11 +77,18 @@ def update(self, fdist, rescale_x=None, rescale_y=None):
yunit = units.hrunit(yaxis)

# approach and retract data
for segment in ["approach", "retract"]:
segment_bool = segment == "retract"
if fdist.metadata["segment count"] == 2:
segments = ["approach", "retract"]
else:
segments = ["approach", "intermediate", "retract"]
for ii, segment in enumerate(segments):
if segment == "intermediate":
# Dear future self...
warnings.warn("Ignoring 'intermediate' segment!")
continue
self.plots[segment].set_data(
fdist[xaxis][fdist["segment"] == segment_bool]*xscale,
fdist[yaxis][fdist["segment"] == segment_bool]*yscale)
fdist[xaxis][fdist["segment"] == ii]*xscale,
fdist[yaxis][fdist["segment"] == ii]*yscale)

self.axis_res.set_xlabel("{} [{}]".format(xaxis, xunit))
self.axis_res.set_ylabel("residuals [{}]".format(yunit))
Expand Down
5 changes: 2 additions & 3 deletions pyjibe/fd/tab_edelta.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,8 @@ def mpl_edelta_update(self):
delta_opt = self.fd.tab_fit.sp_range_1.value()
# Update slider range
xaxis = self.fd.tab_fit.cb_xaxis.currentText()
segment = self.fd.tab_fit.cb_segment.currentText().lower()
segment_bool = segment == "retract"
segid = fdist["segment"] == segment_bool
segment_idx = self.fd.tab_fit.cb_segment.currentIndex()
segid = fdist["segment"] == segment_idx
xdata = fdist[xaxis]
xscale = units.hrscale(xaxis)
minx = np.min(xdata[segid])*xscale
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
license="GPL v3",
description=description,
long_description=open('README.rst').read() if exists('README.rst') else '',
install_requires=["afmformats>=0.15.0",
"nanite>=1.7.8",
install_requires=["afmformats>=0.16.0",
"nanite>=2.0.0",
"matplotlib>=3", # NavigationToolbar2QT mod
"pyqt5"],
python_requires='>=3.6, <4',
Expand Down

0 comments on commit 19f9139

Please sign in to comment.