Skip to content

Commit

Permalink
Tweak to deal with missing scipy.ndimage.measurements.morphology and …
Browse files Browse the repository at this point in the history
…bump version number
  • Loading branch information
gb119 committed Jul 2, 2022
1 parent 3da57d5 commit 5e61699
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion Stoner/Analysis.py
Expand Up @@ -160,7 +160,10 @@ def decompose(self, xcol=None, ycol=None, sym=None, asym=None, replace=True, **k
ycol = self.find_col(ycol)
if isinstance(ycol, list):
ycol = ycol[0] # FIXME should work with multiple output columns
pxdata = self.search(xcol, lambda x, r: x > 0, xcol)
if np.abs((self//xcol).min())<np.abs((self//xcol).max()):
pxdata = self.search(xcol, lambda x, r: x < 0, xcol)
else:
pxdata = self.search(xcol, lambda x, r: x > 0, xcol)
xdata = np.sort(np.append(-pxdata, pxdata))
self.data = self.interpolate(xdata, xcol=xcol)
ydata = self.data[:, ycol]
Expand Down
2 changes: 1 addition & 1 deletion Stoner/__init__.py
Expand Up @@ -35,7 +35,7 @@
Options = _Options()


__version_info__ = ("0", "10", "4")
__version_info__ = ("0", "10", "5")
__version__ = ".".join(__version_info__)

__homepath__ = pathlib.Path(__file__).parent.resolve()
Expand Down
5 changes: 4 additions & 1 deletion Stoner/tools/decorators.py
Expand Up @@ -312,7 +312,10 @@ def actual_decorator(cls):
continue # Do not bind all the external functions if we're in ReadTheDocs
for fname in dir(mod):
if not fname.startswith("_"):
func = getattr(mod, fname)
try:
func = getattr(mod, fname)
except AttributeError: # This shouldn't happen, but it did for scipy.ndimage!
continue
fmod = getattr(func, "__module__", getattr(getattr(func, "__class__", None), "__module__", ""))
if callable(func) and isinstance(fmod, str) and fmod[:5] in ["Stone", "scipy", "skima"]:
if transpose:
Expand Down

0 comments on commit 5e61699

Please sign in to comment.