slactwin package

slactwin package

copyright:

Copyright (c) 2026 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/slactwin/LICENSE

Subpackages

Submodules

slactwin.config module

Common configuration

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/slactwin/LICENSE

slactwin.config.cfg()[source]

PKDict of common configuration.

db_api

api_uri, auth_secret, tcp_ip, and tcp_port values. PKDict is compatible with pykern.api.server.start, global_resources.Allocator, and db_api_client.

Returns:

configuration values. (Make a copy before modifying.)

Return type:

PKDict

slactwin.config.dev_path(path, **ensure_kwargs)[source]

Prefixes root of the directory for development to path.

Returns:

absolute path with parent directories created

Return type:

py.path

slactwin.const module

Constants

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/slactwin/LICENSE

slactwin.db module

Wraps SQLAlchemy

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/slactwin/LICENSE

slactwin.db.init_module()[source]

slactwin.db_api module

slactwin.db_api_client module

Client to access database over pykern.api

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/slactwin/LICENSE

class slactwin.db_api_client.DbAPIClient(http_config=None)[source]

Bases: Client

See pykern.api.client.Client for how to make API calls.

slactwin.db_api_client.for_job_cmd()[source]

slactwin.db_query module

Database queries

api

run_date min max search start_dt and stop_dt search run value names with min and max list of return value names achirve_path return cols with order by date time

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/slactwin/LICENSE

slactwin.db_query.init_by_db(meta)[source]

slactwin.modules module

Initialize modules once, in prescribed order

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/slactwin/LICENSE

slactwin.modules.import_and_init()[source]

Import modules and call their init_module functions

slactwin.quest module

Context for a web or command line operation (think: request object)

A quest is an instance of API and contains several attributes (Attr):

db

an instance of slactwin.db providing calls to the database

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/slactwin/LICENSE

class slactwin.quest.API(*args, **kwargs)[source]

Bases: API

Superclass of quest entry points

class slactwin.quest.Attr(qcall, **kwargs)[source]

Bases: Attr

Superclass of quest context objects

slactwin.quest.attr_classes()[source]

Classes instantiated automatically on every start

Returns:

class objects

Return type:

tuple

slactwin.quest.import_and_start()[source]

Import slactwin.modules, initialize them, and call start

Returns:

instantiated coroutine

Return type:

asyncio.task

slactwin.quest.register_attr(attr_class)[source]

Called by modules to add their classes to attr_classes

Parameters:

attr_class (class) – implements pykern.quets.Attr

slactwin.quest.start()[source]

Calls pykern.quest.start with attr_classes

Returns:

instantiated coroutine

Return type:

asyncio.task

slactwin.run_importer module

slactwin.simrun_util module

slactwin.slactwin_console module

Front-end command line for slactwin.

See pykern.pkcli for how this module is used.

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/slactwin/LICENSE

slactwin.slactwin_console.main()[source]

slactwin.util module