easyvvuq package¶
Subpackages¶
- easyvvuq.actions package
- easyvvuq.analysis package
- easyvvuq.comparison package
- easyvvuq.db package
- easyvvuq.decoders package
- easyvvuq.encoders package
- easyvvuq.pools package
- easyvvuq.sampling package
- Submodules
- easyvvuq.sampling.base module
- easyvvuq.sampling.empty module
- easyvvuq.sampling.pce module
- easyvvuq.sampling.qmc module
- easyvvuq.sampling.quasirandom module
- easyvvuq.sampling.random module
- easyvvuq.sampling.replica_sampler module
- easyvvuq.sampling.sampler_of_samplers module
- easyvvuq.sampling.stochastic_collocation module
- easyvvuq.sampling.sweep module
- Module contents
- easyvvuq.utils package
Submodules¶
easyvvuq.base_element module¶
easyvvuq.campaign module¶
EasyVVUQ Campaign
This module contains the Campaign class that is used to coordinate all EasyVVUQ workflows.
-
class
easyvvuq.campaign.Campaign(name=None, params=None, encoder=None, decoder=None, db_type='sql', db_location=None, work_dir='./', state_file=None, relocate=None, change_to_state=False, verify_all_runs=True)¶ Bases:
objectCampaigns organise the dataflow in EasyVVUQ workflows.
The Campaign functions as as state machine for the VVUQ workflows. It uses a database (CampaignDB) to store information on both the target application and the VVUQ algorithms being employed. It also collects data from the simulations and can be used to store and resume your state.
Notes
Multiple campaigns can be combined in a CampaignDB. Hence the particular campaign we are currently working on will be specified using campaign_id.
Parameters: - name (
str, optional) - params (dict) – Description of the parameters to associate with the application.
- encoder (
easyvvuq.encoders.base.BaseEncoder) – Encoder element to convert parameters into application run inputs. - decoder (
easyvvuq.decoders.base.BaseDecoder) – Decoder element to convert application run output into data for VVUQ analysis. - db_type (str, default=”sql”) – Type of database to use for CampaignDB.
- db_location (
str, optional) – Location of the underlying campaign database - either a path or acceptable URI for SQLAlchemy. - work_dir (
str, optional, default=’./’) – Path to working directory - used to store campaign directory. - state_file (
str, optional) – Path to serialised state - used to initialise the Campaign. - relocate (dict or None) – Relocation dictionary. If specified will try to relocate the campaign according to the information within the dictionary, dictionary format: {‘work_dir’: str, ‘campaign_dir’: str, ‘db_location’: str}. The parameter db_location is optional.
- change_to_state (bool, optional, default=False) – Should we change to the directory containing any specified state_file in order to make relative paths work.
- verify_all_runs (bool, optional, default=True) – Check all new runs being added for unrecognised params (not defined for the currently set app), values lying within defined physical range, type checking etc. This should normally always be set to True, but in cases where the performance is too degraded, the checks can be disabled by setting to False.
Variables: - campaign_name (str or None) – Name for the campaign/workflow.
- _campaign_dir (str or None) – Path to the directory campaign uses for local storage (runs inputs etc)
- db_location (str or None) – Location of the underlying campaign database - either a path or acceptable URI for SQLAlchemy.
- db_type (str or None) – Type of CampaignDB (“sql”).
- _log (list) – The log of all elements that have been applied, with information about their application
- campaign_id (int) – ID number for the current campaign in the CampaignDB.
- campaign_db (easyvvuq.db.BaseCampaignDB) – A campaign database object
- last_analysis – The result of the most recent analysis carried out on this campaign
- _active_app (dict) – Info about currently set app
- _active_app_name (str) – Name of currently set app
- _active_app_encoder (easyvvuq.encoders.BaseEncoder) – The current Encoder object being used, from the currently set app
- _active_app_decoder (easyvvuq.decoders.BaseDecoder) – The current Decoder object being used, from the currently set app
- _active_app_collater (easyvvuq.collate.BaseCollationElement) – The current Collater object assigned to this campaign
- _active_sampler (easyvvuq.sampling.BaseSamplingElement) – The currently set Sampler object
- _active_sampler_id (int) – The database id of the currently set Sampler object
-
add_app(name=None, params=None, decoderspec=None, encoder=None, decoder=None, set_active=True)¶ Add an application to the CampaignDB.
Parameters: - name (str) – Name of the application.
- params (dict) – Description of the parameters to associate with the application.
- decoderspec (dict) – A Cerberus validation dictionary for the output of the decoder if left None, will not be used.
- encoder (
easyvvuq.encoders.base.BaseEncoder) – Encoder element to convert parameters into application run inputs. - decoder (
easyvvuq.decoders.base.BaseDecoder) – Decoder element to convert application run output into data for VVUQ analysis. - set_active (bool) – Should the added app be set to be the currently active app?
-
add_default_run()¶ Add a single new run to the queue, using only default values for all parameters.
-
add_runs(runs, mark_invalid=False)¶ Add a new run to the queue.
Parameters: - runs (list of dicts) – Each dict defines the value of each model parameter listed in self.params_info for a run to be added to self.runs
- mark_invalid (bool) – Will mark runs that fail verification as invalid (but will not raise an exception)
-
all_complete()¶ Check if all runs have reported having output generated by a completed simulation.
Returns: Return type: list of runs
-
analyse(**kwargs)¶ If available will call an appropriate analysis class on the collation result.
Parameters: **kwargs - dict – Argument to the analysis class constructor (after sampler).
-
apply_analysis(analysis)¶ Run the analysis element on the output of the last run collation.
Parameters: analysis (easyvvuq.analysis.base.BaseAnalysisElement) – Element that performs a VVUQ analysis on a dataframe summary of run outputs.
-
apply_for_each_run_dir(action, status=<Status.ENCODED: 2>, batch_size=1)¶ For each run in this Campaign’s run list, apply the specified action (an object of type Action)
Parameters: - action (the action to be applied to each run directory) – The function to be applied to each run directory. func() will be called with the run directory path as its only argument.
- status (Status) – Will apply the action only to those runs whose status is as specified
Returns: action_statuses – An object containing ActionStatus instances to track action execution
Return type:
-
call_for_each_run(fn, status=<Status.ENCODED: 2>)¶
-
campaign_dir¶ Get the path in which to load/save files related to the campaign.
Returns: Path to the campaign directory - given as a subdirectory of the working directory. Return type: str
-
collate()¶ Combine the output from all runs associated with the current app.
-
draw_samples(num_samples=0, replicas=1, mark_invalid=False)¶ Draws num_samples sets of parameters from the currently set sampler, resulting in num_samples * replicas new runs added to the runs list. If num_samples is 0 (its default value) then this method draws ALL samples from the sampler, until exhaustion (this will fail if the sampler is not finite).
Notes
Do NOT use this in cases where you need ‘replicas’ with a different random seed. In those cases need to sample from a uniform_integer distribution and filter at analysis step.
Parameters: - num_samples (int) – Number of samples to draw from the active sampling element. By default is 0 (draw ALL samples)
- replicas (int) – Number of replica runs to create with each set of parameters. Default is 1 - so only a single run added for each set of parameters.
- mark_invalid (bool) – If True will mark runs that go outside valid parameter range as INVALID. This is useful for MCMC style methods where you want those runs to evaluate to low probabilities.
-
get_active_app()¶ Returns a dict of information regarding the application that is currently set for this campaign.
-
get_active_sampler()¶ Return the active sampler element in use by this campaign.
Returns: easyvvuq.sampling.base.BaseSamplingElement Return type: The sampler currently in use
-
get_campaign_runs_dir()¶ Get the runs directory from the CampaignDB.
Returns: Path in which the runs information will be written. Return type: str
-
get_collation_result(last_iteration=False)¶ Return dataframe containing all collated results
Parameters: last_collation (bool) – Will only return the result of the last collation. Returns: Return type: pandas dataframe
-
get_invalid_runs(last_iteration=False)¶ Return dataframe containing all results marked as INVALID.
Parameters: last_collation (bool) – Will only return the result of the last collation. Returns: Return type: pandas DataFrame
-
get_last_analysis()¶ Return the output of the most recently run analysis element.
-
ignore_runs(list_of_run_IDs)¶ Flags the specified runs to be IGNORED in future collation. Note that this does NOT remove previously collated results from the collation table. For that you must refresh the collation by running recollate().
Parameters: list_of_run_IDs (list) – The list of run IDs for the runs that should be set to status IGNORED
-
init_fresh(name, db_type='sql', db_location=None, work_dir='.')¶ Initialise a new campaign - create database and output directory (campaign_dir, a uniquely named directory in work_dir).
Parameters: - name (str) – Campaign name.
- db_type (str) – Database type - current options are ‘sql’.
- db_location (str or None) – Path in which to create campaign database - defaults to None which results in the database being placed in campaign_dir with a default name.
- work_dir (str) – Path in which to create the campaign_dir.
-
init_from_state_file(state_file, relocate=None)¶ Load campaign state from file.
Parameters: - state_file (str) – Path to the file containing the campaign state.
- relocate (dict or None) – Relocation dictionary. If specified will try to relocate the campaign according
- to the information within the dictionary, dictionary format ({‘work_dir’: str,)
- ‘campaign_dir’ (str, ‘db_location’: str}. The parameter db_location is optional.)
-
iterate(action, batch_size=8, nsamples=0, mark_invalid=False)¶ This is the equivalent of sample_and_apply for methods that rely on the output of the previous sampling stage (primarily MCMC).
Parameters: - nsamples (int) – number of samples to draw
- action (BaseAction) – an action to be executed
- batch_size (int) – number of actions to be executed at the same time
- mark_invalid (bool) – Mark runs that go outside the specified input parameter range as INVALID.
Yields: action_statuses (ActionStatuses) – An object containing ActionStatus instances to track action execution
-
list_runs(sampler=None, campaign=None, status=None)¶ Get list of runs in the CampaignDB.
Returns: Return type: list of runs
-
load_state(state_filename, relocate=None)¶ Load up a Campaign state from the specified JSON file
Parameters: - state_filename (str) – Name of file from which to load the state
- relocate (dict or None) – Relocation dictionary. If specified will try to relocate the campaign according
- to the information within the dictionary, dictionary format ({‘work_dir’: str,)
- ‘campaign_dir’ (str, ‘db_location’: str}. The parameter db_location is optional.)
-
populate_runs_dir()¶ Populate run directories based on runs in the CampaignDB.
This calls the encoder element defined for the current application to create input files for it in each run directory, usually with varying input (scientific) parameters. Note that this method will also create the directories in the file system. The directory names will be formed in relation to the work_dir argument you have specified when creating the Campaign object.
Returns: Return type: a list with run ids
-
recollate()¶ - Clears the current collation table, changes all COLLATED status runs
- back to ENCODED, then runs collate() again
-
relocate(campaign_dir)¶ Relocate the campaign by specifying a new path where campaign is located.
Parameters: new_path (str) – new runs directory
-
rerun(list_of_run_IDs)¶ Sets the status of the specified runs to ENCODED, so that their results may be recollated later (presumably after extending, rerunning or otherwise modifying the data in the relevant run folder). Note that this method will NOT perform any execution - it simply flags the run in EasyVVUQ as being uncollated. Actual execution is (as usual) the job of the user or middleware.
Parameters: list_of_run_IDs (list) – The list of run IDs for the runs that should be set to status ENCODED
-
sample_and_apply(action, batch_size=8, nsamples=0, mark_invalid=False)¶ This will draw samples, populated the runs directories and run the specified action. This is a convenience method.
Parameters: - nsamples (int) – number of samples to draw
- action (BaseAction) – an action to be executed
- batch_size (int) – number of actions to be executed at the same time
- mark_invalid (bool) – Mark runs that go outside the specified input parameter range as INVALID.
Returns: action_statuses – An object containing ActionStatus instances to track action execution
Return type:
-
save_state(state_filename)¶ Save the current Campaign state to file in JSON format :Parameters: state_filename (str) – Name of file in which to save the state
-
scan_completed(*args, **kwargs)¶ Check campaign database for completed runs (defined as runs with COLLATED status)
Returns: Return type: list of runs
-
set_app(app_name)¶ Set active app for the campaign.
Application information is retrieved from self.campaign_db.
Parameters: app_name (str or None) – Name of selected app, if None given then first app will be selected.
-
set_sampler(sampler, update=False)¶ Set active sampler.
Parameters: - sampler (easyvvuq.sampling.base.BaseSamplingElement) – Sampler that will be used to create runs for the current campaign.
- update (bool) – If set to True it will not add the sampler to the database, just change it as the active sampler.
- name (
easyvvuq.campaign_dask module¶
-
class
easyvvuq.campaign_dask.CampaignDask(name=None, params=None, encoder=None, decoder=None, db_type='sql', db_location=None, work_dir='./', state_file=None, relocate=None, change_to_state=False, verify_all_runs=True)¶ Bases:
easyvvuq.campaign.CampaignThis extends the standard Campaign to enable execution on clusters using the Dask JobQueue functionality.
-
apply_for_each_run_dir(action, client, status=<Status.ENCODED: 2>)¶ For each run in this Campaign’s run list, apply the specified action (an object of type Action)
Parameters: - action (the action to be applied to each run directory) – The function to be applied to each run directory. func() will be called with the run directory path as its only argument.
- client (a Dask client associated with a cluster you want to) – run your jobs on.
-
easyvvuq.campaign_qcgpj module¶
-
class
easyvvuq.campaign_qcgpj.CampaignQCGPJ(name=None, params=None, encoder=None, decoder=None, db_type='sql', db_location=None, work_dir='./', state_file=None, relocate=None, change_to_state=False, verify_all_runs=True)¶ Bases:
easyvvuq.campaign.CampaignThis extends the standard Campaign to enable execution on clusters using the QCG-PilotJob mechanism.
-
apply_for_each_run_dir(action, manager, status=<Status.ENCODED: 2>)¶ For each run in this Campaign’s run list, apply the specified action (an object of type Action)
Parameters: - action (the action to be applied to each run directory) – The function to be applied to each run directory. func() will be called with the run directory path as its only argument.
- manager (a QCG-PilotJob manager instance that should be used) – for execution of actions
-
easyvvuq.constants module¶
Constants and Enums to set defaults and constrain selections
| ivar default_campaign_prefix: | |
|---|---|
| Text used to ensure campaign names are identifiable and somewhat human readable. | |
| vartype default_campaign_prefix: | |
| str | |
easyvvuq.data_structs module¶
Data structures to ensure consistency during serialization for databases.
-
class
easyvvuq.data_structs.AppInfo(name=None, paramsspec=None, decoderspec=None, encoder=None, decoder=None)¶ Bases:
objectHandles information for particular application.
Variables: - name (str or None) – Human readable application name.
- paramsspec (ParamsSpecification or None) – Description of possible parameter values.
- decoderspec (dict) – Description of the output format of the decoder.
- input_encoder (
easyvvuq.encoders.base.BaseEncoder) – Encoder element for application. - output_decoder (
easyvvuq.decoders.base.BaseDecoder) – Decoder element for application.
-
input_encoder¶
-
output_decoder¶
-
to_dict(flatten=False)¶ Convert to a dictionary (optionally flatten to single level)
Parameters: flatten (bool) – Should the return dictionary be single level (i.e. should paramsspec be serialized). Returns: Dictionary representing the application- if flattened then paramsspec is returned as a JSON format sting. Return type: dict
-
class
easyvvuq.data_structs.CampaignInfo(name=None, easyvvuq_version=None, campaign_dir_prefix=None, campaign_dir=None, runs_dir=None, local=False)¶ Bases:
objectHandles information on Campaign.
Parameters: - name (str or None) – Human readable campaign name.
- easyvvuq_version (str or None) – Version of EasyVVUQ used to create the campaign.
- campaign_dir_prefix (str or None) – Prefix test for campaign directory.
- campaign_dir (str or None,) – Path to the campaign directory.
- runs_dir (str or None) – path to run directory (within the campaign directory)
- local (bool, default=False) – Is this campaign designed to be created and executed on the same machine?
Variables: - name (str or None) – Human readable campaign name.
- easyvvuq_version (str or None) – Version of EasyVVUQ used to create the campaign.
- campaign_dir_prefix (str or None) – Prefix test for campaign directory.
- campaign_dir (str or None,) – Path to the campaign directory.
- runs_dir (str or None) – path to run directory (within the campaign directory)
-
easyvvuq_version¶
-
to_dict(flatten=False)¶ Convert this to a dictionary
Parameters: flatten (bool) – Should the return dictionary be single level (always true here). Returns: Dictionary representing the campaign. Return type: dict
-
class
easyvvuq.data_structs.RunInfo(run_name=None, run_dir=None, app=None, params=None, sample=None, campaign=None, status=<Status.NEW: 1>)¶ Bases:
objectHandles information for individual application runs.
Parameters: - run_name (str) – Human readable name of the run.
- app (None or int) – ID of the associated application.
- params (None or dict) – Dictionary of parameter values for this run.
- sample (None or int) – ID of the sampler that created the run.
- campaign (None or int) – ID of the associated campaign.
Variables: -
to_dict(flatten=False)¶ Convert to a dictionary (optionally flatten to single level)
Parameters: flatten (bool) – Should the return dictionary be single level (i.e. should params or other dictionary variables be serialized). Returns: Dictionary representing the run - if flattened then params are returned as a JSON format sting. Return type: dict
-
easyvvuq.data_structs.check_local_dir(path, dir_type='campaign')¶ Check that local path exists and if not create it.
Parameters: - path (str) – Directory location to check.
- dir_type (str, default=’campaign’) – Type of directory we are checking (used for user and debugging information.)
-
easyvvuq.data_structs.check_reference(ref, run_name, ref_type='campaign')¶ Validation check for a RunInfo reference. Checks that an integer value has been passed to use as a reference to another ‘table’ - i.e. to a specific campaign, app or sampler.
Parameters: - ref (int) – Reference to be checked.
- run_name (str) – Name of run for which the check is being performed (user info/ debugging).
- ref_type (str, default=’campaign’) – Are we checking for a campaign, sampler or app (user info/ debugging).
easyvvuq.params_specification module¶
Data structures to ensure consistency during serialization for databases.
-
class
easyvvuq.params_specification.EasyVVUQValidator(*args, **kwargs)¶ Bases:
cerberus.validator.ValidatorValidator class. Normalizes and/or validates any mapping against a validation-schema which is provided as an argument at class instantiation or upon calling the
validate(),validated()ornormalized()method. An instance itself is callable and executes a validation.All instantiation parameters are optional.
There are the introspective properties
types,validators,coercers,default_setters,rules,normalization_rulesandvalidation_rules.The attributes reflecting the available rules are assembled considering constraints that are defined in the docstrings of rules’ methods and is effectively used as validation schema for
schema.Parameters: - schema (any mapping) – See
schema. Defaults toNone. - ignore_none_values (
bool) – Seeignore_none_values. Defaults toFalse. - allow_unknown (
boolor any mapping) – Seeallow_unknown. Defaults toFalse. - require_all (
bool) – Seerequire_all. Defaults toFalse. - purge_unknown (
bool) – Seepurge_unknown. Defaults to toFalse. - purge_readonly (
bool) – Removes all fields that are defined asreadonlyin the normalization phase. - error_handler (class or instance based on
BaseErrorHandlerortuple) – The error handler that formats the result oferrors. When given as two-value tuple with an error-handler class and a dictionary, the latter is passed to the initialization of the error handler. Default:BasicErrorHandler.
-
checkers= ()¶
-
coercers= ()¶
-
default_setters= ()¶
-
normalization_rules= {'coerce': {'oneof': [{'type': 'callable'}, {'type': 'list', 'schema': {'oneof': [{'type': 'callable'}, {'type': 'string', 'allowed': ()}]}}, {'type': 'string', 'allowed': ()}]}, 'default': {'nullable': True}, 'default_setter': {'oneof': [{'type': 'callable'}, {'type': 'string', 'allowed': ()}]}, 'purge_unknown': {'type': 'boolean'}, 'rename': {'type': 'hashable'}, 'rename_handler': {'oneof': [{'type': 'callable'}, {'type': 'list', 'schema': {'oneof': [{'type': 'callable'}, {'type': 'string', 'allowed': ()}]}}, {'type': 'string', 'allowed': ()}]}}¶
-
rules= {'allof': {'logical': 'allof', 'type': 'list'}, 'allow_unknown': {'oneof': [{'type': 'boolean'}, {'type': ['dict', 'string'], 'check_with': 'bulk_schema'}]}, 'allowed': {'type': 'container'}, 'anyof': {'logical': 'anyof', 'type': 'list'}, 'check_with': {'oneof': [{'type': 'callable'}, {'type': 'list', 'schema': {'oneof': [{'type': 'callable'}, {'type': 'string', 'allowed': ()}]}}, {'type': 'string', 'allowed': ()}]}, 'coerce': {'oneof': [{'type': 'callable'}, {'type': 'list', 'schema': {'oneof': [{'type': 'callable'}, {'type': 'string', 'allowed': ()}]}}, {'type': 'string', 'allowed': ()}]}, 'contains': {'empty': False}, 'default': {'nullable': True}, 'default_setter': {'oneof': [{'type': 'callable'}, {'type': 'string', 'allowed': ()}]}, 'dependencies': {'check_with': 'dependencies', 'type': ('dict', 'hashable', 'list')}, 'empty': {'type': 'boolean'}, 'excludes': {'schema': {'type': 'hashable'}, 'type': ('hashable', 'list')}, 'forbidden': {'type': 'list'}, 'items': {'check_with': 'items', 'type': 'list'}, 'keysrules': {'check_with': 'bulk_schema', 'forbidden': ['rename', 'rename_handler'], 'type': ['dict', 'string']}, 'max': {'nullable': False}, 'maxlength': {'type': 'integer'}, 'meta': {}, 'min': {'nullable': False}, 'minlength': {'type': 'integer'}, 'noneof': {'logical': 'noneof', 'type': 'list'}, 'nullable': {'type': 'boolean'}, 'oneof': {'logical': 'oneof', 'type': 'list'}, 'purge_unknown': {'type': 'boolean'}, 'readonly': {'type': 'boolean'}, 'regex': {'type': 'string'}, 'rename': {'type': 'hashable'}, 'rename_handler': {'oneof': [{'type': 'callable'}, {'type': 'list', 'schema': {'oneof': [{'type': 'callable'}, {'type': 'string', 'allowed': ()}]}}, {'type': 'string', 'allowed': ()}]}, 'require_all': {'type': 'boolean'}, 'required': {'type': 'boolean'}, 'schema': {'anyof': [{'check_with': 'schema'}, {'check_with': 'bulk_schema'}], 'type': ['dict', 'string']}, 'type': {'check_with': 'type', 'type': ['string', 'list']}, 'valuesrules': {'check_with': 'bulk_schema', 'forbidden': ['rename', 'rename_handler'], 'type': ['dict', 'string']}}¶
-
validation_rules= {'allof': {'logical': 'allof', 'type': 'list'}, 'allow_unknown': {'oneof': [{'type': 'boolean'}, {'type': ['dict', 'string'], 'check_with': 'bulk_schema'}]}, 'allowed': {'type': 'container'}, 'anyof': {'logical': 'anyof', 'type': 'list'}, 'check_with': {'oneof': [{'type': 'callable'}, {'type': 'list', 'schema': {'oneof': [{'type': 'callable'}, {'type': 'string', 'allowed': ()}]}}, {'type': 'string', 'allowed': ()}]}, 'contains': {'empty': False}, 'dependencies': {'check_with': 'dependencies', 'type': ('dict', 'hashable', 'list')}, 'empty': {'type': 'boolean'}, 'excludes': {'schema': {'type': 'hashable'}, 'type': ('hashable', 'list')}, 'forbidden': {'type': 'list'}, 'items': {'check_with': 'items', 'type': 'list'}, 'keysrules': {'check_with': 'bulk_schema', 'forbidden': ['rename', 'rename_handler'], 'type': ['dict', 'string']}, 'max': {'nullable': False}, 'maxlength': {'type': 'integer'}, 'meta': {}, 'min': {'nullable': False}, 'minlength': {'type': 'integer'}, 'noneof': {'logical': 'noneof', 'type': 'list'}, 'nullable': {'type': 'boolean'}, 'oneof': {'logical': 'oneof', 'type': 'list'}, 'readonly': {'type': 'boolean'}, 'regex': {'type': 'string'}, 'require_all': {'type': 'boolean'}, 'required': {'type': 'boolean'}, 'schema': {'anyof': [{'check_with': 'schema'}, {'check_with': 'bulk_schema'}], 'type': ['dict', 'string']}, 'type': {'check_with': 'type', 'type': ['string', 'list']}, 'valuesrules': {'check_with': 'bulk_schema', 'forbidden': ['rename', 'rename_handler'], 'type': ['dict', 'string']}}¶
- schema (any mapping) – See
easyvvuq.worker module¶
-
class
easyvvuq.worker.Worker(db_type='sql', db_location=None, campaign_name=None, app_name=None, write_to_db=True)¶ Bases:
objectA Worker is a stripped down version of the Campaign, providing access to runs in the database, encoding etc. The purpose is, for example, to allow encoding/running/decoding of runs to take place in a separate process (script) from the main script.
-
call_for_each_run(fn, status=<Status.ENCODED: 2>)¶ Loop through all runs in this campaign with the specified status, and call the specified user function for each.
-
encode_runs(run_id_list)¶ Runs the encoder for all run ids listed in run_id_list.
-