Repository navigation
Exploritory work with grace and knockout tests - moving to main - #23
Merged
Merged
Conversation
…_Project into exploritory_work
There was a problem hiding this comment.
Pull request overview
Adds exploratory GRACE joint-inversion work and knockout-style experiments, along with new plotting utilities to visualize posterior covariance structure (notably ice vs firn GMSL) and CG convergence.
Changes:
- Introduces a GRACE-augmented factored forward operator + preconditioned inversion workflow (new work script + figures).
- Adds a knockout test script that runs multiple inversion variants and produces comparative diagnostic plots.
- Extends plotting utilities in
pygeoinf_extraswith corner/bivariate-corner plotting helpers.
Reviewed changes
Copilot reviewed 8 out of 46 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| work/14_grace_joint_inversion/joint_precon_grace.py | New exploratory script adding GRACE as an additional observation row in a factored forward operator + preconditioned inversion. |
| work/14_grace_joint_inversion/figs1/joint_precon_grace_cg_convergence.pdf | Generated convergence plot output from the GRACE joint-preconditioned solve. |
| work/14_grace_joint_inversion/figs/knockout_grace_gmsl.pdf | Generated figure for GRACE-related knockout/GMSL visualization. |
| work/13_knockout_test/knockout_test.py | New knockout experiment script running multiple inversions and producing GMSL/component comparison plots. |
| work/13_knockout_test/figs/knockout_gmsl.pdf | Generated GMSL posterior comparison plot output. |
| work/08_joint_inversion/joint_precon_factored.py | Adds ice-vs-firn GMSL covariance corner plot and increases CG max iterations. |
| work/08_joint_inversion/joint_inversion.py | Removes interactive plt.show() calls (non-interactive/script-friendly). |
| work/08_joint_inversion/figs1/joint_precon_cg_convergence.pdf | Generated convergence plot output (updated). |
| test_var.py | Adds an ad-hoc debug script for computing GMSL posterior stats. |
| src/pygeoinf_extras/plots.py | Adds general corner plot + bivariate-corner plotting helpers for Gaussian posteriors. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Comment on lines
+639
to
+642
| sigma = abs(exp_mm - total_gmsl_true_mm) / std_mm | ||
| print( | ||
| f" {label:<25}: mean={exp_mm:.4f} mm, std={std_mm:.2e} mm, " | ||
| f"{sigma:.2f} sigma from truth" |
Comment on lines
+20
to
+24
| read_gloss_tide_gauge_data, | ||
| sea_level_change_to_load_operator, | ||
| sea_surface_height_operator, | ||
| tide_gauge_operator, | ||
| ) |
Comment on lines
+28
to
+31
| from project import colors | ||
| from project.operators import ( | ||
| ice_thickness_to_estimated_gmsl_operator, | ||
| ) |
Comment on lines
+6
to
+8
| print("Computing GMSL posterior full:") | ||
| exp_mm, std_mm = compute_gmsl_posterior(posterior_full) | ||
| print(f"Exp: {exp_mm}, Std: {std_mm}") |
Comment on lines
+35
to
+45
| Args: | ||
| posterior_measure: Multi-dimensional posterior measure (pygeoinf object) | ||
| true_values: True values for each dimension (optional) | ||
| labels: Labels for each dimension (optional) | ||
| title: Title for the plot | ||
| figsize: Figure size tuple (if None, calculated based on dimensions) | ||
| show_plot: Whether to display the plot | ||
| include_sigma_contours: Whether to include 1-sigma contour lines | ||
| colormap: Colormap for 2D plots | ||
| parallel: Compute dense covariance matrix in parallel, default False. | ||
| n_jobs: Number of cores to use in parallel calculations, default -1. |
Comment on lines
+279
to
+294
| def plot_bivariate_corner( | ||
| posterior_measure: object, | ||
| /, | ||
| *, | ||
| true_values: Optional[ | ||
| Union[List[float], np.ndarray] | ||
| ] = None, | ||
| labels: Optional[List[str]] = None, | ||
| title: str = "Joint Posterior Distribution", | ||
| figsize: Optional[tuple] = (8, 8), | ||
| include_sigma_contours: bool = True, | ||
| colormap: str = "Blues", | ||
| parallel: bool = False, | ||
| n_jobs: int = -1, | ||
| pdf_colors: Optional[List[str]] = None, | ||
| ): |
0thomasholland
added a commit
that referenced
this pull request
Apr 11, 2026
0thomasholland
added a commit
that referenced
this pull request
Apr 11, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.