To help with evangelizing, I would like to be able to say, "Writing the script is no more onerous than providing a yaml file containing a list of nodes with configurations and their connections. The script serves double-duty as your configuration file!"
The one hurdle to me saying that with confidence is the awkward pattern:
from ezmsg.my.proc import MyNode, MyNodeSettings
my_node = MyNode(MyNodeSettings(key1=value1, key2=value2))
I think that I can make the argument more convincingly if we didn't also need the MyNodeSettings class. i.e.,
from ezmsg.my.proc import MyNode
my_node = MyNode(key1=value1, key2=value2)
In the end, I'm hoping for something like the following:
import ezmsg.core as ez
from ezmsg.lsl.units import LSLInletUnit
from ezmsg.sigproc.butterworthfilter import ButterworthFilter
# ... other useful Units ...
def main(somepath: str = "/default/path", someswitch: str = "defualt switchvalue") -> None:
comps = {
"EEG_INLET": LSLInletUnit(stream_name="BrainVision RDA", stream_type="EEG"),
"BPFILTER": ButterworthFilter(order=2, cuton=1, cutoff=70),
# ... etc ...
}
ez.run(
components=comps,
connections=(
(comps["EEG_INLET"].OUTPUT_SIGNAL, comps["BPFILTER"].INPUT_SIGNAL),
(comps["BPFILTER"].OUTPUT_SIGNAL, comps["ETC"].INPUT_SIGNAL)
)
)
if __name__ == "__main__":
try:
import typer # instead of argparse
typer.run(main)
except ModuleNotFoundError:
main()
If this can be achieved then it is no more complicated than yaml files I've seen in other BCI frameworks.
To help with evangelizing, I would like to be able to say, "Writing the script is no more onerous than providing a yaml file containing a list of nodes with configurations and their connections. The script serves double-duty as your configuration file!"
The one hurdle to me saying that with confidence is the awkward pattern:
I think that I can make the argument more convincingly if we didn't also need the
MyNodeSettings
class. i.e.,In the end, I'm hoping for something like the following:
If this can be achieved then it is no more complicated than yaml files I've seen in other BCI frameworks.