NeXpy 2.1.0__tar.gz → 2.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {nexpy-2.1.0 → nexpy-2.2.0}/PKG-INFO +3 -3
- {nexpy-2.1.0 → nexpy-2.2.0}/README.md +1 -1
- {nexpy-2.1.0 → nexpy-2.2.0}/conda-recipe/meta.yaml +5 -5
- {nexpy-2.1.0 → nexpy-2.2.0}/docs/source/conf.py +1 -1
- nexpy-2.2.0/docs/source/images/validation-panel.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/docs/source/pythongui.rst +40 -12
- {nexpy-2.1.0 → nexpy-2.2.0}/docs/source/pythonshell.rst +23 -4
- {nexpy-2.1.0 → nexpy-2.2.0}/pyproject.toml +1 -1
- {nexpy-2.1.0 → nexpy-2.2.0}/src/NeXpy.egg-info/PKG-INFO +3 -3
- {nexpy-2.1.0 → nexpy-2.2.0}/src/NeXpy.egg-info/SOURCES.txt +3 -1
- {nexpy-2.1.0 → nexpy-2.2.0}/src/NeXpy.egg-info/requires.txt +1 -1
- {nexpy-2.1.0 → nexpy-2.2.0}/src/NeXpy.egg-info/scm_file_list.json +3 -1
- nexpy-2.2.0/src/NeXpy.egg-info/scm_version.json +8 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/_version.py +3 -3
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/gui/dialogs.py +54 -10
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/gui/fitdialogs.py +249 -6
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/gui/mainwindow.py +1 -1
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/gui/treeview.py +4 -1
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/gui/utils.py +36 -12
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/gui/widgets.py +4 -0
- nexpy-2.2.0/tests/test_expand_node.py +37 -0
- nexpy-2.2.0/tests/test_report_error.py +67 -0
- nexpy-2.1.0/docs/source/images/validation-panel.png +0 -0
- nexpy-2.1.0/src/NeXpy.egg-info/scm_version.json +0 -8
- {nexpy-2.1.0 → nexpy-2.2.0}/.gitattributes +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/.github/dependabot.yaml +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/.github/workflows/ci.yml +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/.github/workflows/sphinx.yml +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/.gitignore +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/.pre-commit-config.yaml +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/COPYING +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/README.rst +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/conda-recipe/bld.bat +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/conda-recipe/build.sh +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/docs/.nojekyll +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/docs/Makefile +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/docs/make.bat +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/docs/requirements.txt +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/docs/source/_static/__ignore__.txt +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/docs/source/examples.rst +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/docs/source/favicon.ico +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/docs/source/images/axis-limits-bar.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/docs/source/images/customize-panel.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/docs/source/images/limits-panel.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/docs/source/images/manage-plugins.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/docs/source/images/nexpy-fits.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/docs/source/images/nexpy-gui.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/docs/source/images/nexpy-logo.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/docs/source/images/options-tab.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/docs/source/images/projection-panel.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/docs/source/images/projection-tab.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/docs/source/images/rotation-plot.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/docs/source/images/scan-panel.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/docs/source/images/signal-tab.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/docs/source/images/simple-plot.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/docs/source/images/skewed-axis.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/docs/source/images/x-tab.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/docs/source/images/y-tab.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/docs/source/images/z-tab.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/docs/source/images/z-toolbar.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/docs/source/includeme.rst +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/docs/source/index.rst +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/docs/source/readers.rst +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/docs/source/treeapi.rst +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/scripts/sync_copyright.py +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/scripts/update_copyright.py +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/setup.cfg +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/NeXpy.egg-info/dependency_links.txt +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/NeXpy.egg-info/entry_points.txt +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/NeXpy.egg-info/pbr.json +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/NeXpy.egg-info/top_level.txt +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/__init__.py +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/examples/README.rst +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/examples/chopper.nxs +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/examples/example.nxs +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/examples/plugins/README.rst +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/examples/plugins/chopper_plugin/chopper/__init__.py +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/examples/plugins/chopper_plugin/chopper/__init__.pyc +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/examples/plugins/chopper_plugin/chopper/convert_qe.py +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/examples/plugins/chopper_plugin/chopper/convert_qe.pyc +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/examples/plugins/chopper_plugin/chopper/get_ei.py +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/examples/plugins/chopper_plugin/chopper/get_ei.pyc +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/examples/plugins/chopper_plugin/pyproject.toml +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/examples/scripts/README.rst +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/examples/scripts/chopper_plot.py +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/examples/scripts/example.py +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/gui/__init__.py +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/gui/consoleapp.py +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/gui/datadialogs.py +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/gui/importdialog.py +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/gui/plotview.py +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/gui/pyqt.py +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/gui/resources/NeXpy.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/gui/resources/NeXpy.svg +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/gui/resources/back.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/gui/resources/backward-icon.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/gui/resources/customize.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/gui/resources/equal.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/gui/resources/export-data.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/gui/resources/export-figure.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/gui/resources/filesave.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/gui/resources/forward-icon.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/gui/resources/forward.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/gui/resources/hand.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/gui/resources/home.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/gui/resources/modify-style.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/gui/resources/move.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/gui/resources/pause-icon.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/gui/resources/refresh-icon.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/gui/resources/tree-link.svg +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/gui/resources/tree-lock.svg +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/gui/resources/tree-modified.svg +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/gui/resources/unlock-icon.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/gui/resources/unlock-red-icon.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/gui/resources/zoom_to_rect.png +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/gui/scripteditor.py +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/models/bose.py +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/models/critexp.py +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/models/op.py +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/models/pdfdecay.py +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/nexpygui.py +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/readers/readnpy.py +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/readers/readspec.py +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/readers/readstack.py +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/readers/readtiff.py +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/src/nexpy/readers/readtxt.py +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/tests/test_imports.py +0 -0
- {nexpy-2.1.0 → nexpy-2.2.0}/tests/test_permissions.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: NeXpy
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.2.0
|
|
4
4
|
Summary: Python GUI to analyze NeXus data
|
|
5
5
|
Author-email: Raymond Osborn <rayosborn@mac.com>
|
|
6
6
|
License: Licensing Terms for NeXpy
|
|
@@ -90,7 +90,7 @@ Requires-Dist: ipython
|
|
|
90
90
|
Requires-Dist: lmfit
|
|
91
91
|
Requires-Dist: matplotlib
|
|
92
92
|
Requires-Dist: mplcursors
|
|
93
|
-
Requires-Dist: nexusformat>=2.
|
|
93
|
+
Requires-Dist: nexusformat>=2.2.0
|
|
94
94
|
Requires-Dist: numpy
|
|
95
95
|
Requires-Dist: packaging
|
|
96
96
|
Requires-Dist: pillow
|
|
@@ -267,7 +267,7 @@ Consult the [NeXpy documentation](http://nexpy.github.io/nexpy) for details
|
|
|
267
267
|
of both the Python command-line API and how to use the NeXpy GUI. If you have
|
|
268
268
|
any general questions concerning the use of NeXpy, please address
|
|
269
269
|
them to the
|
|
270
|
-
[NeXus Mailing List](
|
|
270
|
+
[NeXus Mailing List](https://manual.nexusformat.org/mailinglist.html).
|
|
271
271
|
If you discover any bugs, please submit a
|
|
272
272
|
[Github issue](https://github.com/nexpy/nexpy/issues), preferably with relevant
|
|
273
273
|
tracebacks.
|
|
@@ -150,7 +150,7 @@ Consult the [NeXpy documentation](http://nexpy.github.io/nexpy) for details
|
|
|
150
150
|
of both the Python command-line API and how to use the NeXpy GUI. If you have
|
|
151
151
|
any general questions concerning the use of NeXpy, please address
|
|
152
152
|
them to the
|
|
153
|
-
[NeXus Mailing List](
|
|
153
|
+
[NeXus Mailing List](https://manual.nexusformat.org/mailinglist.html).
|
|
154
154
|
If you discover any bugs, please submit a
|
|
155
155
|
[Github issue](https://github.com/nexpy/nexpy/issues), preferably with relevant
|
|
156
156
|
tracebacks.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
package:
|
|
2
2
|
name: nexpy
|
|
3
|
-
version: "2.0
|
|
3
|
+
version: "2.2.0"
|
|
4
4
|
|
|
5
5
|
source:
|
|
6
6
|
git_url: https://github.com/nexpy/nexpy.git
|
|
7
|
-
git_tag: v2.0
|
|
7
|
+
git_tag: v2.2.0
|
|
8
8
|
|
|
9
9
|
build:
|
|
10
10
|
entry_points:
|
|
@@ -14,12 +14,12 @@ build:
|
|
|
14
14
|
|
|
15
15
|
requirements:
|
|
16
16
|
build:
|
|
17
|
-
- python >=3.
|
|
17
|
+
- python >=3.10
|
|
18
18
|
- setuptools
|
|
19
19
|
- setuptools_scm
|
|
20
20
|
|
|
21
21
|
run:
|
|
22
|
-
- python >= 3.
|
|
22
|
+
- python >= 3.10
|
|
23
23
|
- ansi2html
|
|
24
24
|
- darkdetect
|
|
25
25
|
- dateparser
|
|
@@ -29,7 +29,7 @@ requirements:
|
|
|
29
29
|
- lmfit
|
|
30
30
|
- matplotlib
|
|
31
31
|
- mplcursors
|
|
32
|
-
- nexusformat >= 2.
|
|
32
|
+
- nexusformat >= 2.2.0
|
|
33
33
|
- numpy
|
|
34
34
|
- packaging
|
|
35
35
|
- pillow
|
|
Binary file
|
|
@@ -312,8 +312,12 @@ Data Menu
|
|
|
312
312
|
Checks the NXDL file that defines the base class of the selected
|
|
313
313
|
group, rather than the group itself, for structural errors. The
|
|
314
314
|
file is taken from the ``base_classes`` subdirectory of the
|
|
315
|
-
current definitions directory
|
|
316
|
-
|
|
315
|
+
current definitions directory or, for the contributed base
|
|
316
|
+
classes, from the
|
|
317
|
+
``contributed_definitions`` subdirectory, in which case a
|
|
318
|
+
warning is added that the base class is a contributed one. This
|
|
319
|
+
is mainly of use to those who are developing or modifying base
|
|
320
|
+
class definitions.
|
|
317
321
|
|
|
318
322
|
**Validate Entry**
|
|
319
323
|
Only displayed if the selected group is an NXentry, NXsubentry,
|
|
@@ -325,16 +329,30 @@ Data Menu
|
|
|
325
329
|
|
|
326
330
|
For NXentry, NXsubentry, and NXroot groups, an **Application
|
|
327
331
|
Definition** file selector is also displayed, allowing a different
|
|
328
|
-
application definition to be chosen. Next to it, the **
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
+
application definition to be chosen. Next to it, the **Inspect** and
|
|
333
|
+
**Lint** buttons act on the selected application definition's NXDL
|
|
334
|
+
file. They are only enabled if the application definition file can
|
|
335
|
+
be found in the definitions directory (in either the
|
|
332
336
|
``applications`` or ``contributed_definitions`` subdirectory) or has
|
|
333
|
-
been selected explicitly.
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
337
|
+
been selected explicitly.
|
|
338
|
+
|
|
339
|
+
**Inspect**
|
|
340
|
+
Displays the NXDL file of the application definition in the text
|
|
341
|
+
window.
|
|
342
|
+
|
|
343
|
+
**Lint**
|
|
344
|
+
Checks the NXDL file for structural errors. If none are found,
|
|
345
|
+
each group in the definition, including those inherited through
|
|
346
|
+
``extends``, is also checked against the base class of the group
|
|
347
|
+
that contains it. Groups that the parent base class does not
|
|
348
|
+
allow, fixed-name groups with the wrong class, and classes with
|
|
349
|
+
no NXDL file are reported. These are given as warnings for a
|
|
350
|
+
definition in the ``applications`` subdirectory and as errors
|
|
351
|
+
for any other definition. If no problems are found, a message to
|
|
352
|
+
that effect is displayed.
|
|
353
|
+
|
|
354
|
+
.. note:: Inspecting and linting require NeXpy to be installed with
|
|
355
|
+
nexusformat v2.2.0 or later. For help in interpreting the linting
|
|
338
356
|
messages, consult the `NXDL reference
|
|
339
357
|
<https://manual.nexusformat.org/nxdl.html>`_.
|
|
340
358
|
|
|
@@ -463,7 +481,9 @@ Window Menu
|
|
|
463
481
|
``~/.nexpy/nexpy.log.1``, *etc*., records operations on the tree
|
|
464
482
|
items, as well as comprehensive tracebacks of exceptions in both the
|
|
465
483
|
GUI and the IPython shell. Only one-line summaries are displayed in
|
|
466
|
-
the shell to improve readability.
|
|
484
|
+
the shell to improve readability. Errors reported to the user in a
|
|
485
|
+
message box are also logged, with only the message of an expected
|
|
486
|
+
NeXus error but the full traceback of any other exception.
|
|
467
487
|
|
|
468
488
|
.. note:: The log files contain ANSI markup to colorize the text,
|
|
469
489
|
which can be rendered in the terminal using ``less -r``.
|
|
@@ -1204,6 +1224,14 @@ appropriate for modeling quasielastic neutron scattering.
|
|
|
1204
1224
|
A 'Compose Model' button allows the algebraic expression combining the
|
|
1205
1225
|
currently added models to be edited.
|
|
1206
1226
|
|
|
1227
|
+
The expression can also contain the function ``convolve(model,
|
|
1228
|
+
kernel)``, which convolves a model with another model, such as a
|
|
1229
|
+
Gaussian or Lorentzian representing the instrumental resolution. For
|
|
1230
|
+
example, ``convolve(Lorentzian_1 + Linear_2, Gaussian_3)`` convolves the
|
|
1231
|
+
sum of the first two models with the third. The 'amplitude' and 'center'
|
|
1232
|
+
parameters are fixed automatically at 1 and 0 whenever a model is used
|
|
1233
|
+
as a kernel, and only the parameters defining its shape are meaningful.
|
|
1234
|
+
|
|
1207
1235
|
It is also possible to combine a subset of models when plotting the
|
|
1208
1236
|
fitted models, by selecting 'Composite Model' before clicking 'Plot
|
|
1209
1237
|
Model'. This allows, for example, several functions representing a
|
|
@@ -412,6 +412,16 @@ temperature value. After creating the virtual field by combining all six
|
|
|
412
412
|
files, the resulting signal has a shape of (6, 1000, 1000). The
|
|
413
413
|
resulting NXdata group has ``temperature`` as an additional axis.
|
|
414
414
|
|
|
415
|
+
By default, the paths of the source files are stored as absolute paths.
|
|
416
|
+
If the consolidated data will be saved in a file that is moved together
|
|
417
|
+
with the source files, use the ``relative_to`` argument, which is the
|
|
418
|
+
name of the file that will hold the consolidated data (or a ``Path`` or
|
|
419
|
+
NXroot object). A source on a different drive, which has no relative path, remains
|
|
420
|
+
absolute.
|
|
421
|
+
|
|
422
|
+
>>> scan_data = nxconsolidate(scan_files, data_path, scan_path,
|
|
423
|
+
>>> relative_to='scan.nxs')
|
|
424
|
+
|
|
415
425
|
>>> scan_files = [f'scan_{T}K.nxs' for T in range(50, 300, 50)]
|
|
416
426
|
>>> data_path = '/entry/data'
|
|
417
427
|
>>> scan_path = '/entry/sample/temperature'
|
|
@@ -1172,7 +1182,8 @@ Python.
|
|
|
1172
1182
|
|
|
1173
1183
|
* ``nxlint``:
|
|
1174
1184
|
Checks NXDL application definition files for structural errors, such
|
|
1175
|
-
as violations of the NXDL schema
|
|
1185
|
+
as violations of the NXDL schema, and for groups that are not allowed
|
|
1186
|
+
by the NeXus base classes. This is useful when developing new
|
|
1176
1187
|
application definitions.
|
|
1177
1188
|
|
|
1178
1189
|
The options of each script are described in :ref:`Command-Line Scripts`.
|
|
@@ -1545,15 +1556,23 @@ nxlint
|
|
|
1545
1556
|
detects common authoring errors, such as ``field`` elements nested within
|
|
1546
1557
|
other ``field`` elements, and, if the ``nxdl.xsd`` schema file is present
|
|
1547
1558
|
in the definitions directory, validates the files against the NXDL
|
|
1548
|
-
schema.
|
|
1549
|
-
|
|
1559
|
+
schema. If no errors are found, it also checks each group of the
|
|
1560
|
+
definition, including those inherited through ``extends``, against the
|
|
1561
|
+
base class of the group that contains it, reporting groups that the base
|
|
1562
|
+
class does not allow, fixed-name groups with the wrong class, and
|
|
1563
|
+
classes with no NXDL file. These are warnings for definitions in the
|
|
1564
|
+
``applications`` directory and errors for any other definition. Base
|
|
1565
|
+
classes in the ``contributed_definitions`` directory are also linted,
|
|
1566
|
+
with a warning that they are contributed. It is intended for anyone
|
|
1567
|
+
writing or modifying application definitions.
|
|
1550
1568
|
|
|
1551
1569
|
.. code-block::
|
|
1552
1570
|
|
|
1553
1571
|
usage: nxlint [-h] [-d DEFINITIONS] [-i] [-w] [-e] [-v]
|
|
1554
1572
|
filename [filename ...]
|
|
1555
1573
|
|
|
1556
|
-
Check NXDL application definition files for structural errors
|
|
1574
|
+
Check NXDL application definition files for structural errors and
|
|
1575
|
+
for groups that are not allowed by the NeXus base classes.
|
|
1557
1576
|
|
|
1558
1577
|
positional arguments:
|
|
1559
1578
|
filename NXDL file(s) to lint
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: NeXpy
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.2.0
|
|
4
4
|
Summary: Python GUI to analyze NeXus data
|
|
5
5
|
Author-email: Raymond Osborn <rayosborn@mac.com>
|
|
6
6
|
License: Licensing Terms for NeXpy
|
|
@@ -90,7 +90,7 @@ Requires-Dist: ipython
|
|
|
90
90
|
Requires-Dist: lmfit
|
|
91
91
|
Requires-Dist: matplotlib
|
|
92
92
|
Requires-Dist: mplcursors
|
|
93
|
-
Requires-Dist: nexusformat>=2.
|
|
93
|
+
Requires-Dist: nexusformat>=2.2.0
|
|
94
94
|
Requires-Dist: numpy
|
|
95
95
|
Requires-Dist: packaging
|
|
96
96
|
Requires-Dist: pillow
|
|
@@ -267,7 +267,7 @@ Consult the [NeXpy documentation](http://nexpy.github.io/nexpy) for details
|
|
|
267
267
|
of both the Python command-line API and how to use the NeXpy GUI. If you have
|
|
268
268
|
any general questions concerning the use of NeXpy, please address
|
|
269
269
|
them to the
|
|
270
|
-
[NeXus Mailing List](
|
|
270
|
+
[NeXus Mailing List](https://manual.nexusformat.org/mailinglist.html).
|
|
271
271
|
If you discover any bugs, please submit a
|
|
272
272
|
[Github issue](https://github.com/nexpy/nexpy/issues), preferably with relevant
|
|
273
273
|
tracebacks.
|
|
@@ -118,5 +118,7 @@ src/nexpy/readers/readspec.py
|
|
|
118
118
|
src/nexpy/readers/readstack.py
|
|
119
119
|
src/nexpy/readers/readtiff.py
|
|
120
120
|
src/nexpy/readers/readtxt.py
|
|
121
|
+
tests/test_expand_node.py
|
|
121
122
|
tests/test_imports.py
|
|
122
|
-
tests/test_permissions.py
|
|
123
|
+
tests/test_permissions.py
|
|
124
|
+
tests/test_report_error.py
|
|
@@ -107,7 +107,9 @@
|
|
|
107
107
|
"src/nexpy/readers/readstack.py",
|
|
108
108
|
"src/nexpy/readers/readtiff.py",
|
|
109
109
|
"src/nexpy/readers/readtxt.py",
|
|
110
|
+
"tests/test_expand_node.py",
|
|
110
111
|
"tests/test_imports.py",
|
|
111
|
-
"tests/test_permissions.py"
|
|
112
|
+
"tests/test_permissions.py",
|
|
113
|
+
"tests/test_report_error.py"
|
|
112
114
|
]
|
|
113
115
|
}
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '2.
|
|
22
|
-
__version_tuple__ = version_tuple = (2,
|
|
21
|
+
__version__ = version = '2.2.0'
|
|
22
|
+
__version_tuple__ = version_tuple = (2, 2, 0)
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'gd49d50b14'
|
|
@@ -1855,7 +1855,8 @@ class StyleDialog(NXPanel):
|
|
|
1855
1855
|
parent : QWidget, optional
|
|
1856
1856
|
The parent of the Style Panel. The default is None.
|
|
1857
1857
|
"""
|
|
1858
|
-
super().__init__('Style', title='Style Panel',
|
|
1858
|
+
super().__init__('Style', title='Style Panel', reset=False,
|
|
1859
|
+
parent=parent)
|
|
1859
1860
|
self.tab_class = StyleTab
|
|
1860
1861
|
self.plotview_sort = True
|
|
1861
1862
|
|
|
@@ -4434,6 +4435,7 @@ class ValidateTab(NXTab):
|
|
|
4434
4435
|
super().__init__(label, parent=parent)
|
|
4435
4436
|
|
|
4436
4437
|
self.node = node
|
|
4438
|
+
self.lint_checked = False
|
|
4437
4439
|
|
|
4438
4440
|
from nexusformat.nexus.utils import get_definitions
|
|
4439
4441
|
self.definitions = get_definitions(nxgetconfig('definitions'))
|
|
@@ -4458,6 +4460,9 @@ class ValidateTab(NXTab):
|
|
|
4458
4460
|
self.pushbutton['Validate Entry'].setVisible(True)
|
|
4459
4461
|
self.application_box = self.filebox('Application Definition',
|
|
4460
4462
|
self.choose_application)
|
|
4463
|
+
self.pushbutton['Inspect'] = NXPushButton(
|
|
4464
|
+
'Inspect', self.inspect_application)
|
|
4465
|
+
self.application_box.addWidget(self.pushbutton['Inspect'])
|
|
4461
4466
|
self.pushbutton['Lint'] = NXPushButton(
|
|
4462
4467
|
'Lint', self.lint_application)
|
|
4463
4468
|
self.application_box.addWidget(self.pushbutton['Lint'])
|
|
@@ -4598,24 +4603,45 @@ class ValidateTab(NXTab):
|
|
|
4598
4603
|
self.show_log() to show the results and then sets the Lint Base
|
|
4599
4604
|
Class button to True and the other action buttons to False.
|
|
4600
4605
|
"""
|
|
4601
|
-
|
|
4602
|
-
'base_classes', f'{self.node.nxclass}.nxdl.xml')
|
|
4603
|
-
if self.lint(base_class):
|
|
4606
|
+
if self.lint(self.node.nxclass):
|
|
4604
4607
|
self.set_checked('Lint Base Class')
|
|
4605
4608
|
|
|
4609
|
+
def inspect_application(self):
|
|
4610
|
+
"""
|
|
4611
|
+
Inspects the NXDL file of the application definition. Calls
|
|
4612
|
+
self.show_log() to show the results and then sets all the
|
|
4613
|
+
action buttons to False.
|
|
4614
|
+
"""
|
|
4615
|
+
try:
|
|
4616
|
+
from nexusformat.nexus.validate import inspect_application
|
|
4617
|
+
except ImportError as error:
|
|
4618
|
+
report_error("Inspecting Application", error)
|
|
4619
|
+
return
|
|
4620
|
+
if self.application is not None:
|
|
4621
|
+
inspect_application(self.application, definitions=self.definitions)
|
|
4622
|
+
self.show_log()
|
|
4623
|
+
self.set_checked(None)
|
|
4624
|
+
|
|
4606
4625
|
def lint_application(self):
|
|
4607
4626
|
"""
|
|
4608
4627
|
Lints the NXDL file of the application definition. Calls
|
|
4609
4628
|
self.show_log() to show the results and then sets all the
|
|
4610
|
-
action buttons to False.
|
|
4629
|
+
action buttons to False. The lint is repeated if the log level
|
|
4630
|
+
is changed.
|
|
4611
4631
|
"""
|
|
4612
4632
|
if self.application is not None and self.lint(self.application):
|
|
4613
4633
|
self.set_checked(None)
|
|
4634
|
+
self.lint_checked = True
|
|
4614
4635
|
|
|
4615
4636
|
def lint(self, filepath):
|
|
4616
4637
|
"""
|
|
4617
4638
|
Lints an NXDL file and logs the results.
|
|
4618
4639
|
|
|
4640
|
+
The file is checked for structural errors. If none are found and
|
|
4641
|
+
the file is an application definition, its groups are also
|
|
4642
|
+
checked against the NeXus base classes, if the installed
|
|
4643
|
+
nexusformat package provides that check.
|
|
4644
|
+
|
|
4619
4645
|
Parameters
|
|
4620
4646
|
----------
|
|
4621
4647
|
filepath : str or Path
|
|
@@ -4633,10 +4659,18 @@ class ValidateTab(NXTab):
|
|
|
4633
4659
|
except ImportError as error:
|
|
4634
4660
|
report_error("Linting NXDL", error)
|
|
4635
4661
|
return False
|
|
4662
|
+
try:
|
|
4663
|
+
from nexusformat.nexus.validate import check_application
|
|
4664
|
+
except ImportError:
|
|
4665
|
+
check_application = None
|
|
4636
4666
|
logger.setLevel({'info': logging.INFO, 'warning': logging.WARNING,
|
|
4637
4667
|
'error': logging.ERROR}[self.log_level])
|
|
4638
4668
|
try:
|
|
4639
4669
|
results = lint_nxdl(filepath, definitions=self.definitions)
|
|
4670
|
+
if (check_application is not None
|
|
4671
|
+
and not any(sev == 'error' for _, _, sev in results)):
|
|
4672
|
+
results += check_application(filepath,
|
|
4673
|
+
definitions=self.definitions)
|
|
4640
4674
|
except (ImportError, NeXusError) as error:
|
|
4641
4675
|
report_error("Linting NXDL", error)
|
|
4642
4676
|
return False
|
|
@@ -4647,19 +4681,20 @@ class ValidateTab(NXTab):
|
|
|
4647
4681
|
logger.total = {'warning': 0, 'error': 0}
|
|
4648
4682
|
if results:
|
|
4649
4683
|
for message, location, severity in results:
|
|
4650
|
-
log(f'[{location}] {message}',
|
|
4684
|
+
log(f'[{location}] {message}' if location else message,
|
|
4685
|
+
level=severity)
|
|
4651
4686
|
log('\nFor help interpreting these errors, consult the NXDL '
|
|
4652
4687
|
'reference at https://manual.nexusformat.org/nxdl.html',
|
|
4653
4688
|
level='all')
|
|
4654
4689
|
else:
|
|
4655
|
-
log(f'No structural errors found in
|
|
4656
|
-
level='all')
|
|
4690
|
+
log(f'No structural errors or base class violations found in '
|
|
4691
|
+
f'"{Path(filepath).name}"', level='all')
|
|
4657
4692
|
log_summary()
|
|
4658
4693
|
self.show_log()
|
|
4659
4694
|
return True
|
|
4660
4695
|
|
|
4661
4696
|
def set_lint_enabled(self):
|
|
4662
|
-
"""Enables the
|
|
4697
|
+
"""Enables the Inspect and Lint buttons if there is a file."""
|
|
4663
4698
|
enabled = False
|
|
4664
4699
|
if self.application is not None:
|
|
4665
4700
|
application = Path(self.application)
|
|
@@ -4669,10 +4704,17 @@ class ValidateTab(NXTab):
|
|
|
4669
4704
|
).is_file()
|
|
4670
4705
|
for directory in ('applications',
|
|
4671
4706
|
'contributed_definitions')))
|
|
4707
|
+
self.pushbutton['Inspect'].setEnabled(enabled)
|
|
4672
4708
|
self.pushbutton['Lint'].setEnabled(enabled)
|
|
4673
4709
|
|
|
4674
4710
|
def set_checked(self, action):
|
|
4675
|
-
"""
|
|
4711
|
+
"""
|
|
4712
|
+
Checks the named action button and unchecks the others.
|
|
4713
|
+
|
|
4714
|
+
This also clears the flag that records that the application
|
|
4715
|
+
definition was the last item linted.
|
|
4716
|
+
"""
|
|
4717
|
+
self.lint_checked = False
|
|
4676
4718
|
for button in self.action_names:
|
|
4677
4719
|
self.pushbutton[button].setChecked(button == action)
|
|
4678
4720
|
|
|
@@ -4686,6 +4728,8 @@ class ValidateTab(NXTab):
|
|
|
4686
4728
|
self.inspect()
|
|
4687
4729
|
elif self.pushbutton['Lint Base Class'].isChecked():
|
|
4688
4730
|
self.lint_base_class()
|
|
4731
|
+
elif self.lint_checked:
|
|
4732
|
+
self.lint_application()
|
|
4689
4733
|
|
|
4690
4734
|
def select_level(self):
|
|
4691
4735
|
"""
|