Add pytest test suite and GitHub Actions CI - #161
Merged
Conversation
- Unit tests for all LiCSBAS_lib modules (tools, inv, loop, io, plot): 89 tests running in ~30 s with no network and no real data - End-to-end smoke tests of steps 11-16 and LiCSBAS_cum2vel.py on a synthetic 10x10-px, 5-epoch dataset with a known velocity field; the inverted velocity is checked against the truth (atol 0.1 mm/yr) - Known latent bugs (nonexistent np.linalg.leastsq in inv_lib.censored_lstsq*, UnboundLocalError in io_lib.make_geotiff) are pinned with xfail(strict=True) to be fixed in separate PRs - CI workflow with micromamba (conda-forge) runs the suite on pushes and PRs to master Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
LiCSBAS2 had no automated tests. This PR adds a pytest-based test suite and a GitHub Actions CI workflow. The whole suite needs no network and no real data, and runs in ~30 s (~5 s without the
smokemarker).LiCSBAS_libmodules (tools,inv,loop,io,plot): coordinate conversions, SBAS design matrices, NSBAS inversion (recovering a forward-modeled velocity field, incl. ann_core=2vsn_core=1consistency check), loop closure, raw-binary/GAMMA-par/baselines I/O, GeoTIFF round-trips, and plot smoke tests.tests/test_bin_smoke.py, markersmoke): steps 11–16 andLiCSBAS_cum2vel.pyrun as subprocesses on a synthetic 10x10-px, 5-epoch, 7-ifg GEOCml dataset (tests/synth.py) with exactly loop-consistent phases from a known velocity field. The inverted velocity is checked against the truth within 0.1 mm/yr.xfail(strict=True), to be fixed in separate PRs:inv_lib.censored_lstsq/censored_lstsq2call the nonexistentnp.linalg.leastsqin their 1-D/single-column branchcensored_lstsq2accessesB.shape[1]before theB.ndimcheck (IndexError for 1-D input)io_lib.make_geotiffraisesUnboundLocalErrorfor dtypes other than float32/uint8.github/workflows/environment-ci.yml;LiCSBAS.ymlis untouched), triggered on pushes and PRs to master, with environment caching.Notes:
LiCSBAS_libis put on the import path bypytest.ini/conftest.py, so tests run without sourcingbashrc_LiCSBAS.sh.Test plan
python -m pytestin the licsbas conda env: 85 passed, 4 xfailed in ~30 sPYTHONPATH/MPLBACKENDunset (self-contained config)🤖 Generated with Claude Code