DynamicSpace

class modelx.core.space.DynamicSpace[source]

Bases: modelx.core.space.BaseSpace

Dynamically created space.

Dynamic spaces of a parametric space are created by accessing its elements for the first time, through subscription [] or call () operations on the parametric space.

Dynamic spaces are not editable like static spaces.

Methods

cur_space([name]) Set the current space to Space name and return it.
has_params() Check if the parameter function is set.
to_frame(*args) Convert the space itself into a Pandas DataFrame object.

Attributes

all_spaces A mapping associating names to all(static and dynamic) spaces.
allow_none Whether a cells can have None as its value.
argvalues A tuple of space arguments.
bases List of base classes.
cells A mapping of cells names to the cells objects in the space.
dynamic_spaces A mapping associating names to dynamic spaces.
formula Property to get, set, delete formula.
frame Alias of to_frame().
fullname Dotted name of the object.
model The model this object belongs to.
name Name of the object.
parameters A tuple of parameter strings.
parent The parent of this object.
properties
refs A map associating names to objects accessible by the names.
spaces A mapping associating names to static spaces.
static_spaces A mapping associating names to static spaces.
_baseattrs

A dict of members expressed in literals

_derived_cells

A mapping associating names to derived cells.

_derived_spaces

A mapping associating names to derived spaces.

_is_base(other)

True if the space is a base space of other, False otherwise.

_is_defined()

True if the space is a defined space, False otherwise.

_is_derived()

True if the space is a derived space, False otherwise.

_is_dynamic()

True if the space is in a dynamic space, False otherwise.

_is_root()

True if ths space is a dynamic space, False otherwise.

_is_static()

True if the space is a static space, False if dynamic.

_is_sub(other)

True if the space is a sub space of other, False otherwise.

_self_cells

A mapping that associates names to cells defined in the space

_self_spaces

A mapping associating names to self spaces.

_to_attrdict(attrs=None)

Get extra attributes

all_spaces

A mapping associating names to all(static and dynamic) spaces.

allow_none

Whether a cells can have None as its value.

This is a property of Model, Space and Cells. If allow_none of a cells is False, the cells cannot have None as its value. Assigning None to the cells or its formula returning None raises an Error. If True, the cells can have None as their value. If set to None, allow_none of its parent is looked up, and the search continues until True or False is found.

Returns:True if the cells can have None, False if it cannot, or None if a default value from the parent is to be used.
argvalues

A tuple of space arguments.

bases

List of base classes.

cells

A mapping of cells names to the cells objects in the space.

cur_space(name=None)

Set the current space to Space name and return it.

If called without arguments, the current space is returned. Otherwise, the current space is set to the space named name and the space is returned.

dynamic_spaces

A mapping associating names to dynamic spaces.

formula

Property to get, set, delete formula.

frame

Alias of to_frame().

fullname

Dotted name of the object.

Names joined by dots, such as ‘Model1.Space1.Cells1’, each element in the string is the name of the parent object of the next one joined by a dot.

has_params()

Check if the parameter function is set.

model

The model this object belongs to.

This is a property of Model, Space and Cells. For models, this property is themselves.

name

Name of the object.

parameters

A tuple of parameter strings.

parent

The parent of this object. None for models.

The parent object of a cells is a space that contains the cells. The parent object of a space is either a model or another space that contains the space.

refs

A map associating names to objects accessible by the names.

spaces

A mapping associating names to static spaces.

static_spaces

A mapping associating names to static spaces.

Alias to spaces()

to_frame(*args)

Convert the space itself into a Pandas DataFrame object.