adaptivemd.TaskGenerator

class adaptivemd.TaskGenerator[source]

A generator helper for Task object creation

This is an important group and is supposed to make it easy for you to create Task object. In a real situation a user should not be faced with the Task details, or at least the programming of a generator is a separate problem. Once you have the generators use them in your adaptive scripts.

Examples

Variables:
  • initial_staging (list of dict or str or Action) – a list of actions to be run once before this generator can be used
  • items (dict of File) – a dictionary of File by name to simplify access to certain files
__init__()[source]

x.__init__(…) initializes x; see help(type(x)) for signature

Methods

__init__() x.__init__(…) initializes x; see help(type(x)) for signature
args() Return a list of args of the __init__ function of a class
base() Return the most parent class actually derived from StorableMixin
descendants() Return a list of all subclassed objects
from_dict(dct) Reconstruct an object from a dictionary representation
get_uuid() Create a new unique ID :returns: the unique number for an object in the project :rtype: long
idx(store) Return the index which is used for the object in the given store.
items()
named(name) Attach a .name property to an object
objects() Returns a dictionary of all storable objects
stage(obj[, target]) Short cut to add a file to be staged
to_dict() Convert object into a dictionary representation

Attributes

ACTIVE_LONG
CREATION_COUNT
INSTANCE_UUID
base_cls Return the base class
base_cls_name Return the name of the base class
cls Return the class name as a string
files
stage_in Return a list of actions needed before tasks can be generated
classmethod from_dict(dct)[source]

Reconstruct an object from a dictionary representation

Parameters:dct (dict) – the dictionary containing a state representation of the class.
Returns:the reconstructed storable object
Return type:StorableMixin
to_dict()[source]

Convert object into a dictionary representation

Used to convert the dictionary into JSON string for serialization

Returns:the dictionary representing the (immutable) state of the object
Return type:dict
stage_in

Return a list of actions needed before tasks can be generated

Returns:the list of Actions to be parsed into stage in steps
Return type:list of Action
stage(obj, target=None)[source]

Short cut to add a file to be staged

Parameters:
  • obj (File) – the file to be staged in the initial staging phase
  • target (Location or str) – the (different) target name to be used