To represent:
from op_system import normalize_rhs
spec = {
"kind": "expr",
"state": ["S", "I"],
"equations": {"S": "-beta * S * I", "I": "beta * S * I - gamma * I"},
"axes": [
{"name": "space", "type": "continuous", "domain": {"lb": 0, "ub": 10}, "size": 5},
],
"mixing": [
{"name": "K", "axes": ["space", "space"], "form": "gaussian", "params": {"sigma": 1.5, "scale": 1.0}},
],
}
rhs = normalize_rhs(spec)
# Access normalized metadata
axes_meta = rhs.meta["axes"] # List of normalized axis definitions
mixing_meta = rhs.meta["mixing"] # List of normalized mixing kernels
Need a Mixing pydantic model that is a discriminated union over:
|
_ALLOWED_MIXING_FORMS: dict[str, tuple[str, ...]] = { |
|
"erfc": ("scale", "sigma"), |
|
"gaussian": ("scale", "sigma"), |
|
"exponential": ("scale", "lambda"), |
|
"gamma": ("scale", "k", "theta"), |
|
"power_law": ("scale", "sigma", "p"), |
|
"custom_value": (), |
|
} |
To represent:
Need a
Mixingpydantic model that is a discriminated union over:op_system/src/op_system/specs.py
Lines 53 to 60 in bb41b22