|
HOPS
HOPS class reference
|
Public Member Functions | |
| def | __init__ (self, config) |
| '_ConditionBuilder' | __enter__ (self) |
| def | __exit__ (self, exc_type, exc_val, exc_tb) |
| '_ConditionBuilder' | AND (self) |
| '_ConditionBuilder' | baseline (self, str b) |
| '_ConditionBuilder' | fgroup (self, str fg) |
| '_ConditionBuilder' | NOT (self) |
| '_ConditionBuilder' | OR (self) |
| '_ConditionBuilder' | scan_after (self, str scan) |
| '_ConditionBuilder' | scan_before (self, str scan) |
| '_ConditionBuilder' | scan_between (self, str lo, str hi) |
| '_ConditionBuilder' | source (self, str s) |
| '_ConditionBuilder' | station (self, str s) |
Implements the fluent builder pattern for a fourfit control-DSL condition token list.
Returned by ``cfg.IF()``. Each method appends tokens to an internal list
and returns ``self``, so calls can be chained before the ``with`` statement.
Boolean operators (matching DSL ``and`` / ``or`` / ``not``)::
.AND() -- appends "and"
.OR() -- appends "or"
.NOT() -- appends "not"
Predicate methods (each appends its keyword plus argument tokens)::
.station(s) -- "station" s
.baseline(b) -- "baseline" b
.source(s) -- "source" s
.fgroup(fg) -- "f_group" fg
.scan_before(scan) -- "scan" "<" scan
.scan_after(scan) -- "scan" ">" scan
.scan_between(lo, hi) -- "scan" lo "to" hi
The token list is passed verbatim to ``MHO_ControlConditionEvaluator``, so
the full DSL grammar (including ``not`` and parentheses via raw token
injection) is available. Final token consumption is done on the C++ side.
Note! Nested conditional ``with`` blocks are not allowed. This mirrors the
underlying fourfit control domain-specific-language (DSL), which has
flat conditionals rather than nested ones. To express multiple predicates,
combine them in a single call chain, e.g.::
with cfg.IF().station("G").AND().source("3C279"):
...
rather than nesting::
with cfg.IF().station("G"):
with cfg.IF().source("3C279"): # not allowed
... | def hops_control.config._ConditionBuilder.__init__ | ( | self, | |
| config | |||
| ) |
| '_ConditionBuilder' hops_control.config._ConditionBuilder.__enter__ | ( | self | ) |
| def hops_control.config._ConditionBuilder.__exit__ | ( | self, | |
| exc_type, | |||
| exc_val, | |||
| exc_tb | |||
| ) |
| '_ConditionBuilder' hops_control.config._ConditionBuilder.AND | ( | self | ) |
Append "and" to the condition token list.
| '_ConditionBuilder' hops_control.config._ConditionBuilder.baseline | ( | self, | |
| str | b | ||
| ) |
Append ``baseline <b>`` tokens.
| '_ConditionBuilder' hops_control.config._ConditionBuilder.fgroup | ( | self, | |
| str | fg | ||
| ) |
Append ``f_group <fg>`` tokens.
| '_ConditionBuilder' hops_control.config._ConditionBuilder.NOT | ( | self | ) |
Append "not" to the condition token list.
| '_ConditionBuilder' hops_control.config._ConditionBuilder.OR | ( | self | ) |
Append "or" to the condition token list.
| '_ConditionBuilder' hops_control.config._ConditionBuilder.scan_after | ( | self, | |
| str | scan | ||
| ) |
Append ``scan > <scan>`` tokens.
| '_ConditionBuilder' hops_control.config._ConditionBuilder.scan_before | ( | self, | |
| str | scan | ||
| ) |
Append ``scan < <scan>`` tokens.
| '_ConditionBuilder' hops_control.config._ConditionBuilder.scan_between | ( | self, | |
| str | lo, | ||
| str | hi | ||
| ) |
Append ``scan <lo> to <hi>`` tokens.
| '_ConditionBuilder' hops_control.config._ConditionBuilder.source | ( | self, | |
| str | s | ||
| ) |
Append ``source <s>`` tokens.
| '_ConditionBuilder' hops_control.config._ConditionBuilder.station | ( | self, | |
| str | s | ||
| ) |
Append ``station <s>`` tokens.