Refactor analytical fit to use QR decomposition and remove central covariance #72
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
| # This workflow tests that the NS fit in main and the one in the PR are consistent | |
| # triggered by PR review submission or edit | |
| name: Vectorised Nested Sampling CI wmin model | |
| on: | |
| pull_request: | |
| types: | |
| - labeled | |
| env: | |
| CACHE_NUMBER: 0 # increase to reset cache manually | |
| jobs: | |
| build: | |
| if: ${{ github.event.label.name == 'run-nested-sampling_ct' }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.11"] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v3 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Set up Conda | |
| uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| miniforge-version: latest | |
| activate-environment: colibri-dev | |
| use-mamba: true | |
| - name: Cache Conda packages | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/conda_pkgs_dir | |
| key: | |
| ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ | |
| hashFiles('environment.yml') }} | |
| - name: Update environment | |
| run: mamba env update -n colibri-dev -f environment.yml | |
| if: steps.cache.outputs.cache-hit != 'true' | |
| - name: Install wmin private repository | |
| run: | | |
| source $(conda info --base)/etc/profile.d/conda.sh # Initialize Conda | |
| conda activate colibri-dev | |
| pip install git+https://${{ secrets.COLIBRI_TOKEN }}@github.com/HEP-PBSP/wmin-model.git | |
| - name: Install colibri | |
| shell: bash -l {0} | |
| run: pip install -e . | |
| - name: Run NS fit | |
| shell: bash -l {0} | |
| run: | | |
| wmin colibri/tests/test_runcards/test_wmin_bayes_L0_vect.yaml -o PR_wmin_bayes_L0_vect | |
| - name: Checkout main branch | |
| uses: actions/checkout@v3 | |
| with: | |
| ref: main | |
| clean: false | |
| - name: Update environment again | |
| run: mamba env update -n colibri-dev -f environment.yml | |
| if: steps.cache.outputs.cache-hit != 'true' | |
| - name: Install wmin private repository | |
| run: | | |
| source $(conda info --base)/etc/profile.d/conda.sh # Initialize Conda | |
| conda activate colibri-dev | |
| pip install git+https://${{ secrets.COLIBRI_TOKEN }}@github.com/HEP-PBSP/wmin-model.git | |
| - name: Install colibri | |
| shell: bash -l {0} | |
| run: pip install -e . | |
| - name: Run NS fit in main | |
| shell: bash -l {0} | |
| run: | | |
| wmin colibri/tests/test_runcards/test_wmin_bayes_L0_vect.yaml -o main_wmin_bayes_L0_vect | |
| - name: Compare NS results | |
| run: | | |
| # Check if files exist | |
| if [ -f PR_wmin_bayes_L0_vect/ns_result.csv ] && [ -f main_wmin_bayes_L0_vect/ns_result.csv ]; then | |
| # Perform the diff only if both files exist | |
| if diff PR_wmin_bayes_L0_vect/ns_result.csv main_wmin_bayes_L0_vect/ns_result.csv &> /dev/null; then | |
| echo "wmin fits are identical" | |
| else | |
| echo "wmin fits are different" | |
| exit 1 # Fail the test by exiting with a non-zero code | |
| fi | |
| else | |
| echo "One or both files do not exist" | |
| exit 1 # Fail the test by exiting with a non-zero code | |
| fi | |