shapepipe.pipeline.dependency_handler

shapepipe.pipeline.dependency_handler

DEPENDENCY HANDLER.

This module defines a class for handling pipeline dependencies.

Author

Samuel Farrens <samuel.farrens@cea.fr>

class DependencyHandler(dependencies=[], executables=[])[source]

Bases: object

Dependency Handler.

This class manages the required Python packages and system executables required to run the pipeline.

Parameters
  • dependencies (list) – List of Python packages names, optionally with required versions

  • executables (list) – List of system executables

property depend

Input Dependency List.

property execute

Input Executable List.

static _convert_to_float(string)[source]

Convert String to Float.

This method converts numerical strings to floats.

Parameters

string (str) – Input string

Returns

Converted value

Return type

float

static _slice_1d(array, indices)[source]

Slice 1D.

Slice 1D list by indices.

Parameters
  • array (list) – List of values

  • indices (list) – List of inidices

Returns

Sliced list

Return type

list

classmethod _slice_2d(array, indices)[source]

Slice 2D.

Slice a list of lists by indices.

Parameters
  • array (list) – List of lists

  • indices (list) – List of inidices

Returns

Sliced list

Return type

list

static _get_indices(array, value)[source]

Get Indices.

Get indices of array elements equal to input value.

Parameters
  • array (list) – List of values

  • value (str) – Value string

Returns

List of indices

Return type

list

classmethod _slice_col_val(array, col, value)[source]

Slice by Column and Value.

Slice a list of lists by elements in a given column equal to a given value.

Parameters
  • array (list) – List of lists

  • col (int) – Column number

  • value (str) – Value string

Returns

Slices list

Return type

list

static _check_executable(exe_name)[source]

Check if Input is Executable.

This method checks if the input executable exists.

Parameters

exe_name (str) – Executable name

Return type

Bool result of test

Raises

TypeError – For invalid input type

_split_string(string)[source]

Split String.

This method splits the version number from the input module string.

Parameters

string (str) – Input module string

Returns

Array of string components

Return type

numpy.ndarray

_split_strings()[source]

Split Strings.

This method splits the input dependency modules strings.

_unique_dependencies()[source]

Create Unique Dependencies.

This method creates a unique list of depencies.

check_dependencies()[source]

Check Dependencies.

This method checks that the required dependencies are installed.

Returns

List of depenecies with versions and paths

Return type

list

check_executables()[source]

Check Executables.

This method checks that the required executables are installed.

Returns

List of executables with paths

Return type

list