Skip to content

Conversation

davidhassell
Copy link
Collaborator

Fixes #843

Needs NCAS-CMS/cfdm#323

Notes:

@davidhassell davidhassell added the enhancement New feature or request label Feb 25, 2025
@davidhassell davidhassell added this to the NEXT VERSION milestone Feb 25, 2025
Copy link
Member

@sadielbartholomew sadielbartholomew left a comment

Choose a reason for hiding this comment

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

Minor comments only.

I am happy overall so approving, though like with my latest (hopefully final) review on the cfdm numpy 2 PR there are a few warnings emerging when I add the np._set_promotion_state("weak_and_warn") to the __init.py__ files and run the cf-python test suite to check for issues concerning the new type promotion behaviour, so we should check that they don't amount to anything or tweak if they do.

Looks to just be these three, though the warning emerges for any call so they spam STDOUT and I've just eyeballed quickly to try to spot anything else, something may be hiding amongst them. Note there is one warning each from a line/block in cf-python, cfdm and cfunits:

...
/home/slb93/git-repos/cfdm/cfdm/data/subarray/boundsfromnodessubarray.py:157: UserWarning: result dtype changed due to the removal of value-based promotion from NumPy. Changed from int32 to int64.
  node_indices = node_indices - start_index
/home/slb93/git-repos/cf-python/cf/regrid/regrid.py:2189: UserWarning: result dtype changed due to the removal of value-based promotion from NumPy. Changed from int64 to int32.
  node_ids += min_id + 1
/home/slb93/miniconda3/envs/cf-env-312-numpy2/lib/python3.12/site-packages/cfunits/units.py:2305: UserWarning: result dtype changed due to the removal of value-based promotion from NumPy. Changed from float64 to float128.
  x -= offset
...

davidhassell and others added 4 commits February 27, 2025 15:17
Co-authored-by: Sadie L. Bartholomew <[email protected]>
Co-authored-by: Sadie L. Bartholomew <[email protected]>
Co-authored-by: Sadie L. Bartholomew <[email protected]>
@davidhassell
Copy link
Collaborator Author

Fixed the cf-python type casting: feb7404
I don't think the cfdm one is a problem
We shouls fix the cfunits one over there.

@davidhassell davidhassell merged commit 279bbc8 into NCAS-CMS:main Feb 28, 2025
@davidhassell davidhassell deleted the numpy-v2-from-cfa-in-cfdm branch February 28, 2025 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move to numpy version 2
2 participants