[WIP] Add new fremor init command for config fetching#68
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #68 +/- ##
==========================================
+ Coverage 94.04% 94.38% +0.33%
==========================================
Files 9 10 +1
Lines 1226 1300 +74
==========================================
+ Hits 1153 1227 +74
Misses 73 73
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
ilaflott
left a comment
There was a problem hiding this comment.
in fremorizer/cmor_init.py
def _fetch_tables_curlis not covered, make a unit test actually run the code and cover the function. do not use excessive mocking or patching.def _fetch_tables_gitis similarly not covered- test the case where
tables_dir is not Noneevaluates toTrueon line 312 - test the
raise ValueError(f"mip era must be... - would using
conda-forge::gitpythonmake sense?
Added comprehensive unit tests in test_cmor_init_subtool.py (commit fd55b26):
Regarding
The subprocess approach is standard practice in the Python ecosystem for Git operations when you don't need complex Git API features. |
fd55b26 to
e47773e
Compare
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
4417bc6 to
d19ee14
Compare
- Created cmor_init.py with experiment config templates and table fetching - Added CLI command in cli.py with --mip_era, --exp_config, --tables_dir, --tag, and --fast options - Exported cmor_init_subtool in __init__.py - Added comprehensive tests in test_cli.py Agent-Logs-Url: https://github.com/ilaflott/fremorizer/sessions/2027c035-0355-448b-ab45-f47f209e2dd2 Co-authored-by: ilaflott <6273252+ilaflott@users.noreply.github.com>
- Test _fetch_tables_git with actual git clone (no mocking) - Test _fetch_tables_curl with actual tarball download (no mocking) - Test ValueError for invalid mip_era values - Test tables_dir=not None cases (git and curl modes) - Test combination of exp_config and tables_dir - Test tables_dir only without exp_config creation Addresses PR feedback on test coverage for cmor_init module. Agent-Logs-Url: https://github.com/ilaflott/fremorizer/sessions/cf8ef105-2b6c-4a3e-9025-7bc14da391a0 Co-authored-by: ilaflott <6273252+ilaflott@users.noreply.github.com>
- Change tag from 'v6.2.56.6' (invalid) to '6.9.33' (valid) - Remove unused Path import - Fix unused variable 'item' warnings by using '_' instead - Simplify test logic by removing try/except skip pattern Agent-Logs-Url: https://github.com/ilaflott/fremorizer/sessions/dfe3328e-5729-49bb-be6f-4d06d2af5a21 Co-authored-by: ilaflott <6273252+ilaflott@users.noreply.github.com>
- Add fremor init to README subcommands list - Add "Getting Started" section in README with init examples - Add init command section in quickstart.rst - Update cookbook.rst workflow to include init step - Update usage.rst subcommands list - Add complete init command reference in commands.rst Agent-Logs-Url: https://github.com/ilaflott/fremorizer/sessions/aa8076ca-e112-4bb0-997f-fbe6660a12d9 Co-authored-by: ilaflott <6273252+ilaflott@users.noreply.github.com>
Add test_fetch_tables_git_with_tag to verify that _fetch_tables_git correctly uses the --branch flag when a tag is specified. This ensures git clone can checkout a specific release tag (e.g., 6.9.33). Agent-Logs-Url: https://github.com/ilaflott/fremorizer/sessions/b249a7f2-8f08-487e-8b8a-60dfba117869 Co-authored-by: ilaflott <6273252+ilaflott@users.noreply.github.com>
043ffc2 to
aa82415
Compare
Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.