forked from nasa/condor
-
Notifications
You must be signed in to change notification settings - Fork 0
fix: handle 1D interpolation result in resample for single-state ODEs #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
389cbf1
fix: handle 1D interpolation result in resample for single-state ODEs
yasumorishima 5a9745e
chore: trigger CodeRabbit review
yasumorishima 8f706bf
Add tests for single-state ODE resample (issue #70)
yasumorishima 28b4a63
Add value assertion for dynamic_output in resample test
yasumorishima File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include_output=Falsepath is not truly exercised in this test.At Line 430 you pass
include_output=False, but the ODE in Lines 420-423 has nodynamic_output. Insrc/condor/contrib.py(Lines 693-750),include_outputis gated bymodel.dynamic_output._count, so this ends up on the same effective path as the basic single-state test.Suggested adjustment
def test_resample_single_state_no_output(self): class ODE(co.ODESystem): a = parameter() x = state() + dynamic_output.velocity = -a * x dot[x] = -a * x class Traj(ODE.TrajectoryAnalysis): tf = 10 initial[x] = 1 sim = Traj(a=0.5) resampled = sim.resample(1.0, include_events=False, include_output=False) assert resampled.t.size > 0🧰 Tools
🪛 Ruff (0.15.6)
[error] 421-421: Undefined name
parameter(F821)
[error] 422-422: Undefined name
state(F821)
[error] 423-423: Undefined name
dot(F821)
[error] 427-427: Undefined name
initial(F821)
[error] 427-427: Undefined name
x(F821)
🤖 Prompt for AI Agents