polaris.analysis.publish.publish
- polaris.analysis.publish.publish(fragment_filenames, output_path, logger=None, thumbnail_size=(320, 240), thumbnail_scale=2, thumbnail_format='jpeg', thumbnail_quality=75, copy_data=False)[source]
Publish every product the fragments describe into the staging tree
Products are published by copying them from the step that owns them, not by symlink, so that the staging tree can be served from a web portal that cannot read the work directory. A web server only follows a link if it can read every directory on the way to its target, and a work directory on scratch space normally does not allow that. The plots are always copied, since they are small. The data files are only copied if
copy_datais set, since for a large mesh they can be most of the size of the analysis; a product whose data file is not copied is published without one.- Parameters:
fragment_filenames (list of str) – The manifest fragments to publish, one per step that makes products. Every such step writes one, empty if it made nothing, which is what lets a step declare them as inputs and have Polaris check them. A fragment that is not on disk is nonetheless reported here rather than raising, so that this is usable on a list nothing has checked; the
publishstep does not rely on it, since a declared input that is missing stops it before it runs.output_path (str) – The root of the staging tree
logger (logging.Logger, optional) – A logger for reporting what was published, which steps published nothing, and what was missing
thumbnail_size (tuple of int, optional) – The bounding box, in displayed pixels, each thumbnail is scaled to fit inside
thumbnail_scale (float, optional) – The number of image pixels rendered per displayed pixel, so that a thumbnail is sharp on a high-resolution display; it need not be a whole number
thumbnail_format ({'jpeg', 'webp'}, optional) – The format thumbnails are written in
thumbnail_quality (int, optional) – The compression quality of thumbnails, from 1 to 100
copy_data (bool, optional) – Whether to copy each product’s data file into the staging tree beside its plot
- Returns:
published (list of dict) – One entry per published product, as written to the merged manifest
missing (list of str) – The paths that are not on disk: first the fragments that were named but never written, then the files a fragment named. Both are reported rather than silently omitted, and neither appears in the merged manifest, which is what defines the published set. A fragment that was never written is only worth a message, since whoever called this may not have had it checked; a fragment that promised a file that is not there is worth a warning.