iode.Tables.new_detached

Tables.new_detached() Self

Create a new empty detached database. Here detached means that the new database is not linked to the global workspace. Any change made to the copied database (subset) will not be applied to the global workspace. This can be useful for example if you want to save previous values of scalars before estimating an equation or a block of equations and then restore the original values if the estimated values are not satisfying.

Returns:
Database

See also

IodeDatabase.copy

Examples

>>> from iode import SAMPLE_DATA_DIR
>>> from iode import comments
>>> comments.load(f"{SAMPLE_DATA_DIR}/fun.cmt")
Loading .../fun.cmt
317 objects loaded 
>>> cmt_detached = comments.new_detached()
>>> cmt_detached.is_detached
True
>>> cmt_detached.names
[]