capacity_convention¶
capacity_convention
¶
capacity_convention(info: DataFrame, *, nan_tau: float = 0.5, a3_ratio: float = A3_RATIO_THRESHOLD, per_vehicle_max: float = 2.0, n_min: int = 20) -> Series
Label each system's capacity-field publication convention.
The GBFS capacity field carries mutually-incompatible semantics across
operators (Fossé & Pallares). This assigns each system one label, in priority
order:
"null": at leastnan_tauof stations declareNaN(A7 regime)."placeholder": a single constant non-zero capacity (A2)."conditional_profile": over-capacity ratio> a3_ratio(A3)."per_vehicle": a small positive mean (<= per_vehicle_max), a per-vehicle estimate rather than a dock count."physical": a genuine physical dock count.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
info
|
DataFrame
|
Requires |
required |
nan_tau
|
float
|
Thresholds for the null, over-capacity and per-vehicle regimes. |
0.5
|
a3_ratio
|
float
|
Thresholds for the null, over-capacity and per-vehicle regimes. |
0.5
|
per_vehicle_max
|
float
|
Thresholds for the null, over-capacity and per-vehicle regimes. |
0.5
|
n_min
|
int
|
Minimum stations for the over-capacity ratio to apply. |
20
|
Returns:
| Type | Description |
|---|---|
Series
|
The convention label indexed by |
See Also
overcapacity_ratio : The A3 ratio behind the conditional_profile label.
reclassify_overcapacity : Act on the over-capacity systems this labels.
audit_static : The A1-A7 audit these conventions help interpret.
Examples:
>>> import pandas as pd
>>> info = pd.DataFrame({
... "system_id": "p", "station_id": [str(i) for i in range(20)],
... "capacity": [12.0] + [0.0] * 19,
... })
>>> capacity_convention(info)["p"]
'conditional_profile'