rafaqz / Rasters.jl

Raster manipulation for the Julia language
MIT License
214 stars 36 forks source link

Breaking: Standardise cf standards and missingval handling #695

Open rafaqz opened 4 months ago

rafaqz commented 4 months ago

This PR standardises cf and missingval behaviour accross all sources.

New keywords are:

I don't like either of these names! if you can think of anything better please suggest something.

@felixcremer @meggart this is the new diskarrays object that does 2-way cf and missingval/maskingval conversions

https://github.com/rafaqz/Rasters.jl/compare/cf?expand=1#diff-1478a88a8bdcffcf7f556cc1865dbe18d69b5c03f75b4481e1f5889e8a6b6b73

Rapsodia86 commented 3 months ago

How about inverting it? Instead of "cf" call it "raw". If raw=false, offset and scale are applied, if raw=true, offset and scale are NOT applied?

And raw=true would be the default?

Maybe "navalue" instead of "maskingval"?

rafaqz commented 3 months ago

Currently I've got scaled=true as the default instead of cf. raw might suggest the missing value is also not transformed?

Main concern with navalue is it sounds like R, and isn't really used in julia

Rapsodia86 commented 3 months ago

Yes, you are right that with "raw" one may expect that data were not touched at all.

Indeed, "navalue" originates from my heavy R usage! And I agree NA is not very julia way.

Point taken:)

rafaqz commented 3 months ago

Thanks for the input though, good to have all the options to choose from

rafaqz commented 3 months ago

Coming back to this I like how short and obvious raw=true is!

But to mean no scaling and no masking - so it will override everything else.

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 82.84251% with 134 lines in your changes missing coverage. Please review.

Project coverage is 81.79%. Comparing base (570fd17) to head (54056cb). Report is 9 commits behind head on main.

Files Patch % Lines
src/modifieddiskarray.jl 68.61% 43 Missing :warning:
src/utils.jl 80.48% 32 Missing :warning:
ext/RastersZarrDatasetsExt/zarrdatasets_source.jl 0.00% 13 Missing :warning:
...imensionalDataExt/GeometryOpsDimensionalDataExt.jl 0.00% 8 Missing :warning:
ext/RastersArchGDALExt/gdal_source.jl 89.55% 7 Missing :warning:
src/stack.jl 85.71% 7 Missing :warning:
src/write.jl 75.00% 7 Missing :warning:
ext/RastersNCDatasetsExt/ncdatasets_source.jl 84.61% 4 Missing :warning:
src/sources/commondatamodel.jl 92.85% 4 Missing :warning:
src/create.jl 96.10% 3 Missing :warning:
... and 5 more
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #695 +/- ## ========================================== - Coverage 82.59% 81.79% -0.80% ========================================== Files 60 64 +4 Lines 4510 4884 +374 ========================================== + Hits 3725 3995 +270 - Misses 785 889 +104 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.