Skip to content
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

Removed redundant implementations of timeseries output components. #1005

Merged
merged 3 commits into from
Oct 17, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
GridData.__eq__ handles non-GridData types for other
robfalck committed Oct 17, 2023
commit 3bed16f072005f442eb4af923e63d3f1654619a1
11 changes: 11 additions & 0 deletions dymos/transcriptions/explicit_shooting/explicit_shooting.py
Original file line number Diff line number Diff line change
@@ -96,6 +96,17 @@ def init_grid(self):
"""
Setup the GridData object for the Transcription.
"""
if self.options['grid'] in ('gauss-lobatto', None):
self.options['grid'] = GaussLobattoGrid(num_segments=self.options['num_segments'],
nodes_per_seg=self.options['order'],
segment_ends=self.options['segment_ends'],
compressed=self.options['compressed'])
elif self.options['grid'] == 'radau-ps':
self.options['grid'] = RadauGrid(num_segments=self.options['num_segments'],
nodes_per_seg=self.options['order'] + 1,
segment_ends=self.options['segment_ends'],
compressed=self.options['compressed'])

dep_methods = {'rk4', '3/8', 'euler', 'ralston', 'rkf', 'rkck', 'dopri'}
if self.options['method'] in dep_methods:
warn_deprecation(f'Integration method {self.options["method"]} is no longer a valid option. Please use one '
15 changes: 9 additions & 6 deletions dymos/transcriptions/grid_data.py
Original file line number Diff line number Diff line change
@@ -413,12 +413,15 @@ def __eq__(self, other):
bool
True if other is equivalent to self, otherwise False.
"""
return self.transcription == other.transcription and \
self.num_segments == other.num_segments and \
np.all(self.segment_ends == other.segment_ends) and \
self.compressed == other.compressed and \
np.all(self.transcription_order == other.transcription_order) and \
np.all(self.num_steps_per_segment == other.num_steps_per_segment)
if isinstance(other, GridData):
return self.transcription == other.transcription and \
self.num_segments == other.num_segments and \
np.all(self.segment_ends == other.segment_ends) and \
self.compressed == other.compressed and \
np.all(self.transcription_order == other.transcription_order) and \
np.all(self.num_steps_per_segment == other.num_steps_per_segment)
else:
return False

def is_aligned_with(self, other, tol=1.0E-12):
"""