[Nexus] Announcing beta-version of the NXvalidate Python package

Sandor Brockhauser sandor.brockhauser at physik.hu-berlin.de
Tue Sep 17 17:35:12 BST 2024


Dear Ray,

You may consider something what we do in pynxtools: 
https://github.com/FAIRmat-NFDI/pynxtools by using submodule on the git 
side and making everything packaged together on pip side. Obviously, 
supporting an arbitrary directory with the definitions, is also a nice 
solution. (we support that via environment variables)

Note that our package also provides command line tools:

- 'read_nexus' for annotating all Groups/Fields/Attributes in a NeXus 
files by providing all documentations along the chain of the interface 
inheritance of the NeXus definition it belongs to.

- 'verify_nexus' for checking compliance with NeXus application 
definitions.

See more on our documentation page: 
https://fairmat-nfdi.github.io/pynxtools/how-tos/validate-nexus-file.html

Bests,
Sandor

On 2024-09-17 15:03, Osborn, Raymond via NeXus wrote:

> Hi Jens,
> 
> Thanks for the suggestion. Code maintenance is always an issue, but I 
> had planned to issue a new release whenever there was an official NeXus 
> release, which is not that frequent. I'm reluctant to complicate the 
> installation process, but I think we could achieve what you are 
> requesting by allowing an option to point to another directory 
> containing the definitions. That directory, for example, could be part 
> of a cloned nexusformat git repository that the user can keep updated. 
> I should be able to implement that in the next few days.
> 
> With regards,
> 
> Ray
> 
> --
> Ray Osborn, Senior Scientist
> Materials Science Division
> Argonne National Laboratory
> Lemont, IL 60439, USA
> Phone: +1 (630) 252-9011
> Email: ROsborn at anl.gov
> 
> From: NeXus <nexus-bounces at shadow.nd.rl.ac.uk> on behalf of Jens Krüger 
> via NeXus <nexus at shadow.nd.rl.ac.uk>
> Date: Tuesday, September 17, 2024 at 1:29 AM
> To: nexus at nexusformat.org <nexus at nexusformat.org>
> Cc: Jens Krüger <Jens.Krueger at frm2.tum.de>
> Subject: Re: [Nexus] Announcing beta-version of the NXvalidate Python 
> package
> 
> Hi Ray, thanks for the information about the nxinspect tool and the 
> effort you put into this project. I have a question: Wouldn't it make 
> sense to download all the definitions from the nexusformat. org during 
> the installation and use them locally
> 
> ZjQcmQRYFpfptBannerStart
> 
> This Message Is From an External Sender
> 
> This message came from outside your organization.
> 
> ZjQcmQRYFpfptBannerEnd
> 
> Hi Ray,
> 
> thanks for the information about the nxinspect tool and the effort you
> 
> put into this project.
> 
> I have a question: Wouldn't it make sense to download all the
> 
> definitions from the nexusformat.org
> 
> during the installation and use them locally instead of put them into
> 
> the repo? I'm afraid,
> 
> that the sync between nexpy and nexusformat repos could be a big
> 
> challenge in the future.
> 
> Best regards
> 
> Jens
> 
> Am 16.09.24 um 18:04 schrieb Osborn, Raymond via NeXus:
> 
>> I am happy to announce that we have just issued the first beta-release 
>> of NXvalidate 
>> (https://urldefense.us/v3/__https://github.com/nexpy/nxvalidate__;!!G_uCfscf7eWS!dBKs6J3MTRu8kT6R8Vfk1ILUz-I_1i71_Vh7ySBK_KpCdajICcg6uNBz-EHhHtwoin6wbp59N6si9gtziFrBLA$ 
>> [1]), a new Python package used to inspect and validate NeXus files. 
>> It is currently available for installation on the PyPI server and the 
>> source code can be downloaded from Github. When it is more mature, it 
>> will be merged into the nexusformat package, with a GUI interface in 
>> NeXpy 
>> (https://urldefense.us/v3/__https://nexpy.github.io/nexpy/__;!!G_uCfscf7eWS!dBKs6J3MTRu8kT6R8Vfk1ILUz-I_1i71_Vh7ySBK_KpCdajICcg6uNBz-EHhHtwoin6wbp59N6si9gv42bvToA$ 
>> [2]). I hope to discuss this at the upcoming meeting of the NeXus 
>> International Advisory Committee and would welcome any feedback if you 
>> try it out before then. Please note that this is not a production 
>> release. Please post any issues to 
>> https://urldefense.us/v3/__https://github.com/nexpy/nxvalidate/issues__;!!G_uCfscf7eWS!dBKs6J3MTRu8kT6R8Vfk1ILUz-I_1i71_Vh7ySBK_KpCdajICcg6uNBz-EHhHtwoin6wbp59N6si9gsrqLSP2Q$ 
>> [3].
> 
>> 
> 
>> Installation
> 
>> Released versions of nxvalidate can be installed using "pip install 
>> nxvalidate" and the source code can be downloaded from the NeXpy Git 
>> repository:
> 
>> 
> 
>> % git clone 
>> https://urldefense.us/v3/__http://github.com/nexpy/nxvalidate.git__;!!G_uCfscf7eWS!dBKs6J3MTRu8kT6R8Vfk1ILUz-I_1i71_Vh7ySBK_KpCdajICcg6uNBz-EHhHtwoin6wbp59N6si9gtz4Uru8A$ 
>> [4]
> 
>> 
> 
>> Usage
> 
>> The nxvalidate package provides a single command-line script.
> 
>> 
> 
>> % nxinspect -h
> 
>> usage: nxinspect [-h] [-f FILENAME] [-p PATH] [-a [APPLICATION]]
> 
>> [-b BASECLASS] [-i] [-w] [-e] [-v]
> 
>> 
> 
>> Inspects and validates NeXus files.
> 
>> 
> 
>> options:
> 
>> -h, --help            show this help message and exit
> 
>> -f FILENAME, --filename FILENAME
> 
>> name of the NeXus file to be validated
> 
>> -p PATH, --path PATH
> 
>> path to group to be validated in the NeXus file
> 
>> -b BASECLASS, --baseclass BASECLASS
> 
>> name of the base class to be listed
> 
>> -a [APPLICATION], --application [APPLICATION]
> 
>> validate the NeXus file against its application definition
> 
>> -i, --info            output info messages in addition to warnings and 
>> errors
> 
>> -w, --warning         output info messages in addition to warnings and 
>> errors
> 
>> -e, --error           output info messages in addition to warnings and 
>> errors
> 
>> -v, --version         show program's version number and exit
> 
>> 
> 
>> N.B., the command is "nxinspect," rather than "nxvalidate" to avoid 
>> confusion with the existing "cnxvalidate" application 
>> (https://urldefense.us/v3/__https://github.com/nexusformat/cnxvalidate__;!!G_uCfscf7eWS!dBKs6J3MTRu8kT6R8Vfk1ILUz-I_1i71_Vh7ySBK_KpCdajICcg6uNBz-EHhHtwoin6wbp59N6si9gtoRsqAFg$ 
>> [5]).
> 
>> 
> 
>> Examples
> 
>> 
> 
>> 1.  To compare the contents of a NeXus file with the base classes 
>> defined by the NeXus standard and print conflicting fields or groups, 
>> type:
> 
>> 
> 
>> % nxinspect -f <filename.nxs> -e
> 
>> 
> 
>> The --info, --warning and --error switches control how much 
>> information is output. The default is --warning.
> 
>> 
> 
>> 2.  To check whether the contents of the NeXus file conform to the 
>> required contents of the application definition specified in the file, 
>> type:
> 
>> 
> 
>> % nxinspect -f <filename.nxs> -a
> 
>> 
> 
>> 3.  To check whether the contents of the NeXus file conform to the 
>> required contents of an application definition file, type:
> 
>> 
> 
>> % nxinspect -f <filename.nxs> -a <application.nxdl.xml>
> 
>> 
> 
>> 4.  To print the contents of a base class, type:
> 
>> 
> 
>> % nxinspect -b <base-class-name>
> 
>> 
> 
>> With regards,
> 
>> Ray Osborn
> 
>> --
> 
>> Ray Osborn, Senior Scientist
> 
>> Materials Science Division
> 
>> Argonne National Laboratory
> 
>> Lemont, IL 60439, USA
> 
>> Phone: +1 (630) 252-9011
> 
>> Email: ROsborn at anl.gov
> 
>> 
> 
>> 
> 
>> 
> 
>> 
> 
>> 
> 
>> _______________________________________________
> 
>> NeXus mailing list
> 
>> NeXus at nexusformat.org
> 
>> https://urldefense.us/v3/__https://lists.nexusformat.org/mailman/listinfo/nexus__;!!G_uCfscf7eWS!dBKs6J3MTRu8kT6R8Vfk1ILUz-I_1i71_Vh7ySBK_KpCdajICcg6uNBz-EHhHtwoin6wbp59N6si9guwW37CUg$ 
>> [6]
> 
> --
> 
> Dipl.-Phys. Jens Krüger
> 
> Leiter Gruppe Instrumentsteuerung
> 
> Head of Instrument control group
> 
> Technische Universität München
> 
> Forschungsneutronenquelle
> 
> Heinz Maier-Leibnitz (FRM II)
> 
> Lichtenberg-Str. 1
> 
> D-85748 Garching
> 
> Tel: + 49 (0)89 289 14716
> 
> Fax: + 49 (0)89 289 14620
> 
> mailto: jens.krueger at frm2.tum.de
> 
> https://urldefense.us/v3/__https://www.frm2.tum.de__;!!G_uCfscf7eWS!dBKs6J3MTRu8kT6R8Vfk1ILUz-I_1i71_Vh7ySBK_KpCdajICcg6uNBz-EHhHtwoin6wbp59N6si9gu-04bayA$ 
> [7]
> 
> https://urldefense.us/v3/__https://www.mlz-garching.de__;!!G_uCfscf7eWS!dBKs6J3MTRu8kT6R8Vfk1ILUz-I_1i71_Vh7ySBK_KpCdajICcg6uNBz-EHhHtwoin6wbp59N6si9gtT85dm6Q$ 
> [8]
> 
> _______________________________________________
> 
> NeXus mailing list
> 
> NeXus at nexusformat.org
> 
> https://urldefense.us/v3/__https://lists.nexusformat.org/mailman/listinfo/nexus__;!!G_uCfscf7eWS!dBKs6J3MTRu8kT6R8Vfk1ILUz-I_1i71_Vh7ySBK_KpCdajICcg6uNBz-EHhHtwoin6wbp59N6si9guwW37CUg$ 
> [6]
> 
> _______________________________________________
> NeXus mailing list
> NeXus at nexusformat.org
> https://lists.nexusformat.org/mailman/listinfo/nexus


