Dynamic Space#

class DynamicSpace(_impl)[source]#

Read-only space created dynamically as a child of another dynamic space.

DynamicSpace objects are automatically created when accessing child spaces within a parameterized space hierarchy. They mirror the structure of their base UserSpace but exist within the context of specific parameter values.

Unlike ItemSpace which represents the root of a parameterized space instance, DynamicSpace represents nested child spaces within that instance.

Creation:

DynamicSpaces are created automatically when:

  • An ItemSpace is created from a parameterized UserSpace

  • The base UserSpace contains child spaces

  • These child spaces are accessed within the ItemSpace context

Key Characteristics:

  • Read-only: Cannot add, modify, or remove cells, spaces, or references

  • Dynamic: Created on-demand when parent ItemSpace is instantiated

  • Derived: Mirrors the structure and formulas of a base UserSpace

  • Contextual: Exists within a specific parameter context from parent ItemSpace

Example

>>> space = model.new_space()
>>> space.parameters = ('x',)
>>> child = space.new_space('Child')  # UserSpace
>>> item = space[1]  # ItemSpace created
>>> item.Child  # DynamicSpace (not ItemSpace)
<DynamicSpace Child in Model1.space[1]>

See also

UserSpace: The base space that DynamicSpace derives from ItemSpace: Root dynamic space with parameters BaseSpace: Base class for all space types

Basic properties#

name

Name of the object.

fullname

Dotted name of the object.

doc

Documentation string

allow_none

Whether a cells can have None as its value.

model

The model this object belongs to.

parent

The parent of this object.

properties

refs

Read-only mapping of reference names to their values.

has_params()

Check whether this space has parameters defined.

set_property(name, value)

Set property name

info

An object whose repr summarizes this Interface.

Inheritance operations#

bases

List of base spaces from which this space inherits.

Child Space operations#

spaces

Read-only mapping of names to child UserSpace objects.

named_spaces

Read-only mapping of names to child UserSpace objects.

cur_space([name])

Set the current space to Space name and return it.

Child Cells operations#

cells

Read-only mapping of cells names to Cells objects.

ItemSpace operations#

itemspaces

Read-only mapping of parameter arguments to ItemSpace objects.

parameters

Tuple of parameter names for this space, or None if not parameterized.

formula

The formula that defines parameter behavior for this space.

clear_all()

Clear all cell values and delete all ItemSpaces recursively.

clear_at(*args, **kwargs)

Delete a child ItemSpace object

node(*args, **kwargs)

Return a Node object for the given arguments.

preds(*args, **kwargs)

Return a list of predecessors of a cell.

succs(*args, **kwargs)

Return a list of successors of a cell.

precedents(*args, **kwargs)

Return a list of the precedents.

Exporting to Pandas objects#

frame

Alias of to_frame().

to_frame(*args)

Convert cells in this space to a pandas DataFrame.