Skip to content

tests: properly register and skip translate test for GFSPhysicsDriver#65

Merged
jjuyeonkim merged 3 commits into
NOAA-GFDL:developfrom
romanc:romanc/run-gfs-physics-driver-on-ci
Oct 10, 2025
Merged

tests: properly register and skip translate test for GFSPhysicsDriver#65
jjuyeonkim merged 3 commits into
NOAA-GFDL:developfrom
romanc:romanc/run-gfs-physics-driver-on-ci

Conversation

@romanc
Copy link
Copy Markdown
Collaborator

@romanc romanc commented Oct 10, 2025

Description

The translate test for GFSPhysicsDriver currently isn't properly registered. NDSL's translate test system thus automatically marks the test as xfail (expected failure) because it can't find the translate test class. xfails are easy to oversee and don't generally raise alarm (because - after all - the test is expected to fail and it does so). xfail is generally used to test that missing features raise a warning. The behavior only started to show after some typing work, which made things more strict.

Given the above context, this PR

How Has This Been Tested?

Running translate tests locally (with the numpy backend) and on the CI (as always).

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
    N/A
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
    N/A
  • New check tests, if applicable, are included
  • Targeted model, if this change was triggered by a model need/shortcoming
    N/A

@romanc romanc changed the title run gfs physics driver tests: properly skip translate test for GFSPhysicsDriver Oct 10, 2025
romanc added a commit to romanc/NDSL that referenced this pull request Oct 10, 2025
while it is expected for a test to fail if that happens, this isn't
proper usage of the `xfail` marker. because doing so will just hide that
tests aren't running, e.g. see
NOAA-GFDL/pySHiELD#65.
@romanc romanc changed the title tests: properly skip translate test for GFSPhysicsDriver tests: properly register and skip translate test for GFSPhysicsDriver Oct 10, 2025
@romanc romanc marked this pull request as ready for review October 10, 2025 08:40
Copy link
Copy Markdown
Collaborator Author

@romanc romanc left a comment

Choose a reason for hiding this comment

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

Just some comment on the proposed changes.

from .translate_fillgfs import TranslateFillGFS
from .translate_fpvs import TranslateFPVS
from .translate_fv_update_phys import DycoreState, TranslateFVUpdatePhys
from .translate_gfs_physics_driver import TranslateGFSPhysicsDriver
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.

This magic import properly registers the translate test.


import ndsl.dsl.gt4py_utils as utils
import ndsl.initialization as util
from ndsl import QuantityFactory, SubtileGridSizer
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.

This is cleanup needed to get the translate test to run. ndsl.initialization currently doesn't expose QuantityFactory and SubtileGridSizer (to be fixed with NOAA-GFDL/NDSL#259). Importing everything from top-level ndsl is where we want to go and it will make our lives easier with upcoming refactors such as NOAA-GFDL/NDSL#243.

self.namelist,
do_dry_convective_adjust=False,
dycore_only=self.namelist.dycore_only,
dycore_only=False,
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.

There's no dycore_only attribute in PhysicsConfig. I guess False is a good value since we are in pySHiELD ...

@fmalatino fmalatino self-requested a review October 10, 2025 11:47
@fmalatino fmalatino requested a review from jjuyeonkim October 10, 2025 14:30
@jjuyeonkim jjuyeonkim added this pull request to the merge queue Oct 10, 2025
Merged via the queue into NOAA-GFDL:develop with commit 9486029 Oct 10, 2025
3 checks passed
@romanc romanc deleted the romanc/run-gfs-physics-driver-on-ci branch October 10, 2025 15:09
github-merge-queue Bot pushed a commit to NOAA-GFDL/NDSL that referenced this pull request Oct 10, 2025
* raise if translate test can't be found

while it is expected for a test to fail if that happens, this isn't
proper usage of the `xfail` marker. because doing so will just hide that
tests aren't running, e.g. see
NOAA-GFDL/pySHiELD#65.

* allow skip_test to be passed as ctor argument

skip_test is an option of our translate test system. let's be nice an
allow users of the translate test system to use that option as part of
the constructor arguments.

* cleanup exports from ndsl.initialization

---------

Co-authored-by: Roman Cattaneo <1116746+romanc@users.noreply.github.com>
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.

3 participants