-
Notifications
You must be signed in to change notification settings - Fork 67
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
Added ability to allow the user to change the name of the integration variable. #874
Conversation
…he name of the users choosing. Elapsed time of a phase has been renamed from time_phase to t_phase to reflect the fact that t is now the generic integration variable.
…looking for the wrong timeseries name when the linkage variable was the independent variable
…aints/objective/timeseries to support existing code with a deprecation warning.
…date introspection to search for appropriate name in constraints, objectives, rates, etc.
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
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.
Looks generally good, I added some quite minor comments!
@@ -263,7 +264,7 @@ | |||
"# timeODE.py\n", | |||
"phase.set_time_options(fix_initial=True, fix_duration=True, duration_val=s_final,\n", | |||
" targets=['curv.s'], units='m', duration_ref=s_final,\n", | |||
" duration_ref0=10)\n", | |||
" duration_ref0=10, name='s')\n", |
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.
At first glance, this name='s'
confuses me. I will review the PR and see if it makes more sense. I'm leaving this note here so I remember to check back in here.
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.
I've left this alone because it was an external contribution. In my mind 's' is often used for arclength so it makes sense to me.
dymos/phase/phase.py
Outdated
as a timeseries output. If a name, it be one of 'time', 'time_phase', one of the states, controls, | ||
control rates, or parameters, in the phase, the path to an output variable in the ODE, or a glob pattern | ||
matching some outputs in the ODE. | ||
as a timeseries output. If a name, it be one of the integration variable, 'time_phase', one of the states, |
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.
"If a name, it be one of" -> "If a name, it should be one of"? or maybe a word is missing in here
|
||
# Solve for the optimal trajectory | ||
p.run_driver() | ||
for time_name in ('time', 'elaspsed_time'): |
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.
should change 'elaspsed' to 'elapsed' in three places
@@ -63,7 +63,7 @@ def configure_time(self, phase): | |||
Configure the inputs/outputs on the time component. | |||
|
|||
This method assumes that target introspection has already been performed by the phase and thus | |||
options['targets'], options['time_phase_targets'], options['t_initial_targets'], | |||
options['targets'], options['timw_phase_targets'], options['t_initial_targets'], |
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.
is timw
correct here?
…introspection work
…was being performed.
55dbd8e
to
a81c083
Compare
Summary
The user may now change the name of the integration variable, which defaults to "time" for backward compatibility.
The elapsed time of the phase can now be referenced as
{time_name}_phase
(it was previouslytime_phase
).Changed the name of the integration variable to
s
in the race car example and documentation.Added documentation of renaming time.
Related Issues
Backwards incompatibilities
Internally, the names of time and time_phase coming out of the TimeComp are now
t
andt_phase
. This shouldn't affect many users as they should be pulling these values from the timeseries instead.New Dependencies
None