Closed ethho closed 3 years ago
Merged much of #24
This PR provides a script (scripts/20210512_partition_model.py
) that constructs and runs two xsimlab.Model
s with contact partitioning. All benchmarks performed serially on MacBook Pro. poetry install
first to set up test env.
Partition2Contact
process to transform travel
and contacts
dataframes (stored as CSV files) into the contact_xr
DataArray.
$ time PYTHONPATH='.' poetry run python scripts/20210512_partition_model.py --func-name partition_from_csv
# ...
50.24s user 14.34s system 99% cpu 1:04.60 total
partition_from_nc
model described below.NC2Contact
to load a precomputed contact_xr
DataArray from a NetCDF file (example at tests/data/20200311_contact_matrix.nc
).
$ time PYTHONPATH='.' poetry run python scripts/20210512_partition_model.py --func-name partition_from_nc
# ...
6.19s user 1.26s system 82% cpu 9.037 total
Fixes #20.