Source code for openmdao.main.factory
import inspect
#public symbols
__all__ = ["Factory"]
[docs]class Factory(object):
"""Base class for objects that know how to create other objects
based on a type argument and several optional arguments (version,
server id, and resource description).
"""
def __init__(self):
pass
[docs] def create(self, typname, version=None, server=None,
res_desc=None, **ctor_args):
"""Return an object of type *typname* (or a proxy to it if it resides
in another process) using the specified package version, server
location, and resource description. Returns None if this factory is
unable to create the specified type.
"""
raise NotImplementedError('create')
[docs] def get_available_types(self, groups=None):
"""Return a set of tuples of the form (typename, metadata_dict), one
for each available plugin type in the given entry point groups.
If groups is *None,* return the set for all openmdao entry point groups.
"""
raise NotImplementedError('get_available_types')
[docs] def get_signature(self, typname, version=None):
"""Return constructor argument signature for *typname,* using the
specified package version. The return value is a dictionary:
args: list
List of 1 or 2-element lists. The first element is the argument
name; the second element is the default value.
varargs: string
The name of the '*' argument.
kwargs: string
The name of the '**' argument.
"""
raise NotImplementedError('get_signature')
@staticmethod