module documentation

Helper functions for naming files.

Most functions are fairly simple, but made to keep a unified and easy-to-handle way of setting filenames. Which should reduce number of errors by typos etc.

Function embed_gap_in_filename Embed gap information in filename (position and duration
Function embed_in_filename General function for embedding strings in the filename
Function embed_nogap_in_filename embed 'nogap' in filename
Function get_condition_folders No summary
Function get_next_non_existent Generate a new filename if path exists, e.g.:
Function model_output_pickle Get name of computed model-output based on state_dict-name
Function threshold_pickle Get name of computed thresholds based on state_dict-name
def embed_gap_in_filename(filename, gap_position, gap_duration): (source)

Embed gap information in filename (position and duration

Parameters
filename:str
gap_position:float
gap_duration:float
Returns
str
def embed_in_filename(filename, embeddings): (source)

General function for embedding strings in the filename

Parameters
filename:stroriginal filename
embeddings:Union[List[str], str]string or list of strings to embed in the filename
Returns
str
def embed_nogap_in_filename(filename): (source)

embed 'nogap' in filename

Parameters
filename:str
Returns
str
def get_condition_folders(mode, bin_width): (source)
Parameters
modespecify whether to use summed ANF or individual channels (defined
bin_widthspecify width of the bins used to down-sample
Returns
def get_next_non_existent(filepath): (source)

Generate a new filename if path exists, e.g.:

When 'test.txt' exists, the function will check 'test-{n=1}.txt' and increment `n` until the filename doesn't exist.

Parameters
filepath:str
Returns
str
def model_output_pickle(state_dict): (source)

Get name of computed model-output based on state_dict-name

Parameters
state_dictstate_dict to retrieve
Returns
filename to use
def threshold_pickle(state_dict): (source)

Get name of computed thresholds based on state_dict-name

Parameters
state_dictstate_dict to retrieve
Returns
filename to use