Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure dtype is preserved after regridding #239

Merged
merged 12 commits into from
May 29, 2024

Conversation

stephenworsley
Copy link
Contributor

Adresses #238.

@stephenworsley
Copy link
Contributor Author

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
Copy link

codecov bot commented Feb 22, 2023

Codecov Report

Attention: Patch coverage is 98.71795% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 98.85%. Comparing base (a50b2b8) to head (b587641).

Files Patch % Lines
esmf_regrid/schemes.py 85.71% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

Copy link
Member

@pp-mo pp-mo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ?

esmf_regrid/esmf_regridder.py Outdated Show resolved Hide resolved
esmf_regrid/esmf_regridder.py Outdated Show resolved Hide resolved
@github-actions
Copy link
Contributor

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

@github-actions github-actions bot added the Stale: Closure warning This stale issue or pull-request has been marked for closure label May 29, 2023
@stephenworsley stephenworsley removed the Stale: Closure warning This stale issue or pull-request has been marked for closure label May 30, 2023
@trexfeathers trexfeathers linked an issue Jun 21, 2023 that may be closed by this pull request
@trexfeathers trexfeathers assigned HGWright and unassigned pp-mo Sep 20, 2023
@CLAassistant
Copy link

CLAassistant commented Oct 26, 2023

CLA assistant check
All committers have signed the CLA.

stephenworsley and others added 5 commits April 25, 2024 15:13
* main: (42 commits)
  Update lockfiles and fix for new esmpy (SciTools-incubator#342)
  Fix for esmpy (SciTools-incubator#353)
  Fix usage of map_blocks (SciTools-incubator#338)
  Revert "Updated environment lockfiles (SciTools-incubator#335)" (SciTools-incubator#341)
  Updated environment lockfiles (SciTools-incubator#335)
  Bump actions/cache from 3 to 4 (SciTools-incubator#333)
  Bump actions/upload-artifact from 3 to 4 (SciTools-incubator#324)
  Bump actions/stale from 8.0.0 to 9.0.0 (SciTools-incubator#322)
  fix asv (SciTools-incubator#339)
  [pre-commit.ci] pre-commit autoupdate (SciTools-incubator#330)
  Bump scitools/workflows from 2023.09.0 to 2024.01.0 (SciTools-incubator#334)
  Updated environment lockfiles (SciTools-incubator#327)
  [pre-commit.ci] pre-commit autoupdate (SciTools-incubator#328)
  Updated environment lockfiles (SciTools-incubator#304)
  Add CITATION.cff (SciTools-incubator#319)
  updated for enums (SciTools-incubator#293)
  Flake8 compliant type checking. (SciTools-incubator#316)
  update to v0.10.dev0 (SciTools-incubator#314)
  Update to v0.9 (SciTools-incubator#313)
  First pass at mesh to mesh (SciTools-incubator#311)
  ...

# Conflicts:
#	CHANGELOG.md
#	esmf_regrid/esmf_regridder.py
#	esmf_regrid/schemes.py
Copy link
Member

@pp-mo pp-mo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically OK except for a possible tidy in the tests.

esmf_regrid/tests/unit/schemes/test_ESMFAreaWeighted.py Outdated Show resolved Hide resolved
esmf_regrid/schemes.py Show resolved Hide resolved
* main:
  Move benchmark code from nox to bm_runner (SciTools-incubator#361)
  Bump scitools/workflows from 2024.01.0 to 2024.04.3 (SciTools-incubator#356)
  Bump peter-evans/create-pull-request from 5.0.2 to 6.0.5 (SciTools-incubator#355)
  [pre-commit.ci] pre-commit autoupdate (SciTools-incubator#336)
  Updated environment lockfiles (SciTools-incubator#344)

# Conflicts:
#	CHANGELOG.md
@pp-mo pp-mo merged commit cf86c1d into SciTools-incubator:main May 29, 2024
16 checks passed
stephenworsley added a commit to stephenworsley/iris-esmf-regrid that referenced this pull request May 30, 2024
* main:
  Ensure dtype is preserved after regridding (SciTools-incubator#239)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dtype of regridded cube changes after realizing the data
4 participants