From 15dd13229b334a0972ca7d568a39e9cbd2f42518 Mon Sep 17 00:00:00 2001 From: Jan Kotanski Date: Fri, 27 Sep 2024 15:02:16 +0200 Subject: [PATCH] fix for metadata parser of groups without NX_class --- ChangeLog | 4 ++++ man/nxscollect.1 | 2 +- man/nxsconfig.1 | 2 +- man/nxscreate.1 | 2 +- man/nxsdata.1 | 2 +- man/nxsetup.1 | 2 +- man/nxsfileinfo.1 | 2 +- man/nxstools.1 | 2 +- nxstools/nxsfileparser.py | 6 ++++-- nxstools/release.py | 2 +- 10 files changed, 16 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2bf9b1cf..d2d834c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2024-09-27 Jan Kotanski + * fix for metadata parser of groups without NX_class (#718) + * tagged as v4.16.1 + 2024-09-26 Jan Kotanski * add enum as a valid secop type(#715) * tagged as v4.16.0 diff --git a/man/nxscollect.1 b/man/nxscollect.1 index a4d4d88d..e2dbb360 100644 --- a/man/nxscollect.1 +++ b/man/nxscollect.1 @@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "NXSCOLLECT" "1" "Sep 11, 2024" "4.15" "NXSTools" +.TH "NXSCOLLECT" "1" "Sep 27, 2024" "4.16" "NXSTools" .SH NAME nxscollect \- upload external images into NeXus/HDF5 file .SH DESCRIPTION diff --git a/man/nxsconfig.1 b/man/nxsconfig.1 index 13b04bed..8460757d 100644 --- a/man/nxsconfig.1 +++ b/man/nxsconfig.1 @@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "NXSCONFIG" "1" "Sep 11, 2024" "4.15" "NXSTools" +.TH "NXSCONFIG" "1" "Sep 27, 2024" "4.16" "NXSTools" .SH NAME nxsconfig \- read NeXus Configuration Server settings .SH DESCRIPTION diff --git a/man/nxscreate.1 b/man/nxscreate.1 index d4a6791d..657e89bf 100644 --- a/man/nxscreate.1 +++ b/man/nxscreate.1 @@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "NXSCREATE" "1" "Sep 11, 2024" "4.15" "NXSTools" +.TH "NXSCREATE" "1" "Sep 27, 2024" "4.16" "NXSTools" .SH NAME nxscreate \- create NeXus Configuration component .SH DESCRIPTION diff --git a/man/nxsdata.1 b/man/nxsdata.1 index 990142a0..111732ae 100644 --- a/man/nxsdata.1 +++ b/man/nxsdata.1 @@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "NXSDATA" "1" "Sep 11, 2024" "4.15" "NXSTools" +.TH "NXSDATA" "1" "Sep 27, 2024" "4.16" "NXSTools" .SH NAME nxsdata \- run NeXus Data Writer .SH DESCRIPTION diff --git a/man/nxsetup.1 b/man/nxsetup.1 index 08ac0a40..3d2cb197 100644 --- a/man/nxsetup.1 +++ b/man/nxsetup.1 @@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "NXSETUP" "1" "Sep 11, 2024" "4.15" "NXSTools" +.TH "NXSETUP" "1" "Sep 27, 2024" "4.16" "NXSTools" .SH NAME nxsetup \- set NeXDaTaS Tango Server environment up .SH DESCRIPTION diff --git a/man/nxsfileinfo.1 b/man/nxsfileinfo.1 index b06413a3..df20f4ef 100644 --- a/man/nxsfileinfo.1 +++ b/man/nxsfileinfo.1 @@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "NXSFILEINFO" "1" "Sep 11, 2024" "4.15" "NXSTools" +.TH "NXSFILEINFO" "1" "Sep 27, 2024" "4.16" "NXSTools" .SH NAME nxsfileinfo \- show metadata of the NeXus file .SH DESCRIPTION diff --git a/man/nxstools.1 b/man/nxstools.1 index 8d887c14..c0067e59 100644 --- a/man/nxstools.1 +++ b/man/nxstools.1 @@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "NXSTOOLS" "1" "Sep 11, 2024" "4.15" "NXSTools" +.TH "NXSTOOLS" "1" "Sep 27, 2024" "4.16" "NXSTools" .SH NAME nxstools \- nxstools Documentation .sp diff --git a/nxstools/nxsfileparser.py b/nxstools/nxsfileparser.py index 9f78da40..1b52b2a1 100644 --- a/nxstools/nxsfileparser.py +++ b/nxstools/nxsfileparser.py @@ -604,10 +604,12 @@ def parseMeta(self): """ for entry in self.__root: nm = entry.name + at = None try: - at = entry.attributes["NX_class"] + if "NX_class" in entry.attributes.names(): + at = entry.attributes["NX_class"] except Exception: - at = None + pass if len(self.entryclasses) == 0 or \ at and (filewriter.first(at.read()) in self.entryclasses): if len(self.entrynames) == 0 or \ diff --git a/nxstools/release.py b/nxstools/release.py index 5c4bd422..bce9eec9 100644 --- a/nxstools/release.py +++ b/nxstools/release.py @@ -19,4 +19,4 @@ """ NXS tools release version""" #: (:obj:`str`) package version -__version__ = "4.16.0" +__version__ = "4.16.1"