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

Added the ability to use a callable that returns a System as an ODE #528

Merged
merged 6 commits into from
Jan 26, 2021

Conversation

robfalck
Copy link
Contributor

Summary

Users may now specify a callable that returns an ODE System as the ode_class for a Phase.
This will allow ExecComps to be used as ODEs via a lambda.

Related Issues

Status

  • Ready for merge

Backwards incompatibilities

None

New Dependencies

None

…urns an OpenMDAO system, where the callable has the arguments (num_nodes=<int>, **ode_init_kwargs).

Added some documentation.
Added tests for invalid callable ODEs with appropriate error messages.
Added test for copying an existing ODE instance via deepcopy, though this is discouraged in the documentation.
@coveralls
Copy link

coveralls commented Jan 26, 2021

Coverage Status

Coverage increased (+0.03%) to 96.472% when pulling 202ccff on robfalck:callable_as_ode into 77e5ad5 on OpenMDAO:master.

@use_tempdirs
class TestBrachExecCompODE(unittest.TestCase):

def tearDown(self):
Copy link
Member

Choose a reason for hiding this comment

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

I think this is redundant when using use_tempdirs.

self.assertEqual(expected, str(e.exception))


@use_tempdirs
Copy link
Member

Choose a reason for hiding this comment

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

No need to add use_tempdirs on an ExplicitComponent.

@use_tempdirs
class TestUpgrade_0_19_0(unittest.TestCase):

def tearDown(self):
Copy link
Member

Choose a reason for hiding this comment

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

Here too.

@robfalck robfalck merged commit 5c7895c into OpenMDAO:master Jan 26, 2021
@robfalck robfalck deleted the callable_as_ode branch May 19, 2021 17:38
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 ExecComps to be used as ODE Systems
3 participants