Units Conversion #91
Replies: 1 comment 1 reply
-
Hi @Pietro-Colonna,
this command did not work for few of the typical parameters shown in the viewer because some of them were promoted variables: the workaround is to create a dictionary from promoted to absolute names (prom_name_to_abs)
I created a version of the viewers that adds the units in the output maybe someone can point me towards a guide on how to push my version of the viewers to the repo and get it accepted? maybe @Kenneth-T-Moore hope this helps Cheers |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone,
I'm writing this post mainly to gather feedback — both from users and developers — regarding the possibility of supporting SI metric units within the code.
As things stand, the pyCycle source code is written almost exclusively using imperial units, and, to the best of my knowledge, there is no straightforward way to produce output in SI units without implementing a wrapper that performs the conversion downstream.
This post is not meant to spark a debate over which unit system is preferable, but simply to highlight the fact that, as of now, pyCycle does not allow for an easy switch between the two systems.
I strongly believe that both the code and the community would benefit greatly from addressing this limitation, for several reasons:
Native support for the metric system would make the code significantly more accessible and could greatly expand the community, with all the long-term advantages this would entail.
The current implementation of imperial units is, in my opinion, questionable (though I’m open to discussion on this point). Conversion factors are hard-coded directly into the equations, which results in, for instance, many partial derivatives in the Jacobians being cluttered with unit conversion constants — reducing both the elegance and readability of the code.

Even when speaking with U.S.-based companies — typically more inclined toward imperial units — there was a shared perception that relying on a unit-dependent tool constitutes a limitation and is not considered best practice.
What I find even more paradoxical is that OpenMDAO already provides symbolic unit conversion capabilities by default. As a result, pyCycle can generally handle metric inputs without major issues. However, since there is no way to specify the units of the outputs, the results are always returned in imperial units. By directly modifying the source code, it is possible to force pyCycle to produce output in SI units fairly easily, but the ideal solution would be to allow the user to specify the desired unit system and obtain dynamically adapted outputs.
I’m convinced that improving the code’s architecture in this direction is entirely feasible, but I’d really like to hear the opinion of those with more experience with the pyCycle codebase.
Beta Was this translation helpful? Give feedback.
All reactions