This release is a pre-release and may not be stable for production use.
p4pillon
Extensions to the p4p Server API, to aid in creation and managment of pvAccess servers.
Installation
p4pillon may be installed via
$ pip install p4pillon
Python Version
Requires Python 3.10 or later. These extensions make extensive use of typing and other recent Python features.
Documentation
Documentation intended for developers using the library is available here.
Extensions
A brief overview of the components of the library.
NT Logic
[!CAUTION] This is not an alternative to the Process Database implemented in a traditional EPICS IOC. Although the Normative Type logic is implemented, it does not implement locking. This means that in the case of multiple simultaneous updates it is possible for a PV to become inconsistent. At this time we suggest that the NT Logic code be used for rapid prototyping and systems where consistency/reliability are not critical.
The SharedNT class, derived from p4p's SharedPV class, automatically implements the logic of Normative Types (at this time NTScalars and NTScalarArrays) using handlers. It is possible, with the CompositeHandler class to override this behaviour, including diabling or replacing Normative Type logic.
CompositeHandler and Rules
p4p only allows a single Handler class to be associated with a SharedPV. To make it easier to combine or share handlers from multiple sources a CompositeHandler class is provided. The supplied CompositeHandler is derived from the p4p Handler. It also derives from an OrderedDict to store componenent Handlers (also standard p4p Handlers). The CompositeHandler calls component handlers in the specified order, and allows the component Handlers to be accessed through the OrderedDict interface.
[!NOTE]
CompositeHandleris designed to work with theHandlerclass, and is not designed to work with theHandlerdecorators.
Rules are component Handlers used with the CompositeHandler used to implement the NT Logic discussed above. The Rule class is derived from the Handler class but implements a commonly encountered flow from put() (for identification and authorisation), to put() (for operations that require comparison between the current state of the PV and its possible future state), and open() (for operations that only need consider the possible future state of the PV).
PVRecipe and Server
PVRecipe is a factory method used to simplify creation of SharedNT objects, i.e. PVs that implement Normative Type logic. It may be used in conjunction with the p4pillon Server class to simplify management of event loops and PV lifecycle.
The config_reader parses a YAML file in order to construct SharedNT PVs which are managed by the p4pillon Server. This is the simplest way to create and configure
Testing
Install the extra dependencies required for testing and development using uv sync (this installs the dev dependency group, which includes test and dist). To install only the test group, use uv sync --group test.
To run tests invoke pytest:
$ uv run pytest
or to run all tests and output a coverage report:
$ uv run coverage run -m pytest
$ uv run coverage report
Linting and Formatting
This repository's CI/CD pipeling (using GitHub Actions) checks that source code meets PEP 8, and other more stringent, coding standards. This uses the ruff linter and code formatter. It is included in the test dependency group (see above) and may be manually invoked:
$ uv run ruff check --fix
$ uv run ruff format
Releases
The release process requires use of the dist dependency group, which may be installed with uv sync --group dist. A build may then be triggered with python -m build. Alternatively, use:
$ uv run --group=dist python -m build
Publication to either PyPi or TestPyPI is performed automatically via CI/CD (i.e. GitHub Actions) and is driven by tags. Any commit intended for package publication must be tagged with a unique tag, and the semantic version must be greater than any existing tag.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file p4pillon-0.2.0rc2.tar.gz.
File metadata
- Download URL: p4pillon-0.2.0rc2.tar.gz
- Upload date:
- Size: 213.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
01eccf9bb636dc514fec249e14e439d12b7ef32de00c9d1583a19bee5b6ada87
|
|
| MD5 |
349298b50274f2fa4a1fc9c096354fe0
|
|
| BLAKE2b-256 |
9652b1f2b84680a5c19b5af4b1f853b107d842794cdd7993ed2cf5513e32d8cb
|
Provenance
The following attestation bundles were made for p4pillon-0.2.0rc2.tar.gz:
Publisher:
build.yaml on ISISNeutronMuon/p4pillon
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
p4pillon-0.2.0rc2.tar.gz -
Subject digest:
01eccf9bb636dc514fec249e14e439d12b7ef32de00c9d1583a19bee5b6ada87 - Sigstore transparency entry: 2333956191
- Sigstore integration time:
-
Permalink:
ISISNeutronMuon/p4pillon@0026a60a1e09a02c4074b4af7984f1731d67e57b -
Branch / Tag:
refs/tags/0.2.0rc2 - Owner: https://github.com/ISISNeutronMuon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yaml@0026a60a1e09a02c4074b4af7984f1731d67e57b -
Trigger Event:
push
-
Statement type:
File details
Details for the file p4pillon-0.2.0rc2-py3-none-any.whl.
File metadata
- Download URL: p4pillon-0.2.0rc2-py3-none-any.whl
- Upload date:
- Size: 73.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0361a5347fdd8aa05ca80ee2e38ef46e58a1fd0c05bb2cd24149658dd1b8c2cb
|
|
| MD5 |
a3cd29242861a64f03233d966674a5ad
|
|
| BLAKE2b-256 |
8cd89c1912173ff1374619eda7471f36ee9f4e6428c589ac9729e1850ae0d404
|
Provenance
The following attestation bundles were made for p4pillon-0.2.0rc2-py3-none-any.whl:
Publisher:
build.yaml on ISISNeutronMuon/p4pillon
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
p4pillon-0.2.0rc2-py3-none-any.whl -
Subject digest:
0361a5347fdd8aa05ca80ee2e38ef46e58a1fd0c05bb2cd24149658dd1b8c2cb - Sigstore transparency entry: 2333956201
- Sigstore integration time:
-
Permalink:
ISISNeutronMuon/p4pillon@0026a60a1e09a02c4074b4af7984f1731d67e57b -
Branch / Tag:
refs/tags/0.2.0rc2 - Owner: https://github.com/ISISNeutronMuon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yaml@0026a60a1e09a02c4074b4af7984f1731d67e57b -
Trigger Event:
push
-
Statement type: