pytrnsys_process.util.file_converter.CsvConverter#

class pytrnsys_process.util.file_converter.CsvConverter[source]#
__init__(*args, **kwargs)#

Methods

__init__(*args, **kwargs)

convert_sim_results_to_csv(input_path, ...)

Convert TRNSYS simulation results to CSV format.

rename_file_with_prefix(file_path, prefix[, ...])

Rename a file with a given prefix.

using_file_content_read_appropriately(file_path)

Read the file according to the file contents.

static rename_file_with_prefix(file_path: ~pathlib.Path, prefix: ~pytrnsys_process.config.constants.FileType, logger: ~logging.Logger = <Logger default_pytrnsys_process (WARNING)>) None[source]#

Rename a file with a given prefix.

Parameters:
  • file_path – Path to the file to rename

  • prefix – FileType enum value specifying the prefix to use

Returns:

Path – Path to the renamed file

Return type:

pathlib.Path

Raises:

FileNotFoundError – If the file doesn’t exist:

convert_sim_results_to_csv(input_path: ~pathlib.Path, output_dir: ~pathlib.Path, logger: ~logging.Logger = <Logger default_pytrnsys_process (WARNING)>) None[source]#

Convert TRNSYS simulation results to CSV format.

Parameters:
  • input_path (pathlib.Path) – Path to input file or directory containing input files

  • output_dir (pathlib.Path) – Directory where CSV files will be saved

Raises:

ValueError – If a file doesn’t match any known pattern:

static using_file_content_read_appropriately(file_path: ~pathlib.Path, logger: ~logging.Logger = <Logger default_pytrnsys_process (WARNING)>) tuple[str, DataFrame][source]#

Read the file according to the file contents.