fast-aircraft-design / FAST-OAD

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

01_tutorial - no xdsm.html created #279

Closed BrieucD closed 3 years ago

BrieucD commented 3 years ago

In "01_tutorial" notebook with fast-oad0.6.0a, at the end of 1. Setting up and analyzing the initial problem, while creating the xdsm file for WhatsOpt, the following error occurs :


AttributeError Traceback (most recent call last)

in 1 XDSM_FILE = pth.join(WORK_FOLDER_PATH, 'xdsm.html') **----> 2 api.write_xdsm(CONFIGURATION_FILE, XDSM_FILE, overwrite=True)** 3 from IPython.display import IFrame 4 IFrame(src=XDSM_FILE, width='100%', height='500px') ~\Anaconda3\lib\site-packages\fastoad\cmd\api.py in write_xdsm(configuration_file_path, xdsm_file_path, overwrite, depth, wop_server_url, api_key) 379 if ok: 380 xdsm = wop.push_mda( --> 381 problem, {"--xdsm": True, "--name": None, "--dry-run": False, "--depth": depth} 382 ) 383 generate_xdsm_html(xdsm, xdsm_file_path) ~\Anaconda3\lib\site-packages\whatsopt\whatsopt_client.py in push_mda(self, problem, options) 264 scalar_format = options.get("--scalar-format") 265 depth = options.get("--depth") --> 266 push_cmd = PushCommand(problem, depth, scalar_format) 267 if options.get("--experimental"): 268 push_cmd = UniversalPushCommand(problem, depth, scalar_format) ~\Anaconda3\lib\site-packages\whatsopt\push_command.py in __init__(self, problem, depth, scalar_format) 23 class PushCommand(object): 24 def __init__(self, problem, depth, scalar_format): ---> 25 data = _get_viewer_data(problem) 26 self.problem = problem 27 self.depth = depth ~\Anaconda3\lib\site-packages\openmdao\devtools\problem_viewer\problem_viewer.py in _get_viewer_data(data_source) 154 comp_exec_idx = [0] # list so pass by ref 155 comp_exec_orders = {} --> 156 data_dict['tree'] = _get_tree_dict(root_group, comp_exec_orders, comp_exec_idx) 157 158 connections_list = [] ~\Anaconda3\lib\site-packages\openmdao\devtools\problem_viewer\problem_viewer.py in _get_tree_dict(system, component_execution_orders, component_execution_index) 54 tree_dict['subsystem_type'] = 'group' 55 children = [_get_tree_dict(s, component_execution_orders, component_execution_index) ---> 56 for s in system._subsystems_myproc] 57 if system.comm.size > 1: 58 if system._subsystems_myproc: ~\Anaconda3\lib\site-packages\openmdao\devtools\problem_viewer\problem_viewer.py in (.0) 54 tree_dict['subsystem_type'] = 'group' 55 children = [_get_tree_dict(s, component_execution_orders, component_execution_index) ---> 56 for s in system._subsystems_myproc] 57 if system.comm.size > 1: 58 if system._subsystems_myproc: ~\Anaconda3\lib\site-packages\openmdao\devtools\problem_viewer\problem_viewer.py in _get_tree_dict(system, component_execution_orders, component_execution_index) 36 children = [] 37 for typ in ['input', 'output']: ---> 38 for ind, abs_name in enumerate(system._var_abs_names[typ]): 39 meta = system._var_abs2meta[abs_name] 40 name = system._var_abs2prom[typ][abs_name] AttributeError: '_AutoIndepVarComp' object has no attribute '_var_abs_names'
christophe-david commented 3 years ago

Looks like a problem in the WhatsOpt client. Could you please provide your version number for wop ? (using pip list). If it is below 1.12, you should upgrade it... (and we will have to check our packaging process, because the installation of FAST-OAD should have triggered the update of wop)

BrieucD commented 3 years ago

Current version for wop is 1.12.1 Connecting Onera external server Ether is ok.

relf commented 3 years ago

Hmmm... I would also check the OpenMDAO version because the error is thrown in openmdao\devtools\problem_viewer\problem_viewer.py.

And I've just checked, it seems you are using an old version because this file does not exist any more in current master. You should update your OpenMDAO version.

BrieucD commented 3 years ago

Indeed, I had to update openmdao from 3.4 to 3.8, But the problem remains. (I've also updated jupyter-client, jupyter-core and setuptools)

christophe-david commented 3 years ago

Actually, relf is right: openmdao\devtools\problem_viewer only exists in OpenMDAO<=2.8, so you should not get such error with a recent OpenMDAO Having OpenMDAO 3.4 is fine (and I checked on my side that FAST-OAD clearly state this requirement to pip, and wop does the same anyway), but my guess is that the environment you installed FAST-OAD 0.6a and the environment where you run the notebook are not the same. To check that, in the notebook where you get the error, I suggest you do:

import sys, openmdao, fastoad
print("Python ", sys.version)
print("OpenMDAO", openmdao.__version__)
print("FAST-OAD", fastoad.__version__)
BrieucD commented 3 years ago

I'm not sure my setup is right, but in the notebook everything seems "ok". fast-oad_tutoriel01

relf commented 3 years ago

If you're still having problem_viewer in the error messages, it means your Python environment is broken, you still have an OpenMDAO 2.x installation somewhere. Maybe you have to check your PATH or PYTHONPATH env variables to ensure you reference one and only one Anaconda3 installation.

BrieucD commented 3 years ago

I had to completely uninstall openmdao and manually remove all files remaining from anterior releases 2.6 and 2.9. in Anaconda3\Lib\site-packages. Then I reinstalled openmdao and now it works. I think that the recent upgrade of openmdao 3.8 didn't manage to correctly remove these parasite files! Thank you for your help!

christophe-david commented 3 years ago

Well, that was a weird problem then, but thank you for the feedback, and thanks @relf for helping !