Improve Tampere figure generation #37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Create pdf and figures | |
| on: | |
| push: | |
| jobs: | |
| compile_pdf: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| container: | |
| image: ghcr.io/agenttix/docker-latex:master | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Compile pdf | |
| run: make | |
| - name: Rename pdf | |
| run: mv "main.pdf" "MSc thesis 2 Mika Mäki.pdf" | |
| - name: Upload pdf | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Thesis pdf | |
| path: "MSc thesis 2 Mika Mäki.pdf" | |
| if-no-files-found: error | |
| gen_figures: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.13 | |
| - name: Print Python version | |
| run: python -V | |
| - name: Install LaTeX | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y cm-super dvipng fontconfig texlive-latex-extra | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| # The full PTtools repository is needed for the example scripts | |
| - name: Checkout PTtools | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: CFT-HY/pttools | |
| # A specific commit is used instead of the 0.9.0 release, | |
| # as the release is missing some __init__.py files in the example folders, | |
| # which prevents the example scripts from being imported. | |
| ref: da50329beba788803ba6bee2b497a89a98bea53d | |
| path: pttools | |
| - name: Load pip cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: .pip | |
| key: pip-${{ runner.os }}-${{ hashFiles('requirements.txt') }} | |
| restore-keys: | | |
| pip-${{ runner.os }}- | |
| pip- | |
| - name: Install requirements | |
| run: | | |
| pip --cache-dir=.pip install --upgrade pip wheel | |
| pip --cache-dir=.pip install -r msc2_python/requirements.txt -r ${{ github.workspace }}/pttools/requirements.txt | |
| - name: Print Numba sysinfo | |
| run: numba --sysinfo | tee numba-sysinfo.txt | |
| - name: Generate PTtools reference data | |
| run: python3 -c "from pttools.bubble.fluid_reference import ref; ref()" | |
| env: | |
| PYTHONPATH: ${{ github.workspace }}/pttools | |
| - name: Generate figures | |
| run: python3 ./msc2_python/figures.py | |
| env: | |
| PYTHONPATH: ${{ github.workspace }}/pttools:${{ github.workspace }}/msc2_python | |
| - name: Generate Tampere figures | |
| run: python3 ./msc2_python/tampere/figures.py | |
| env: | |
| PYTHONPATH: ${{ github.workspace }}/pttools:${{ github.workspace }}/msc2_python | |
| - name: Upload results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Figures | |
| path: | | |
| fig | |
| !fig/lecture_notes | |
| if-no-files-found: error |