Skip to content

Commit 7276565

Browse files
committed
Enable figure generation on GitHub Actions
1 parent 490662e commit 7276565

File tree

2 files changed

+48
-50
lines changed

2 files changed

+48
-50
lines changed

.github/workflows/main.yml

Lines changed: 44 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -20,50 +20,47 @@ jobs:
2020
name: Thesis pdf
2121
path: "MSc thesis 2 Mika Mäki.pdf"
2222
if-no-files-found: error
23-
# This cannot be enabled before PTtools is public
24-
# gen_figures:
25-
# runs-on: ubuntu-latest
26-
# timeout-minutes: 10
27-
# steps:
28-
# - name: Checkout
29-
# uses: actions/checkout@v4
30-
# - name: Checkout PTtools
31-
# uses: actions/checkout@v4
32-
# with:
33-
# repository: CFT-HY/pttools
34-
# ref: dev
35-
# path: pttools
36-
# - name: Setup Python
37-
# uses: actions/setup-python@v5
38-
# with:
39-
# python-version: 3.12
40-
# - name: Load pip cache
41-
# uses: actions/cache@v4
42-
# with:
43-
# path: .pip
44-
# key: pip-${{ runner.os }}-${{ hashFiles('requirements.txt') }}
45-
# restore-keys: |
46-
# pip-${{ runner.os }}-
47-
# pip-
48-
# - name: Install requirements
49-
# run: |
50-
# pip --cache-dir=.pip install --upgrade pip
51-
# pip --cache-dir=.pip install --upgrade wheel
52-
# pip --cache-dir=.pip install -r requirements.txt
53-
# - name: Print Numba sysinfo
54-
# run: numba --sysinfo | tee numba-sysinfo.txt
55-
# - name: Generate reference data
56-
# run: python3 ${{ github.workspace }}/pttools/pttools/bubble/fluid_reference.py
57-
# env:
58-
# PYTHONPATH: ${{ github.workspace }}/pttools
59-
# - name: Run tests
60-
# run: python3 ./msc2-python/figures.py
61-
# env:
62-
# PYTHONPATH: ${{ github.workspace }}/pttools:${{ github.workspace }}/msc2-python
63-
# - name: Upload results
64-
# uses: actions/upload-artifact@v4
65-
# with:
66-
# name: Figures
67-
# path: |
68-
# msc2-python/fig
69-
# if-no-files-found: error
23+
gen_figures:
24+
runs-on: ubuntu-latest
25+
timeout-minutes: 10
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
# The full PTtools repository is needed for the example scripts
30+
- name: Checkout PTtools
31+
uses: actions/checkout@v4
32+
with:
33+
repository: CFT-HY/pttools
34+
ref: v0.9.0
35+
path: pttools
36+
- name: Setup Python
37+
uses: actions/setup-python@v5
38+
with:
39+
python-version: 3.13
40+
- name: Load pip cache
41+
uses: actions/cache@v4
42+
with:
43+
path: .pip
44+
key: pip-${{ runner.os }}-${{ hashFiles('requirements.txt') }}
45+
restore-keys: |
46+
pip-${{ runner.os }}-
47+
pip-
48+
- name: Install requirements
49+
run: |
50+
pip --cache-dir=.pip install --upgrade pip wheel
51+
pip --cache-dir=.pip install -r requirements.txt -r ${{ github.workspace }}/pttools/requirements.txt
52+
- name: Print Numba sysinfo
53+
run: numba --sysinfo | tee numba-sysinfo.txt
54+
- name: Generate PTtools reference data
55+
run: python3 -c "from pttools.bubble.fluid_reference import ref; ref()"
56+
- name: Run tests
57+
run: python3 ./msc2-python/figures.py
58+
env:
59+
PYTHONPATH: ${{ github.workspace }}/pttools:${{ github.workspace }}/msc2-python
60+
- name: Upload results
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: Figures
64+
path: |
65+
msc2-python/fig
66+
if-no-files-found: error

msc2-python/requirements.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
numpy
2-
# pttools-gw[performance] @ git+ssh://git@github.com/hindmars-org/pttools.git@dev
3-
scipy
1+
numpy >= 2.1.3
2+
# This is how one could install PTtools without the example scripts
3+
# pttools-gw[numbalsoda,performance] == 0.9.0
4+
scipy >= 1.15.1

0 commit comments

Comments
 (0)