jLM.BaseTypes#

Simulation object base class and collections

Functions

abstractmethod(funcobj)

A decorator indicating abstract methods.

Classes

ABCMeta(name, bases, namespace, **kwargs)

Metaclass for defining Abstract Base Classes (ABCs).

Namespace(sos)

This function simply creates and returns a new Namespace object wrapping the current SimObjs container.

SimObj(sim, idx, *args, **kwargs)

Base class to simulation objects

SimObjs(sim, cls[, idbase])

Container to manage simulation data types

class jLM.BaseTypes.Namespace(sos)[source]#

Bases: object

This function simply creates and returns a new Namespace object wrapping the current SimObjs container. The main purpose is to provide a more user-friendly interface for accessing simulation objects through tab completion.

Convienence class for TAB completing simulation objects

Parameters:

sos (SimObjs) – Object collection

class jLM.BaseTypes.SimObj(sim, idx, *args, **kwargs)[source]#

Bases: object

Base class to simulation objects

class jLM.BaseTypes.SimObjs(sim, cls, idbase=0)[source]#

Bases: object

Container to manage simulation data types

freeze()[source]#

Do not create new objects from failed lookups

get(*args, **kwargs)[source]#

Return a simulation object, create it if it does not exist

Parameters:

*args – Arguments to constructor

Keyword Arguments:

**kwargs – Keyword arguments to constructor

Returns:

Object

Return type:

SimObj

getAutoNamespace()[source]#

Get Namespace object.

is_defined(*args, **kwargs)[source]#

Check if get would create a new object

Parameters:

*args – Arguments to constructor

Keyword Arguments:

**kwargs – Keyword arguments to constructor

Returns:

True if would create new object.

Return type:

bool

matchRegex(regex)[source]#

Generator returning matches to regular expression

Parameters:

regex (str) –

Regular expression matching the name attribute of

contained objects

Returns:

Generator of SimObj

Return type:

generator

unfreeze()[source]#

Create new objects from failed lookups