Skip to main content

Python implementation of the SiLA 2 standard for lab automation

Project description

coverage report License: MIT

:warning: On 2021-11-15, this project replaced a legacy Python implementation of SiLA 2. That project can be found here and is still installable via pip install sila2lib.

SiLA 2 Python Implementation

Getting started

Installation

Use pip install sila2 to install the library.

On Raspberry Pi systems, you might encounter ImportErrors when using the library. Use the following commands to fix them:

  • Error: ImportError: libxslt.so.1: cannot open shared object file: No such file or directory
    • Solution: Uninstall lxml and reinstall it with apt
      • pip uninstall -y lxml
      • sudo apt install python3-lxml
  • Error: ImportError: /home/pi/.local/.../cygrpc.cpython-39-arm-linux-gnueabihf.so: undefined symbol: __atomic_exchange_8
    • Solution: Uninstall grpcio and grpcio-tools and reinstall them with apt
      • pip uninstall -y grpcio grpcio-tools
      • sudo apt install python3-grpcio python3-grpc-tools

Guides

Guides on SiLA server generation, feature implementation, and usage of SiLA clients can be found in the docs directory.

Example

The directory example_server contains an example SiLA server application. example_client_scripts contains multiple SiLA client programs that interact with the example server.

Implementation status

Missing parts from SiLA 2 specification

  • Encryption
    • currently, communication is not encrypted
  • Lifetime handling for binary transfer
    • currently, large binaries are only deleted on request
  • Lifetime handling for observable commands
    • currently, no lifetime is reported and execution UUIDs stay valid indefinitely
  • Server-initiated connection (SiLA 2 v1.1)
    • currently, only client-initiated connections are supported

Deviations from SiLA 2 specification

Code generator

  • Generates submodules from feature definitions (.sila.xml files)
    • feature implementation abstract base class
    • client typing stub (.pyi file)
  • Does not yet support the Structure and Custom data types (fallback to typing.Any)
  • Does not yet generate full docstrings (e.g. constraints are missing)

Contributing

Contributions in the form of issues, feature requests and merge requests are welcome. To reduce duplicate work, please create an issue and state that you are working on it before you spend significant time on writing code for a merge request.

Development setup

Clone the repository, initialize the submodule and install it as editable, including the development requirements:

git clone https://gitlab.com/sila2/sila_python
cd sila2
git submodule update --init --recursive
pip install -e .[dev]

Development environment

This project uses black as code formatter and isort for sorting imports.

flake8 is used to check for various code problems. pytest is used for testing, pytest-cov for measuring code coverage.

To apply formatting, the script run-formatting is provided with this repository. For testing, use run-checks afterwards.

To apply formatting and run a fast subset of the full test suite before each commit, link the script pre-commit to .git/hooks/pre-commit: ln -s ./pre-commit ./.git/hooks/pre-commit

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sila2-0.3.4.tar.gz (73.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sila2-0.3.4-py3-none-any.whl (149.2 kB view details)

Uploaded Python 3

File details

Details for the file sila2-0.3.4.tar.gz.

File metadata

  • Download URL: sila2-0.3.4.tar.gz
  • Upload date:
  • Size: 73.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.6.3 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.11

File hashes

Hashes for sila2-0.3.4.tar.gz
Algorithm Hash digest
SHA256 7f57007b8d910d53c826d3464660a8f5424c40cfba0058231161705f8502db6d
MD5 f180e63a177287361bcf22ff1ea269f6
BLAKE2b-256 47805ae9a6a738febe035d993f69b3a4a53d11c1cec610844476d507dc9d568d

See more details on using hashes here.

File details

Details for the file sila2-0.3.4-py3-none-any.whl.

File metadata

  • Download URL: sila2-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 149.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.6.3 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.11

File hashes

Hashes for sila2-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0d27b64e4566e4ba4f87229cd8884e262e00141d713da252d8ce31afea0c1c8b
MD5 c471a2e4d0ae65ba51cc1e4d4a028fcd
BLAKE2b-256 3ae721fa24a8bb3c7eb282f796e171d49bc5922fc43301a3d958a56164f8aaaa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page