def with_prof

cswap-bend-cli@0.1.0.0 · profile.bend:229

import cswap-bend-cli@0.1.0.0/profile.bend as Profile
import Base
import cswap-bend-cli@0.1.0.0/daemon/config.bend as Cfg

229# The autoswitch settings with the profile's keys laid over them.
230def with_prof(+c: Cfg.Cfg, +p: Prof) -> Cfg.Cfg:
231  match c p:
232    case Cfg.Cfg{th, iv, cd, hy, st, ia, ut, ms} Prof{n, algo, pth, pms, pcd, piv}:
233      Cfg.Cfg{over_thr(pth, th), over_secs(piv, iv, 15, 3600), over_secs(pcd, cd, 0, 86400), hy, strat_of(algo, st), ia, ut, Cfg.over_models(pms, ms)}

Uses (6)

Used by (4)