History – Reference Guide

This guide is for versions 1.0.0rc.2+ (Release Candidate)

Source code




Class HistoryBinConcentration

    For the management of historical data for bin concentrations
    
nameargumentsreturns
__init__bins=None, active=False, chem_labels=None, frequency=1

        :param bins:        List of bin addresses for which history is to be kept; use None to mean all
        :param active:      Flag indicating whether the history is enabled
        :param chem_labels: List of chemicals for which history is to be kept; use None to mean all
        :param frequency:   How many simulation cycles to wait until taking another data snapshoot
        
nameargumentsreturns
enable_historyfrequency=1, chem_labels=None, bins=NoneNone
        Request history capture, with the specified parameters.
        If history was already enabled, this function can be used to alter its capture parameters.

        :param frequency:
        :param chem_labels: [OPTIONAL] List of chemicals to include in the history;
                                if None (default), include them all.
        :param bins:        [OPTIONAL] Bin address, or list of them;
                                if None (default), include them all.
        :return:            None
        
nameargumentsreturns
save_snapshotsystem_time, data_snapshot, step_count=None, caption=""None

           EXAMPLE of data_snapshot (for 1D) systems:
                { 6: {"A": 1.3, "B": 3.9},
                  8: {"A": 4.6, "B": 2.7}
                }

           EXAMPLE of data_snapshot (for 2D) systems:
                { (0,0): {"A": 1.3, "B": 3.9},
                  (3,5): {"A": 4.6, "B": 2.7}
                }
        :param system_time:
        :param data_snapshot:
        :param step_count:
        :param caption:         [OPTIONAL] String to save alongside this snapshot
        :return:                None
        
nameargumentsreturns
bin_historybin_address, include_captions=False
        Return the history at the given bin, as a Pandas dataframe.
        The first column is "SYSTEM TIME", and the other ones are the various chemicals for which
        history had been enabled.
        If no historical data is located, an informational string is returned

        :param bin_address:         A single bin address.  EXAMPLES, in 1D: 8   In 2D : (3,3)
        :param include_captions:    If True, the captions are returned as an extra "caption" column at the end
        :return:                    A Pandas data frame, or a string if no historical data is present
        



Class HistoryReactionRate

    For the management of historical reaction-rate data for Uniform Compartments
    
nameargumentsreturns
__init__rxns=None, active=False, chem_labels=None, frequency=1

        :param rxns:        List of reactions (identified by their index) for which history is to be kept; use None to mean all
        :param active:      Flag indicating whether the history is enabled
        :param chem_labels: List of chemicals for which history is to be kept; use None to mean all
        :param frequency:   How many simulation cycles to wait until taking another data snapshoot
        
nameargumentsreturns
enable_historyfrequency=1, chem_labels=None, rxns=NoneNone
        Request history capture, with the specified parameters.
        If history was already enabled, this function can be used to alter its capture parameters.

        :param frequency:
        :param chem_labels: [OPTIONAL] List of chemicals to include in the history;
                                if None (default), include them all.
        :param rxns:
        :return:            None
        
nameargumentsreturns
save_snapshotsystem_time, data_snapshot, step_count=None, caption=""None

           EXAMPLE of data_snapshot:
                {"rxn1_rate": 6.3, "rxn2_rate": 14.3}

        :param system_time:
        :param data_snapshot:
        :param step_count:
        :param caption:         [OPTIONAL] String to save alongside this snapshot
        :return:                None
        



Class HistoryUniformConcentration

    For the management of historical concentration data for Uniform Compartments
    
nameargumentsreturns
__init__active=False, chem_labels=None, frequency=1

        :param active:      Flag indicating whether the history is enabled
        :param chem_labels: List of chemicals for which history is to be kept; use None to mean all
        :param frequency:   How many simulation cycles to wait until taking another data snapshoot
        
nameargumentsreturns
enable_historyfrequency=1, chem_labels=NoneNone
        Request history capture, with the specified parameters.
        If history was already enabled, this function can be used to alter its capture parameters.

        :param frequency:
        :param chem_labels: [OPTIONAL] List of chemicals to include in the history;
                                if None (default), include them all.
        :return:            None
        
nameargumentsreturns
save_snapshotsystem_time, data_snapshot, step_count=None, caption=""None

        :param system_time:
        :param data_snapshot:   EXAMPLE: {"A": 1.3, "B": 4.9}
        :param step_count:
        :param caption:         [OPTIONAL] String to save alongside this snapshot
        :return:                None