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

silx.io.fioh5: Improved handling of missing data entries #4156

Merged
merged 3 commits into from
Oct 7, 2024

Conversation

tifuchs
Copy link
Contributor

@tifuchs tifuchs commented Aug 6, 2024

Enables the loading of fio files with missing data entries, that can not be converted into the target data type.
Mostly uses the default behaviour of numpy.genfromtxt.

For example: Entries like <no data> or nan in a FLOAT data column are automatically converted to numpy.nan by numpy.genfromtxt.

Not all missing values can be handled:
Missing boolean or integer values cannot be flagged as missing (i.e. nan) in a bool or integer array and thus result in a ValueError.

Closes #4155

@woutdenolf
Copy link
Contributor

woutdenolf commented Aug 12, 2024

Fix CI failures

 >       val = val.decode().lower()
E       AttributeError: 'str' object has no attribute 'decode'

Could you also add a unit test with FIO data that has missingvalues?

@t20100 t20100 added this to the Next release milestone Aug 27, 2024
Copy link
Member

@t20100 t20100 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

As already mentioned, the continuous integration fails highlighting an bytes/str issue and it would also be great to have a test with nan and no data

src/silx/io/fioh5.py Outdated Show resolved Hide resolved
src/silx/io/fioh5.py Outdated Show resolved Hide resolved
src/silx/io/fioh5.py Outdated Show resolved Hide resolved
@t20100 t20100 merged commit 45bce37 into silx-kit:main Oct 7, 2024
6 of 10 checks passed
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.

[IO] FIO files: handle missing data
3 participants