Context#
- class pharmpy.workflows.Context(name, ref=None, common_options=None)[source]#
Bases:
ABC
Context for runs
A database of results, metadata and run files for one tool run
- Parameters:
name (str) – Name of the context
ref (str) – A reference (path) to the context
Attributes Summary
ModelDatabase to store results of models run in context
Methods Summary
abort_workflow
(message)call_workflow
(workflow, unique_name)create_subcontext
(name)Create a new subcontext of this context
exists
(name[, ref])get_model_context_path
(model)Get the parent context of this context
get_subcontext
(name)Get one of the subcontexts of this context
Check if the tool running in the context has completed
Retrieve a list of all model names in the context
Retrieve a list of the names of all subcontexts in the context
log_error
(message[, model])Add an error message to the log
log_info
(message[, model])Add an info message to the log
log_message
(severity, message[, model])Add a message to the log
log_warning
(message[, model])Add a warning message to the log
retrieve_annotation
(name)Retrieve an annotation for a model
retrieve_key
(name)Retrive the key corresponding to a model name
retrieve_log
([level])Retrieve the entire log all - the entire log current - only the current Context level lower - current and sub levels
Read tool metadata
retrieve_model_entry
(name)Retrieve tool results
store_annotation
(name, annotation)Store an annotation string (description) for a model
store_key
(name, key)Associate a key with a model name
store_message
(severity, ctxpath, date, message)store_metadata
(metadata)Store tool metadata
store_results
(res)Store tool results
Attributes Documentation
- context_path#
- model_database#
ModelDatabase to store results of models run in context
Methods Documentation
- abstract list_all_subcontexts()[source]#
Retrieve a list of the names of all subcontexts in the context
- log_info(message, model=None)[source]#
Add an info message to the log
Currently with echo to stdout. In the future this could be changed or be configurable.
- abstract retrieve_key(name)[source]#
Retrive the key corresponding to a model name
This key can be used to lookup the model in the model database
- abstract retrieve_log(level='all')[source]#
Retrieve the entire log all - the entire log current - only the current Context level lower - current and sub levels
- abstract store_annotation(name, annotation)[source]#
Store an annotation string (description) for a model