epymorph.adrio.commuting_flows
Commuters
Bases: FetchADRIO[int64, int64]
Loads data from the US Census Bureau's ACS Commuting Flows product. This product uses answers to the American Community Survey over a five year period to estimate the number of workers aggregated by where they live and where they work. It is a useful estimate of regular commuting activity between locations.
The product aggregates to the US-County-equivalent granularity, so this ADRIO can work with county or state scopes. Because the data are presented using FIPS codes, we must be certain to use a compatible scope -- therefore the data vintage loaded by this ADRIO is based on the geo scope year and not the simulation time frame. Available data years are nominally 2010, 2015, and 2020, however note that the 2020 data year was compiled using 2022 geography.
The result is an NxN matrix of integers, with residency location on the first axis and work location on the second axis.
Parameters:
-
fix_missing
(Fill[int64] | int | Callable[[], int] | Literal[False]
, default:0
) –The method to use to fix missing values. Missing values are common in this dataset, which simply omits pairs of locations for which there were no recorded workers. Therefore the default is to fill with zero.
See Also
The ACS Commuting Flows documentation from the US Census.
result_format
property
result_format: ResultFormat
Information about the expected format of the ADRIO's resulting data.
validate_result
Validates that the result of evaluating the ADRIO adheres to the expected result format.
Parameters:
-
context
(Context
) –The context in which the result has been evaluated.
-
result
(NDArray[ResultT]
) –The result produced by the ADRIO.
Raises:
-
ADRIOProcessingError
–If the result is invalid, indicating the processing logic has a bug.
estimate_data
estimate_data() -> DataEstimate
Estimate the data usage for this ADRIO in the current context.
Returns:
-
DataEstimate
–The estimated data usage for this ADRIO's current context. If a reasonable estimate cannot be made, returns
EmptyDataEstimate
.
validate_context
validate_context(context: Context) -> None
Validates the context before ADRIO evaluation.
Parameters:
-
context
(Context
) –The context to validate.
Raises:
-
ADRIOContextError
–If this ADRIO cannot be evaluated in the given context.