Closed enricostragiotti closed 2 months ago
It turns out that the problem come from the order in which the yml file is given. This
payload_range:
id: fastoad.performances.payload_range
propulsion_id: fastoad.wrapper.propulsion.rubber_engine
mission_name: MTOW_mission
mission_file_path: ConfigFiles/missions.yml
...
works as expected, while
payload_range:
id: fastoad.performances.payload_range
propulsion_id: fastoad.wrapper.propulsion.rubber_engine
mission_file_path: ConfigFiles/missions.yml
mission_name: MTOW_mission
...
doesn't. To investigate. the problem is only for payload_range mission.
Describe the bug I get a FastMissionFileMissingMissionNameError when using payload_range mission when the mission file contains multiple mission names.
Error message Traceback (most recent call last): File "d:\estragio\CPOR\03_Projet\02_ACAP\01_Code\etude_cleanaviation\main\ACAP\EtudeBaseline\ACAP_results\02_O239+\01_Base_config\01_payload_range\payload_range.py", line 22, in", line 8, in init
File "D:\estragio\CPOR\03_Projet\02_ACAP\01_Code\etude_cleanaviation.venv\lib\site-packages\fastoad\openmdao\problem.py", line 349, in post_init
self.analyze()
File "D:\estragio\CPOR\03_Projet\02_ACAP\01_Code\etude_cleanaviation.venv\lib\site-packages\fastoad\openmdao\problem.py", line 357, in analyze
om.Problem.setup(problem_copy)
File "D:\estragio\CPOR\03_Projet\02_ACAP\01_Code\etude_cleanaviation.venv\lib\site-packages\openmdao\core\problem.py", line 1025, in setup
model._setup(model_comm, self._metadata)
File "D:\estragio\CPOR\03_Projet\02_ACAP\01_Code\etude_cleanaviation.venv\lib\site-packages\openmdao\core\group.py", line 733, in _setup
self._setup_procs(self.pathname, comm, self._problem_meta)
File "D:\estragio\CPOR\03_Projet\02_ACAP\01_Code\etude_cleanaviation.venv\lib\site-packages\openmdao\core\group.py", line 638, in _setup_procs
subsys._setup_procs(subsys.pathname, sub_comm, prob_meta)
File "D:\estragio\CPOR\03_Projet\02_ACAP\01_Code\etude_cleanaviation.venv\lib\site-packages\openmdao\core\group.py", line 638, in _setup_procs
subsys._setup_procs(subsys.pathname, sub_comm, prob_meta)
File "D:\estragio\CPOR\03_Projet\02_ACAP\01_Code\etude_cleanaviation.venv\lib\site-packages\openmdao\core\group.py", line 583, in _setup_procs
self.setup()
File "D:\estragio\CPOR\03_Projet\02_ACAP\01_Code\etude_cleanaviation.venv\lib\site-packages\fastoad\module_management\service_registry.py", line 288, in setup
self.options[name] = value
File "D:\estragio\CPOR\03_Projet\02_ACAP\01_Code\etude_cleanaviation.venv\lib\site-packages\openmdao\utils\options_dictionary.py", line 526, in setitem__
self._assert_valid(name, value)
File "D:\estragio\CPOR\03_Projet\02_ACAP\01_Code\etude_cleanaviation.venv\lib\site-packages\openmdao\utils\options_dictionary.py", line 311, in _assert_valid
meta['check_valid'](name, value)
File "D:\estragio\CPOR\03_Projet\02_ACAP\01_Code\etude_cleanaviation.venv\lib\site-packages\fastoad\models\performances\mission\openmdao\payload_range.py", line 113, in _update_mission_wrapper
self._mission_wrapper.force_all_block_fuel_usage()
File "D:\estragio\CPOR\03_Projet\02_ACAP\01_Code\etude_cleanaviation.venv\lib\site-packages\fastoad\models\performances\mission\openmdao\mission_wrapper.py", line 100, in force_all_block_fu self.options[name] = value
File "D:\estragio\CPOR\03_Projet\02_ACAP\01_Code\etude_cleanaviation.venv\lib\site-packages\openmdao\utils\options_dictionary.py", line 526, in setitem__
self._assert_valid(name, value)
File "D:\estragio\CPOR\03_Projet\02_ACAP\01_Code\etude_cleanaviation.venv\lib\site-packages\openmdao\utils\options_dictionary.py", line 311, in _assert_valid
meta['check_valid'](name, value)
File "D:\estragio\CPOR\03_Projet\02_ACAP\01_Code\etude_cleanaviation.venv\lib\site-packages\fastoad\models\performances\mission\openmdao\payload_range.py", line 113, in _update_mission_wrapper
self._mission_wrapper.force_all_block_fuel_usage()
File "D:\estragio\CPOR\03_Projet\02_ACAP\01_Code\etude_cleanaviation.venv\lib\site-packages\fastoad\models\performances\mission\openmdao\mission_wrapper.py", line 100, in force_all_block_fu self._assert_valid(name, value)
File "D:\estragio\CPOR\03_Projet\02_ACAP\01_Code\etude_cleanaviation.venv\lib\site-packages\openmdao\utils\options_dictionary.py", line 311, in _assert_valid
meta['check_valid'](name, value)
File "D:\estragio\CPOR\03_Projet\02_ACAP\01_Code\etude_cleanaviation.venv\lib\site-packages\fastoad\models\performances\mission\openmdao\payload_range.py", line 113, in _update_mission_wrapper
self._mission_wrapper.force_all_block_fuel_usage()
File "D:\estragio\CPOR\03_Projet\02_ACAP\01_Code\etude_cleanaviation.venv\lib\site-packages\fastoad\models\performances\mission\openmdao\mission_wrapper.py", line 100, in force_all_block_fu meta['check_valid'](name, value)
File "D:\estragio\CPOR\03_Projet\02_ACAP\01_Code\etude_cleanaviation.venv\lib\site-packages\fastoad\models\performances\mission\openmdao\payload_range.py", line 113, in _update_mission_wrapper
self._mission_wrapper.force_all_block_fuel_usage()
File "D:\estragio\CPOR\03_Projet\02_ACAP\01_Code\etude_cleanaviation.venv\lib\site-packages\fastoad\models\performances\mission\openmdao\mission_wrapper.py", line 100, in force_all_block_fu File "D:\estragio\CPOR\03_Projet\02_ACAP\01_Code\etude_cleanaviation.venv\lib\site-packages\fastoad\models\performances\mission\openmdao\payload_range.py", line 113, in _update_mission_wrapper
self._mission_wrapper.force_all_block_fuel_usage()
File "D:\estragio\CPOR\03_Projet\02_ACAP\01_Code\etude_cleanaviation.venv\lib\site-packages\fastoad\models\performances\mission\openmdao\mission_wrapper.py", line 100, in force_all_block_fu self._mission_wrapper.force_all_block_fuel_usage()
File "D:\estragio\CPOR\03_Projet\02_ACAP\01_Code\etude_cleanaviation.venv\lib\site-packages\fastoad\models\performances\mission\openmdao\mission_wrapper.py", line 100, in force_all_block_fu File "D:\estragio\CPOR\03_Projet\02_ACAP\01_Code\etude_cleanaviation.venv\lib\site-packages\fastoad\models\performances\mission\openmdao\mission_wrapper.py", line 100, in force_all_block_fuel_usage
el_usage
if self.mission_name:
if self.mission_name:
File "D:\estragio\CPOR\03_Projet\02_ACAP\01_Code\etude_cleanaviation.venv\lib\site-packages\fastoad\models\performances\mission\mission_definition\mission_builder\mission_builder.py", line
148, in mission_name
self._mission_name = self.get_unique_mission_name()
File "D:\estragio\CPOR\03_Projet\02_ACAP\01_Code\etude_cleanaviation.venv\lib\site-packages\fastoad\models\performances\mission\mission_definition\mission_builder\mission_builder.py", line
282, in get_unique_mission_name
raise FastMissionFileMissingMissionNameError(
fastoad.models.performances.mission.mission_definition.exceptions.FastMissionFileMissingMissionNameError: Mission name must be specified if several missions are defined in mission file.
api_cs25.generate_inputs(CONFIGURATION_FILE, SOURCE_FILE, overwrite=True) File "D:\estragio\CPOR\03_Projet\02_ACAP\01_Code\etude_cleanaviation.venv\lib\site-packages\fastoad\cmd\api.py", line 328, in generate_inputs conf.write_needed_inputs(source_data_path) File "D:\estragio\CPOR\03_Projet\02_ACAP\01_Code\etude_cleanaviation.venv\lib\site-packages\fastoad\io\configuration\configuration.py", line 216, in write_needed_inputs problem.write_needed_inputs(source_file_path, source_formatter) File "D:\estragio\CPOR\03_Projet\02_ACAP\01_Code\etude_cleanaviation.venv\lib\site-packages\fastoad\openmdao\problem.py", line 114, in write_needed_inputs [variable for variable in self.analysis.problem_variables if variable.is_input] File "D:\estragio\CPOR\03_Projet\02_ACAP\01_Code\etude_cleanaviation.venv\lib\site-packages\fastoad\openmdao\problem.py", line 175, in analysis self._analysis = ProblemAnalysis(self) File "