0

In the early versions of OpenMDAO (pre 0.13.0), we could use ports with different datatypes than float, like Int, Str, Bool etc. Link given below -

http://openmdao.org/releases/0.13.0/docs/basics/variables.html

Right now I am using the latest version and would like to use Enum type input (i.e. param) port to my Component in order to restrict the value it takes to the values I specify. Is there an equivalent way to do the same in the newer versions of OpenMDAO (1.x.x) wherein you can explicitly mention the datatype of a port of a component?

1 Answer 1

2

unfortunately, Enum is the one data-type that we didn't port over to 1.x from the older code. We couldn't find a use-case for it as a variable that got passed between components.

However, if you just want an input that has ENUM for some kind of user set parameters/setting we do have that.

We made an Option object that you can add to any component. We use it a lot for drivers. One of the ways you can use that is to specify values when you add an option which makes it function like an Enum. That will hopefully work for you.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the reply. After reading your reply and looking at the links you have given, it seems that it should do the work. Could you please provide a use case or already implemented example where optimizer driver is assigning values to the design variables which are given by the user rather than from the continuous design space specified by upper and lower bounds?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.