User interface: subcommand: demo

The demo subcommand is useful to demonstrate HDF5 file validation and to verify correct program operation. It uses an example NeXus HDF5 data file supplied with the punx software, the writer_1_3.hdf5 example from the NeXus manual.

command line help

console> punx demo -h
punx demo -h
usage: punx demo [-h]

optional arguments:
  -h, --help  show this help message and exit

Examples

One example of how to use punx is shown in the demo mode. This can be used directly after installing the python package.

Type this command …:

punx demo

… and this output will appear on the console, showing a validation of writer_1_3.hdf5, an example NeXus HDF5 data file from the NeXus documentation.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
console> punx validate C:\Users\shoun\Apps\Anaconda\lib\site-packages\punx\data\writer_1_3.hdf5
Validation findings
:file: writer_1_3.hdf5
:validation results shown:  COMMENT, ERROR, NOTE, OK, TODO, UNUSED, WARN
==================== ============================ ====== ====================================================
address              validation                   status comment(s)
==================== ============================ ====== ====================================================
/                    @NX_class assumed            OK     file root: NXroot
/Scan                validItemName                NOTE   relaxed re: [A-Za-z_][\w_]*
/Scan@NX_class       @NX_class known              OK     NXentry is known
/Scan/data           validItemName-strict         OK     strict re: [a-z_][a-z0-9_]*
/Scan/data@NX_class  @NX_class known              OK     NXdata is known
/Scan/data/counts    NXdata@ignoreExtraFields     OK     field ignored due to group attribute setting
/Scan/data/two_theta NXdata@ignoreExtraFields     OK     field ignored due to group attribute setting
/Scan/data           NXDL review: NXdata          TODO   validate with NXdata specification (incomplete)
/Scan                NXDL review: NXentry         TODO   validate with NXentry specification (incomplete)
/                    NXDL review: NXroot          TODO   validate with NXroot specification (incomplete)
/Scan/data/counts    NXdata group default plot v3 OK     NXdata@signal = counts
/Scan/data/counts    NeXus default plot v3        OK     NeXus data file default plot: /NXentry/NXdata@signal
==================== ============================ ====== ====================================================

summary statistics
======= ===== ===========================================================
status  count description
======= ===== ===========================================================
OK      8     meets NeXus specification
NOTE    1     does not meet NeXus specification, but acceptable
WARN    0     does not meet NeXus specification, not generally acceptable
ERROR   0     violates NeXus specification
TODO    3     validation not implemented yet
UNUSED  0     optional NeXus item not used in data file
COMMENT 0     comment from the punx source code
--      --    --
TOTAL   12    --
======= ===== ===========================================================

console> punx structure C:\Users\shoun\Apps\Anaconda\lib\site-packages\punx\data\writer_1_3.hdf5
C:\Users\shoun\Apps\Anaconda\lib\site-packages\punx\data\writer_1_3.hdf5 : NeXus data file
  Scan:NXentry
    @NX_class = NXentry
    data:NXdata
      @NX_class = NXdata
      @signal = counts
      @axes = two_theta
      @two_theta_indices = [0]
      counts:NX_INT32[31] = [1037, 1318, 1704, '...', 1321]
        @units = counts
      two_theta:NX_FLOAT64[31] = [17.926079999999999, 17.925909999999998, 17.925750000000001, '...', 17.92108]
        @units = degrees

Problems when running the demo

Sometimes, problems happen when running the demo. In this section are some common problems encountered and what was done to resolve them.

Cannot reach GitHub

See GitHub API rate limit exceeded