Skip to content

Commit 854256b

Browse files
committed
Merge branch 'main' of github.com:python-hydro/ppmpy
2 parents 951c571 + e65067d commit 854256b

9 files changed

Lines changed: 45 additions & 18 deletions

File tree

.github/workflows/codespell.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
fetch-depth: 0
1919

2020
- name: Setup Python
21-
uses: actions/setup-python@v5
21+
uses: actions/setup-python@v6
2222
with:
2323
python-version: '3.12'
2424
cache: "pip"

.github/workflows/docs-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
sudo apt install pandoc doxygen
2626
2727
- name: Setup Python
28-
uses: actions/setup-python@v5
28+
uses: actions/setup-python@v6
2929
with:
3030
python-version: '3.12'
3131
cache: "pip"

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- uses: actions/checkout@v5
1414

1515
- name: Set up Python
16-
uses: actions/setup-python@v5
16+
uses: actions/setup-python@v6
1717
with:
1818
python-version: "3.12"
1919
cache: "pip"

.github/workflows/flake8.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- uses: actions/checkout@v5
2020

2121
- name: Install Python 3.12
22-
uses: actions/setup-python@v5
22+
uses: actions/setup-python@v6
2323
with:
2424
python-version: '3.12'
2525
cache: "pip"

.github/workflows/pylint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- uses: actions/checkout@v5
2020

2121
- name: Install Python
22-
uses: actions/setup-python@v5
22+
uses: actions/setup-python@v6
2323
with:
2424
python-version: '3.12'
2525
cache: "pip"

.github/workflows/pytest-all.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,16 @@ jobs:
1717

1818
strategy:
1919
matrix:
20-
python-version: ["3.11", "3.12", "3.13"]
20+
python-version: ["3.11", "3.12", "3.13", "3.14"]
2121

2222
steps:
2323
- uses: actions/checkout@v5
2424

2525
- name: Install Python ${{ matrix.python-version }}
26-
uses: actions/setup-python@v5
26+
uses: actions/setup-python@v6
2727
with:
2828
python-version: ${{ matrix.python-version }}
29+
allow-prereleases: true
2930
cache: "pip"
3031

3132
- name: Install dependencies

.github/workflows/pytest-mac.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- uses: actions/checkout@v5
2424

2525
- name: Install Python ${{ matrix.python-version }}
26-
uses: actions/setup-python@v5
26+
uses: actions/setup-python@v6
2727
with:
2828
python-version: ${{ matrix.python-version }}
2929
cache: "pip"

examples/ppm-reconstruction.ipynb

Lines changed: 12 additions & 9 deletions
Large diffs are not rendered by default.

ppmpy/reconstruction.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,30 @@ def draw_parabola(self, gp, *, scale=None):
233233
a = self.am[n] + xi*(self.ap[n] - self.am[n] + self.a6[n] * (1.0-xi))
234234
gp.ax.plot(x, a/scale, color="C1", lw=2)
235235

236+
def draw_average(self, gp, *, scale=None):
237+
"""Draw the horizontal line that represents the cell-average
238+
in each zone on the axes ax.
239+
240+
Parameters
241+
----------
242+
243+
gp : GridPlot
244+
the grid plot object
245+
scale : float, optional
246+
normalization factor (default is maximum data value)
247+
"""
248+
249+
ilo = max(gp.lo_index, self.grid.lo-1)
250+
ihi = min(gp.hi_index, self.grid.hi+1)
251+
252+
if scale is None:
253+
scale = np.max(self.a[ilo:ihi+1])
254+
255+
for n in range(ilo, ihi+1):
256+
gp.ax.hlines(y=self.a[n]/scale,
257+
xmin=self.grid.xl[n], xmax=self.grid.xr[n],
258+
linestyle='--', lw=1, color='k')
259+
236260
def mark_cubic(self, gp, *, scale=None):
237261
"""Mark the location of the initial interface states from the
238262
cubic interpolant on the axes ax.
@@ -244,7 +268,6 @@ def mark_cubic(self, gp, *, scale=None):
244268
the grid plot object
245269
scale : float, optional
246270
normalization factor (default is maximum data value)
247-
248271
"""
249272

250273
ilo = max(gp.lo_index-1, self.grid.lo-2)

0 commit comments

Comments
 (0)