Coast/Land Mask + Tidy Up - #21
Conversation
There was a problem hiding this comment.
Pull request overview
This PR migrates dependency management into pyproject.toml, introduces a coastline/inland-water masking helper for more accurate gridding/plotting, and consolidates CI into the shared meta-ci-action workflows while updating examples and lint/type-check configuration.
Changes:
- Moved runtime/test/dev dependencies into
pyproject.toml(and removedrequirements.txt). - Added coastline + inland-water masking logic to improve land/water handling in gridded outputs and plotting.
- Replaced multiple bespoke GitHub Actions workflows with shared
ucgmsim/meta-ci-actionworkflows; updated examples to match current upstream dependencies.
Reviewed changes
Copilot reviewed 15 out of 17 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| requirements.txt | Removed in favor of pyproject.toml dependency declaration. |
| pyproject.toml | Defines core + optional dependencies and adds deptry/ruff/ty configuration. |
| pygmt_helper/plotting.py | Adds coast/water mask helper and adjusts plotting/gridding behavior and typing. |
| pygmt_helper/plots.py | API cleanup for plotting helpers; updates options for roads/topo and disagg return typing. |
| pygmt_helper/examples/srf.py | Updates SRF example to use source-modelling SRF reader instead of removed qcore SRF API. |
| pygmt_helper/examples/polygons.py | Formatting/cleanup of polygon example. |
| pygmt_helper/examples/fault_traces.py | Updates example to match plotting API changes (no explicit NZMapData wiring). |
| pygmt_helper/examples/event_stations.py | Minor cleanup/formatting change. |
| .github/workflows/ruff.yml | Removed (superseded by consolidated CI workflow). |
| .github/workflows/pytest.yml | Removed (superseded by consolidated CI workflow). |
| .github/workflows/numpydoc.yml | Removed (superseded by consolidated CI workflow). |
| .github/workflows/deptry.yml | Removed (superseded by consolidated CI workflow). |
| .github/workflows/git-extension.yml | Updated to validate git dependency formatting against pyproject.toml. |
| .github/workflows/claude-review.yml | Adds shared Claude review workflow wiring. |
| .github/workflows/ci.yml | Adds consolidated CI workflow via ucgmsim/meta-ci-action. |
| .github/dependabot.yml | Enables dependabot updates for uv ecosystem configuration. |
Suppressed comments (1)
pygmt_helper/plotting.py:328
- Coastline is drawn twice: once in the land background plot (with both fill and pen) and again later in the dedicated coastline plot. This duplicates strokes and can cause thicker/darker coastlines depending on pen settings. Consider removing the pen from the land-fill pass so the coastline is only stroked once on top.
# Plot background land
fig.plot(
data=map_data.coastline_df,
pen=f"{plot_kwargs['coastline_pen_width']}p,{plot_kwargs['coastline_pen_color']}",
fill=plot_kwargs["land_color"],
)
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| dependencies = [ | ||
| "numpy", | ||
| "pandas", | ||
| "geopandas>1.0", | ||
| "pyarrow", | ||
| "pygmt>=0.16.0", | ||
| "pyproj", | ||
| "xarray", | ||
| "scipy", | ||
| "shapely>=2", | ||
| "qcore-utils", | ||
| "pooch", | ||
| "tqdm", | ||
| "netcdf4", |
There was a problem hiding this comment.
Use dependency groups rather than the per-ignore rules below to avoid transient dependencies on packages we don't use
| dependencies = [ | |
| "numpy", | |
| "pandas", | |
| "geopandas>1.0", | |
| "pyarrow", | |
| "pygmt>=0.16.0", | |
| "pyproj", | |
| "xarray", | |
| "scipy", | |
| "shapely>=2", | |
| "qcore-utils", | |
| "pooch", | |
| "tqdm", | |
| "netcdf4", | |
| dependencies = [ | |
| "numpy", | |
| "pandas[parquet]", | |
| "geopandas>1.0", | |
| "pygmt>=0.16.0", | |
| "pyproj", | |
| "xarray[io]", | |
| "scipy", | |
| "shapely>=2", | |
| "qcore-utils", | |
| "pooch", | |
| "tqdm", |
There was a problem hiding this comment.
The io group for xarray pulls in all io packages required for various formats, and similar for pandas with parquet.
|
|
||
| [tool.deptry.per_rule_ignores] | ||
| DEP002 = ["pyarrow", "netcdf4"] | ||
|
|
There was a problem hiding this comment.
Can drop these
Uh oh!
There was an error while loading. Please reload this page.