Replace nccmp with xarray in test_remap_pp_components.py#827
Open
Replace nccmp with xarray in test_remap_pp_components.py#827
nccmp with xarray in test_remap_pp_components.py#827Conversation
- In test_remap_pp_components.py: replaced 3 nccmp -d calls with xr.testing.assert_equal, renamed test_nccmp_* to test_compare_* - In test_split_netcdf.py: replaced nccmp -d with xr.testing.assert_equal for data tests, replaced nccmp -mg with xr.testing.assert_identical for metadata tests Agent-Logs-Url: https://github.com/NOAA-GFDL/fre-cli/sessions/288da653-c4d3-4b41-bc3b-d062092ae272 Co-authored-by: ilaflott <6273252+ilaflott@users.noreply.github.com>
Agent-Logs-Url: https://github.com/NOAA-GFDL/fre-cli/sessions/288da653-c4d3-4b41-bc3b-d062092ae272 Co-authored-by: ilaflott <6273252+ilaflott@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Remove and replace nccmp from test_remap_pp_components.py
Replace nccmp with xarray in test_remap_pp_components.py and test_split_netcdf.py
Apr 1, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #827 +/- ##
=======================================
Coverage 84.12% 84.12%
=======================================
Files 71 71
Lines 4944 4944
=======================================
Hits 4159 4159
Misses 785 785
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
…led in a different PR
test_remap_pp_components.py
test_remap_pp_components.pynccmp with xarray in test_remap_pp_components.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes
Remove
nccmpsubprocess calls from two test files, replacing with nativexarraycomparisons.fre/app/remap_pp_components/tests/test_remap_pp_components.py:nccmp -d→xr.testing.assert_equalfor 3 data comparison teststest_nccmp_*→test_compare_*fre/pp/tests/test_split_netcdf.py:nccmp -d --force→xr.testing.assert_equalintest_split_file_datanccmp -mg --force→xr.testing.assert_identicalintest_split_file_metadata(covers both global attrs and variable metadata)Both files use context managers for dataset cleanup:
xarrayis already a project dependency; no new dependencies added.Issue ticket number and link (if applicable)
Checklist before requesting a review