whatsopt / whatsopt-cli Goto Github PK
View Code? Open in Web Editor NEWWhatsOpt command line interface
License: Apache License 2.0
WhatsOpt command line interface
License: Apache License 2.0
Meaning you can only fetch implementations for top level disciplines.
For nested disciplines there is no support.
It looks like the new auto-ivc feature of OpenMDAO 3.2 breaks things in wop.
Provided you have already connected once to WhatsOpt server, the following snippet should work with OpenMDAO 3.1 but should break with OpenMDAO 3.2 or 3.3.
Uncommenting the line that adds the IVC to the group makes the script work again.
Also, the code works in all case if components are added directly in problem.model
with no additional group added.
import openmdao.api as om
from whatsopt.show_utils import generate_xdsm_html
from whatsopt.whatsopt_client import WhatsOpt
class SomeComponent(om.ExplicitComponent):
def setup(self):
self.add_input("foo")
self.add_output("bar")
def compute(self, inputs, outputs, discrete_inputs=None, discrete_outputs=None):
outputs["bar"] = inputs["foo"]
problem = om.Problem()
ivc = om.IndepVarComp()
ivc.add_output("foo", 10.0)
group = om.Group()
# group.add_subsystem("ivc", ivc, promotes=["*"])
group.add_subsystem("comp", SomeComponent(), promotes=["*"])
problem.model.add_subsystem("group", group, promotes=["*"])
problem.setup()
problem.final_setup()
wop = WhatsOpt(login=False)
ok = wop.login(echo=False)
if ok:
xdsm = wop.push_mda(
problem, {"--xdsm": True, "--name": "dummy_test", "--dry-run": False, "--depth": 1}
)
generate_xdsm_html(xdsm, "xdsm.html")
Error message:
Traceback (most recent call last):
File "/Volumes/MacHD2/Users/tof/PycharmProjects/FAST-OAD/results/xdsm_test.py", line 45, in <module>
problem, {"--xdsm": True, "--name": "dummy_test", "--dry-run": False, "--depth": 1}
File "/Volumes/MacHD2/Users/tof/PycharmProjects/FAST-OAD/.venv/lib/python3.7/site-packages/whatsopt/whatsopt_client.py", line 262, in push_mda
problem.model, push_cmd.tree, use_depth=True
File "/Volumes/MacHD2/Users/tof/PycharmProjects/FAST-OAD/.venv/lib/python3.7/site-packages/whatsopt/push_command.py", line 34, in get_mda_attributes
self._collect_disc_infos(self.problem.model, self.tree)
File "/Volumes/MacHD2/Users/tof/PycharmProjects/FAST-OAD/.venv/lib/python3.7/site-packages/whatsopt/push_command.py", line 262, in _collect_disc_infos
self._collect_disc_infos(system._subsystems_myproc[i], child, prefix)
File "/Volumes/MacHD2/Users/tof/PycharmProjects/FAST-OAD/.venv/lib/python3.7/site-packages/whatsopt/push_command.py", line 265, in _collect_disc_infos
if not isinstance(system._subsystems_myproc[i], IndepVarComp):
IndexError: list index out of range
Internal data structure _var_abs_names
is removed
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.