Clarify install docs for Gadi/submodules; add actionable submodule error - #607
Merged
Merged
Conversation
A user hit ModuleNotFoundError for access_moppy.vocabularies.CMIP6_CVs after `pip install .` from a local clone: the vocabularies/ directories are git submodules, and a clone made without initialising them ships an empty package-data glob, so the CMOR CVs/tables go missing at runtime. PyPI/conda distributions already bundle this data correctly and are unaffected. - README/docs: add an NCI Gadi section pointing at the ACCESS-NRI conda/analysis3-latest module (no pip install needed), and document `git clone --recurse-submodules` / `git submodule update --init --recursive` for source installs. - vocabulary_processors.py: wrap the importlib.resources.files() calls used to load CV/table data in a _vocab_files() helper that turns a missing-submodule ModuleNotFoundError into an actionable message. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (50.0%) is below the target coverage (90.0%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #607 +/- ##
=======================================
- Coverage 75.1% 75.1% -0.0%
=======================================
Files 38 38
Lines 8070 8075 +5
Branches 1517 1517
=======================================
+ Hits 6061 6064 +3
- Misses 1688 1690 +2
Partials 321 321
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Summary
ModuleNotFoundError: No module named 'access_moppy.vocabularies.CMIP6_CVs'afterpip install .from a local clone. Root cause:vocabularies/CMIP6_CVs(and the other CV/table dirs) are git submodules, and a clone made without initialising them ships an emptypackage-dataglob, so the CMOR CVs/tables go missing at runtime. Verified PyPI's published wheel already bundles this data correctly (unaffected).conda/analysis3-latestmodule (nopip installneeded), and documentgit clone --recurse-submodules/git submodule update --init --recursivefor source installs.vocabulary_processors.py: wrap theimportlib.resources.files()calls used to load CV/table data in a_vocab_files()helper so a missing-submoduleModuleNotFoundErrorgets an actionable message instead of a bare traceback.Test plan
pixi run -e dev pytest tests/ -k "vocabulary" -q— 180 passedCMIP6VocabularyforAmon.prto confirm normal loading still worksvocabularies/CMIP6_CVs/etc. are already bundled correctly🤖 Generated with Claude Code