ItemSpace#
- class ItemSpace(_impl)[source]#
Root dynamic space created by calling a parameterized UserSpace with arguments.
ItemSpace is a subclass of
DynamicSpacethat represents the top-level space instance for a specific set of parameter values. When a UserSpace has a parameter formula defined, accessing it with arguments (via[]subscription or()call) creates an ItemSpace that serves as the root of a dynamic space hierarchy.Each ItemSpace:
Corresponds to a unique combination of parameter values
Contains cells with formulas inherited from the base UserSpace
Creates child DynamicSpaces for any nested spaces in the base
Is cached and reused when accessed with the same arguments
- Creation:
ItemSpaces are created automatically when a parameterized UserSpace is accessed with arguments:
>>> space = model.new_space() >>> space.parameters = ('x', 'y') >>> space[1, 2] # Creates ItemSpace with x=1, y=2 <ItemSpace space[1, 2] in Model1>
Key Characteristics:
Root dynamic space: Top of the dynamic space hierarchy for given parameters
Parameterized: Has specific argument values (accessible via
argvalues)Read-only: Cannot be edited after creation
Cached: Same arguments return the same ItemSpace instance
Deletable: Can be removed via
clear_at()ordel space[args]
The key distinction from
DynamicSpace:ItemSpace = root of dynamic hierarchy (has parameters)
DynamicSpace = nested child within that hierarchy (no parameters)
See also
DynamicSpace: Non-root dynamic spaces in the hierarchyUserSpace: The base space that ItemSpace derives fromUserSpace.parameters: Define parameters for a spaceAdded in version 0.0.21: Split from DynamicSpace class
Basic properties#
Name of the object. |
|
Dotted name of the object. |
|
Documentation string |
|
Whether a cells can have None as its value. |
|
The model this object belongs to. |
|
The parent of this object. |
|
Read-only mapping of reference names to their values. |
|
|
Set the current space to Space |
Check whether this space has parameters defined. |
|
|
Set property |
An object whose |
Inheritance properties#
List of base spaces from which this space inherits. |
Child Space properties#
Child Cells properties#
ItemSpace properties#
A tuple containing the argument values used to create this ItemSpace. |
|
Tuple of parameter names for this space, or None if not parameterized. |