Utilities and Interfaces

interface.py

fusedwind.interface.base(cls)[source]

Decorator for a FUSED base class

fusedwind.interface.check_base_compliance(base, cls)[source]

Do some checks on the I/O compatibility of the class with its base:

Parameters:
  • class (cls) – the base class to be satisfied
  • class – the current class to check
fusedwind.interface.cls_list_inputs(cls)[source]

Return a list of inputs in a Component class

fusedwind.interface.cls_list_outputs(cls)[source]

Return a list of outputs in a Component class

fusedwind.interface.cls_list_vars(cls)[source]

Return a list of variables in a VariableTree class

class fusedwind.interface.configure_base(base)[source]

Bases: object

decorator that enforces a check that the function first argument instance (i.e. self) is in compliance with the base class.

class fusedwind.interface.implement_base(*args)[source]

Bases: object

Decorator to implements the bases. Can both be used for Components and Assemblies

fusedwind.interface.interface(comp_cls)[source]

Returns the class ICompCls(Interface)

fused_helper.py

class fusedwind.fused_helper.defaultdictree[source]

Bases: collections.defaultdict, fusedwind.fused_helper.dictree

Same as dictree, but with defaultdict as a base

class fusedwind.fused_helper.dictree[source]

Bases: dict

Transform a dictionary into a tree

VariableTree(cls)[source]

Creates an openMDAO VariableTree and fills it with the dic content

df()[source]

return a flatten pandas DataFrame of the dictree

fusedwind.fused_helper.disp(comp)[source]

Display a Container

fusedwind.fused_helper.draw_graph(self, name='Graph', value=False)[source]

Draw the SVG dot_graph of an OpenMDAO Component/Driver/Assembly instance

fusedwind.fused_helper.flatten(t)[source]

Flatten a nested dictionary

fusedwind.fused_helper.fused_autodoc(cls)[source]

Decorator to automatically document the inputs and outputs of an Assembly / Component

fusedwind.fused_helper.init_container(self, **kwargs)[source]

Initialise a container with a dictionary of inputs

fusedwind.fused_helper.interactive_graph(self)[source]

Create an interative graph using Ipython widgets

fusedwind.fused_helper.interactive_output(self)[source]

Create an interative graph using Ipython widgets

fusedwind.fused_helper.interactive_plot(self)[source]

Create an interative plot using Ipython widgets

fusedwind.fused_helper.lconnect(self, a, b)[source]

lazy_connect function. try to connect the outputs of a to the inputs of b that have the same name.

Parameters:
  • Assembly (self) – The assembly containing the components to connect
  • str (b) – The name of the component output a to connect. If a == ‘’, then self.inputs is used
  • str – The name of the component inputs a to connect. If b == ‘’, then self.outputs is used
fusedwind.fused_helper.list_ios(self, iotype=None)[source]

Only list the I/Os that are not in the base Assembly class

fusedwind.fused_helper.make_graph(self, name='Graph', value=False)[source]

Make the dot_graph of an OpenMDAO Component/Driver/Assembly instance

fusedwind.fused_helper.my_call(self, **kwargs)[source]

Partial function of the Component/Assembly Returns a tree dictionary containing the inputs, outputs and nested result dictionaries from the containers

fusedwind.fused_helper.my_str(var, parent='', value=False)[source]

String representation for generating graphs

fusedwind.fused_helper.out_graph_assembly(self, graph, value=False)[source]

Generate the dot_graph for an Assembly

fusedwind.fused_helper.out_graph_component(self, graph, value=False)[source]

Generate the dot_graph for a component

fusedwind.fused_helper.out_graph_driver(self, graph, value=False)[source]

Generate the dot_graph for a driver

class fusedwind.fused_helper.pandasMDAO(a)[source]

Bases: object

Create a pandas memorizer to a component or an Assembly. Each time the memorizer is run, it will look in the DataFrame if the inputs are already there, if they are it will update the component or assembly with the corresponding outputs, otherwise it will run the component or assembly and append the results to the DataFrame

fusedwind.fused_helper.pandas_memoized(cls)[source]

Decorator to add a pandas memorizer to a component or an assembly