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

Update copy_volume.py #35

Merged
merged 1 commit into from
Apr 14, 2022
Merged

Conversation

martinschorb
Copy link
Contributor

needs to be converted to str, otherwise if is determined from data, it will fail with:

    dtype = "u" + dtype
TypeError: can only concatenate str (not "numpy.dtype[int8]") to str

see mobie/mobie-utils-python#57

needs to be converted to `str`, otherwise if is determined from data, it will fail with:

```
    dtype = "u" + dtype
TypeError: can only concatenate str (not "numpy.dtype[int8]") to str
```
@martinschorb
Copy link
Contributor Author

would you also want to add a test for extracting the dtype from the raw data and then converting it?

Copy link
Owner

@constantinpape constantinpape left a comment

Choose a reason for hiding this comment

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

Thanks, I will merge once the tests pass.

@constantinpape
Copy link
Owner

would you also want to add a test for extracting the dtype from the raw data and then converting it?

Not quite sure what you mean by this, but I already have a test that checks that int_to_uint works:
https://github.com/constantinpape/cluster_tools/blob/master/test/downscaling/test_downscaling.py#L183

@martinschorb
Copy link
Contributor Author

Yes, other than over at mobie it looks like the scenario that a np.dtype object ends up in this string concatenation doe not happen here. So no need to test for it.

@constantinpape
Copy link
Owner

Yes, other than over at mobie it looks like the scenario that a np.dtype object ends up in this string concatenation doe not happen here. So no need to test for it.

Whether this is a string or a np dtype depends on the underlying store that is returned by elf.io.open_file. Since open_file is a very thin wrapper it's not possible to unify this.

Anyways, the fix here is very simple and with it support for np dtypes should be ensured, we don't need to add extra tests for this case.

Tests pass so I will merge now, thanks!

@constantinpape constantinpape merged commit bb497e1 into constantinpape:master Apr 14, 2022
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.

2 participants