xarray icon indicating copy to clipboard operation
xarray copied to clipboard

fix dtype complex for rasterio backend

Open agrouaze opened this issue 3 years ago • 8 comments

rasterio backend support for the complex_int16 dtype

  • [x] Closes #5491
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst

agrouaze avatar Jun 20 '21 06:06 agrouaze

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

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

pep8speaks avatar Jun 20 '21 06:06 pep8speaks

@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?

jhamman avatar Jun 23 '21 18:06 jhamman

Yes I can think about a test. Could this test be a simple .tiff file opening or is it too high level?

agrouaze avatar Jun 24 '21 11:06 agrouaze

Also see: https://github.com/corteva/rioxarray/pull/359

snowman2 avatar Jun 24 '21 16:06 snowman2

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 ?

max-sixty avatar Aug 04 '21 15:08 max-sixty

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

agrouaze avatar Aug 25 '21 14:08 agrouaze

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.

github-actions[bot] avatar Aug 25 '21 14:08 github-actions[bot]

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)?

keewis avatar Aug 25 '21 17:08 keewis