Core Models
- class
pbcommand.models.
FileType
(file_type_id, base_name, ext, mime_type)[source]¶Bases:
object
Core File Type data model
Parameters:
- file_type_id – unique file string
- base_name – default base name of the file (without extension)
- ext – file extension
- mime_type – file mimetype
Returns:
default_name
¶Default name of file alias for base_name
- class
pbcommand.models.
TaskOptionTypes
[source]¶Bases:
object
Core Task Option type id type
- classmethod
ALL_SIMPLE
()[source]¶Returns a set of ‘simple’ task option types (e.g., boolean, string, int, float)
BOOL
= 'boolean'¶
CHOICE_FLOAT
= 'choice_float'¶
CHOICE_INT
= 'choice_integer'¶
CHOICE_STR
= 'choice_string'¶
FLOAT
= 'float'¶
INT
= 'integer'¶
STR
= 'string'¶
- classmethod
from_choice_str
(sx)[source]¶Validates and returns a task choice option type or raises ValueError
- classmethod
from_simple_str
(sx)[source]¶Validates a string is a validate task option type id or raise ValueError
:raises ValueError
- class
pbcommand.models.
DataStore
(ds_files, created_at=None)[source]¶Bases:
object
Parameters:
- ds_files (list[DataStoreFile]) – list of datastore file instances
- created_at – Date the datastore was created. if None, will use the current datetime
version
= '0.2.2'¶
- class
pbcommand.models.
DataStoreFile
(uuid, source_id, type_id, path, is_chunked=False, name='', description='')[source]¶Bases:
object
Parameters:
- uuid – UUID of the datstore file
- source_id – source id of the DataStore file
- type_id – File Type id of
- path – Absolute path to the datastore file
- is_chunked – is the datastore file a “chunked” file from a scatter/chunking task
- name – Display name of datastore file
- description – Description of the datastore file
file_type
¶
source_id
¶This is the consistent form that is used in the code base
- class
pbcommand.models.
PipelineChunk
(chunk_id, **kwargs)[source]¶Bases:
object
kwargs is a key-value store. keys that begin “$chunk.” are considered to be semantically understood by workflow and can be “routed” to chunked task inputs.
Values that don’t begin with “$chunk.” are considered metadata.
Parameters: chunk_id (str) – Chunk id
CHUNK_KEY_PREFIX
= '$chunk.'¶
RX_CHUNK_KEY
= <_sre.SRE_Pattern object>¶
chunk_d
¶
chunk_keys
¶
chunk_metadata
¶
set_chunk_key
(chunk_key, value)[source]¶Overwrite or add a chunk_key => value to the Chunk datum
the chunk-key can be provided with or without the ‘$chunk:’ prefix
- class
pbcommand.models.
SymbolTypes
[source]¶Bases:
object
Symbols that are understood during resolving, such as max number of processors, Max Chunks. Used when defining a Tool Contract
MAX_NCHUNKS
= '$max_nchunks'¶
MAX_NPROC
= '$max_nproc'¶
NCHUNKS
= '$nchunks'¶
NPROC
= '$nproc'¶
OPTS
= '$opts'¶
RESOLVED_OPTS
= '$ropts'¶
SCHEMA_OPTS
= '$opts_schema'¶
TASK_TYPE
= '$task_type'¶