BEHAVIOR: use single square root in PhaseSpaceFactor (#484)
          
            #388
        
      
  
    
      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: Benchmark | |
| env: | |
| FORCE_COLOR: "1" | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| - epic/* | |
| workflow_dispatch: | |
| inputs: | |
| specific-pip-packages: | |
| description: Run benchmarks with specific pip packages | |
| required: false | |
| type: string | |
| jobs: | |
| benchmark: | |
| name: Performance regression | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - uses: astral-sh/setup-uv@v5 | |
| - id: with | |
| if: inputs.specific-pip-packages | |
| name: Determine additional packages to install | |
| run: | | |
| additional_packages='' | |
| for package in ${{ inputs.specific-pip-packages }}; do | |
| additional_packages="$additional_packages --with $package" | |
| done | |
| echo "packages=$additional_packages" | tee -a $GITHUB_OUTPUT | |
| - name: Run pytest-benchmark | |
| run: | | |
| uv run \ | |
| --all-extras \ | |
| --group test \ | |
| --no-dev \ | |
| ${{ steps.with.outputs.packages }} \ | |
| pytest \ | |
| -k benchmark \ | |
| --benchmark-json output.json \ | |
| --durations=0 | |
| working-directory: benchmarks | |
| - name: Warn on performance decrease | |
| if: github.event_name == 'pull_request' | |
| uses: benchmark-action/github-action-benchmark@v1 | |
| with: | |
| benchmark-data-dir-path: "" | |
| comment-on-alert: true | |
| fail-on-alert: true | |
| gh-repository: github.com/ComPWA/ampform-benchmark-results | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| name: AmpForm benchmark results | |
| output-file-path: benchmarks/output.json | |
| tool: pytest | |
| - name: Create local benchmark data repository | |
| if: github.event_name != 'pull_request' | |
| uses: benchmark-action/github-action-benchmark@v1 | |
| with: | |
| benchmark-data-dir-path: "" | |
| gh-repository: github.com/ComPWA/ampform-benchmark-results | |
| github-token: ${{ secrets.PAT }} | |
| name: AmpForm benchmark results | |
| output-file-path: benchmarks/output.json | |
| tool: pytest | |
| - name: Push results to GitHub Pages | |
| if: github.event_name != 'pull_request' | |
| run: git push 'https://ComPWA:${{ secrets.PAT }}@github.com/ComPWA/ampform-benchmark-results' gh-pages | |
| working-directory: benchmark-data-repository |