Skip to main content

CI Coverage PyPI License

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:

plot

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)

Source distribution for scanspec 1.0.0
File Size Uploaded
scanspec-1.0.0.tar.gz 285.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for scanspec 1.0.0
File Interpreter ABI Platform
scanspec-1.0.0-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.8

2 release files

0.7.6

2 release files

0.7.5

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.6

2 release files

0.6.5

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.5

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5

2 release files

0.4

2 release files

0.3

2 release files

0.2

2 release files

0.1.1

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page