xarray
xarray copied to clipboard
fix dtype complex for rasterio backend
rasterio backend support for the complex_int16
dtype
- [x] Closes #5491
- [ ] User visible changes (including notable bug fixes) are documented in
whats-new.rst
Hello @grouny! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
- In the file
xarray/tests/test_backends.py
:
Line 4171:42: E231 missing whitespace after ',' Line 4705:37: E201 whitespace after '(' Line 4705:42: E202 whitespace before ')' Line 4710:39: E225 missing whitespace around operator Line 4712:35: E225 missing whitespace around operator Line 4714:1: E302 expected 2 blank lines, found 1
Comment last updated at 2021-08-25 14:30:57 UTC
@grouny - thanks for this PR! And I see that this is your first time contributing to Xarray -- Welcome!
This fix you propose looks great. Apart from the linter complaining about some whitespace, I think this would benefit from a simple test. Would you mind adding a test to xarray/tests/test_backends.py
?
Q for @snowman2 - is rioxarray handling complex datatypes in this way?
Yes I can think about a test. Could this test be a simple .tiff file opening or is it too high level?
Also see: https://github.com/corteva/rioxarray/pull/359
As discussed in the dev meeting, this would be great to merge. The test could be to create a small file, and then read it. Would that work @grouny ?
I added a test in test_backends.py
:
pytest -s ./test_backends.py::TestRasterio::test_rasterio_complex_dtype
But since there is a coming fix in rasterio
I am wondering whether this PR is still needed:
https://github.com/mapbox/rasterio/commit/7114fb7fb5e48146c4f04eb818daaa1fa632d817
Unit Test Results
6 files 6 suites 51m 22s :stopwatch: 16 226 tests 14 490 :heavy_check_mark: 1 736 :zzz: 0 :x: 90 552 runs 82 368 :heavy_check_mark: 8 184 :zzz: 0 :x:
Results for commit 674d9b69.
can you try if your test (without the other changes) fails with rasterio=1.2.3
and passes with rasterio>=1.2.4
(I think that's the first version that includes the commit you referenced)?