From a602f094b72de5371925e1fe1f0bd49af04f3b79 Mon Sep 17 00:00:00 2001 From: Ray Osborn <rayosborn@mac.com> Date: Thu, 8 Dec 2022 17:22:15 -0600 Subject: [PATCH 1/2] Remove remnants of PY2 class inheritance --- src/nexusformat/nexus/lock.py | 2 +- src/nexusformat/nexus/plot.py | 2 +- src/nexusformat/nexus/tree.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/nexusformat/nexus/lock.py b/src/nexusformat/nexus/lock.py index 96ad348..922b549 100644 --- a/src/nexusformat/nexus/lock.py +++ b/src/nexusformat/nexus/lock.py @@ -22,7 +22,7 @@ class NXLockException(Exception): LOCK_FAILED = 1 -class NXLock(object): +class NXLock: """Class for acquiring and releasing file-based locks. Attributes diff --git a/src/nexusformat/nexus/plot.py b/src/nexusformat/nexus/plot.py index 9700a83..0433fae 100644 --- a/src/nexusformat/nexus/plot.py +++ b/src/nexusformat/nexus/plot.py @@ -96,7 +96,7 @@ def label(field): return field.nxname -class PylabPlotter(object): +class PylabPlotter: """Matplotlib plotter class for 1D or 2D NeXus data. When the nexusformat package is used within NeXpy, plots are produced by diff --git a/src/nexusformat/nexus/tree.py b/src/nexusformat/nexus/tree.py index d1a32c0..7e5d98a 100644 --- a/src/nexusformat/nexus/tree.py +++ b/src/nexusformat/nexus/tree.py @@ -364,7 +364,7 @@ class NeXusError(Exception): pass -class NXFile(object): +class NXFile: """Interface for input/output to NeXus files using h5py. Usage:: @@ -1808,7 +1808,7 @@ def nxpath(self): return self._parent.nxpath -class NXattr(object): +class NXattr: """Class for NeXus attributes of a NXfield or NXgroup object. Attributes @@ -1932,7 +1932,7 @@ def shape(self): _npattrs = list(filter(lambda x: not x.startswith('_'), np.ndarray.__dict__)) -class NXobject(object): +class NXobject: """Abstract base class for elements in NeXus files. From 2a2475920de53126de558130edd30c11c656f437 Mon Sep 17 00:00:00 2001 From: Ray Osborn <rayosborn@mac.com> Date: Thu, 8 Dec 2022 17:26:31 -0600 Subject: [PATCH 2/2] Rename PylabPlotter to PyplotPlotter Pylab is no longer supported, so PyplotPlotter is now appropriate. --- src/nexusformat/nexus/plot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nexusformat/nexus/plot.py b/src/nexusformat/nexus/plot.py index 0433fae..1dd30ba 100644 --- a/src/nexusformat/nexus/plot.py +++ b/src/nexusformat/nexus/plot.py @@ -96,7 +96,7 @@ def label(field): return field.nxname -class PylabPlotter: +class PyplotPlotter: """Matplotlib plotter class for 1D or 2D NeXus data. When the nexusformat package is used within NeXpy, plots are produced by @@ -326,4 +326,4 @@ def plot(self, data_group, fmt=None, xmin=None, xmax=None, plt.ion() -plotview = PylabPlotter() +plotview = PyplotPlotter()