Utilities (utils)

Utilities tools.

process_header(header[, skipcols])

Process comment-line header (usually indicated by the '#' character) of text files.

load_parameter_set(parameter_file)

Load a parameter set from a file into a dictionary.


horizonground.utils.process_header(header, skipcols=0)[source]

Process comment-line header (usually indicated by the '#' character) of text files.

Parameters
  • header (str) – File header line either delimited by comma or space.

  • skipcols (int, optional) – Skip the first columns (default is 0).

Returns

columns – Column headings of the file.

Return type

list of str

horizonground.utils.load_parameter_set(parameter_file)[source]

Load a parameter set from a file into a dictionary.

Parameters

parameter_file (str or pathlib.Path) – Parameter file with the header line giving the parameter names and the first non-comment line giving the parameter values delimited by comma.

Returns

parameter_set – Parameter set.

Return type

dict

Notes

Parameters with names beginning with ‘Delta’ are discarded.

horizonground.utils.get_test_data_loc(filename)[source]

Get location of the test data set.

Parameters

filename (str) – File name of the test data set including its extension.

Returns

filepath – Path to the test data file.

Return type

pathlib.Path