Skip to content

Commit 041e6bf

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents a532757 + 98ee6c7 commit 041e6bf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+4792
-4088
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
- uses: julia-actions/julia-buildpkg@latest
6363
- uses: julia-actions/julia-runtest@latest
6464
- uses: julia-actions/julia-processcoverage@v1
65-
- uses: codecov/codecov-action@v4
65+
- uses: codecov/codecov-action@v5
6666
with:
6767
token: ${{ secrets.CODECOV_TOKEN }}
6868
fail_ci_if_error: false # or true if you want CI to fail when Codecov fails

.github/workflows/Format.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: 'Format'
2+
3+
on:
4+
pull_request_target:
5+
paths: ['**/*.jl']
6+
types: [opened, synchronize, reopened, ready_for_review]
7+
8+
permissions:
9+
contents: read
10+
actions: write
11+
pull-requests: write
12+
13+
jobs:
14+
runic:
15+
runs-on: ubuntu-latest
16+
if: github.event.pull_request.draft == false
17+
steps:
18+
- name: Check out repository
19+
uses: actions/checkout@v4
20+
with:
21+
ref: ${{github.event.pull_request.head.ref}}
22+
repository: ${{github.event.pull_request.head.repo.full_name}}
23+
fetch-depth: 0
24+
25+
- name: Add upstream remote
26+
run: |
27+
git remote add upstream https://github.com/${{ github.repository }}
28+
git fetch upstream
29+
30+
- name: Setup Julia
31+
uses: julia-actions/setup-julia@v2
32+
with:
33+
version: '1'
34+
arch: 'x64'
35+
- uses: julia-actions/cache@v2
36+
37+
- name: Install Runic
38+
run: |
39+
julia --project=@runic -e 'using Pkg; Pkg.add("Runic")'
40+
curl -o git-runic https://raw.githubusercontent.com/fredrikekre/Runic.jl/master/bin/git-runic
41+
chmod +x git-runic
42+
sudo mv git-runic /usr/local/bin
43+
44+
- name: Run Runic
45+
id: runic
46+
run: |
47+
set +e
48+
MERGE_BASE=$(git merge-base upstream/${{ github.base_ref }} HEAD) || exit 1
49+
DIFF=$(git runic --diff $MERGE_BASE)
50+
EXIT_CODE=$?
51+
52+
echo "exit_code=$EXIT_CODE" >> $GITHUB_OUTPUT
53+
echo "diff<<EOF" >> $GITHUB_OUTPUT
54+
echo "$DIFF" >> $GITHUB_OUTPUT
55+
echo "EOF" >> $GITHUB_OUTPUT
56+
57+
# if Runic failed, bail out
58+
[ $EXIT_CODE -eq 2 ] && exit 1 || exit 0
59+
60+
- name: Find comment
61+
uses: peter-evans/find-comment@v3
62+
id: find-comment
63+
with:
64+
issue-number: ${{ github.event.pull_request.number }}
65+
comment-author: 'github-actions[bot]'
66+
body-includes: '<!-- runic-format-summary -->'
67+
68+
- name: Comment formatting suggestions
69+
if: steps.runic.outputs.exit_code == 1
70+
uses: peter-evans/create-or-update-comment@v4
71+
with:
72+
comment-id: ${{ steps.find-comment.outputs.comment-id }}
73+
issue-number: ${{ github.event.pull_request.number }}
74+
body: |
75+
<!-- runic-format-summary -->
76+
77+
Your PR requires formatting changes to meet the project's style guidelines.
78+
Please consider running [Runic](https://github.com/fredrikekre/Runic.jl) (`git runic ${{ github.base_ref }}`) to apply these changes.
79+
80+
<details>
81+
<summary>Click here to view the suggested changes.</summary>
82+
83+
```diff
84+
${{ steps.runic.outputs.diff }}
85+
```
86+
87+
</details>
88+
edit-mode: replace
89+
90+
- name: Update stale comment
91+
if: steps.runic.outputs.exit_code == 0 && steps.find-comment.outputs.comment-id
92+
uses: peter-evans/create-or-update-comment@v4
93+
with:
94+
comment-id: ${{ steps.find-comment.outputs.comment-id }}
95+
issue-number: ${{ github.event.pull_request.number }}
96+
body: |
97+
<!-- runic-format-summary -->
98+
99+
Your PR no longer requires formatting changes. Thank you for your contribution!
100+
edit-mode: replace
101+
102+
# XXX: if Github ever supports allow-failure (actions/runner#2347)
103+
#- name: Propagate exit code
104+
# run: |
105+
# exit ${{ steps.runic.outputs.exit_code }}

.github/workflows/SpellCheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ jobs:
1010
- name: Checkout Actions Repository
1111
uses: actions/checkout@v4
1212
- name: Check spelling
13-
uses: crate-ci/typos@v1.26.8
13+
uses: crate-ci/typos@v1.28.1
1414
with:
1515
args: --exclude **/*.txt --exclude **/*.pvsm

.github/workflows/draft-pdf.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ tutorial/test.tiff
2020
*.vtr
2121
*.vts
2222
*.jld2
23+
*.swm
24+
*.swn
25+
*.swo
2326
*.tiff
2427
*.nc
2528
!/test/test_files/ISCTest.xml

.typos.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Shepard = "Shepard"
55
arange = "arange"
66
iy = "iy"
77
nin = "nin"
8+
tect = "tect"
89

910
[files]
1011
extend-exclude = ["tutorials/*.pvsm","docs/paper/paper.bib"]

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "GeophysicalModelGenerator"
22
uuid = "3700c31b-fa53-48a6-808a-ef22d5a84742"
33
authors = ["Boris Kaus", "Marcel Thielmann"]
4-
version = "0.7.12"
4+
version = "0.7.13"
55

66
[deps]
77
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
@@ -51,7 +51,7 @@ FFMPEG = "0.4"
5151
FileIO = "1"
5252
GDAL_jll = "300.900.0 - 301.901.0"
5353
GLMakie = "0.8, 0.9, 0.10, 0.11"
54-
GeoParams = "0.2 - 0.6"
54+
GeoParams = "0.2 - 0.7"
5555
Geodesy = "1"
5656
GeometryBasics = "0.1 - 0.4"
5757
Glob = "1.2 - 1.3"

ext/Chmy_utils.jl

Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -15,39 +15,39 @@ println("Loading Chmy-GMG tools")
1515
1616
Creates a GMG `CartGrid` data structure from a `Chmy` grid object
1717
"""
18-
function create_CartGrid(grid::StructuredGrid; ylevel=0.0)
18+
function create_CartGrid(grid::StructuredGrid; ylevel = 0.0)
1919

20-
coord1D = Vector.(coords(grid, Vertex()))
20+
coord1D = Vector.(coords(grid, Vertex()))
2121
coord1D_cen = Vector.(coords(grid, Center()))
22-
N = length.(coord1D)
23-
L = extent(grid, Vertex())
24-
X₁ = origin(grid, Vertex())
25-
Δ = spacing(grid)
26-
ConstantΔ = false;
22+
N = length.(coord1D)
23+
L = extent(grid, Vertex())
24+
X₁ = origin(grid, Vertex())
25+
Δ = spacing(grid)
26+
ConstantΔ = false
2727
if isa(grid, UniformGrid)
2828
ConstantΔ = true
2929
end
30-
if ndims(grid)==2
30+
if ndims(grid) == 2
3131
# we need a special treatment of this, as all GMG routines work with 3D coordinates
32-
X₁ = (X₁[1], ylevel, X₁[2])
33-
L = (L[1], 0.0, L[2])
34-
Δ = (Δ[1], 0.0, Δ[2])
35-
N = (N[1],1,N[2])
32+
X₁ = (X₁[1], ylevel, X₁[2])
33+
L = (L[1], 0.0, L[2])
34+
Δ = (Δ[1], 0.0, Δ[2])
35+
N = (N[1], 1, N[2])
3636
coord1D = (coord1D[1], [0.0], coord1D[2])
3737
coord1D_cen = (coord1D_cen[1], [0.0], coord1D_cen[2])
3838
end
39-
Xₙ = X₁ .+ L
40-
39+
Xₙ = X₁ .+ L
4140

42-
return CartGrid(ConstantΔ,N,Δ,L,X₁,Xₙ,coord1D, coord1D_cen)
41+
42+
return CartGrid(ConstantΔ, N, Δ, L, X₁, Xₙ, coord1D, coord1D_cen)
4343
end
4444

4545
# all functions to be ported
4646
function_names = (:add_box!, :add_sphere!, :add_ellipsoid!, :add_cylinder!, :add_layer!, :add_polygon!, :add_slab!, :add_stripes!, :add_volcano!)
4747

4848
for fn in function_names
4949

50-
@eval begin
50+
@eval begin
5151
"""
5252
$($fn)( Phase::Field,
5353
Temp::Field,
@@ -56,22 +56,24 @@ for fn in function_names
5656
5757
Sets `$($fn)` function for `Chmy` fields and grids.
5858
"""
59-
function $fn( Phase::Field,
60-
Temp::Field,
61-
Grid::StructuredGrid; # required input
62-
kwargs...)
59+
function $fn(
60+
Phase::Field,
61+
Temp::Field,
62+
Grid::StructuredGrid; # required input
63+
kwargs...
64+
)
6365

6466
CartGrid = create_CartGrid(Grid)
6567

6668
cell = false
67-
if all(location(Phase).==Center())
69+
if all(location(Phase) .== Center())
6870
cell = true
6971
end
70-
71-
return ($fn)(Phase, Temp, CartGrid; cell=cell, kwargs...)
72+
73+
return ($fn)(Phase, Temp, CartGrid; cell = cell, kwargs...)
7274
end
7375
end
74-
76+
7577
end
7678

7779

@@ -80,28 +82,30 @@ function_names = (:above_surface, :below_surface)
8082

8183
for fn in function_names
8284

83-
@eval begin
85+
@eval begin
8486
"""
8587
$($fn)( Grid::StructuredGrid, field::Field, DataSurface_Cart::CartData; kwargs...)
8688
8789
Sets `$($fn)` function for `Chmy` grids and the field `field` which can be either on vertices or centers
8890
"""
89-
function $fn( Grid::StructuredGrid,
90-
field::Field,
91-
DataSurface_Cart::CartData;
92-
kwargs...)
91+
function $fn(
92+
Grid::StructuredGrid,
93+
field::Field,
94+
DataSurface_Cart::CartData;
95+
kwargs...
96+
)
9397

9498
CartGrid = create_CartGrid(Grid)
95-
99+
96100
cell = false
97-
if all(location(field).==Center())
101+
if all(location(field) .== Center())
98102
cell = true
99103
end
100104

101-
return ($fn)(CartGrid, DataSurface_Cart; cell=cell, kwargs...)
105+
return ($fn)(CartGrid, DataSurface_Cart; cell = cell, kwargs...)
102106
end
103107
end
104-
108+
105109
end
106110

107111

0 commit comments

Comments
 (0)