gws_core

Introduction
Getting Started
Developer guide
Release
Architecture
CLI
Technical documentations
Version

ResourceDownloaderBase

Abstract class to aggregate common methods for resource downloader tasks

Attributes
config_specs: Dictfile_downloader: FileDownloaderinput_specs: InputSpecsmessage_dispatcher: MessageDispatcheroutput_specs: OutputSpecsresource_loader: ResourceLoaderstyle: TypingStyle
Functions
__init__

Constructor, please do not overwrite this method, use the init method instead Leave the constructor without parameters

check_before_run

This can be overwritten to perform custom check before running task. See doc of CheckBeforeTaskResult for more information

params : ConfigParams
inputs : TaskInputs
Return type : CheckBeforeTaskResult
create_resource_from_file

Methode to create the resource from a file (once downloaded) and return it as a task output

resource_file : str
uncompress_option : Literal
resource_loader_mode : ShareEntityCreateMode
Return type : Resource
create_tmp_dir

Create a temporary directory. This directory will be deleted after the task is run. Output file or folder are moved out of this directory before it is deleted.

Return type : str
get_default_output_spec_type
spec_name : str
Return type : Type
get_scenario_id
Return type : str
get_task_id
Return type : str
init

This can be overwritten to perform custom initialization of the task. This method is called just after the init and before the check_before_run method

log_debug_message
message : str
log_error_message
message : str
log_info_message
message : str
log_message

Store a message in the progress

message : str
message to store in the progress
type_ : MessageLevel
log_success_message
message : str
log_warning_message
message : str
run

This must be overiwritten to perform the task of the task.

This is where most of your code must go

params : ConfigParams
[description]
inputs : TaskInputs
[description]
Return type : Dict
run_after_task

Save share info, clean temp files, etc

update_progress_value

Update the progress value

value : float
value between 0 and 100 of the progress
message : str
if provided a message is stored on the progress
classname @classmethod

Returns the name of the class

slugify : bool - False
True to slugify the class name if True
snakefy : bool - False
True to snakefy the class name if True
replace_uppercase : bool - False
Replace upper cases by "-" if True
Return type : str
full_classname @classmethod

Returns the full name of the class

slugify : bool - False
Slugify the returned class name if True
snakefy : bool - False
Snakefy the returned class name if True
Return type : str
get_brick_name @classmethod
Return type : str
get_config_specs_dto @classmethod
Return type : Dict
get_human_name @classmethod

Get the human name of the resource

Return type : str
get_input_specs @classmethod

Returns the input specs of the process

Return type : InputSpecs
get_output_specs @classmethod

Returns the input specs of the process

Return type : OutputSpecs
get_short_description @classmethod

Get the short description of the resource

Return type : str
get_style @classmethod

Get the style of the resource

Return type : TypingStyle
get_typing_name @classmethod

Get the typing name of the resource

Return type : str
has_visible_config_specs @classmethod
Return type : bool
inheritors @classmethod

Get all the classes that inherit this class

Return type : List