paws.core.operations package

Subpackages

Submodules

paws.core.operations.OpManager module

class paws.core.operations.OpManager.OpManager[source]

Bases: paws.core.models.TreeModel.TreeModel

OpManager provides access to and control over paws Operations.

activate_op(op_module)[source]

Import Operation module and add its Operation subclass to the tree.

This method imports the Operation to check compatibility, and then sets the ‘active’ flag to True. After this, the Operation is available via self.get_op()

Parameters:op_module (str) – Name of the Operation module. Example: If class MyOperation is in the CATEGORY.MyOperation module, retrieve it with op_module = ‘CATEGORY.MyOperation’.
add_cat(cat_module)[source]

Add category cat_module to the tree.

add_op(cat_module, op_name)[source]

Add label for an Operation at op_name under category cat_module.

get_operation(operation_uri)[source]

Get an Operation, activate it if needed, instantiate, return.

Parameters:operation_uri (str) – uri indicating the operation module, e.g. PROCESSING.TESTS.Fibonacci.
Returns:op – the instantiated Operation
Return type:Operation
is_op_activated(op_module)[source]

Return boolean indicating whether Operation is active.

Parameters:op_module (str) – Name of the Operation module. see activate_op().
list_operations()[source]
load_operations(cat_op_list=[('EXECUTION', 'Batch'), ('EXECUTION', 'Conditional'), ('EXECUTION', 'Realtime'), ('IO.BL15', 'ReadHeader_SSRL15'), ('IO.BL15', 'ReadImageAndHeader_SSRL15'), ('IO.BL42', 'ReadImageAndHeader_SSRL42'), ('IO.CALIBRATION', 'Fit2DToPONI'), ('IO.CALIBRATION', 'NikaToPONI'), ('IO.CALIBRATION', 'ReadPONI'), ('IO.CALIBRATION', 'WXDToPONI'), ('IO.CSV', 'CSVToArray'), ('IO.CSV', 'CSVToXYData'), ('IO.CSV', 'WriteArrayCSV'), ('IO.DAT', 'WriteListsDAT'), ('IO.FILESYSTEM', 'BuildFileList'), ('IO.FILESYSTEM', 'BuildFilePath'), ('IO.FILESYSTEM', 'CheckFilePath'), ('IO.FILESYSTEM', 'FileIterator'), ('IO.IMAGE', 'FabIOOpen'), ('IO.IMAGE', 'FabIOWrite'), ('IO.IMAGE', 'LoadTif'), ('IO.IMAGE', 'LoadTif_PIL'), ('IO.IMAGE', 'OpenRaw'), ('IO.MISC', 'ReadNPSynthRecipe'), ('IO.MODELS.SAXS', 'LoadSAXSClassifier'), ('IO.NUMPY', 'Loadtxt_q_I_dI'), ('IO.PIF', 'CheckDataSet'), ('IO.PIF', 'SavePIFAsJSON'), ('IO.PIF', 'ShipJSON'), ('IO.PIF', 'ShipToDataSet'), ('IO.YAML', 'LoadYAML'), ('IO.YAML', 'SaveYAML'), ('PACKAGING.BATCH', 'ListFromBatch'), ('PACKAGING.BATCH', 'XYDataFromBatch'), ('PACKAGING.BL15', 'TimeTempFromHeader'), ('PACKAGING.CALIBRATION', 'GetPyFAIArgs'), ('PACKAGING', 'LogLogZip'), ('PACKAGING.PIF', 'EmptyPif'), ('PACKAGING.PIF', 'Pif1dScatteringIntensity'), ('PACKAGING.PIF', 'PifNPSynthExperiment'), ('PACKAGING.PIF', 'PifSAXS'), ('PACKAGING.PIF', 'UnpackSAXS'), ('PACKAGING', 'Unzip'), ('PACKAGING', 'Window'), ('PACKAGING', 'WindowZip'), ('PACKAGING', 'Zip'), ('PROCESSING.BACKGROUND', 'BgSubtractByTemperature'), ('PROCESSING.BACKGROUND', 'SubtractMaximumBackground'), ('PROCESSING.BASIC', 'ArrayLog'), ('PROCESSING.BASIC', 'ArrayMirrorHorizontal'), ('PROCESSING.BASIC', 'ArrayMirrorVertical'), ('PROCESSING.BASIC', 'InvertBinaryArray'), ('PROCESSING.BASIC', 'LogY'), ('PROCESSING.BASIC', 'Rotation'), ('PROCESSING.BASIC', 'Subtract'), ('PROCESSING.INTEGRATION', 'ApplyIntegrator1d'), ('PROCESSING.INTEGRATION', 'ApplyIntegrator2d'), ('PROCESSING.INTEGRATION', 'BuildPyFAIIntegrator'), ('PROCESSING.PEAKS', 'FindPeaksByWindow'), ('PROCESSING.PEAKS', 'VoigtPeakFit'), ('PROCESSING.SAXS', 'ComputeSAXS'), ('PROCESSING.SAXS', 'FFTRadialDistribution'), ('PROCESSING.SAXS', 'PostProcessTimeSeries'), ('PROCESSING.SAXS', 'SpectrumClassifier'), ('PROCESSING.SAXS', 'SpectrumClassifierGUI'), ('PROCESSING.SAXS', 'SpectrumFit'), ('PROCESSING.SAXS', 'SpectrumFitGUI'), ('PROCESSING.SAXS', 'SpectrumMCAnneal'), ('PROCESSING.SAXS', 'SpectrumParameterization'), ('PROCESSING.SAXS', 'SpectrumProfiler'), ('PROCESSING.SAXS', 'TimeSeriesSpectrumFit'), ('PROCESSING.SMOOTHING', 'MovingAverage'), ('PROCESSING.SMOOTHING', 'SavitzkyGolay'), ('PROCESSING.ZINGERS', 'EasyZingers1d'), ('TESTS', 'Identity'), ('TESTS', 'ListPrimes'), ('TESTS', 'NoiseArray'), ('TMP', 'GetSAXSFlags')])[source]

