{"id":25895398,"url":"https://github.com/diamondlightsource/tickit","last_synced_at":"2025-03-02T22:31:09.568Z","repository":{"id":41416362,"uuid":"406710061","full_name":"DiamondLightSource/tickit","owner":"DiamondLightSource","description":"Event-based hardware simulation framework","archived":false,"fork":false,"pushed_at":"2025-02-03T11:13:12.000Z","size":100491,"stargazers_count":7,"open_issues_count":28,"forks_count":1,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-02-26T09:40:23.678Z","etag":null,"topics":["from-dls-controls"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DiamondLightSource.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":".github/CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-15T10:08:22.000Z","updated_at":"2024-11-08T23:09:16.000Z","dependencies_parsed_at":"2023-11-22T14:47:37.329Z","dependency_job_id":"2c264aeb-673c-4572-93ab-3994c76be913","html_url":"https://github.com/DiamondLightSource/tickit","commit_stats":{"total_commits":183,"total_committers":13,"mean_commits":"14.076923076923077","dds":0.5191256830601093,"last_synced_commit":"7732a1024fb62f0166fbdb32701f1ce9ad97d07c"},"previous_names":["dls-controls/tickit"],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiamondLightSource%2Ftickit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiamondLightSource%2Ftickit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiamondLightSource%2Ftickit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiamondLightSource%2Ftickit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DiamondLightSource","download_url":"https://codeload.github.com/DiamondLightSource/tickit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241582512,"owners_count":19985845,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["from-dls-controls"],"created_at":"2025-03-02T22:31:08.981Z","updated_at":"2025-03-02T22:31:09.553Z","avatar_url":"https://github.com/DiamondLightSource.png","language":"Python","readme":"tickit\n======\n\n|code_ci| |docs_ci| |coverage| |pypi_version| |license|\n\nAn event-based multi-device simulation framework providing configuration and\norchestration of complex multi-device simulations.\n\n============== ==============================================================\nPyPI           ``pip install tickit``\nSource code    https://github.com/dls-controls/tickit\nDocumentation  https://dls-controls.github.io/tickit\nReleases       https://github.com/dls-controls/tickit/releases\n============== ==============================================================\n\nAn example simulation consists of a simple counter and a sink. The counter\nincrements up a given value and then passes this value to a sink.\n\nA simulation is defined using a yaml file, in which the graphing of the required\ncomponents is denoted. This file defines a **Counter** device named **counter** and\na **Sink** device named **counter_sink**. The output **_value** of **counter** is wired\nto the input of **counter_sink**.\n\n.. code-block:: yaml\n\n    - type: examples.devices.counter.Counter\n      name: counter\n      inputs: {}\n    - type: tickit.devices.sink.Sink\n      name: counter_sink\n      inputs:\n        input:\n          component: counter\n          port: _value\n\n\nThis file is executed to run the simulation.\n\n.. code-block:: bash\n\n    python -m tickit all examples/configs/counter.yaml\n\n\nThe simulation will output logs depicting the incrementing of the counter:\n\n.. code-block:: bash\n\n    DEBUG:examples.devices.counter:Counter initialized with value =\u003e 0\n    DEBUG:asyncio:Using selector: EpollSelector\n    DEBUG:tickit.core.management.ticker:Doing tick @ 0\n    DEBUG:tickit.core.components.component:counter got Input(target='counter', time=0, changes=immutables.Map({}))\n    DEBUG:examples.devices.counter:Counter incremented to 1\n    DEBUG:tickit.core.management.schedulers.base:Scheduler got Output(source='counter', time=0, changes=immutables.Map({'value': 1}), call_at=1000000000)\n    DEBUG:tickit.core.management.schedulers.base:Scheduling counter for wakeup at 1000000000\n    DEBUG:tickit.core.components.component:counter_sink got Input(target='counter_sink', time=0, changes=immutables.Map({}))\n    DEBUG:tickit.devices.sink:Sunk {}\n    DEBUG:tickit.core.management.schedulers.base:Scheduler got Output(source='counter_sink', time=0, changes=immutables.Map({}), call_at=None)\n    DEBUG:tickit.core.management.ticker:Doing tick @ 1000000000\n    DEBUG:tickit.core.components.component:counter got Input(target='counter', time=1000000000, changes=immutables.Map({}))\n    DEBUG:examples.devices.counter:Counter incremented to 2\n    DEBUG:tickit.core.management.schedulers.base:Scheduler got Output(source='counter', time=1000000000, changes=immutables.Map({'value': 2}), call_at=2000000000)\n\n\nThe counting device is defined as below. It increments a given value and logs as\nit increments.\n\n.. code-block:: python\n\n    @dataclass\n    class Counter(ComponentConfig):\n        \"\"\"Simple counting device.\"\"\"\n\n        def __call__(self) -\u003e Component:  # noqa: D102\n            return DeviceComponent(\n                name=self.name,\n                device=CounterDevice(),\n                )\n\n    class CounterDevice(Device):\n        \"\"\"A simple device which increments a value.\"\"\"\n\n        class Inputs(TypedDict):\n            ...\n\n        class Outputs(TypedDict):\n            value: int\n\n        def __init__(self, initial_value: int = 0, callback_period: int = int(1e9)) -\u003e None:\n            self._value = initial_value\n            self.callback_period = SimTime(callback_period)\n            LOGGER.debug(f\"Counter initialized with value =\u003e {self._value}\")\n\n        def update(self, time: SimTime, inputs: Inputs) -\u003e DeviceUpdate[Outputs]:\n            self._value = self._value + 1\n            LOGGER.debug(f\"Counter incremented to {self._value}\")\n            return DeviceUpdate(\n                CounterDevice.Outputs(value=self._value),\n                SimTime(time + self.callback_period),\n            )\n\n.. |code_ci| image:: https://github.com/dls-controls/tickit/workflows/Code%20CI/badge.svg?branch=master\n    :target: https://github.com/dls-controls/tickit/actions?query=workflow%3A%22Code+CI%22\n    :alt: Code CI\n\n.. |docs_ci| image:: https://github.com/dls-controls/tickit/workflows/Docs%20CI/badge.svg?branch=master\n    :target: https://github.com/dls-controls/tickit/actions?query=workflow%3A%22Docs+CI%22\n    :alt: Docs CI\n\n.. |coverage| image:: https://codecov.io/gh/dls-controls/tickit/branch/master/graph/badge.svg\n    :target: https://codecov.io/gh/dls-controls/tickit\n    :alt: Test Coverage\n\n.. |pypi_version| image:: https://img.shields.io/pypi/v/tickit.svg\n    :target: https://pypi.org/project/tickit\n    :alt: Latest PyPI version\n\n.. |license| image:: https://img.shields.io/badge/License-Apache%202.0-blue.svg\n    :target: https://opensource.org/licenses/Apache-2.0\n    :alt: Apache License\n\n..\n    Anything below this line is used when viewing README.rst and will be replaced\n    when included in index.rst\n\nSee https://dls-controls.github.io/tickit for more detailed documentation.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiamondlightsource%2Ftickit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiamondlightsource%2Ftickit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiamondlightsource%2Ftickit/lists"}