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

Guard against unicode when saving HDF5 imageseries #466

Merged

Conversation

psavery
Copy link
Collaborator

@psavery psavery commented Aug 30, 2022

When writing out the multiruby dexelas example imageseries in hexrdgui after
performing aggregation, I would encounter the following error:

TypeError: No conversion path for dtype: dtype('<U3')

It appears that some of the metadata being saved as HDF5 attributes
was a unicode string. Specifically, for this case, it appears that the
panel_id key had a unicode ff1 value.

Converting to a regular string fixes the issue.

I don't know why the panel ID came out to have a unicode value, but
we can guard against it and convert it into a regular string.

When writing out the [multiruby dexelas](https://github.com/HEXRD/examples/tree/master/NIST_ruby/multiruby_dexelas) example imageseries in hexrdgui after
performing aggregation, I would encounter the following error:

```
TypeError: No conversion path for dtype: dtype('<U3')
```

It appears that some of the metadata being saved as HDF5 attributes
was a unicode string. Specifically, for this case, it appears that the
`panel_id` key had a unicode `ff1` value.

Converting to a regular string fixes the issue.

I don't know why the panel ID came out to have a unicode value, but
we can guard against it and convert it into a regular string.

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
@pep8speaks
Copy link

pep8speaks commented Aug 30, 2022

Hello @psavery! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2022-08-30 02:18:26 UTC

This is so that the CI will pass.

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
@joelvbernier joelvbernier merged commit 7b3c034 into HEXRD:master Aug 30, 2022
@psavery psavery deleted the imageseries-hdf5-save-unicode-guard branch August 31, 2022 13:22
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