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]: Dataconverter does not change type of a field with the type different but compatible to the expected one #523

Open
GinzburgLev opened this issue Jan 17, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@GinzburgLev
Copy link
Contributor

When the field of a certain type is passed a value of a different, but compatible type, the correct verification is done, however the resulting .nxs file still has the original (non-converted) type.

Example

Using the pynxtools-mpes example upload files, add a field at "metadata/energy_calibration/tof" path to MoTe2.h5. It is supposed to be NX_FLOAT, add instead integer there. The output of dataconverter (dataconverter --reader mpes --nxdl NXmpes path/config_file.json path/MoTe2_with_int.h5) will still have integer saved under the field. Same procedure with string under the field will (correctly) give a warning.

Likely reason

Function is_valid_data_field() ("pynxtools/src/pynxtools/dataconverter/helpers.py") checks the possibility of conversion and the conversion itself, however it is later used only in validation, and not for the conversion itself.

@GinzburgLev GinzburgLev added the bug Something isn't working label Jan 17, 2025
@GinzburgLev GinzburgLev changed the title Dataconverter does not change type of a field with the type different but compatible to the expected one (such as int -> float)) [Bug]: Dataconverter does not change type of a field with the type different but compatible to the expected one Jan 17, 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