You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
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.The text was updated successfully, but these errors were encountered: