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

Enhanced binary strings decoding #428

Merged
merged 15 commits into from
Sep 13, 2024
Merged

Conversation

lukaspie
Copy link
Collaborator

@lukaspie lukaspie commented Sep 11, 2024

Following up on discussions in FAIRmat-NFDI/nexus_definitions#283 (comment)

@lukaspie lukaspie force-pushed the convert_binary_strings_enhanced branch from 67eee90 to 5cd9dd1 Compare September 11, 2024 15:57
Comment on lines 56 to 59
if not isinstance(string_obj, (np.ndarray, bytes, str)):
raise ValueError(
f"Unsupported type {type(string_obj)}. Expected np.ndarray, bytes, or str."
)
Copy link
Collaborator

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.

Copy link
Collaborator Author

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

.gitmodules Outdated Show resolved Hide resolved
@lukaspie
Copy link
Collaborator Author

@rettigl @sanbrock this branch should be finished now

src/pynxtools/nexus/nexus.py Outdated Show resolved Hide resolved
src/pynxtools/nexus/nexus.py Show resolved Hide resolved
@lukaspie lukaspie merged commit bd01ed5 into master Sep 13, 2024
12 checks passed
@lukaspie lukaspie deleted the convert_binary_strings_enhanced branch September 13, 2024 08:43
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.

4 participants