Skip to content

Fix create_test_conda_env: isolate version from heavy imports, add submodules, fix test issues#6

Merged
ilaflott merged 2 commits intomainfrom
copilot/fix-create-test-conda-env
Apr 14, 2026
Merged

Fix create_test_conda_env: isolate version from heavy imports, add submodules, fix test issues#6
ilaflott merged 2 commits intomainfrom
copilot/fix-create-test-conda-env

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 14, 2026

  • Replace nccmp subprocess calls with netCDF4-based comparisons in test_cmor_run_subtool.py (adapted from fre-cli PR #826)
    • Add netCDF4/numpy imports and CMIP6_REQUIRED_GLOBAL_ATTRS constant
    • Add _assert_data_matches() and _assert_metadata_matches() helper functions
    • Rewrite 4 tests: case1/case2 data and metadata comparison
  • Remove nccmp from environment.yaml
  • Remove nccmp from .cspell/ok-unknown-words.txt
  • Update PHASE_2.5_EQUIVALENCE_TESTING.md to remove nccmp reference
  • Update PHASE_3_DEFERRED_FEATURES.md to mark item 1 as complete
  • All 108 tests pass, 8 xfailed as expected
  • pylint 9.48/10
  • Validation passed (code review + CodeQL: both clean)

Copilot AI linked an issue Apr 14, 2026 that may be closed by this pull request
@ilaflott
Copy link
Copy Markdown
Member

#5

Copilot AI changed the title [WIP] Fix create_test_conda_env not working Fix create_test_conda_env: isolate version from heavy imports, add submodules, fix test issues Apr 14, 2026
Copilot AI requested a review from ilaflott April 14, 2026 01:34
Copilot AI and others added 2 commits April 13, 2026 21:56
- Move __version__ to _version.py to avoid importing cmor during pip build
- Update pyproject.toml to read version from fremorizer._version
- Add submodules: recursive to checkout step in workflow
- Add nccmp to environment.yaml (needed by tests)
- Fix test_find_statics_file_success to use tmp_path (avoid test pollution)
- Fix test_setup_fre_cmor_run_subtool to create output directory

Agent-Logs-Url: https://github.com/ilaflott/fremorizer/sessions/9d29eafc-3795-4808-ba85-95ab00fa460f

Co-authored-by: ilaflott <6273252+ilaflott@users.noreply.github.com>
- Replace 4 nccmp subprocess calls with netCDF4-based Python assertions
- Add _assert_data_matches() and _assert_metadata_matches() helpers
- Add CMIP6_REQUIRED_GLOBAL_ATTRS constant for metadata validation
- Remove nccmp from environment.yaml
- Remove nccmp from .cspell/ok-unknown-words.txt
- Update PHASE_2.5_EQUIVALENCE_TESTING.md to remove nccmp reference
- Mark Phase 3 item 1 as complete in PHASE_3_DEFERRED_FEATURES.md

Adapted from fre-cli PR #826.

Agent-Logs-Url: https://github.com/ilaflott/fremorizer/sessions/60372479-3053-4bc3-ae84-1bdc0a048e2d

Co-authored-by: ilaflott <6273252+ilaflott@users.noreply.github.com>
@ilaflott ilaflott force-pushed the copilot/fix-create-test-conda-env branch from 32e6a7c to b2f388f Compare April 14, 2026 01:56
@ilaflott ilaflott marked this pull request as ready for review April 14, 2026 01:58
@ilaflott
Copy link
Copy Markdown
Member

winner winner

@ilaflott ilaflott merged commit e946421 into main Apr 14, 2026
5 of 6 checks passed
@ilaflott ilaflott deleted the copilot/fix-create-test-conda-env branch April 14, 2026 02:29
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.

create_test_conda_env doesnt work

2 participants