OpenMDAO/OpenMDAO-Framework — Issue #665: create_passthrough doesn't like input variables from variable trees
Author: jcchin
Created: 2011-10-26 19:01:55+00:00
State: open

When trying to 'create_passthrough' for an input variable from within the flops wrapper. I get the error
RuntimeError: [variable.variable] must be an output variable.

This only seems to be a problem with variable trees (regardless if it's an input or output variable) All other variables have no issues being passed through. I can also work around the issue by creating a new variable in the parent assembly and connecting it to the variableTree variable.

I've tried to recreate the issue below:

from openmdao.main.api import Component, VariableTree, Assembly
from openmdao.lib.datatypes.api import Float, Int, Slot

class TestContainer(VariableTree):
dummy1 = Float(1.0)
dummy2 = Float(1.0)

class TestComponent(Component):
dummy_data = Slot(TestContainer(),iotype='in')
dummyin = Float(iotype='in')

def __init__(self):
super(TestComponent,self).__init__()
#Instantiate
self.add('dummy_data',TestContainer())

class TestAssembly(Assembly):

def __init__(self):
super(TestAssembly,self).__init__()
#Instantiate
#self.add('dummy_data',TestContainer())
self.add('comp',TestComponent())

self.create_passthrough('comp.dummy_data.dummy1')
#self.create_passthrough('comp.dummyin')

if __name__ == "__main__":

from openmdao.main.api import set_as_top

blah = set_as_top(TestAssembly())

blah.run()
print blah.comp.dummy_data.dummy1