Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: "uv"
directory: "/"
schedule:
interval: "weekly"
allow:
- dependency-name: "ruff"
13 changes: 13 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: CI

on: [pull_request]

jobs:
ci:
uses: ucgmsim/meta-ci-action/.github/workflows/ci.yml@main
with:
package-dir: pygmt_helper
system-packages: "gmt libgmt-dev ghostscript"
uv-extra-args: "--all-extras"
numpydoc-extra-excludes: "-E examples"
enable-coverage: false
11 changes: 11 additions & 0 deletions .github/workflows/claude-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Claude PR Review

on:
issue_comment:
types: [created]

jobs:
review:
uses: ucgmsim/meta-ci-action/.github/workflows/claude-review.yml@main
secrets:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
27 changes: 0 additions & 27 deletions .github/workflows/deptry.yml

This file was deleted.

18 changes: 0 additions & 18 deletions .github/workflows/git-extension.yml

This file was deleted.

36 changes: 0 additions & 36 deletions .github/workflows/numpydoc.yml

This file was deleted.

82 changes: 0 additions & 82 deletions .github/workflows/pytest.yml

This file was deleted.

8 changes: 0 additions & 8 deletions .github/workflows/ruff.yml

This file was deleted.

6 changes: 1 addition & 5 deletions pygmt_helper/examples/event_stations.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from pathlib import Path

import numpy as np
import pandas as pd

from pygmt_helper import plotting
Expand Down Expand Up @@ -128,10 +127,7 @@
box="+p0.5p,black",
):
fig = plotting.gen_region_fig(
region=inset_region,
high_res_topo=use_high_res_topo,
high_quality=True,
fig=fig
region=inset_region, high_res_topo=use_high_res_topo, high_quality=True, fig=fig
)

# Plot the sites
Expand Down
8 changes: 2 additions & 6 deletions pygmt_helper/examples/fault_traces.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pandas as pd
from qcore import nhm

from pygmt_helper import plots, plotting
from pygmt_helper import plots

# Config
nhm_ffp = Path("path to nhm file")
Expand All @@ -17,9 +17,6 @@
# Load the NHM
nhm_data = nhm.load_nhm(str(nhm_ffp))

# Load plotting data
map_data = plotting.NZMapData.load()

# Load the source information
cybershake_df = pd.read_csv(
Path(__file__).parent / "resources" / "cybershake_v20p4_200.csv", index_col=0
Expand All @@ -41,12 +38,11 @@
fig = plots.faults_plot(
rupture_df,
[cur_fault for cur_name, cur_fault in nhm_data.items()],
map_data=map_data,
title="Faults",
show_hypo=show_hypo,
)
fig.savefig(
output_dir / f"fault_traces.png",
dpi=900,
anti_alias=True,
)
)
68 changes: 35 additions & 33 deletions pygmt_helper/examples/polygons.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from pygmt_helper import plotting

import pygmt
import shapely

region = (170, 175, -45, -40)
Expand All @@ -16,39 +15,42 @@


test_polygon = shapely.Polygon(
[
[
170.50175961398025,
-43.43397759003748
],
[
170.03920443841383,
-43.88211179838194
],
[
170.61151846919984,
-44.265124035523286
],
[
171.81886587660995,
-43.74633923909617
],
[
171.00351438069657,
-43.24605985518982
],
[
170.50175961398025,
-43.43397759003748
]
],

[
[170.50175961398025, -43.43397759003748],
[170.03920443841383, -43.88211179838194],
[170.61151846919984, -44.265124035523286],
[171.81886587660995, -43.74633923909617],
[171.00351438069657, -43.24605985518982],
[170.50175961398025, -43.43397759003748],
],
)


plotting.plot_geometry(fig, test_polygon, pen='1p,blue,-', crs='4326')
plotting.label_polygon_on_boundary(fig, test_polygon, 'Outside!', align=True, projection=projection, fill='white', pen='1p,black', offset='0.3c')
plotting.label_geometry_inside(fig, test_polygon, 'Inside!', fill='white', pen='1p,black')
plotting.label_polygon_at(fig, 0.35, test_polygon, 'Around!', align=True, projection=projection, fill='white', pen='1p,black', offset='0.3c', justify='TC')
plotting.plot_geometry(fig, test_polygon, pen="1p,blue,-", crs="4326")
plotting.label_polygon_on_boundary(
fig,
test_polygon,
"Outside!",
align=True,
projection=projection,
fill="white",
pen="1p,black",
offset="0.3c",
)
plotting.label_geometry_inside(
fig, test_polygon, "Inside!", fill="white", pen="1p,black"
)
plotting.label_polygon_at(
fig,
0.35,
test_polygon,
"Around!",
align=True,
projection=projection,
fill="white",
pen="1p,black",
offset="0.3c",
justify="TC",
)

fig.savefig('polygons.jpeg')
fig.savefig("polygons.jpeg")
Loading
Loading