Skip to content

Commit

Permalink
measure performance of dynamic_tests and speed up one_rxn_exponential…
Browse files Browse the repository at this point in the history
….xlsx
  • Loading branch information
artgoldberg committed Dec 24, 2019
1 parent 37dc91a commit 4b32dec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Binary file modified tests/fixtures/dynamic_tests/one_rxn_exponential.xlsx
Binary file not shown.
8 changes: 6 additions & 2 deletions wc_sim/testing/utils.py
Expand Up @@ -7,12 +7,13 @@
"""

from collections import defaultdict
import math
from matplotlib import pyplot
from matplotlib.backends.backend_pdf import PdfPages
import math
import numpy as np
import os
import tempfile
import time

from wc_lang import Model
from wc_lang.io import Reader
Expand Down Expand Up @@ -290,7 +291,6 @@ def verify_independently_solved_model(test_case, model_filename, results_dir):
if os.path.isfile(file_path):
os.unlink(file_path)

print(f'testing {os.path.basename(model_filename)} with {integration_framework}')
model = read_model_for_test(model_filename, integration_framework=f'WC:{integration_framework}')

# simulate model
Expand All @@ -300,7 +300,11 @@ def verify_independently_solved_model(test_case, model_filename, results_dir):
checkpoint_period=checkpoint_period,
ode_time_step=1.)
simulation = Simulation(model)
start_time = time.perf_counter()
_, results_dir = simulation.run(end_time=end_time, **args)
elapsed_rt = time.perf_counter() - start_time
print(f'ran {os.path.basename(model_filename)} with {integration_framework} in '
f'{elapsed_rt:.2e} (sec)')

# test dynamics
# read expected trajectories
Expand Down

0 comments on commit 4b32dec

Please sign in to comment.