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

several dymos components are doing unnecessary unit conversions #972

Open
naylor-b opened this issue Aug 29, 2023 · 1 comment
Open

several dymos components are doing unnecessary unit conversions #972

naylor-b opened this issue Aug 29, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@naylor-b
Copy link
Member

naylor-b commented Aug 29, 2023

Description

Several components (AnalyticTimeseriesOutputComp, ExplicitShootingTimeseriesComp,
PseudospectralTimeseriesOutputComp, and SolveIVPTimeseriesOutputComp) have the following logic:

if input_units is None or units is None:
     ... 
else:
     self._conversion_factors[name] = unit_conversion(input_units, units)

Later, unit conversion is done if name is found in self._conversion_factors.
This results in unnecessary unit conversions in cases where units and input_units are the same.

GaussLobattoInterleaveComp also seems to have a similar issue.

Example

I noticed this when looking through the code, but it looks like calling _add_output_configure on one of these timeseries comps with units that are the same as the src units (or if src is None) will result in unnecessary conversions.

Dymos Version

1.8.1

Relevant environment information

No response

@naylor-b naylor-b added the bug Something isn't working label Aug 29, 2023
@robfalck robfalck removed their assignment Aug 30, 2023
@robfalck
Copy link
Contributor

This is a holdover from the days before OpenMDAO supported unit conversion on constraints and objectives. We can get rid of it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants