waveform_collection.local.common module

waveform_collection.local.common.check_file_exists(file)[source]

Checks that the specified file is present and readable.

Parameters:

file (str) – Path to file to test

Returns:

True if file exists and is readable, False otherwise

Return type:

bool

waveform_collection.local.common.check_file_extension(file, extension)[source]

Checks that the specified file has the correct extension.

Parameters:
  • file (str) – Path to file to test

  • extension (str) – Extension to test for, e.g. ‘.txt’

Returns:

True if file has extension extension, False otherwise

Return type:

bool

waveform_collection.local.common.load_json_file(file)[source]

Loads the specified JSON file (must have .json extension) using json.load().

Parameters:

file (str) – Path to JSON file

Returns:

The contents of the JSON file