KarrLab / wc_sim

A multi-algorithmic simulator for whole-cell models
MIT License
6 stars 2 forks source link

Speed up wc_sim tests #52

Closed artgoldberg closed 4 years ago

artgoldberg commented 5 years ago

Currently, the full unittest takes about 30 min. The slowest 10 tests (below) take about 80% of the run-time.

288.07s tests/multialgorithm/test_simulation.py::TestSimulation::test_simulation_model_in_file
252.97s tests/multialgorithm/test_simulation.py::TestSimulation::test_simulate_wo_output_files
214.97s tests/multialgorithm/test_simulation.py::TestSimulation::test_reseed
173.91s tests/multialgorithm/test_multialgorithm_simulation.py::TestRunSSASimulation::test_run_ssa_suite
139.74s tests/multialgorithm/test_dynamic_mass.py::TwoSpeciesTestCase::test_exponentially_increase_to_steady_state_mass_and_descend_to_concentration
99.85s tests/multialgorithm/test_dynamic_mass.py::MetabolismAndGeneExpressionTestCase::test
92.26s tests/examples/test_simulation_run.py::TestSimulationRun::test_simulation_run
76.53s tests/multialgorithm/test_multialgorithm_simulation.py::TestRunSSASimulation::test_run_multiple_ssa_submodels
76.49s tests/multialgorithm/test_simulation.py::TestSimulation::test_simulate
66.26s tests/multialgorithm/test_dynamic_components.py::TestDynamicModel::test_dynamic_model
artgoldberg commented 4 years ago

The full unit test has now sped up to 13 minutes, perhaps because the DE sim has been sped up. These are now the slowest 12 tests:

89.77s call     tests/test_simulation.py::TestSimulation::test_simulate_wo_output_files
88.40s call     tests/test_simulation.py::TestSimulation::test_simulation_model_in_file
85.54s call     tests/test_simulation.py::TestSimulation::test_reseed
60.88s call     tests/testing/test_make_models.py::TestMakeModels::test_make_test_model
57.97s call     tests/test_dynamic_mass.py::TwoSpeciesTestCase::test_exponentially_increase_to_steady_state_mass_and_descend_to_concentration
50.56s call     tests/test_dynamic_mass.py::MetabolismAndGeneExpressionTestCase::test
35.25s call     tests/test_simulation.py::TestSimulation::test_simulate
32.05s call     tests/examples/test_simulation_run.py::TestSimulationRun::test_simulation_run
17.93s call     tests/test_multialgorithm_simulation.py::TestRunSSASimulation::test_runtime_errors
16.30s call     tests/test_dynamic_mass.py::TwoSpeciesTestCase::test_exponentially_increase_to_steady_state_count_and_mass
12.97s call     tests/test_multialgorithm_simulation.py::TestMultialgorithmSimulationDynamically::test_closed_form_models
11.79s call     tests/test_wc_lang_files_are_valid.py::ValidateWcLangFilesTestCase::test
artgoldberg commented 4 years ago

Fast enough now.