pytrnsys_process.read package#

Submodules#

pytrnsys_process.read.readers module#

class pytrnsys_process.read.readers.ReaderBase(SKIPFOOTER: int = 24, HEADER: int = 1, DELIMITER: str = '\\s+')[source]#

Bases: object

SKIPFOOTER: int = 24#
HEADER: int = 1#
DELIMITER: str = '\\s+'#
read(file_path: Path, skipfooter: int = 24, header: int = 1, delimiter: str = '\\s+') DataFrame[source]#

Common read function for all readers

__init__(SKIPFOOTER: int = 24, HEADER: int = 1, DELIMITER: str = '\\s+') None#
class pytrnsys_process.read.readers.PrtReader(SKIPFOOTER: int = 24, HEADER: int = 1, DELIMITER: str = '\\s+')[source]#

Bases: ReaderBase

read_hourly(hourly_file: ~pathlib.Path, starting_year: int = 1990, logger: ~logging.Logger = <Logger default_pytrnsys_process (WARNING)>) DataFrame[source]#

Read hourly TRNSYS output data from a file.

Parameters:
  • hourly_file – Path to the hourly TRNSYS output file

  • starting_year – Year to use as the start of the simulation (default: 1990)

Returns:

df – DataFrame with hourly data indexed by timestamp, with ‘Period’ and ‘time’ columns removed

Return type:

pandas.DataFrame

Raises:

ValueError – If the timestamps are not exactly on the hour (minutes or seconds != 0):

read_monthly(monthly_file: ~pathlib.Path, starting_year: int = 1990, logger: ~logging.Logger = <Logger default_pytrnsys_process (WARNING)>) DataFrame[source]#

Read monthly TRNSYS output data from a file.

Parameters:
  • monthly_file – Path to the monthly TRNSYS output file

  • starting_year – Year to use as the start of the simulation (default: 1990)

Returns:

df – DataFrame with monthly data indexed by timestamp, with ‘Month’ and ‘time’ columns removed

Return type:

pandas.DataFrame

Raises:

ValueError – If the timestamps are not at the start of each month at midnight: (not month start or hours/minutes/seconds != 0)

read_step(step_file: Path, starting_year: int = 1990, skipfooter=0, header=0)[source]#
class pytrnsys_process.read.readers.HeaderReader(SKIPFOOTER: int = 24, HEADER: int = 1, DELIMITER: str = '\\s+')[source]#

Bases: ReaderBase

NUMBER_OF_ROWS_TO_SKIP = 1#
NUMBER_OF_ROWS = 0#
read_headers(sim_file: Path) list[str][source]#
__init__(SKIPFOOTER: int = 24, HEADER: int = 1, DELIMITER: str = '\\s+') None#
class pytrnsys_process.read.readers.CsvReader(SKIPFOOTER: int = 0, HEADER: int = 0, DELIMITER: str = ',')[source]#

Bases: ReaderBase

SKIPFOOTER: int = 0#
HEADER: int = 0#
DELIMITER: str = ','#
read_csv(csv_file: Path) DataFrame[source]#
__init__(SKIPFOOTER: int = 0, HEADER: int = 0, DELIMITER: str = ',') None#

Module contents#

class pytrnsys_process.read.PrtReader(SKIPFOOTER: int = 24, HEADER: int = 1, DELIMITER: str = '\\s+')[source]#

Bases: ReaderBase

read_hourly(hourly_file: ~pathlib.Path, starting_year: int = 1990, logger: ~logging.Logger = <Logger default_pytrnsys_process (WARNING)>) DataFrame[source]#

Read hourly TRNSYS output data from a file.

Parameters:
  • hourly_file – Path to the hourly TRNSYS output file

  • starting_year – Year to use as the start of the simulation (default: 1990)

Returns:

df – DataFrame with hourly data indexed by timestamp, with ‘Period’ and ‘time’ columns removed

Return type:

pandas.DataFrame

Raises:

ValueError – If the timestamps are not exactly on the hour (minutes or seconds != 0):

read_monthly(monthly_file: ~pathlib.Path, starting_year: int = 1990, logger: ~logging.Logger = <Logger default_pytrnsys_process (WARNING)>) DataFrame[source]#

Read monthly TRNSYS output data from a file.

Parameters:
  • monthly_file – Path to the monthly TRNSYS output file

  • starting_year – Year to use as the start of the simulation (default: 1990)

Returns:

df – DataFrame with monthly data indexed by timestamp, with ‘Month’ and ‘time’ columns removed

Return type:

pandas.DataFrame

Raises:

ValueError – If the timestamps are not at the start of each month at midnight: (not month start or hours/minutes/seconds != 0)

read_step(step_file: Path, starting_year: int = 1990, skipfooter=0, header=0)[source]#
class pytrnsys_process.read.HeaderReader(SKIPFOOTER: int = 24, HEADER: int = 1, DELIMITER: str = '\\s+')[source]#

Bases: ReaderBase

NUMBER_OF_ROWS = 0#
NUMBER_OF_ROWS_TO_SKIP = 1#
__init__(SKIPFOOTER: int = 24, HEADER: int = 1, DELIMITER: str = '\\s+') None#
read_headers(sim_file: Path) list[str][source]#
class pytrnsys_process.read.CsvReader(SKIPFOOTER: int = 0, HEADER: int = 0, DELIMITER: str = ',')[source]#

Bases: ReaderBase

DELIMITER: str = ','#
HEADER: int = 0#
SKIPFOOTER: int = 0#
__init__(SKIPFOOTER: int = 0, HEADER: int = 0, DELIMITER: str = ',') None#
read_csv(csv_file: Path) DataFrame[source]#