-
Notifications
You must be signed in to change notification settings - Fork 8
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
Enhanced binary strings decoding #428
Conversation
67eee90
to
5cd9dd1
Compare
src/pynxtools/nexus/nexus.py
Outdated
if not isinstance(string_obj, (np.ndarray, bytes, str)): | ||
raise ValueError( | ||
f"Unsupported type {type(string_obj)}. Expected np.ndarray, bytes, or str." | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not work simply like this, because I fed every value through the decode function before, i.e. also numerical ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed the type checking, now the decoding only happens on
- bytes objects -> returns list
- list of bytes or mixed bytes/str -> returns list of str
- np.arrays of of bytes or mixed bytes/str -> returns np.arrays of str
Following up on discussions in FAIRmat-NFDI/nexus_definitions#283 (comment)