Dataset¶
arkindex_worker.worker.dataset ¶
BaseWorker methods for datasets.
Classes¶
MissingDatasetArchive ¶
Bases: Exception
Exception raised when the compressed archive associated to a dataset isn’t found in its task artifacts.
DatasetMixin ¶
Functions¶
add_arguments ¶
add_arguments() -> None
Define specific argparse
arguments for the worker using this mixin
Source code in arkindex_worker/worker/dataset.py
76 77 78 79 80 81 82 83 84 85 86 87 88 |
|
list_process_sets ¶
list_process_sets() -> Iterator[Set]
List dataset sets associated to the worker’s process. This helper is not available in developer mode.
Returns:
Type | Description |
---|---|
Iterator[Set]
|
An iterator of |
Source code in arkindex_worker/worker/dataset.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
|
list_set_elements ¶
list_set_elements(dataset_set: Set) -> Iterator[Element]
List elements in a dataset set.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataset_set |
Set
|
Set to find elements in. |
required |
Returns:
Type | Description |
---|---|
Iterator[Element]
|
An iterator of Element built from the |
Source code in arkindex_worker/worker/dataset.py
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
|
list_sets ¶
list_sets() -> Iterator[Set]
List the sets to be processed, either from the CLI arguments or using the list_process_sets method.
Returns:
Type | Description |
---|---|
Iterator[Set]
|
An iterator of |
Source code in arkindex_worker/worker/dataset.py
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
|
update_dataset_state ¶
update_dataset_state(
dataset: Dataset, state: DatasetState
) -> Dataset
Partially updates a dataset state through the API.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataset |
Dataset
|
The dataset to update. |
required |
state |
DatasetState
|
State of the dataset. |
required |
Returns:
Type | Description |
---|---|
Dataset
|
The updated |
Source code in arkindex_worker/worker/dataset.py
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
|
Functions¶
check_dataset_set ¶
check_dataset_set(value: str) -> tuple[uuid.UUID, str]
The --set
argument should have the following format:
Args: value (str): Provided argument.
Raises: ArgumentTypeError: When the value is invalid.
Returns: tuple[uuid.UUID, str]: The ID of the dataset parsed as UUID and the name of the set.
Source code in arkindex_worker/worker/dataset.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
|