Skip to content

fre.cmor: replace nccmp subprocess calls with netCDF4 in cmor run subtool tests#826

Open
Copilot wants to merge 4 commits intomainfrom
copilot/remove-replace-nccmp-from-tests
Open

fre.cmor: replace nccmp subprocess calls with netCDF4 in cmor run subtool tests#826
Copilot wants to merge 4 commits intomainfrom
copilot/remove-replace-nccmp-from-tests

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 1, 2026

  • Set up conda environment and run tests to generate NetCDF files
  • Inspect input vs output files to identify what's preserved and what changes
  • Add import numpy as np and CMIP6_REQUIRED_GLOBAL_ATTRS constant
  • Extract shared assertion logic into _assert_data_matches() and _assert_metadata_matches() helpers
  • Update test_fre_cmor_run_subtool_case1_output_compare_data: file format differs + sos data, lat/lon/time coordinates, and shapes preserved
  • Update test_fre_cmor_run_subtool_case1_output_compare_metadata: global attrs differ + CMIP6-required attrs present + standard_name/long_name/_FillValue/missing_value preserved
  • Update test_fre_cmor_run_subtool_case2_output_compare_data: same data assertions as case1
  • Update test_fre_cmor_run_subtool_case2_output_compare_metadata: same metadata assertions as case1
  • All 16 tests pass, pylint 9.87/10
  • Code review and CodeQL clean

Copilot AI changed the title [WIP] Remove and replace nccmp from test_cmor_run_subtool.py replace nccmp subprocess calls with netCDF4 in cmor run subtool tests Apr 1, 2026
Copilot AI requested a review from ilaflott April 1, 2026 15:53
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.12%. Comparing base (7e80492) to head (08c7952).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #826   +/-   ##
=======================================
  Coverage   84.12%   84.12%           
=======================================
  Files          71       71           
  Lines        4944     4944           
=======================================
  Hits         4159     4159           
  Misses        785      785           
Flag Coverage Δ
unittests 84.12% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7e80492...08c7952. Read the comment docs.

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

@ilaflott ilaflott marked this pull request as ready for review April 1, 2026 17:28
@ilaflott ilaflott requested a review from cwhitlock-NOAA April 1, 2026 17:29
Copy link
Copy Markdown
Member

@ilaflott ilaflott left a comment

Choose a reason for hiding this comment

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

Wish i did this a long time ago!

@ilaflott ilaflott requested review from ceblanton and singhd789 April 1, 2026 18:06
@ilaflott ilaflott changed the title replace nccmp subprocess calls with netCDF4 in cmor run subtool tests fre.cmor: replace nccmp subprocess calls with netCDF4 in cmor run subtool tests Apr 1, 2026
@ilaflott ilaflott added the beta1 label Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

remove+replace nccmp from fre/cmor/tests/test_cmor_run_subtool.py

3 participants