OpenMDAO Logo

An open-source MDAO framework written in Python.

OpenMDAO v1.2.0

Today marks the release of OpenMDAO 1.2.0, which contains several features and bugfixes, but which is highlighted by an API change:

API Change
The way imports work in OpenMDAO has changed. Importing things from their parent module
no longer works. Importing things directly from their source files still works.
A new namespace, “openmdao.api” has been created, from which you can import anything
you previously got from a module file.

Examples:
#Example 1: old way, import from module, no longer supported
from openmdao.core import Component, Group
from openmdao.components import IndepVarComp
from openmdao.solvers import ScipyGMRES

#Example 2: directly from source file (still works), to do same as Ex 1.
from openmdao.core.component import Component
from openmdao.core.group import Group
from openmdao.components.indep_var_comp import IndepVarComp
from openmdao.solvers.scipy_gmres import ScipyGMRES

#Example 3: new way using openmdao.api, to do same as Ex 1.
from openmdao.api import Component, Group, IndepVarComp, ScipyGMRES

As always, even though we are still in alpha, we apologize if our API changes
cause any problems. Feel free to ask questions on our Stack Overflow tag if you
experience any difficulties.

Comments are closed.

Fork me on GitHub