2017-01-20 110 views
0

我正在構建一個新的OpenMDAO組件。我這樣做:OpenMDAO錯誤:對象沒有屬性'_post_setup_vars'

prob = Problem(impl=impl, root=myNewComponent(nTurbs=4, rotor_diameter=126.0)) 
prob.driver = ScipyOptimizer() 
prob.driver.add_desvar('turbineX') 
prob.driver.add_objective('AEP') 
prob.setup() 
prob.run() 

..和OpenMDAO崩潰AttributeError: 'myNewComponent' object has no attribute '_post_setup_vars'。這個消息是什麼意思?

回答

0

你忘了把super(myNewComponent, self).__init__()放在你的組件的__init__函數中。

相關問題