funpack.parsing.process
The Process class, and functions for parsing processing steps.
This module defines the Process class which is used by the
funpack.processing module to run FUNPACK processing steps.
- exception funpack.parsing.process.NoSuchProcessError[source]
Bases:
ExceptionException raised by the
Processclass when an unknown process name is specified.
- class funpack.parsing.process.Process(ptype, name, args, kwargs, procstr)[source]
Bases:
objectSimple class which represents a single processing step. The
run()method can be used to run the process on the data for one or more variables.- property args
Returns the positional arguments for this
Process.
- auxillaryVariables(broadcastIndex=None)[source]
Returns a list of “auxillary” variables for this process. Auxillary variables are variables which a process is not being applied to, but which is needed by the process. These variables are passed in as arguments to the process.
The names of any arguments which contain auxillary variables are specified via the
auxvidsargument to the processor decorator function.
- property broadcastKwargs
Returns the keyword arguments for this
Processwhich will broadcasted across all variable IDs that are passed to an invocation ofrun().
- property filterMissing
Return
Trueif this processing function expects that the list of variable IDs which it is given will not contain the IDs of variables which are not present in the data.This property is set via a
filterMissingargument passed to the processor decorator function. Its default value isTrue.
- property kwargs
Returns the keyword arguments for this
Process.
- property name
Returns the name of this
Process.
- property processString
Returns the original string, from the processing table/ command-line, which defines this
Process.
- run(*args, broadcastIndex=None)[source]
Run the process on the data, passing it the given arguments, and any arguments that were passed to
__init__().- Parameters:
broadcastIndex – Deprecated. If provided, and if any broadcast arguments were specified for this process, this index is used to retrieve one value each broadcast argument list - this value is then passed to the process function.
- funpack.parsing.process.makeProcessParser()[source]
Generate a
pyparsingparser which can be used to parse a single process call in the processing table.
- funpack.parsing.process.parseProcesses(procs, ptype)[source]
Parses the given string containing one or more comma-separated process calls, as defined in the processing table. Returns a list of
Processobjects.- Parameters:
procs – String containing one or more comma-separated (pre-)processing steps.
ptype – either
cleanerorprocessor
- Returns:
A list of
Processobjects.