Load Operations into OpManager.

Parameters:cat_op_list (list of (str,str), optional) – Each element in the list is a tuple containing two strings. The first string in the tuple indicates the category subpackage. The second string in the tuple indicates the operation module. The default is to load all operations detected by paws.core.operations at startup.
n_ops()[source]
print_cat(cat_uri, rowprefix=' ')[source]

Generate a string that lists the contents of the operations category specified by cat_uri

paws.core.operations.Operation module

class paws.core.operations.Operation.InputLocator(tp=0, val=None)[source]

Bases: object

Objects of this class are used as containers for inputs to an Operation. They contain the information needed to find the relevant input data.

class paws.core.operations.Operation.Operation(inputs, outputs)[source]

Bases: object

Class template for implementing paws operations

build_clone()[source]

Clone the Operation.

If this is used to provide a copy of the Operation for distributed execution, then it should be called after all inputs have been loaded, with the exception of workflow items, e.g. after calling WfManager.prepare_wf().

clear_outputs()[source]
classmethod clone()[source]
description()[source]

Provide a string describing the Operation.

doc_as_string()[source]
get_outputs()[source]
input_description()[source]
keys()[source]
output_description()[source]
static parameter_doc(name, value, doc)[source]
run()[source]

Operation.run() should use the Operation.inputs and set values for all of the items in Operation.outputs.

set_input(input_name, val)[source]
setup_dict()[source]

Produce a dictionary fully describing the setup of the Operation.

Returns:dct – Dictionary specifying the module name and input setup for the current state of the Operation
Return type:dict
stop()[source]

paws.core.operations.optools module

Various tools for working with Workflows and Operations

exception paws.core.operations.optools.ExecutionError(msg)[source]

Bases: exceptions.Exception

class paws.core.operations.optools.FileSystemIterator(dirpath, regex, include_existing_files=True)[source]

Bases: _abcoll.Iterator

next()[source]

Return the next item from the iterator. When exhausted, raise StopIteration

paws.core.operations.optools.dict_contains_uri(uri, d)[source]
paws.core.operations.optools.get_uri_from_dict(uri, d)[source]

Module contents

paws.core.operations.load_ops_from_path(path_, pkg, cat_root='')[source]