DynamicSpace.clear_all#
- DynamicSpace.clear_all()#
Clear all cell values and delete all ItemSpaces recursively.
This method performs a comprehensive cleanup by:
Clearing both input and calculated values from all cells
Processing cells in this space and all nested child spaces recursively
Deleting all
ItemSpaceinstances in this space and child spaces
This is useful for:
Freeing memory by removing all cached calculations
Resetting the model to a clean state
Preparing for a new calculation with different input data
Example
>>> space.clear_all() >>> # All cell values cleared, all ItemSpaces deleted >>> len(space.itemspaces) 0
See also
clear_cells(): Clear only cell values (keep ItemSpaces)clear_items(): Delete only ItemSpaces (keep cell values)Model.clear_all: Model-level clearing
Warning
This operation cannot be undone. Input values that were set programmatically will be lost and must be re-entered.
Changed in version 0.16.0: Changed to delete child ItemSpaces recursively and to clear recursive child Cells.
clear_items()works the same as this method before change.