shapepipe.pipeline.shared

shapepipe.pipeline.shared

SHARED.

The module defines functions that can be shared between pipeline modules.

Author

Samuel Farrens <samuel.farrens@cea.fr>

check_duplicate(input_list)[source]

Check Duplicate.

Check whether input list contains at least one duplicate.

Parameters

input_list (list) – input list

Returns

Duplicate element, empty string if none found

Return type

str

find_files(path, pattern='*', ext='*')[source]

Find Files.

This method recursively retrieves file names from a given path that match a given pattern and/or have a given extension.

Parameters
  • path (str) – Full path to files

  • pattern (str, optional) – File pattern, default is ‘*’

  • ext (str, optional) – File extension, default is ‘*’

Returns

List of file names

Return type

list

Raises
split_module_run(module_str)[source]

Split Module Run.

Extract module name and run from input string.

Parameters

module_str (str) – Module name or run string

Returns

Module name and module run string

Return type

tuple

Raises

TypeError – If input is not a string