ActivitySim / activitysim

An Open Platform for Activity-Based Travel Modeling
https://activitysim.github.io
BSD 3-Clause "New" or "Revised" License
190 stars 99 forks source link

Revised structure for writing example tests #848

Open jpn-- opened 5 months ago

jpn-- commented 5 months ago

I am proposing a new structure for writing example tests.

Currently, we write most examples using layered config directories. For example, here we look for settings in three different directories:

https://github.com/ActivitySim/activitysim/blob/739c2e428856eb401b42e95cedf9fd88bfcb02c6/activitysim/examples/prototype_mtc/test/test_mtc.py#L34-L39

As we have more complicated testing permutations, these can get messy and hard to maintain:

https://github.com/ActivitySim/activitysim/blob/739c2e428856eb401b42e95cedf9fd88bfcb02c6/activitysim/examples/prototype_mtc_extended/test/test_mtc_extended.py#L86-L137

I propose a more direct structure for testing, where there are only a very limited number of "main" config directories, and various permutations for testing are not written out in more config directories, but instead manipulated directly in the Python of the test.

https://github.com/camsys/sandag-abm3-example/blob/6092354290a45aa4b771a8c18910b8bb4cd952de/test/test_sandag_abm3.py#L217-L239

cc @i-am-sijia @dhensle