slicops.pkcli package

Base class and common routines for other pkcli’s to inherit/use.

copyright:

Copyright (c) 2024 The Board of Trustees of the Leland Stanford Junior University, through SLAC National Accelerator Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All Rights Reserved.

license:

http://github.com/slaclab/slicops/LICENSE

class slicops.pkcli.CommandsBase[source]

Bases: object

Common functionality between all pkclis

quest_start()[source]

Begin a request which wraps all APIs.

Submodules

slicops.pkcli.device_db module

Interact with device_db

copyright:

Copyright (c) 2025 The Board of Trustees of the Leland Stanford Junior University, through SLAC National Accelerator Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All Rights Reserved.

license:

http://github.com/slaclab/slicops/LICENSE

slicops.pkcli.device_db.query(func_name, *args)[source]

Call func_name in slicops.device_db

Parameters:
  • func_name (str) – valid function

  • args (str) – passed verbatim to function

Returns:

result of function

Return type:

object

slicops.pkcli.epics module

SlicOps EPICS utilities.

copyright:

Copyright (c) 2024 The Board of Trustees of the Leland Stanford Junior University, through SLAC National Accelerator Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All Rights Reserved.

license:

http://github.com/slaclab/slicops/LICENSE

slicops.pkcli.epics.init_sim_detector()[source]

Initialize the ADSimDetector module with useful default values.

slicops.pkcli.epics.sim_detector(ioc_sim_detector_dir=None)[source]

Run an EPICS IOC Sim Detector

Parameters:

ioc_sim_detector_dir (str, optional) – Directory containing EPICS code for iocSimDetector

slicops.pkcli.fractals module

Generate fractals controlled by a yaml_db

copyright:

Copyright (c) 2024 The Board of Trustees of the Leland Stanford Junior University, through SLAC National Accelerator Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All Rights Reserved.

license:

http://github.com/slaclab/slicops/LICENSE

slicops.pkcli.fractals.forever(period)[source]
slicops.pkcli.fractals.once()[source]
slicops.pkcli.fractals.path()[source]

slicops.pkcli.ioc module

IOC configured from a YAML file

copyright:

Copyright (c) 2024 The Board of Trustees of the Leland Stanford Junior University, through SLAC National Accelerator Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All Rights Reserved.

license:

http://github.com/slaclab/slicops/LICENSE

slicops.pkcli.ioc.run(init_yaml, db_yaml=None)[source]

slicops.pkcli.lcls_elements_csv module

Parse lcls_tools/common/devices/yaml/lcls_elements.csv for slicops.device_sql_db.recreate

TODO(robnagler): only includes what is used in slicops and slactwin at the moment

TODO(robnagler): uses a cached meme-pvs.txt.xz which is created by meme.names.list_pvs("%", sort_by="z")

TODO(robnagler): add machine and area_to_machine, beam_path_to_machine

copyright:

Copyright (c) 2025 The Board of Trustees of the Leland Stanford Junior University, through SLAC National Accelerator Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All Rights Reserved.

license:

http://github.com/slaclab/slicops/LICENSE

slicops.pkcli.lcls_elements_csv.create_sql_db(csv_path, pvs_path)[source]

Convert device yaml file to db

Parameters:
  • csv_path (str or path-like) – path to lcls_elements.csv [see Parser]

  • pvs_path (str or path-like) – path to pvs.txt.xz [see Parser]

Returns:

db stats, e.g. number of devices

Return type:

PKDict

slicops.pkcli.lcls_elements_csv.save_pvs()[source]

Converts all meme.names.list_pvs into pvs.txt.gz resource

For use with create_sql_db, pipe output to xz -9 then to file.

Returns:

joined list of pvs

Return type:

str

slicops.pkcli.lcls_tools_yaml module

Parse lcls_tools/common/devices/yaml/*.yaml for slicops.device_sql_db.recreate

TODO(robnagler): document, add machine and area_to_machine, beam_path_to_machine

copyright:

Copyright (c) 2024 The Board of Trustees of the Leland Stanford Junior University, through SLAC National Accelerator Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All Rights Reserved.

license:

http://github.com/slaclab/slicops/LICENSE

slicops.pkcli.lcls_tools_yaml.create_sql_db()[source]

Convert device yaml file to db

slicops.pkcli.service module

Start SlicOps services.

copyright:

Copyright (c) 2024 The Board of Trustees of the Leland Stanford Junior University, through SLAC National Accelerator Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All Rights Reserved.

license:

http://github.com/slaclab/slicops/LICENSE

class slicops.pkcli.service.Commands[source]

Bases: CommandsBase

ui_api(tcp_port=None, prod=False)[source]

Start UI API web server.

This web server provides a friendly and secure API for SlicOps apps.

Parameters:

prod (bool) – run in production mode (serve Vue statically)

slicops.pkcli.yaml_db module

Read/write a YAML file atomically

copyright:

Copyright (c) 2024 The Board of Trustees of the Leland Stanford Junior University, through SLAC National Accelerator Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All Rights Reserved.

license:

http://github.com/slaclab/slicops/LICENSE

slicops.pkcli.yaml_db.path(base)[source]
slicops.pkcli.yaml_db.read(base)[source]

Convert the db into PKDict.

If not found, returns empty PKDict() with a warning.

Returns:

values in the db

Return type:

PKDict

slicops.pkcli.yaml_db.write(base, *key_value_pairs)[source]

Update db with key=value arguments or single dict as arg

Parameters:

key_value_pairs (str) – list of key_value_pairs or single dict