Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
robfalck committed Aug 15, 2023
1 parent e6411ff commit 651f199
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def initialize(self):
self.options.declare('num_nodes', types=(int,))
self.options.declare('foo_units', allow_none=True, default=None)
self.options.declare('foo_shapes', allow_none=True, default=None)
self.options.declare('foo_static', types=dict, allow_none=True, default=None)
self.options.declare('foo_static', default=[])

def setup(self):
num_nodes = self.options['num_nodes']
Expand All @@ -24,7 +24,9 @@ def setup(self):

foo_unit = 'kg' if self.options['foo_units'] is None else self.options['foo_units']['vdot_comp']

foo_tags = ['dymos.static_target'] if self.options['foo_static']['vdot_comp'] else []
foo_tags = ['dymos.static_target']\
if 'vdot_comp' in self.options['foo_static'] and self.options['foo_static']['vdot_comp'] else []

foo_shape = (1,) if 'dymos.static_target' in foo_tags else foo_shape

vdot_comp = om.ExecComp(['vdot = g * cos(theta)',
Expand All @@ -40,7 +42,9 @@ def setup(self):

foo_unit = 'kg' if self.options['foo_units'] is None else self.options['foo_units']['xdot_comp']

foo_tags = ['dymos.static_target'] if self.options['foo_static']['xdot_comp'] else []
foo_tags = ['dymos.static_target']\
if 'xdot_comp' in self.options['foo_static'] and self.options['foo_static']['xdot_comp'] else []

foo_shape = (1,) if 'dymos.static_target' in foo_tags else foo_shape

xdot_comp = om.ExecComp(['xdot = v * sin(theta)',
Expand All @@ -56,7 +60,9 @@ def setup(self):

foo_unit = 'kg' if self.options['foo_units'] is None else self.options['foo_units']['ydot_comp']

foo_tags = ['dymos.static_target'] if self.options['foo_static']['ydot_comp'] else []
foo_tags = ['dymos.static_target']\
if 'ydot_comp' in self.options['foo_static'] and self.options['foo_static']['ydot_comp'] else []

foo_shape = (1,) if 'dymos.static_target' in foo_tags else foo_shape

ydot_comp = om.ExecComp(['ydot = -v * cos(theta)',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
from .state_rate_collector_comp import StateRateCollectorComp
from .tau_comp import TauComp

from ...utils.introspection import get_targets, configure_controls_introspection, \
from ...utils.introspection import configure_controls_introspection, \
configure_time_introspection, configure_parameters_introspection, \
configure_states_discovery, configure_states_introspection, _get_targets_metadata,\
configure_states_discovery, configure_states_introspection, _get_targets_metadata, \
_get_common_metadata, get_promoted_vars
from ...utils.misc import get_rate_units, _unspecified

Expand Down

0 comments on commit 651f199

Please sign in to comment.