DesignStore

Contents

DesignStore#

class pulserver.host.DesignStore[source]#

Bases: object

The designs of one scan, each in <root>/<scan>/<id>/ and immutable once written.

A store root holds one directory per scan, named by whatever plays it: a scanner names it after the scan, and the reconstruction finds a series’ design from the scan and the identifier its header carries. A design directory holds the Pulseq files of its chain, its IR cache and MANIFEST. It is written in a stage and renamed into place, so a reader sees a design whole or not at all, and two processes writing one design leave one directory. A scan plays one design, so committing a design removes the scan’s others. A design whose sequence sets EnablePmc is published with its scan’s empty pose file, <root>/<scan>/motion.buf.

Parameters:
  • root (Path | str) – Directory of scans; created when missing.

  • scan (str) – Name of the scan’s directory: one path component, not starting with ..

Raises:

ValueError – If scan is not a directory name.

Methods

commit

Publish a staged directory as the design of identity; return its identifier.

directory

Return the directory of a design, whether or not it exists.

discard

find

Return the identifier of the stored design with this identity, or None.

manifest

Return a stored design's manifest.

pack

Return a stored design as a bundle: a gzip-compressed tar of its files.

receive

Store a bundle pack() made, after checking it; return its identifier.

stage

Create an empty directory to write a design into.