Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Warnings are being omitted if pynxtools is re-imported #561

Open
rettigl opened this issue Feb 25, 2025 · 0 comments
Open

[Bug]: Warnings are being omitted if pynxtools is re-imported #561

rettigl opened this issue Feb 25, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@rettigl
Copy link
Collaborator

rettigl commented Feb 25, 2025

Contact Details

No response

What happened?

If pynxtools is imported twice (e.g. because of auto-reload), many warnings are not being printed. This is probably an issue with the logger setup.

Relevant log output

Import pynxtools using 
%load_ext autoreload
%autoreload 2

First conversion:
convert(input_file=("NXmpes_config_v1.json", "Scan1496.yaml"), reader="mpes", nxdl="NXmpes_arpes", objects=(res_xarray,), output="test.nxs")

Using mpes reader to convert the given files:  
• NXmpes_config_v1.json
• Scan1496.yaml
Main element /ENTRY[entry]/notes/description not provided. Removing the parent group /ENTRY[entry]/notes.
Main element /ENTRY[entry]/experiment_documentation/description not provided. Removing the parent group /ENTRY[entry]/experiment_documentation.
Could not find value for key /ENTRY[entry]/experiment_description with value ['@eln:/ENTRY/identifier', '@attrs:metadata/entry_identifier', '@attrs:metadata/elabFTW/project/title'].
Tried prefixes: [('@eln', '/ENTRY/identifier'), ('@attrs', 'metadata/entry_identifier'), ('@attrs', 'metadata/elabFTW/project/title')].
Could not find value for key /ENTRY[entry]/INSTRUMENT[instrument]/beamTYPE[beam_pump]/pulse_delay with value @attrs:metadata/scan_info/delay.
Tried prefixes: [('@attrs', 'metadata/scan_info/delay')].
WARNING: The value at /ENTRY[entry]/INSTRUMENT[instrument]/MANIPULATOR[manipulator]/sample_bias_voltmeter/measurement should be one of the following: ['voltage']
WARNING: The data entry corresponding to /ENTRY[entry]/data/temperature is required and hasn't been supplied by the reader.
WARNING: The data entry corresponding to /ENTRY[entry]/data/delay is required and hasn't been supplied by the reader.
WARNING: The data entry corresponding to /ENTRY[entry]/core_levels is required and hasn't been supplied by the reader.
WARNING: Field /ENTRY[entry]/energy_axis_calibration/program written without documentation.
WARNING: Field /ENTRY[entry]/energy_axis_calibration/version written without documentation.
WARNING: There were attributes set for the field /ENTRY[entry]/INSTRUMENT[instrument]/beamTYPE[beam_pump]/pulse_delay, but the field does not exist.
WARNING: The attribute /ENTRY[entry]/INSTRUMENT[instrument]/beamTYPE[beam_pump]/pulse_delay/@units will not be written.
WARNING: There were attributes set for the field /ENTRY[entry]/INSTRUMENT[instrument]/beamTYPE[beam_pump]/pulse_delay, but the field does not exist.
WARNING: The attribute /ENTRY[entry]/INSTRUMENT[instrument]/beamTYPE[beam_pump]/pulse_delay/@reference_beam will not be written.
The output file generated: test.nxs.

Now change something in the pynxtools source (e.g. adding a blank line, I did in the helpers.py file). This is auto-reloaded.

Now convert again:

Using mpes reader to convert the given files:  
• NXmpes_config_v1.json
• Scan1496.yaml
Main element /ENTRY[entry]/notes/description not provided. Removing the parent group /ENTRY[entry]/notes.
Main element /ENTRY[entry]/experiment_documentation/description not provided. Removing the parent group /ENTRY[entry]/experiment_documentation.
Could not find value for key /ENTRY[entry]/experiment_description with value ['@eln:/ENTRY/identifier', '@attrs:metadata/entry_identifier', '@attrs:metadata/elabFTW/project/title'].
Tried prefixes: [('@eln', '/ENTRY/identifier'), ('@attrs', 'metadata/entry_identifier'), ('@attrs', 'metadata/elabFTW/project/title')].
Could not find value for key /ENTRY[entry]/INSTRUMENT[instrument]/beamTYPE[beam_pump]/pulse_delay with value @attrs:metadata/scan_info/delay.
Tried prefixes: [('@attrs', 'metadata/scan_info/delay')].
The output file generated: test.nxs.
@rettigl rettigl added the bug Something isn't working label Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant