osl_ephys.utils.file_handling#

File handling utility functions.

Attributes#

osl_logger

Functions#

process_file_inputs(inputs)

Process inputs for several cases

sanitise_filepath(fname)

Remove leading/trailing whitespace, tab, newline and carriage return

_load_unicode_inputs(fname)

find_run_id(infile[, preload])

validate_outdir(outdir)

Checks if an output directory exists and if not creates it.

get_rawdir(files)

Gets the raw data directory from filename(s).

add_subdir(file, outdir[, run_id])

Add sub-directory.

osl_print(s[, logfile])

Module Contents#

osl_ephys.utils.file_handling.osl_logger = None[source]#
osl_ephys.utils.file_handling.process_file_inputs(inputs)[source]#

Process inputs for several cases

The argument, inputs, can be… 1) string path to unicode file 2) string path to dir (e.g. if CTF .ds dir) 3) string path to file or regular-expression matching files 4) list of string paths to files 5) list of string paths to dirs (e.g. if CTF .ds dirs) 6) list of tuples with path to file and output name pairs 7) list of MNE objects

osl_ephys.utils.file_handling.sanitise_filepath(fname)[source]#

Remove leading/trailing whitespace, tab, newline and carriage return characters.

osl_ephys.utils.file_handling._load_unicode_inputs(fname)[source]#
osl_ephys.utils.file_handling.find_run_id(infile, preload=True)[source]#
osl_ephys.utils.file_handling.validate_outdir(outdir)[source]#

Checks if an output directory exists and if not creates it.

osl_ephys.utils.file_handling.get_rawdir(files)[source]#

Gets the raw data directory from filename(s).

osl_ephys.utils.file_handling.add_subdir(file, outdir, run_id=None)[source]#

Add sub-directory.

osl_ephys.utils.file_handling.osl_print(s, logfile=None)[source]#