flitsr.input.TCM¶
- class flitsr.input.TCM(split_faults=False, method_level=False, allow_duplicates=None)¶
Bases:
Input- __init__(split_faults=False, method_level=False, allow_duplicates=None)¶
Methods
__init__([split_faults, method_level, ...])check_format(input_path)Check whether the files from the specified input_path are of the concrete types format.
Fills the spectrum object with elements read in from the open file 'f'.
Method to get the separators used for printing out elements when writing a spectrum in the format of this input type.
get_reader(input_path)Static helper method that guesses the input type of the given input path out of all available input types.
get_run_file_name(input_path)Return the name of the run file that this input type determines for the given input string.
get_type()Return the InputType enum of this input type.
read_in(input_path[, split_faults, ...])Static helper method that guesses the input type of the given input path out of all available input types, and reads in the spectrum using that input type.
read_spectrum(input_path)Read in the spectrum from the given input file using this input type.
write_spectrum(spectrum, output_path)Output the spectrum in TCM format
- static check_format(input_path: str) bool¶
Check whether the files from the specified input_path are of the concrete types format. The implementation of this abstract method must return a boolean, where True indicates that the input is in the format recognized by the implementing class, and False otherwise
- Parameters:
input_path – str: The input path to check for format.
- Returns:
True if the input path refers to input in the format that this input type can read, or False otherwise.
- construct_details(f: TextIOWrapper)¶
Fills the spectrum object with elements read in from the open file ‘f’.
- construct_tests(f: TextIOWrapper)¶
- fill_spectrum(f: TextIOWrapper)¶
- classmethod get_elem_separators()¶
Method to get the separators used for printing out elements when writing a spectrum in the format of this input type. NOTE: this method does not need to be implemented by an input type unless it is used in the implemented write_spectrum method.
- static get_run_file_name(input_path: str)¶
Return the name of the run file that this input type determines for the given input string.
- Parameters:
input_path – str: The name of the input file.
- Returns:
The name of the run file.
- read_spectrum(input_path: str) Spectrum¶
Read in the spectrum from the given input file using this input type.
- Parameters:
input_path – str: The path string of the input spectrum.
split_faults – bool: Whether to split faults using FLITSR’s split_faults functionality.
method_level – (Default value = False) Whether to read this spectrum in as a method level spectrum.
- Returns:
The spectrum that was read in.