3.1. wc_test package

3.1.1. Submodules

3.1.2. wc_test.core module

Methods for verifying models

Author:Balazs Szigeti <balazs.szigeti@mssm.edu>
Date:2018-05-10
Copyright:2018, Karr Lab
License:MIT

TODO: - all reaction methods: currently len(rate_laws)=1 assumed, generalize - mod_parameters values are INTs in perturb_methods, but LISTs for sim_scan methods, synchornize

class wc_test.core.DynamicTestCase(model, checkpoint_period=None, _results_dir=None)[source]

Bases: wc_test.core.ModelTestCase

Class to test dynamic properties of models

model[source]

model or path to the model file

Type:wc_lang.core.Model
checkpoint_period[source]

interval at which results are saved

Type:int
results_dir[source]

path to directory where results will be stored

Type:str
avg_conc_runs(n, target_specie_ids, end_time)[source]
avg_conc_time(target_specie_ids, end_time)[source]
delta_conc(species, run_results)[source]
get_growth_rate(end_time)[source]
setUp()[source]

Hook method for setting up the test fixture before exercising it.

sim_scan_parameters(mod_parameters, end_time)[source]
sim_scan_reactions(mod_reactions, end_time)[source]
sim_scan_species(mod_species, end_time)[source]
simulate(end_time, n=None)[source]
tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

class wc_test.core.ModelTestCase(model, checkpoint_period=None, _results_dir=None)[source]

Bases: unittest.case.TestCase

Base classe for WC model testing classes

get_reaction(reaction_id)[source]
get_specie(specie_id)[source]
perturb_parameters(mod_parameters)[source]
perturb_reactions(mod_reactions)[source]
perturb_species(mod_species)[source]
select_submodels(mod_submodels)[source]

Turn off all submodels, except the ones listed in submodel_ids

class wc_test.core.StaticTestCase(model, checkpoint_period=None, _results_dir=None)[source]

Bases: wc_test.core.ModelTestCase

Test case for static properties of models

check_init_compartment_volumes(bounds)[source]
check_init_reactions_rates(bounds)[source]
check_init_species_types_charges(bounds)[source]
check_init_species_types_weights(bounds)[source]
is_charge_balanced(reaction_id)[source]

Testing whether a reaction is charge balanced. Retruns boolean True if it is, False otherwise

Parameters:reaction (wc_lang.core.Reaction) – reaction
is_mass_balanced(reaction_id)[source]

Testing whether a reaction is mass balanced. Retruns boolean True if it is, False otherwise

Parameters:reaction (wc_lang.core.Reaction) – reaction
reactions_charge_balanced()[source]

Testing whether reactions in the model are charge balanced.

Parameters:model (wc_lang.core.Model) – model
Returns:keys are reaction.ids; value is True if reaction is charge balanced, False otherwise
Return type:charge_balanced (dict)
reactions_mass_balanced()[source]

Testing whether reactions in the model are mass balanced.

Parameters:model (wc_lang.core.Model) – model
Returns:keys are reaction.ids; value is True if reaction is mass balanced, False otherwise
Return type:mass_balanced (dict)

3.1.3. Module contents