iode.Database.merge_from

Note

Below, Database represents either:

  • Comments

  • Equations

  • Identities

  • Lists

  • Scalars

  • Tables

  • Variables

Database.merge_from(self, input_file: str)

Merge all objects stored in the input file ‘input_file’ into the current database.

Parameters:
input_file: str

file from which the objects to merge are read.

Examples

>>> from iode import SAMPLE_DATA_DIR
>>> from iode import comments
>>> comments.load(f"{SAMPLE_DATA_DIR}/fun.cmt")
>>> len(comments)
317
>>> # delete all comments
>>> comments.clear()
>>> len(comments)
0
>>> # reload all comments
>>> comments.merge_from(f"{SAMPLE_DATA_DIR}/fun.cmt")
>>> len(comments)
317