File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ from __future__ import annotations
2+
3+ import activitysim .abm # register components
4+ from activitysim .core import timing , workflow
5+
6+
7+ def test_expression_profiling ():
8+ state = workflow .create_example ("prototype_mtc" , temp = True )
9+
10+ state .settings .expression_profile = True
11+ state .run .all ()
12+
13+ # generate a summary of slower expression evaluation times
14+ # across all models and write to a file
15+ analyze = timing .AnalyzeEvalTiming (state )
16+ analyze .component_report (style = state .settings .expression_profile_style )
17+ analyze .subcomponent_report (style = state .settings .expression_profile_style )
18+
19+ workdir = state .filesystem .working_dir
20+ outdir = workdir .joinpath (state .filesystem .output_dir )
21+ assert outdir .joinpath (
22+ "log/expr-performance/expression-timing-subcomponents.html"
23+ ).exists ()
24+ assert outdir .joinpath (
25+ "log/expr-performance/expression-timing-components.html"
26+ ).exists ()
27+ assert outdir .joinpath (
28+ "log/expr-performance/tour_mode_choice.work.simple_simulate.eval_nl.eval_utils.log"
29+ ).exists ()
You can’t perform that action at this time.
0 commit comments