cobramod.core.summary ===================== .. py:module:: cobramod.core.summary .. autoapi-nested-parse:: Summary This module is responsible for the short summary in the command line and for other summaries in different formats. Attributes ---------- .. autoapisummary:: cobramod.core.summary.debug_log Classes ------- .. autoapisummary:: cobramod.core.summary.DataModel Functions --------- .. autoapisummary:: cobramod.core.summary.summary Module Contents --------------- .. py:data:: debug_log .. py:class:: DataModel(lists) A class that can create a snapshot of a model and generates the summary based on those snapshots. Contains methods to identify differences and save them in multiple formats. .. py:method:: from_model(model) :classmethod: Method to create a DataModel object based on a model object. :param model: Model based on which a DataModel object is to be created. :type model: Model .. py:method:: diff(other) Creates a new DataModel object consisting of the differences between the original and the passed DataModel object. :param other: DataModel to be compared with this one. :type other: DataModel .. py:method:: to_excl(path, model = None, additions=None, deletions=None) Method to save a DataModel as an Excel file. Can also be used to save the changes between two points in time, in an Excel file format. For other formats see :func:`cobramod.summary.DataModel.to_csv` or :func:`cobramod.summary.DataModel.to_txt`. :param path: Location where the file is to be saved. :type path: Path :param model: Model for the extraction of model id and name. :type model: Model :param additions: DataModel that contains the new entities in the model. :type additions: DataModel :param deletions: DataModel that contains the remote entities in the model. :type deletions: DataModel .. py:method:: to_csv(path, model = None, additions=None, deletions=None) Method to save a DataModel as a CSV file. Can also be used to save the changes between two points in time, as a CSV. For other formats see :func:`cobramod.summary.DataModel.to_excl` or :func:`cobramod.summary.DataModel.to_txt`. :param path: Location where the file is to be saved. :type path: Path model (Model): Model for the extraction of model id and name. additions (DataModel): DataModel that contains the new entities in the model. deletions (DataModel): DataModel that contains the remote entities in the model. .. py:method:: to_txt(path, model = None, additions=None, deletions=None) Method to save a DataModel as a txt file. Can also be used to save the changes between two points in time, as a txt. For other formats see :func:`cobramod.summary.DataModel.to_excl` or :func:`cobramod.summary.DataModel.to_csv`. :param path: Location where the file is to be saved. :type path: Path :param model: Model for the extraction of model id and name. :type model: Model :param additions: DataModel that contains the new entities :type additions: DataModel :param in the model.: :param deletions: DataModel that contains the remote entities :type deletions: DataModel :param in the model.: .. py:function:: summary(model, original, filename) Produces the short summary and another one in the defined format. :param model: model with recent changes. :type model: Model :param original: Object with data from the previous model. Use method :func:`cobramod.summary.DataModel`. :type original: DataModel :param filename: Location where the summary should be stored. The file format is determined by the suffix of the filename. Thus, '.txt', '.csv' or '.xlsx' can be used. :type filename: Path