Example #1
0
 def test_make_core_model_fail_4(self):
     #Unused variable
     __model__ = {
         'system_type': ['pyTestModel', 'Dummy'],
         'states': ['mRNA', 'Pep', 'UnsedDummy'],
         'parameters': ['syn_mRNA', 'deg_mRNA', 'syn_Pep', 'deg_Pep', 'Ki'],
         'inputs': ['Ind'],
         'equations': [
             'dmRNA = syn_mRNA*Ind/(Ind + Ki) - deg_mRNA*mRNA',
             'dPep  = syn_Pep*mRNA - deg_Pep/0'
         ],
         'ia':
         'ia_result_bmss01001.csv'
     }
     core_model = mh.make_core_model(**__model__)
Example #2
0
    def test_make_core_model(self):
        global core_model_1
        __model__ = {
            'system_type': ['pyTestModel', 'Dummy'],
            'states': ['mRNA', 'Pep'],
            'parameters': ['syn_mRNA', 'deg_mRNA', 'syn_Pep', 'deg_Pep', 'Ki'],
            'inputs': ['Ind'],
            'equations': [
                'dmRNA = syn_mRNA*Ind/(Ind + Ki) - deg_mRNA*mRNA',
                'dPep  = syn_Pep*mRNA - deg_Pep'
            ],
            'ia':
            'ia_result_bmss01001.csv'
        }
        core_model = mh.make_core_model(**__model__)

        #Assert here
        for key in __model__:
            assert core_model[key] is not None

        #Save for reuse
        core_model_1 = core_model
Example #3
0
    #Read a .ini file and return a core_model
    core_model_1 = mh.from_config(filename)

    for key in core_model_1:
        print(key)
        print(core_model_1[key])
        print()
    '''
    BMSS also provides a constructor that allows you construct core models on the fly.
    
    IMPORTANT: When in doubt, always use the constructor to ensure that your data 
    is formatted correctly.
    '''

    core_model_2 = mh.make_core_model(system_type=core_model_1['system_type'],
                                      states=core_model_1['states'],
                                      parameters=core_model_1['parameters'],
                                      inputs=core_model_1['inputs'],
                                      equations=core_model_1['equations'],
                                      ia=core_model_1['ia'])
    '''
    Once the core model has been created. We can create callable functions that can be used for integration.
    '''
    #Convert the model into code
    #Open the file named TestModel_Dummy.py
    code = mh.model_to_code(
        core_model_1, local=True)  #Don't touch the local argument for now.

    #Note that all functions by this code are standardized to accept inputs in the form y, t, params