Skip to content

Coast/Land Mask + Tidy Up - #21

Open
claudio525 wants to merge 6 commits into
mainfrom
coast_water_mask
Open

Coast/Land Mask + Tidy Up#21
claudio525 wants to merge 6 commits into
mainfrom
coast_water_mask

Conversation

@claudio525

@claudio525 claudio525 commented Aug 14, 2026

Copy link
Copy Markdown
Contributor
  • Added function for getting a coast/land mask
  • Updated pyproject.toml, removed requirements.txt
  • Tidied up workflow actions to use the meta-ci-action
  • Updated srf.py example to use source-modelling instead of qcore srf.py (no longer exists)
  • Addressed ruff/type checking issues.

@claudio525
claudio525 marked this pull request as draft August 14, 2026 02:47
@claudio525 claudio525 changed the title Adds coast/in-land water mask function. Plus minor improvements. Coast/Land Mask + Tidy Up Aug 16, 2026
@claudio525
claudio525 requested a lite review from Copilot August 17, 2026 00:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 removed requirements.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-action workflows; 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.

Comment thread pygmt_helper/plotting.py
Comment thread pygmt_helper/plotting.py
Comment thread .github/workflows/git-extension.yml Outdated
Comment thread pyproject.toml
@claudio525
claudio525 marked this pull request as ready for review August 17, 2026 01:16
Comment thread pyproject.toml
Comment on lines +12 to +25
dependencies = [
"numpy",
"pandas",
"geopandas>1.0",
"pyarrow",
"pygmt>=0.16.0",
"pyproj",
"xarray",
"scipy",
"shapely>=2",
"qcore-utils",
"pooch",
"tqdm",
"netcdf4",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use dependency groups rather than the per-ignore rules below to avoid transient dependencies on packages we don't use

Suggested change
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",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The io group for xarray pulls in all io packages required for various formats, and similar for pandas with parquet.

Comment thread pyproject.toml

[tool.deptry.per_rule_ignores]
DEP002 = ["pyarrow", "netcdf4"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can drop these

Suggested change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants