Search code examples
openmdao

Can set_parameter_options be added to the trajectory class?


For the Dymos problems I work with, I have code that adds states, controls, etc. in bulk and then use the set_XXX_options() method to specify specific parameter values (e.g. opt=True). This is easy for Dymos phases, because each phase has a add_XXX() method and an associated set_XXX_options() method. However, the trajectory.add_parameter() method does an associated trajectory.set_parameter_options() method.

Is there a reason the set_parameter_options() method is not available for trajectory objects? Can it be added as a method?


Solution

  • This is a good point and there's no reason we can't add this method, and we should for API consistency.

    In the mean time, you can access the parameter_options dictionary after add_parameter to change settings. For instance,

    traj.add_parameter('foo', ...)
    traj.parameter_options['foo']['opt'] = True
    

    I'll add an issue to make this a part of the API.