Repository navigation
Fix GCV reader, plotting, packaging and CI; add regression tests - #13
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: de8f26577b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.11" | ||
| cache: pip |
There was a problem hiding this comment.
Point the pip cache at an existing dependency file
In the added test job, actions/setup-python@v5 enables the pip cache without cache-dependency-path, so it searches its default dependency manifests (requirements.txt or pyproject.toml). This commit contains neither file—the dependencies are declared in setup.py—causing setup-python to stop before the install, lint, and test steps. Set cache-dependency-path to setup.py/environment.yml or disable caching.
Useful? React with 👍 / 👎.
| with pytest.raises(ValueError, match="git lfs pull"): | ||
| gb.Berror(SAMPLE).read_records() |
There was a problem hiding this comment.
Create an LFS pointer fixture instead of using tracked data
When tests run in a normal clone where Git LFS smudged the sample—or after following the reader's own git lfs pull advice—SAMPLE is real GCV data, so read_records() does not raise the expected pointer error and this test fails. The current CI hides the problem with lfs: false; write a pointer into tmp_path so the test remains deterministic regardless of checkout state.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: de8f26577b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.11" | ||
| cache: pip |
There was a problem hiding this comment.
Point the pip cache at an existing dependency file
In the added test job, actions/setup-python@v5 enables the pip cache without cache-dependency-path, so it searches its default dependency manifests (requirements.txt or pyproject.toml). This commit contains neither file—the dependencies are declared in setup.py—causing setup-python to stop before the install, lint, and test steps. Set cache-dependency-path to setup.py/environment.yml or disable caching.
Useful? React with 👍 / 👎.
| with pytest.raises(ValueError, match="git lfs pull"): | ||
| gb.Berror(SAMPLE).read_records() |
There was a problem hiding this comment.
Create an LFS pointer fixture instead of using tracked data
When tests run in a normal clone where Git LFS smudged the sample—or after following the reader's own git lfs pull advice—SAMPLE is real GCV data, so read_records() does not raise the expected pointer error and this test fails. The current CI hides the problem with lfs: false; write a pointer into tmp_path so the test remains deterministic regardless of checkout state.
Useful? React with 👍 / 👎.
Motivation
.gcvmatrices and when producing plots, and make packaging/CI sane for modern Python tooling.Description
gsiberror/__init__.pyto validate header/record sizes, reject truncated or invalid files, detect Git LFS pointer files with an actionable message, and produce a non-duplicated cyclic longitude axis (endpoint=Falsefor longitudes).Berror.my_nameso it no longer overwrites itself and provideget_nameto return the configured display name, defaulting to the filename.gsiberror/plot_functions.pyby validating inputs, raising descriptiveValueErrorfor unknown variables, applying global min/max after unit conversions (e.g. pressure and humidity scalings), and returning the createdmatplotlibfigure objects.setup.pyandenvironment.ymlmetadata and dependency constraints (project_urls,extras_require, relaxCartopypin, alignnumpy/pythonrequirements).tests/test_berror.pyandtests/test_plot_functions.pycovering LFS pointer detection, truncated files, name-setting,var_namevalidation, andglobal_minmaxscaling behaviour..github/workflows/ci.ymlto run lint/format checks andpyteston pull requests and limit docs deployment to pushes onmain.Testing
PYTHONWARNINGS=error python -m compileall -q gsiberror tests setup.pywhich completed without warnings.ruff check . --exclude notebooksandruff format --check gsiberror tests setup.pywhich passed after automatic fixes.git diff --checkand static checks to ensure formatting and no leftover issues, which passed.pytest -qin the local image but collection failed due to missing runtime dependencies (ModuleNotFoundError: No module named 'numpy'and inability to import the package because the test runner environment did not have the package installed), so unit tests could not be executed locally; the CI job added to the workflow installspip install -e ".[dev]"before running tests to ensure dependencies are available.pip install) and to create a remote issue viaghfailed in this environment because network/proxy and GitHub authentication are not available, andpython setup.py --namecould not run here becausesetuptoolsis not present in the image.Codex Task