one_at_a_time
dsa.one_at_a_time(base, ranges)Vary each parameter in ranges in turn, holding the rest at base.
The union of one-way sweeps, with the base case included once as its own scenario. This is the design a tornado diagram reads.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| base | pd.Series | Point values of every parameter, indexed by name. | required |
| ranges | Mapping[str, Sequence[float]] |
Maps a parameter name to the values to sweep it over (a (low, high) pair or any longer sequence). |
required |
Returns
| Name | Type | Description |
|---|---|---|
| Design | A (design, descriptor) pair with 1 + sum(len(v)) scenarios: the |
|
| Design | base case first, then each parameter’s sweep. The descriptor names the | |
| Design | single parameter each scenario varies and its value. |
Example
import pandas as pd from heormodel.dsa import one_at_a_time base = pd.Series({“a”: 1.0, “b”: 2.0}) design, descriptor = one_at_a_time(base, {“a”: (0.5, 1.5), “b”: (1.0, 3.0)}) len(design) 5 descriptor[“scenario”].tolist() [‘(base)’, ‘a=0.5’, ‘a=1.5’, ‘b=1’, ‘b=3’]