8000 convert int-like values silently into float-like for NX_FLOAT by rettigl · Pull Request #637 · FAIRmat-NFDI/pynxtools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

convert int-like values silently into float-like for NX_FLOAT #637

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

Merged
merged 2 commits into from
May 13, 2025

Conversation

rettigl
Copy link
Collaborator
@rettigl rettigl commented May 9, 2025

As discussed with @lukaspie, I believe we should not be strict with NX_FLOAT and convert int-like values into float-like values silently. I don't see any case where this would cause an issue, but if NX_FLOAT values are encoded as ints in some source file, it can be difficult to change this in the writing process. One example is the example E1 from pynxtools_mpes https://github.com/FAIRmat-NFDI/pynxtools-mpes/blob/60aa3d5724f7a1578287cb1331008a47c95c91ae/src/pynxtools_mpes/nomad/examples/E1%20Convert%20to%20NeXus.ipynb where one NX_FLOAT value is encoded as int in the hdf5 source file.

This PR adds a conversion function and respective tests.

Closes #523

Co-authored-by: Lukas Pielsticker <50139597+lukaspie@users.noreply.github.com>
Copy link
Collaborator
@lukaspie lukaspie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rettigl rettigl merged commit eb5d573 into master May 13, 2025
17 checks passed
@rettigl rettigl deleted the convert_int_to_float branch May 13, 2025 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Dataconverter does not change type of a field with the type different but compatible to the expected one
2 participants
0