scanspec
Specify step and flyscan paths in a serializable, efficient and Pythonic way using combinations of:
- Specs like Line or Spiral
- Optionally Snaking
- Zip, Product and Concat to compose
Serialize the Spec rather than the expanded Path and reconstruct it on the server. It can then be iterated over like a cycler, or a stack of scan Frames can be produced and expanded Paths created to consume chunk by chunk.
| Source | https://github.com/bluesky/scanspec |
|---|---|
| PyPI | pip install scanspec |
| Docker | docker run ghcr.io/bluesky/scanspec:latest |
| Documentation | https://bluesky.github.io/scanspec |
| Releases | https://github.com/bluesky/scanspec/releases |
An example ScanSpec of a 2D snaked grid flyscan inside a circle spending 0.4s at each point:
from scanspec.specs import Ellipse, Fly
spec = Fly(0.4 @ Ellipse(x, 1, 1, 1/9, y, 2.8, y_step=1.7/11, snake=True))
Which when plotted looks like:
Scan points can be iterated through directly for convenience:
for point in spec.midpoints():
print(point)
# ...
# {'y': 3.1818181818181817, 'x': 0.8333333333333333}
# {'y': 3.1818181818181817, 'x': 0.7222222222222222}
or a Path created from the stack of Frames and chunks of a given length consumed from it for performance:
from scanspec.core import Path
stack = spec.calculate()
len(stack[0]) # 44
stack[0].axes() # ['y', 'x']
path = Path(stack, start=5, num=30)
chunk = path.consume(10)
chunk.midpoints # {'x': <ndarray len=10>, 'y': <ndarray len=10>}
chunk.upper # bounds are same dimensionality as positions
chunk.duration # duration of each frame
See https://bluesky.github.io/scanspec for more detailed documentation.
Metadata
Release files for scanspec 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| scanspec-1.0.0.tar.gz | 285.0 kB | Without provenance | Details for scanspec-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| scanspec-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for scanspec-1.0.0-py3-none-any.whl |
Total release size: 322.9 kB
Release files / scanspec-1.0.0.tar.gz
| Download URL | scanspec-1.0.0.tar.gz |
|---|---|
| Size | 285.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
31d297861978e56bb6cfcaa15527bad5ba3dc158b3fc52142ecb5611a22e1b5a
|
|
BLAKE2b-256 checksum How to use checksums |
03c37b3621a0eec53b7e348457de68a33a93314c5626523ab1481395811aa09e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / scanspec-1.0.0-py3-none-any.whl
| Download URL | scanspec-1.0.0-py3-none-any.whl |
|---|---|
| Size | 37.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4ad6dccd6ac19dbd8af888c80c5db53c70d6b8aee9d26c0ca174cebd3c396730
|
|
BLAKE2b-256 checksum How to use checksums |
68b9f44b139096467996b4d85589d9880fd55f0c80a204d298a1b73d0adc2654
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Security for scanspec 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.