Ensure dtype is preserved after regridding#239
Conversation
|
Note: this will still change the dtype if you start with integer data (by design). This does mean that the dask array also will have to be changed to better align with the underlying data in this case. This should be a seperable issue which can be addressed in its own PR. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #239 +/- ##
==========================================
- Coverage 98.85% 98.85% -0.01%
==========================================
Files 36 37 +1
Lines 3855 3929 +74
==========================================
+ Hits 3811 3884 +73
- Misses 44 45 +1 ☔ View full report in Codecov by Sentry. |
pp-mo
left a comment
There was a problem hiding this comment.
I'm not convinced that there aren't a few more cases to address here. I think I would create test examples where both weights + source_array can be integer / float32 / float64, and check that output dtypes are as expected in all those cases.
But I may have missed that dtypes for the weights array are always known, or more limited ?
|
@SciTools-incubator/esmf-regrid-devs This pull-request is stale due to a lack of activity in the last 90 days. Remove stale label or comment, otherwise this pull-request will close automatically in 7 days time. |
* main: (42 commits) Update lockfiles and fix for new esmpy (SciTools#342) Fix for esmpy (SciTools#353) Fix usage of map_blocks (SciTools#338) Revert "Updated environment lockfiles (SciTools#335)" (SciTools#341) Updated environment lockfiles (SciTools#335) Bump actions/cache from 3 to 4 (SciTools#333) Bump actions/upload-artifact from 3 to 4 (SciTools#324) Bump actions/stale from 8.0.0 to 9.0.0 (SciTools#322) fix asv (SciTools#339) [pre-commit.ci] pre-commit autoupdate (SciTools#330) Bump scitools/workflows from 2023.09.0 to 2024.01.0 (SciTools#334) Updated environment lockfiles (SciTools#327) [pre-commit.ci] pre-commit autoupdate (SciTools#328) Updated environment lockfiles (SciTools#304) Add CITATION.cff (SciTools#319) updated for enums (SciTools#293) Flake8 compliant type checking. (SciTools#316) update to v0.10.dev0 (SciTools#314) Update to v0.9 (SciTools#313) First pass at mesh to mesh (SciTools#311) ... # Conflicts: # CHANGELOG.md # esmf_regrid/esmf_regridder.py # esmf_regrid/schemes.py
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
pp-mo
left a comment
There was a problem hiding this comment.
Basically OK except for a possible tidy in the tests.
* main: Move benchmark code from nox to bm_runner (SciTools#361) Bump scitools/workflows from 2024.01.0 to 2024.04.3 (SciTools#356) Bump peter-evans/create-pull-request from 5.0.2 to 6.0.5 (SciTools#355) [pre-commit.ci] pre-commit autoupdate (SciTools#336) Updated environment lockfiles (SciTools#344) # Conflicts: # CHANGELOG.md
* main: Ensure dtype is preserved after regridding (SciTools#239)
* main: Bump scitools/workflows from 2024.06.0 to 2024.06.5 (SciTools#377) Fix typo (SciTools#371) Bump scitools/workflows from 2024.04.3 to 2024.06.0 (SciTools#365) Update to v0.11.dev0. (SciTools#363) Update to v0.10.0 (SciTools#362) Extend regridder saving/loading to all regridders (SciTools#357) Ensure dtype is preserved after regridding (SciTools#239) Move benchmark code from nox to bm_runner (SciTools#361) # Conflicts: # esmf_regrid/schemes.py
Adresses #238.