-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Based on the documentation here, The Simulation
initializer's data
arg accepts an arbitrary dictionary as an input, but will only work if this dictionary is a properly-configured household object. This dictionary (it appears) is only used if the simulation type is household-level, while a macro
-typed sim expects a str | policyengine_core.Dataset | None
-type.
This introduces quite a few drawbacks:
- If
data
can bestr | Dataset | dict[Any, Any] | None
, that's basically every type; we start to lose the advantages of applying typing data
must be handled by both thehousehold
andmacro
calculation processes, meaning both will need to evaluate the existence of any of these types- Passing an arbitrary
dict
will mean we either need manual validation on the household calculation side, or we will create strange breakage patterns for users unacquainted with the schema - The datasets we use are, under the hood, merely an array of households. Let's say we allowed the passage of custom subsets of households for calculation purposes. Because we've tied ourselves to a
dict
, this would require schema migration. I think it'd be better if we just started out using alist[dict]
structure and just confirmed for the time being that these are just single-entry lists.
Metadata
Metadata
Assignees
Labels
No labels