Skip to content

Quantity.field has true array accessor to the compute domain on a Quantity#141

Merged
FlorianDeconinck merged 9 commits into
NOAA-GFDL:developfrom
FlorianDeconinck:feature/quantity_field
May 13, 2025
Merged

Quantity.field has true array accessor to the compute domain on a Quantity#141
FlorianDeconinck merged 9 commits into
NOAA-GFDL:developfrom
FlorianDeconinck:feature/quantity_field

Conversation

@FlorianDeconinck
Copy link
Copy Markdown
Collaborator

@FlorianDeconinck FlorianDeconinck commented May 9, 2025

Description

  • Introduce field as a replacement for quantity.view[:]
  • Rename data_array as data_as_xarray and introduce field_as_xarray

How Has This Been Tested?
Extension to the unit tests

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • New check tests, if applicable, are included

Rename `data_array` as `data_as_xarray` and introduce `field_as_xarray`
@FlorianDeconinck FlorianDeconinck requested a review from oelbert May 9, 2025 18:29
oelbert
oelbert previously approved these changes May 12, 2025
Copy link
Copy Markdown
Collaborator

@oelbert oelbert left a comment

Choose a reason for hiding this comment

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

v happy to see this go in

Comment on lines 97 to 99
assert quantity.data[0, 0] == 1
assert quantity.data[2, 2] == 5
assert quantity.data[4, 4] == 3
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe someday it will make sense to do this with a halo and we can test that the data is different than the field or view

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Your wishes are my command*.

*Subject to budget constraint, time and implementation technical details. Offer can be removed at any time for no reasons. Definition of "wishes" and "command" subject to change.

Copy link
Copy Markdown
Collaborator

@oelbert oelbert left a comment

Choose a reason for hiding this comment

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

Even better!

@FlorianDeconinck FlorianDeconinck merged commit 1d2446a into NOAA-GFDL:develop May 13, 2025
5 checks passed
@FlorianDeconinck FlorianDeconinck deleted the feature/quantity_field branch May 13, 2025 16:06
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.

2 participants