You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lume-epics is a dedicated API for serving LUME model variables with EPICS. Configurations for LUME model variables can be found in lume-model.
Installation
Lume-epics may be installed via conda on the conda-forge channel:
$ conda install lume-epics -c conda-forge
Alternatively, you may install from the GitHub repository using:
$ pip install https://github.com/slaclab/lume-epics.git
Server
The EPICS server requires a model class, model_kwargs, and an epics configuration for instantiation. Once instantiated, the server is started using the Server.start() method, which has an optional monitor keyword argument, monitor, that controls thread execution. When monitor=True, the server is run in the main thread and may be stopped using keyboard interrupt (Ctr+C). If using monitor=False, the server can be stopped manually using the Server.stop() method.
fromlume_epics.epics_serverimportServerfromlume_model.utilsimportvariables_from_yamlfromlume_epics.utilsimportconfig_from_yamlimportosfromexamples.modelimportDemoModelimportloggingif__name__=="__main__":
withopen("examples/files/demo_config.yml", "r") asf:
input_variables, output_variables=variables_from_yaml(f)
withopen("examples/files/epics_config.yml", "r") asf:
epics_config=config_from_yaml(f)
server=Server(
DemoModel,
epics_config,
model_kwargs={
"input_variables": input_variables,
"output_variables": output_variables,
},
)
# monitor = False does not loop in main threadserver.start(monitor=True)
Compatable models
See docs for notes on serving online models with lume-epics.
About
Lume-epics is a dedicated API for serving LUME model variables with EPICS.