Skip to content

Conversation

@pp-mo
Copy link
Member

@pp-mo pp-mo commented Oct 8, 2025

Closes #6740

TBH this might have targetted "save_dataless" #6739 instead.
But now it can just wait till after that one

@codecov
Copy link

codecov bot commented Oct 8, 2025

Codecov Report

❌ Patch coverage is 97.43590% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 90.32%. Comparing base (9c06cca) to head (1cb44e7).

Files with missing lines Patch % Lines
lib/iris/cube.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6741      +/-   ##
==========================================
+ Coverage   90.29%   90.32%   +0.02%     
==========================================
  Files          91       91              
  Lines       24656    24674      +18     
  Branches     4618     4623       +5     
==========================================
+ Hits        22264    22286      +22     
+ Misses       1620     1618       -2     
+ Partials      772      770       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pp-mo pp-mo marked this pull request as ready for review October 9, 2025 09:06
@pp-mo pp-mo mentioned this pull request Oct 9, 2025
@pp-mo pp-mo marked this pull request as draft October 10, 2025 09:27
@pp-mo
Copy link
Member Author

pp-mo commented Oct 10, 2025

Status Update Fri 2023-10-10

I'm currently using this branch to add some more extensive documentation, since I felt I needed a decent location to describe the properties of merging with dataless cubes.

Also, I want to at least refer to #6739

Hence put this in draft for a while...

@pp-mo pp-mo marked this pull request as ready for review October 22, 2025 18:07
Copy link
Contributor

@ukmo-ccbunney ukmo-ccbunney left a comment

Choose a reason for hiding this comment

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

Looks good Patrick 👍🏼
Just a few comments.

Comment on lines +1268 to +1270
# We expect that the "parts" should **all be the same**
assert data.shape == part_shape
assert data.dtype == part_dtype
Copy link
Contributor

@ukmo-ccbunney ukmo-ccbunney Oct 24, 2025

Choose a reason for hiding this comment

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

The assertion on shape is only made for dataful cubes; there is no check that the dataless cube shape is consistent. Should that be happening here too?

Can cubes of different shape end up in this function?

else:
# We expect that the "parts" should **all be the same**
assert data.shape == part_shape
assert data.dtype == part_dtype
Copy link
Contributor

Choose a reason for hiding this comment

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

Raise exception instead?

Ruff S101: Favour exceptions over asserts


Most notably, dataless cubes can be used as the target "grid cube" for most regridding
schemes, since in that case the cube's coordinates are all that the method uses.
See also :meth:`iris.util.make_gridcube`.
Copy link
Contributor

Choose a reason for hiding this comment

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

The implication seems to be that make_gridcube should be able to return dataless cubes, this doesn't look like part of this PR, is there a plan to implement this? If not, it might be worth clarifying what is relevant here about make_gridcube.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Support dataless cubes in merge

3 participants