From 431de8857c56ec8b025a8c1be96eb89dd1dda220 Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Fri, 11 Jul 2025 11:58:41 -0400 Subject: [PATCH 1/6] update URLs + isort --- ppmpy/__init__.py | 3 +-- ppmpy/euler.py | 3 ++- ppmpy/grid.py | 2 +- ppmpy/riemann_exact.py | 2 +- ppmpy/tests/test_euler.py | 2 +- ppmpy/tests/test_gravity.py | 2 +- ppmpy/tests/test_grid.py | 2 +- ppmpy/tests/test_ppm_reconstruction.py | 2 +- ppmpy/tests/test_riemann.py | 2 +- pyproject.toml | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ppmpy/__init__.py b/ppmpy/__init__.py index 1ac8cb3..49d6637 100644 --- a/ppmpy/__init__.py +++ b/ppmpy/__init__.py @@ -10,8 +10,7 @@ from .eigen import eigen +from .euler import Euler from .grid import FVGrid from .reconstruction import PPMInterpolant, flattening_coefficient from .riemann_exact import RiemannProblem, State - -from .euler import Euler diff --git a/ppmpy/euler.py b/ppmpy/euler.py index 100779c..0fb70f6 100644 --- a/ppmpy/euler.py +++ b/ppmpy/euler.py @@ -8,7 +8,8 @@ from ppmpy.eigen import eigen from ppmpy.grid import FVGrid -from ppmpy.reconstruction import PPMInterpolant, HSEPPMInterpolant, flattening_coefficient +from ppmpy.reconstruction import (HSEPPMInterpolant, PPMInterpolant, + flattening_coefficient) from ppmpy.riemann_exact import RiemannProblem, State diff --git a/ppmpy/grid.py b/ppmpy/grid.py index 26d6303..77c4c8d 100644 --- a/ppmpy/grid.py +++ b/ppmpy/grid.py @@ -3,8 +3,8 @@ """ -import numpy as np import matplotlib.pyplot as plt +import numpy as np class GridPlot: diff --git a/ppmpy/riemann_exact.py b/ppmpy/riemann_exact.py index 3d19093..c44496f 100644 --- a/ppmpy/riemann_exact.py +++ b/ppmpy/riemann_exact.py @@ -14,8 +14,8 @@ `q_int = rp.sample_solution()` """ -import numpy as np import matplotlib.pyplot as plt +import numpy as np from scipy import optimize diff --git a/ppmpy/tests/test_euler.py b/ppmpy/tests/test_euler.py index 36bcc33..929ae98 100644 --- a/ppmpy/tests/test_euler.py +++ b/ppmpy/tests/test_euler.py @@ -2,7 +2,7 @@ from numpy.testing import assert_array_almost_equal_nulp from ppmpy.euler import Euler, FluidVars -from ppmpy.initial_conditions import sod, acoustic_pulse +from ppmpy.initial_conditions import acoustic_pulse, sod class TestFluidVars: diff --git a/ppmpy/tests/test_gravity.py b/ppmpy/tests/test_gravity.py index b5330ea..36acab7 100644 --- a/ppmpy/tests/test_gravity.py +++ b/ppmpy/tests/test_gravity.py @@ -1,7 +1,7 @@ import numpy as np -from ppmpy.grid import FVGrid from ppmpy.gravity import constant_gravity +from ppmpy.grid import FVGrid class TestGravity: diff --git a/ppmpy/tests/test_grid.py b/ppmpy/tests/test_grid.py index 04b65e1..7271c43 100644 --- a/ppmpy/tests/test_grid.py +++ b/ppmpy/tests/test_grid.py @@ -1,5 +1,5 @@ import numpy as np -from numpy.testing import assert_array_equal, assert_array_almost_equal_nulp +from numpy.testing import assert_array_almost_equal_nulp, assert_array_equal from pytest import approx from ppmpy.grid import FVGrid diff --git a/ppmpy/tests/test_ppm_reconstruction.py b/ppmpy/tests/test_ppm_reconstruction.py index f2ce2f7..876bb88 100644 --- a/ppmpy/tests/test_ppm_reconstruction.py +++ b/ppmpy/tests/test_ppm_reconstruction.py @@ -1,5 +1,5 @@ import numpy as np -from numpy.testing import assert_array_equal, assert_array_almost_equal_nulp +from numpy.testing import assert_array_almost_equal_nulp, assert_array_equal from ppmpy.grid import FVGrid from ppmpy.reconstruction import PPMInterpolant diff --git a/ppmpy/tests/test_riemann.py b/ppmpy/tests/test_riemann.py index 4669074..0bdffcd 100644 --- a/ppmpy/tests/test_riemann.py +++ b/ppmpy/tests/test_riemann.py @@ -1,6 +1,6 @@ from pytest import approx -from ppmpy import State, RiemannProblem +from ppmpy import RiemannProblem, State class TestGrid: diff --git a/pyproject.toml b/pyproject.toml index 00addde..f9cbe2a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ dependencies = [ [project.urls] Homepage = "https://github.com/python-hydro/ppmpy" - +Documentation = "https://python-hydro.github.io/ppmpy # packaging From c8e2fe8935efecd76428d756496da25bd86c5354 Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Fri, 11 Jul 2025 12:02:02 -0400 Subject: [PATCH 2/6] add MacOS CI --- .github/workflows/codespell.yml | 2 +- .github/workflows/docs-test.yml | 2 +- .github/workflows/docs.yml | 2 +- .github/workflows/flake8.yml | 4 +-- .github/workflows/pylint.yml | 2 +- .github/workflows/pytest-all.yml | 2 +- .github/workflows/pytest-mac.yml | 53 ++++++++++++++++++++++++++++++++ 7 files changed, 60 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/pytest-mac.yml diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml index a500eeb..2632607 100644 --- a/.github/workflows/codespell.yml +++ b/.github/workflows/codespell.yml @@ -20,7 +20,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: '3.12' cache: "pip" - name: Install dependencies diff --git a/.github/workflows/docs-test.yml b/.github/workflows/docs-test.yml index ef4162c..e02429f 100644 --- a/.github/workflows/docs-test.yml +++ b/.github/workflows/docs-test.yml @@ -27,7 +27,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: '3.12' cache: "pip" - name: Install dependencies diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index b7d2dc4..3a53e23 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -15,7 +15,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.11" + python-version: "3.12" cache: "pip" - name: Install Python dependencies diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml index 3496ef9..e67000f 100644 --- a/.github/workflows/flake8.yml +++ b/.github/workflows/flake8.yml @@ -18,10 +18,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install Python 3.11 + - name: Install Python 3.12 uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: '3.12' cache: "pip" - name: Install pylint diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 24f9740..5bb6d3f 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -21,7 +21,7 @@ jobs: - name: Install Python uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: '3.12' cache: "pip" - name: Install dependencies + pylint diff --git a/.github/workflows/pytest-all.yml b/.github/workflows/pytest-all.yml index 6137fb5..62777cc 100644 --- a/.github/workflows/pytest-all.yml +++ b/.github/workflows/pytest-all.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: - python-version: ["3.10", "3.11", "3.12", "3.13"] + python-version: ["3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/pytest-mac.yml b/.github/workflows/pytest-mac.yml new file mode 100644 index 0000000..8b410cf --- /dev/null +++ b/.github/workflows/pytest-mac.yml @@ -0,0 +1,53 @@ +name: pytest-mac + +on: + # Trigger the workflow on push or pull request, + # but only for the main branch + push: + branches: + - main + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + test-mac: + runs-on: macos-latest + + strategy: + matrix: + python-version: ["3.11", "3.12", "3.13"] + + steps: + - uses: actions/checkout@v4 + + - name: Install Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: "pip" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Install ppmpy + run: pip install --editable . + + - name: Print system info + run: | + echo '::group::NumPy' + pip install threadpoolctl &>/dev/null + python -c "import sys, numpy; print(numpy.__version__); print(sys.version); print(numpy.show_runtime())" + echo '::endgroup::' + echo '::group::CPU info' + lscpu + echo '::endgroup::' + echo '::group::Package versions' + pip list --format=freeze + echo '::endgroup::' + + - name: Run tests with pytest + run: pytest -v -s --cov=ppmpy --color=yes From cdb7d32fac971aba7e8b8154af54f17ba0026ab3 Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Fri, 11 Jul 2025 12:04:19 -0400 Subject: [PATCH 3/6] fix --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f9cbe2a..7972d87 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ dependencies = [ [project.urls] Homepage = "https://github.com/python-hydro/ppmpy" -Documentation = "https://python-hydro.github.io/ppmpy +Documentation = "https://python-hydro.github.io/ppmpy" # packaging From 49c0c34df98e9fc62172d5ff552f7c1d65cc0f09 Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Fri, 11 Jul 2025 12:08:00 -0400 Subject: [PATCH 4/6] update CPU info --- .github/workflows/pytest-mac.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest-mac.yml b/.github/workflows/pytest-mac.yml index 8b410cf..44dbc6f 100644 --- a/.github/workflows/pytest-mac.yml +++ b/.github/workflows/pytest-mac.yml @@ -43,7 +43,7 @@ jobs: python -c "import sys, numpy; print(numpy.__version__); print(sys.version); print(numpy.show_runtime())" echo '::endgroup::' echo '::group::CPU info' - lscpu + sysctl -a | grep machdep.cpu echo '::endgroup::' echo '::group::Package versions' pip list --format=freeze From 0a6ad26ae102b6624b3ad26767e37e86d69493e1 Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Thu, 4 Sep 2025 10:06:58 -0400 Subject: [PATCH 5/6] bump up action --- .github/workflows/codespell.yml | 2 +- .github/workflows/docs-test.yml | 2 +- .github/workflows/docs.yml | 2 +- .github/workflows/flake8.yml | 2 +- .github/workflows/pylint.yml | 2 +- .github/workflows/pytest-all.yml | 2 +- .github/workflows/pytest-mac.yml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml index 2632607..6773d64 100644 --- a/.github/workflows/codespell.yml +++ b/.github/workflows/codespell.yml @@ -18,7 +18,7 @@ jobs: fetch-depth: 0 - name: Setup Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: '3.12' cache: "pip" diff --git a/.github/workflows/docs-test.yml b/.github/workflows/docs-test.yml index e02429f..b367751 100644 --- a/.github/workflows/docs-test.yml +++ b/.github/workflows/docs-test.yml @@ -25,7 +25,7 @@ jobs: sudo apt install pandoc doxygen - name: Setup Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: '3.12' cache: "pip" diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 3a53e23..6dc02aa 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: "3.12" cache: "pip" diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml index e67000f..a1ab5b1 100644 --- a/.github/workflows/flake8.yml +++ b/.github/workflows/flake8.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/checkout@v4 - name: Install Python 3.12 - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: '3.12' cache: "pip" diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 5bb6d3f..3e3e251 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/checkout@v4 - name: Install Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: '3.12' cache: "pip" diff --git a/.github/workflows/pytest-all.yml b/.github/workflows/pytest-all.yml index 62777cc..93bd516 100644 --- a/.github/workflows/pytest-all.yml +++ b/.github/workflows/pytest-all.yml @@ -23,7 +23,7 @@ jobs: - uses: actions/checkout@v4 - name: Install Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} cache: "pip" diff --git a/.github/workflows/pytest-mac.yml b/.github/workflows/pytest-mac.yml index 44dbc6f..256aa10 100644 --- a/.github/workflows/pytest-mac.yml +++ b/.github/workflows/pytest-mac.yml @@ -23,7 +23,7 @@ jobs: - uses: actions/checkout@v4 - name: Install Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} cache: "pip" From 9839ee4a174a638f3196dfd9d7691d94af3841bd Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Thu, 4 Sep 2025 10:07:56 -0400 Subject: [PATCH 6/6] add python 3.14 --- .github/workflows/pytest-all.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pytest-all.yml b/.github/workflows/pytest-all.yml index 93bd516..ecc98ac 100644 --- a/.github/workflows/pytest-all.yml +++ b/.github/workflows/pytest-all.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: - python-version: ["3.11", "3.12", "3.13"] + python-version: ["3.11", "3.12", "3.13", "3.14"] steps: - uses: actions/checkout@v4 @@ -26,6 +26,7 @@ jobs: uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} + allow-prereleases: true cache: "pip" - name: Install dependencies