Closed EPajares closed 1 year ago
I think the config is better to be like:
[
{
"category": "supermarket",
"max_traveltime":10,
"sensitivity":250000,
"weight":1
},
{
"category": "tram_stop",
"max_traveltime":15,
"sensitivity":250000,
"weight":1
}
]
Then we can use a general Config
schema for them. And validate based on term category
.
Of course this can have a con that the input can have multiple values for single category :thinking:
Hard decision. I think your idea makes sense. But maybe we could make sure that the category is only used once. So we avoid that the user defines two configs for one category.
So we can create a Pydantic model per heat-map type (closest, gravity, etc.) and based on type, validate each configurations against it's related Pydantic class.
Sounds great
Implemented (Initiated) for gravity and closest: 5c9e5cec01b541d384ae1188104294ed1f8f3a8e We need to add others as well.
I think it's also good to use some type key
for poi/aoi/...
This approach makes code cleaner for validation.
{
"supermarket":{
"max_traveltime": 5,
"weight": 1,
"type": "aoi"
},
"park":{
"max_traveltime": 10,
"weight": 1
"type": "poi"
}
}
Of course this also has cons 🤔 As we may have different pydantic class for poi or aoi But we can also make fields optional and then do validation based on type.
I agree. Or should we make poi/aoi as parent key like:
{ "aoi": {} "poi": {} }
This task/issue closed on Tue Jun 06 2023 ✅
Goal of this issue
For each calculation types for heat-maps (#1783), we need different settings. For example for
modified_gaussian_per_grid()
, we needsensitivity
andcutoff
. We need to check these settings.Resources
Examples of configs: Config for gravity:
Config for closest:
Deliverables
Branch to derive