corteva / rioxarray

geospatial xarray extension powered by rasterio
https://corteva.github.io/rioxarray
Other
507 stars 80 forks source link

BUG: Handle additional data types in `rio.reproject` #619

Closed caldwellst closed 1 year ago

caldwellst commented 1 year ago
codecov[bot] commented 1 year ago

Codecov Report

Base: 96.02% // Head: 95.90% // Decreases project coverage by -0.11% :warning:

Coverage data is based on head (fffee84) compared to base (0f77e13). Patch has no changes to coverable lines.

:exclamation: Current head fffee84 differs from pull request most recent head dabc42b. Consider uploading reports for the commit dabc42b to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #619 +/- ## ========================================== - Coverage 96.02% 95.90% -0.12% ========================================== Files 12 12 Lines 1735 1735 ========================================== - Hits 1666 1664 -2 - Misses 69 71 +2 ``` | [Impacted Files](https://codecov.io/gh/corteva/rioxarray/pull/619?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=corteva) | Coverage Δ | | |---|---|---| | [rioxarray/raster\_array.py](https://codecov.io/gh/corteva/rioxarray/pull/619/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=corteva#diff-cmlveGFycmF5L3Jhc3Rlcl9hcnJheS5weQ==) | `98.13% <ø> (ø)` | | | [rioxarray/rioxarray.py](https://codecov.io/gh/corteva/rioxarray/pull/619/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=corteva#diff-cmlveGFycmF5L3Jpb3hhcnJheS5weQ==) | `96.15% <0.00%> (-0.46%)` | :arrow_down: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=corteva). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=corteva)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

snowman2 commented 1 year ago

One option to make this more future proof is to change this: https://github.com/corteva/rioxarray/blob/0f77e13b54ba82ffb9cf2f655c9e310f85890bd9/rioxarray/raster_array.py#L513

to:

_NODATA_DTYPE_MAP.get(dtype_rev[self._obj.dtype.name])

Thoughts?

caldwellst commented 1 year ago

I think that sounds like a solid idea, particularly as it seems unlikely new data types will be added with corresponding defaults. It may be useful to just set a reminder to check in a set period of time (1 year) if that list has changed in case standard defaults have been added for those that are None.

snowman2 commented 1 year ago

I think that sounds like a solid idea

Mind updating this PR with the change?

snowman2 commented 1 year ago

Thanks @caldwellst :+1: