ewoksmx.tasks.mx_ccp4.mx_ccp4_cloud_uploader.MXCCP4CloudUploader#

class ewoksmx.tasks.mx_ccp4.mx_ccp4_cloud_uploader.MXCCP4CloudUploader(inputs=None, varinfo=None, node_id=None, node_attrs=None, execinfo=None, profile_directory=None)[source]#

Bases: DracDatasetTask

Parameters:
  • inputs (Optional[Mapping])

  • varinfo (Optional[dict])

  • node_id (Union[str, int, tuple, None])

  • node_attrs (Optional[dict])

  • execinfo (Optional[dict])

  • profile_directory (Optional[dict])

MISSING_DATA = <MISSING_DATA>#
are_roles_valid()#

Check that the user has the role that corresponds with the keywods of the workflow

assert_ready_to_execute()#
authenticate(sessionId)#

Validates: 1) the user session based on the provided session ID. 2) The user’s role is allowed by the workflow

Return type:

str

Args:

session_id (str): The session ID to validate.

Raises:

Exception: If the session has expired (lifeTimeMinutes < 0).

authorize(sessionId, datasets)#

Checks: 1) the user has access to all the datasets sent in the attribute datasets 2) the raw_data_path is the location of one of these datasets 3) Validity days

Args:

session_id (str): The session ID to validate. raw_data_path (str): Location of the raw data that needs processing datasets ([]): Array f datasets

Raises:

Exception: If the user has not access to the datasets or the raw_data_path does not belong to the datasets

calculate_output_folder()#

Initializes the FolderManager and computes the output folder path based on the raw data path. Ensures the folder exists before returning.

Returns:

str: The path to the output folder.

cancel()#

Function called when a task is cancelled. To be implemented by the derived classes

property cancelled: bool#

Return True if the task has been cancelled by the user

classmethod class_nonce()#
classmethod class_nonce_data()#
classmethod class_registry_name()#
Return type:

Optional[str]

cleanup_references()#

Removes all references to the inputs. Side effect: fixes the uhash of the task and outputs

abstract compose_output_folder()#
property done: bool#

Completed (with or without exception)

property exception: Exception | None#
execute(force_rerun=False, raise_on_error=True, cleanup_references=False)#
Parameters:
  • force_rerun (Optional[bool])

  • raise_on_error (Optional[bool])

  • cleanup_references (Optional[bool])

extract_metadata_from(datasets, raw_data_path, output_folder)#

This method extracts the necessary “administrative” metadata to upload the datasets to DRAC

property failed: bool#

Completed with exception

fix_uhash()#

Fix the uhash when it is derived from the uhash data.

get_input_uhashes()#
get_input_value(key, default=<MISSING_DATA>)#
Parameters:

default (Any)

Return type:

Any

get_input_values()#
get_named_input_values()#
get_output_transfer_data()#

The values are either DataUri or Variable

get_output_uhashes()#
get_output_value(key, default=<MISSING_DATA>)#
Parameters:

default (Any)

Return type:

Any

get_output_values()#
get_positional_input_values()#
classmethod get_subclass(registry_name, _second_attempt=False)#

Retrieving a derived class

classmethod get_subclass_names()#
Return type:

List[str]

classmethod get_subclasses()#
get_task_name()[source]#

the task name will be used as folder name in the PROCESSED_FOLDER Example: /data/visitor/PROCESSED_DATA/sample/dataset/{task_name}

get_uhash_init(serialize=False)#
classmethod input_model()#
Return type:

Optional[Type[BaseInputModel]]

classmethod input_names()#
Return type:

Set[str]

property input_uhashes#
property input_values#

DEPRECATED

property input_variables: VariableContainer#
property inputs: ReadOnlyVariableContainerNamespace#
instance_nonce()#
classmethod instantiate(registry_name, **kw)#

Factory method for instantiating a derived class.

Parameters:
  • registry_name (str) – for example “tasklib.tasks.MyTask” or “MyTask”

  • **kwTask constructor arguments

  • registry_name

Returns Task:

is_in_validity_days_range()#

Check that the run is between the validity days of the workflow

property is_ready_to_execute#
is_single_run()[source]#

If True the same task can be ran only once

is_upload_to_catalogue_enabled()[source]#

If true the data will be uploaded to the catalogue

property job_id: str | None#
property label: str#
property missing_inputs: VariableContainerMissingNamespace#
property missing_outputs: VariableContainerMissingNamespace#
property n_positional_inputs: int#
classmethod n_required_positional_inputs()#
Return type:

int

property named_input_values#

DEPRECATED

property node_id: str | int | tuple#
property npositional_inputs#

DEPRECATED

classmethod optional_input_names()#
Return type:

Set[str]

property output_metadata: dict | None#
classmethod output_model()#
Return type:

Optional[Type[BaseOutputModel]]

classmethod output_names()#
Return type:

Set[str]

property output_transfer_data#

DEPRECATED

property output_uhashes#

DEPRECATED

property output_values#

DEPRECATED

property output_variables: VariableContainer#
property outputs: VariableContainerNamespace#
property positional_input_values#

DEPRECATED

process(datasets, raw_dataset_folder)[source]#
classmethod required_input_names()#
Return type:

Set[str]

reset_state()#
run()#

Initializes and manages data processing in a safe and coherent manner. Ensures a consistent status lifecycle: STARTED → RUNNING → FINISHED/TERMINATED.

This method: - Retrieves mandatory task input parameters. - Authenticates the session. - Authorize the data. - Logs relevant metadata. - Computes output paths. - Executes the main processing logic. - Uploads to catalog if enabled.

set_uhash_init(pre_uhash=None, instance_nonce=None)#
Parameters:
  • pre_uhash (Union[str, bytes, UniversalHash, HasUhash, None])

  • instance_nonce (Optional[Any])

property succeeded: bool#

Completed without exception and with output values

property task_identifier: str#
property uhash: UniversalHash | None#
uhash_randomize()#
undo_fix_uhash()#
undo_randomize()#
upload_to_catalogue()#
property workflow_id: str | None#