Add simple reionization heating model #151
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: Python tests | |
| on: [push, pull_request] | |
| jobs: | |
| python_tests: | |
| runs-on: ubuntu-latest | |
| if: (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != 'cmbant/camb') | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: "Latest Python 3.10" | |
| os: ubuntu-latest | |
| python-version: "3.10" | |
| - name: "Windows Python 3.13" | |
| os: windows-latest | |
| python-version: "3.13" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| allow-prereleases: true | |
| - run: ln -s $(which gfortran-14) /usr/local/bin/gfortran | |
| if: matrix.os == 'macos-latest' | |
| - name: Pre-commit checks | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| pip install pre-commit | |
| pre-commit run --all-files | |
| - name: Format Help Message | |
| if: failure() && matrix.os == 'ubuntu-latest' | |
| run: | | |
| echo "❌ Code formatting or style issues detected!" | |
| echo "" | |
| echo "Install pre-commit hooks to auto-format on commit:" | |
| echo " pip install -e .[dev]" | |
| echo " pre-commit install" | |
| echo "" | |
| echo "See the errors above for details." | |
| exit 1 | |
| - name: Install dependencies | |
| run: | | |
| python --version | |
| gfortran --version | |
| pip install -e . | |
| - name: Run tests | |
| run: | | |
| python -c "import camb; print(camb.__version__)" | |
| python -m unittest camb.tests.camb_test | |
| - name: HM code tests | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| git clone https://github.com/alexander-mead/HMcode_test_outputs.git | |
| python -m unittest camb.tests.hmcode_test |