fast-aircraft-design / FAST-OAD

FAST-OAD: An open source framework for rapid Overall Aircraft Design
GNU General Public License v3.0
47 stars 25 forks source link

Test OAD process fails with OpenMDAO 3.17.0 #427

Closed florentLutz closed 2 years ago

florentLutz commented 2 years ago

Describe the bug There seems to be an incompatibility with OpenMDAO 3.17.0. When upgrading from 3.16.0 or below to 3.17.0, the integration tests will fail even if the pyproject.toml allows to install the 3.17.0 version

To Reproduce After cloning the repository run poetry install Then run pip install openmdao==3.17.0 Run the pytest named test_oad_process in tests/integraton_tests/test_oad_process.py

Expected behavior Expect the test to pass without issue : image

Error message

FAILED [100%]
tests\integration_tests\oad_process\test_oad_process.py:45 (test_oad_process)
cleanup = None

def test_oad_process(cleanup):
    """
    Test for the overall aircraft design process.
    """

  configurator = FASTOADProblemConfigurator(pth.join(DATA_FOLDER_PATH, "oad_process.yml"))

  \# Create inputs
  ref_inputs = pth.join(DATA_FOLDER_PATH, "CeRAS01_legacy.xml")
  configurator.write_needed_inputs(ref_inputs)

  \# Create problems with inputs
  problem = configurator.get_problem(read_inputs=True)
  problem.setup()

tests\integration_tests\oad_process\test_oad_process.py:59: 
\_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
src\fastoad\openmdao\problem.py:94: in setup
    self._read_inputs_with_setup_done()
\_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <fastoad.openmdao.problem.FASTOADProblem object at 0x00000239E063BF88>

def _read_inputs_with_setup_done(self):
    """
    Set initial values of inputs. self.setup() must have been run.
    """
    input_variables, unused_variables = self._get_problem_inputs()
    self.additional_variables = unused_variables
    for input_var in input_variables:
        # set_val() will crash if input_var.metadata["val"] is a list, so
        # we ensure it is a numpy array
        input_var.metadata["val"] = np.asarray(input_var.metadata["val"])
        self.set_val(input_var.name, **input_var.metadata)

TypeError: set_val() got an unexpected keyword argument 'shape'

src\fastoad\openmdao\problem.py:162: TypeError

Environment

Additional context Whe downgrading to 3.16.0 the issue does not appear