processing.seabird.module module

Inheritance diagram of processing.seabird.module
class processing.seabird.module.ProcessingModule(name, exe_dir, psa_dir, exe_path=None, psa_path=None, new_file_suffix='')[source]

Bases: object

Collects the information necesssary to run a Seabird Processing module.

A module needs paths to an exe, to a psa and to an input file. On top of that, a few non-mandatory settings can be specified, like the output file path or a new file name. The collected information is then used to feed a ProcessingStep.

Parameters:
  • name (str:) – The name of the module. Is used to find corresponding files.

  • exe_dir (Path | str:) – The path to the executable directory. Is used if no direct path to any executable is given.

  • psa_dir (Path | str:) – The path to the configuration directory. Is used if no direct path to any config file is given.

  • exe_path (Path | str | None:) – The path to the modules executable.

  • psa_path (Path | str | None:) – The path to the modules configuration file.

  • new_file_suffix (str:) – An optional suffix to append to the output file name.

check_input_path(input_path, file_type, directory)[source]

Tests the given exe or config path and runs find_file upon failure.

The path needs to be absolute and present. This method basically performs all the logic to retrieve an executable and configuration path with the help of find_file.

Parameters:
  • input_path (Path | str | None :) – The path to the file that needs testing. If none given, directly start searching a default one by calling find_file.

  • file_type (str :) – The type of the file to check on. Either ‘exe’ or some form of configuration file, usually ‘psa’.

  • directory (Path :) – The directory to search for, upon failure.

Return type:

Path | None

find_file(file_type, parent_dir)[source]

Finds the closest matching file of a certain type inside of a given directory.

Parameters:
  • file_type (str :) – The file type to search for.

  • parent_dir (Path :) – The directory to search in.

Return type:

Path | None