Skip to content

Example GPR Notebook - #11

Open
vtommasini wants to merge 1 commit into
sxs-collaboration:mainfrom
vtommasini:example-notebook
Open

Example GPR Notebook#11
vtommasini wants to merge 1 commit into
sxs-collaboration:mainfrom
vtommasini:example-notebook

Conversation

@vtommasini

@vtommasini vtommasini commented Jun 8, 2026

Copy link
Copy Markdown

Example GPR notebook to run either on local machine or on HPC. Uses small dataset to demonstrate how to train the GPR and run the cross validation, in order to learn the optimal orbital parameters for non-eccentric BBH simulations.

Copilot AI review requested due to automatic review settings June 8, 2026 00:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a new GPR diagnostics module and accompanying examples/tests to support leave-one-out evaluation and residual plotting of the GPR-based orbital-parameter correction model.

Changes:

  • Introduces SimulationSupport.gpr.diagnostics with LOO prediction, LOO cross-validation, and residual plotting utilities.
  • Adds a unittest suite covering the new diagnostics functions.
  • Adds an example notebook + plotting style + SLURM submission script for running the GPR workflow.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
tests/test_diagnostics.py Adds unit tests validating outputs/shapes and basic behavior of LOO + residual utilities.
src/SimulationSupport/gpr/diagnostics.py Implements LOO prediction/cross-validation and residual plotting helpers for GPR.
src/SimulationSupport/gpr/init.py Re-exports diagnostics symbols at package import time.
src/SimulationSupport/EccentricityControl/Examples/run_gpr.sh Adds a SLURM submission script to run the example notebook via papermill.
src/SimulationSupport/EccentricityControl/Examples/plots.mplstyle Adds a Matplotlib style file used by the example notebook.
src/SimulationSupport/EccentricityControl/Examples/GPRExampleNotebook_readme.txt Documents how to run the example notebook locally/HPC.
src/SimulationSupport/EccentricityControl/Examples/GPRExampleNotebook.ipynb Adds an end-to-end notebook demonstrating data prep, training, and diagnostics.
Comments suppressed due to low confidence (1)

src/SimulationSupport/EccentricityControl/Examples/run_gpr.sh:1

  • The script hard-codes user-specific absolute paths, making it non-portable and brittle across environments/users. Prefer parameterizing paths (env vars / script args), using relative paths where possible, and consider adding set -euo pipefail to fail fast on errors.
#!/bin/bash

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/SimulationSupport/gpr/diagnostics.py Outdated
Comment thread src/SimulationSupport/gpr/diagnostics.py Outdated
Comment thread src/SimulationSupport/gpr/diagnostics.py Outdated
Comment thread src/SimulationSupport/gpr/diagnostics.py Outdated
Comment thread src/SimulationSupport/gpr/diagnostics.py Outdated
Comment thread src/SimulationSupport/gpr/diagnostics.py Outdated
Comment thread src/SimulationSupport/gpr/diagnostics.py Outdated
Comment thread src/SimulationSupport/gpr/__init__.py Outdated
Comment thread src/SimulationSupport/EccentricityControl/Examples/plots.mplstyle Outdated
Comment thread src/SimulationSupport/EccentricityControl/Examples/GPRExampleNotebook.ipynb Outdated
Comment thread src/SimulationSupport/EccentricityControl/Examples/GPRExampleNotebook_readme.txt Outdated
Comment thread src/SimulationSupport/EccentricityControl/Examples/GPRExampleNotebook.ipynb Outdated
Comment thread src/SimulationSupport/EccentricityControl/Examples/GPRExampleNotebook.ipynb Outdated
Comment thread src/SimulationSupport/EccentricityControl/Examples/GPRExampleNotebook.ipynb Outdated
Comment thread src/SimulationSupport/EccentricityControl/Examples/GPRExampleNotebook.ipynb Outdated
Comment thread src/SimulationSupport/EccentricityControl/Examples/GPRExampleNotebook.ipynb Outdated

@nilsvu nilsvu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commenting in a list here because notebooks don't work very well in GitHub.

  • Please clean up your imports, you only need very few of those. Dependencies that you definitely need have to be added to pyproject.toml, and it's important to be conservative with those.
  • Please add pandas, sxs as a dependencies to pyproject.toml
  • Many of the chosen simulations are deprecated. Can you select a more recent dataset?
  • You don't need to compute chi_p I think
  • Why do you keep NaN eccentricity simulations? I hope a more recent dataset doesn't have NaNs at all, so don't filter for that.
  • Define features earlier and use it in the GPR training cell.
  • Do you need all those astype(float) commands? Remove if not needed.
  • Can you simplify the saving to disk cell so you don't have to compute things before saving to disk? Would be good to just take the output of the GPR training and save to disk, without an extra compute step in between.

@nilsvu nilsvu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can squash your commits into one

Comment thread pyproject.toml Outdated
Comment thread src/SimulationSupport/EccentricityControl/Examples/GPRExampleNotebook.ipynb Outdated
Comment thread src/SimulationSupport/EccentricityControl/Examples/GPRExampleNotebook.ipynb Outdated
Comment thread src/SimulationSupport/EccentricityControl/Examples/GPRExampleNotebook.ipynb Outdated
Comment thread src/SimulationSupport/EccentricityControl/Examples/GPRExampleNotebook.ipynb Outdated
Comment thread src/SimulationSupport/EccentricityControl/Examples/GPRExampleNotebook.ipynb Outdated
Comment thread src/SimulationSupport/EccentricityControl/Examples/GPRExampleNotebook.ipynb Outdated
Comment thread src/SimulationSupport/EccentricityControl/Examples/GPRExampleNotebook.ipynb Outdated
Comment thread src/SimulationSupport/EccentricityControl/Examples/run_gpr.sh Outdated
Comment thread src/SimulationSupport/EccentricityControl/Examples/GPRExampleNotebook.ipynb Outdated
@vtommasini
vtommasini force-pushed the example-notebook branch 4 times, most recently from f2a7d40 to d7ef55c Compare June 24, 2026 17:10
GPR tutorial fixed typos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants