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

Timeseries Expressions #846

Merged
merged 26 commits into from
Nov 3, 2022
Merged

Conversation

kaushikponnapalli
Copy link
Contributor

@kaushikponnapalli kaushikponnapalli commented Oct 26, 2022

Summary

Added capability to add custom expressions as outputs to the timeseries.

Related Issues

Backwards incompatibilities

Minor changes to how timeseries outputs are called.
Where previously p.model.phase0.timeseries.get_io_metadata(iotypes=('input', 'output'), get_remote=True) would return a dict keyed by states:foo, now p.model.phase0.timeseries.timeseries_comp.get_io_metadata(iotypes=('input', 'output'), get_remote=True) must be called.

Similarly, when using output_dict = dict(p.model.list_outputs()), the resulting dict is keyed by traj.phases.phase0.timeseries.timeseries_comp.foo instead of traj.phases.phase0.timeseries.foo

An alternative is to call get_promoted_vars(p.model, io_types='output'). This will yield a dict keyed by traj.phase0.timeseries.foo

New Dependencies

None

…es output is an expression. If it is, then the output name option is used instead of the name
…ensured no white spaces are left in variable names

class TimeseriesOutputGroup(om.Group):
def initialize(self):
self.options.declare('timeseries_output_comp', types=TimeseriesOutputCompBase,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding option recordable=False will silence a lot of the warnings showing up on CI.

@@ -276,9 +281,10 @@ def setup_timeseries_outputs(self, phase):
output_subset=options['subset'],
time_units=phase.time_options['units'])

phase.add_subsystem(name, subsys=timeseries_comp)
timeseries_group = TimeseriesOutputGroup(has_expr=has_expr, timeseries_output_comp=timeseries_comp)
phase.add_subsystem(name, subsys=timeseries_group)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use argument promotes_inputs=['*'], promotes_outputs=['*'] here so that things can be addressed as timeseries.foo rather than timeseries.timeseries_comp.foo elsewhere in the code. That should make the contents of the timeseries group irrelevant to the user.

As long as you do this promotion for both the enclosed exec comp and the enclosed TimeseriesComp, connections will not have to change and any common inputs between the two components will be implicitly connected.

@robfalck
Copy link
Contributor

robfalck commented Nov 3, 2022

I'm going to merge this in and deal with the latest jaxlib issue after.

@robfalck robfalck merged commit eaac459 into OpenMDAO:master Nov 3, 2022
@kaushikponnapalli kaushikponnapalli deleted the timeseries_expr branch November 22, 2024 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow custom expressions in timeseries outputs.
2 participants