Add SpEC's OmegaDotEccRemoval.py - #13
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR brings SpEC’s eccentricity-removal workflow into SimulationSupport by adding the (largely unmodified) OmegaDotEccRemoval.py implementation and a small wrapper API that computes eccentricity estimates and suggested initial-parameter updates from in-memory trajectories, along with a test and API docs wiring.
Changes:
- Add
OmegaDotEccRemoval.py(SpEC-derived) and expose its fitting routines for library use. - Add
eccentricity_control_params(...)convenience wrapper that computes eccentricity and suggested updates from trajectory arrays. - Add a unit test for the wrapper, API docs entry, and a new
varprodependency.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/SimulationSupport/EccentricityControl/OmegaDotEccRemoval.py |
Adds SpEC-derived eccentricity fitting and update computation logic. |
src/SimulationSupport/EccentricityControl/EccentricityControlParams.py |
Introduces a Python API wrapper around the SpEC-derived routines for array inputs. |
tests/EccentricityControl/Test_EccentricityControlParams.py |
Adds a test exercising the wrapper on synthetic PN trajectories. |
pyproject.toml |
Adds varpro as a VCS-pinned dependency. |
docs/Api.rst |
Exposes the new wrapper module in Sphinx API docs. |
Suppressed comments (1)
src/SimulationSupport/EccentricityControl/OmegaDotEccRemoval.py:1669
B_std_devis computed as a standard deviation, but the second term usesparam_std_dev_spin[3]without squaring it (the first term uses**2). This likely underestimates the uncertainty and is dimensionally inconsistent.
B_std_dev = sqrt(pLin_spin[2]**2 * param_std_dev_spin[2]**2 \
+ pLin_spin[3]**2 * param_std_dev_spin[3]) / B_spin
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+1514
to
+1515
| B_std_dev = sqrt(pLin_nonspin[2]**2 * param_std_dev_nonspin[2]**2 \ | ||
| + pLin_nonspin[3]**2 * param_std_dev_nonspin[3]) / B_nonspin |
Member
Author
There was a problem hiding this comment.
@markscheel I think this might be a bug in SpEC
nilsvu
enabled auto-merge
September 2, 2026 07:53
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.