Thanks to visit codestin.com
Credit goes to github.com

Skip to content

🌎 A few more basic stencils#337

Merged
FlorianDeconinck merged 3 commits intoNOAA-GFDL:developfrom
FlorianDeconinck:feat/more_basic_stencils
Dec 9, 2025
Merged

🌎 A few more basic stencils#337
FlorianDeconinck merged 3 commits intoNOAA-GFDL:developfrom
FlorianDeconinck:feat/more_basic_stencils

Conversation

@FlorianDeconinck
Copy link
Collaborator

@FlorianDeconinck FlorianDeconinck commented Dec 8, 2025

Description

Adding basic stencils to help with transparent orchestration without the advanced Quantity operations:

  • Expose all "basic" operations to ndsl.stencils level import
  • Add set_value on 2D floatfield
  • Add set_value on 2D bool masks

How has this been tested?

Trivial repeat of previous stencils.

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 (e.g. add new modules to docs/docstrings/)
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • New check tests, if applicable, are included

Add set_value on 2D bool masks
@FlorianDeconinck FlorianDeconinck changed the title :earth 🌎 A few more basic stencils Dec 8, 2025
Copy link
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.

Minor preference on naming, but otherwise happy for this to go in

Comment on lines 50 to 62
def set_value_2D_defn(buffer: FloatFieldIJ, value: Float) -> None:
"""
Sets every element of buffer to the value specified by value argument.

Args:
buffer: output field
value: value of Float type
"""
with computation(FORWARD), interval(0, 1):
buffer = value


def set_IJ_mask_value_defn(mask_out: BoolFieldIJ, value: Bool) -> None:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't love the _defn part of the stencil names, would rather have set_value_2d and set_ij_mask_value but that's a minor nit

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agreed - I will remove it in the current ones and make a duplication/deprecation for the older ones

@FlorianDeconinck FlorianDeconinck added this pull request to the merge queue Dec 9, 2025
@FlorianDeconinck FlorianDeconinck removed this pull request from the merge queue due to a manual request Dec 9, 2025
@FlorianDeconinck FlorianDeconinck added this pull request to the merge queue Dec 9, 2025
Merged via the queue into NOAA-GFDL:develop with commit 5e49ee1 Dec 9, 2025
6 checks passed
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