episimlab.partition package
Submodules
episimlab.partition.contacts module
- class episimlab.partition.contacts.ContactsFromCSV(*, contacts_fp)
Bases:
object
Load baseline contact patterns from a CSV file to a contacts DataArray.
- contacts_fp
attr.Attribute
No description given
Variable properties:
type :
variable
intent :
in
dimensions : ()
- contacts
attr.Attribute
No description given
Variable properties:
type :
global
intent :
out
global name : contacts
- TAGS = ('partition',)
- get_contacts_da(df: pandas.core.frame.DataFrame) xarray.core.dataarray.DataArray
- get_contacts_df()
- initialize()
- contacts_fp
episimlab.partition.partition module
- class episimlab.partition.partition.Partition(*, travel_pat, contacts, coords={})
Bases:
object
Given travel patterns travel_pat and baseline contact rates contacts, estimate the pairwise contact probabilities phi from contact partitioning.
- phi
attr.Attribute
No description given
Variable properties:
type :
global
intent :
out
global name : phi
- travel_pat
attr.Attribute
Mobility/travel patterns
Variable properties:
type :
variable
intent :
in
global name : travel_pat
dimensions : (‘vertex0’, ‘vertex1’, ‘age0’)
- contacts
attr.Attribute
Pairwise baseline contact patterns
Variable properties:
type :
variable
intent :
in
global name : contacts
dimensions : (‘age0’, ‘age1’)
- _coords
attr.Attribute
Mapping of all variables that belong to group ‘coords’
Variable properties:
type :
group_dict
intent :
in
default value : {}
- CONTACTS_DIMS = ('age0', 'age1')
- TAGS = ('partition',)
- TRAVEL_PAT_DIMS = ('vertex0', 'vertex1', 'age0')
- property contacts_coords
- property contacts_dims
- property coords
- get_c_ijk(tp: xarray.core.dataarray.DataArray) xarray.core.dataarray.DataArray
- property phi_coords
- property phi_dims
Overwrite this method if using different dims than BaseFOI.PHI_DIMS
- run_step(step_delta)
- property travel_pat_coords
- property travel_pat_dims
- unsuffixed_coords(dims)
- phi
episimlab.partition.travel_pat module
- class episimlab.partition.travel_pat.TravelPatFromCSV(*, travel_pat_fp, dask_chunks=None)
Bases:
object
Load travel patterns from a CSV file to a travel_pat DataArray.
- travel_pat_fp
attr.Attribute
Path to a csv file containing travel patterns
Variable properties:
type :
variable
intent :
in
dimensions : ()
static :
True
- travel_pat
attr.Attribute
No description given
Variable properties:
type :
global
intent :
out
global name : travel_pat
- dask_chunks
attr.Attribute
Number of chunks in which to divide the travel_pat dataarray using dask. none or 0 will skip dask chunking.
Variable properties:
type :
variable
intent :
in
global name : dask_chunks
dimensions : ()
default value : None
static :
True
- RAISE_NULL = False
- TAGS = ('partition', 'dependency::dask')
- get_date_mask(date: pandas.core.series.Series, step_start, step_end) pandas.core.series.Series
Given timestamps step_start and step_end, returns a mask for the travel dataframe. Special handling for NaT and cases where step_start equals step_end.
- get_travel_da(df: pandas.core.frame.DataFrame, chunks: Optional[int] = None) xarray.core.dataarray.DataArray
Convert a DataFrame into a single DataArray, using Dask to chunk into chunk divisions if chunk is not None.
- get_travel_df() pandas.core.frame.DataFrame
Load travel patterns from a CSV file and run preprocessing.
- initialize()
- run_step(step_start, step_end)
- travel_pat_fp
- class episimlab.partition.travel_pat.TravelPatRepeatDaily(*, travel_pat_fp, dask_chunks=None)
Bases:
episimlab.partition.travel_pat.TravelPatFromCSV
Example process that sets travel_pat based on a travel patterns CSV with data for only one date. This effectively sets travel_pat to be the same for the entire simulation.
- travel_pat_fp
attr.Attribute
Path to a csv file containing travel patterns
Variable properties:
type :
variable
intent :
in
dimensions : ()
static :
True
- travel_pat
attr.Attribute
No description given
Variable properties:
type :
global
intent :
out
global name : travel_pat
- dask_chunks
attr.Attribute
Number of chunks in which to divide the travel_pat dataarray using dask. none or 0 will skip dask chunking.
Variable properties:
type :
variable
intent :
in
global name : dask_chunks
dimensions : ()
default value : None
static :
True
- TAGS = ('example', 'partition', 'dependency::dask')
- run_step(step_start, step_end)
- travel_pat_fp