-
Notifications
You must be signed in to change notification settings - Fork 68
A few updates from with GTOC #1218
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
Conversation
| shape = options['shape'] | ||
| if isinstance(shape, int): | ||
| shape = (shape,) | ||
| val_shape = (num_nodes,) + shape |
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.
Might be cleaner to just compute val_shape once and then use it for all three different kinds of targerts, since it only depends on options.
dymos/phase/phase.py
Outdated
| configure_controls_introspection, configure_parameters_introspection, \ | ||
| configure_timeseries_output_introspection, classify_var | ||
| from ..utils.misc import _unspecified, create_subprob | ||
| from ..utils.misc import _unspecified, create_subprob, is_scalar_or_singleton |
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 was hoping you were getting rid of the relative import while you were 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.
Consider this a christmas present from me :)
| """ | ||
| raise NotImplementedError(f'Transcription {self.__class__.__name__} does not implement method ' | ||
| '_phase_set_val.') | ||
| # All phases at least set state vals at the input nodes |
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.
"all phases" means "all transcriptions" ?
| # Case 2: We've been given a single value of a shaped state. | ||
| state_vals = np.broadcast_to(vals_array, (num_state_input_nodes,) + state_shape) | ||
| else: | ||
| if time_vals is None: |
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.
This "else" statement only contains an if/elif/else block, so I think you can bring them all up one level into the main if.
Kenneth-T-Moore
left a comment
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 good, but see comments.
…rkhoff will at least report errors. In BirkhoffDefectComp, the state_defect which is linear when fix_intial/fix_final is True, is NOT linear when fix_initial/fix_final are False AND they are connected to a nonlinear output. TODO: Think of a better way to characterize that.
Summary
(num_state_input_nodes,) + shapeset of state values.(num_control_input_nodes,) + shapeRelated Issues
None
Backwards incompatibilities
None
New Dependencies
None