Links:
------
[1] 
https://urldefense.us/v3/__https:/github.com/nexpy/nxvalidate__;!!G_uCfscf7eWS!dBKs6J3MTRu8kT6R8Vfk1ILUz-I_1i71_Vh7ySBK_KpCdajICcg6uNBz-EHhHtwoin6wbp59N6si9gtziFrBLA$
[2] 
https://urldefense.us/v3/__https:/nexpy.github.io/nexpy/__;!!G_uCfscf7eWS!dBKs6J3MTRu8kT6R8Vfk1ILUz-I_1i71_Vh7ySBK_KpCdajICcg6uNBz-EHhHtwoin6wbp59N6si9gv42bvToA$
[3] 
https://urldefense.us/v3/__https:/github.com/nexpy/nxvalidate/issues__;!!G_uCfscf7eWS!dBKs6J3MTRu8kT6R8Vfk1ILUz-I_1i71_Vh7ySBK_KpCdajICcg6uNBz-EHhHtwoin6wbp59N6si9gsrqLSP2Q$
[4] 
https://urldefense.us/v3/__http:/github.com/nexpy/nxvalidate.git__;!!G_uCfscf7eWS!dBKs6J3MTRu8kT6R8Vfk1ILUz-I_1i71_Vh7ySBK_KpCdajICcg6uNBz-EHhHtwoin6wbp59N6si9gtz4Uru8A$
[5] 
https://urldefense.us/v3/__https:/github.com/nexusformat/cnxvalidate__;!!G_uCfscf7eWS!dBKs6J3MTRu8kT6R8Vfk1ILUz-I_1i71_Vh7ySBK_KpCdajICcg6uNBz-EHhHtwoin6wbp59N6si9gtoRsqAFg$
[6] 
https://urldefense.us/v3/__https:/lists.nexusformat.org/mailman/listinfo/nexus__;!!G_uCfscf7eWS!dBKs6J3MTRu8kT6R8Vfk1ILUz-I_1i71_Vh7ySBK_KpCdajICcg6uNBz-EHhHtwoin6wbp59N6si9guwW37CUg$
[7] 
https://urldefense.us/v3/__https:/www.frm2.tum.de__;!!G_uCfscf7eWS!dBKs6J3MTRu8kT6R8Vfk1ILUz-I_1i71_Vh7ySBK_KpCdajICcg6uNBz-EHhHtwoin6wbp59N6si9gu-04bayA$
[8] 
https://urldefense.us/v3/__https:/www.mlz-garching.de__;!!G_uCfscf7eWS!dBKs6J3MTRu8kT6R8Vfk1ILUz-I_1i71_Vh7ySBK_KpCdajICcg6uNBz-EHhHtwoin6wbp59N6si9gtT85dm6Q$
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.nexusformat.org/pipermail/nexus/attachments/20240917/59fb2c06/attachment-0003.htm>


More information about the NeXus mailing list