nrgpy.quality.quality module#

nrgpy.quality.quality.check_for_missing_txt_files(txt_file_names)[source]#

check list of files for missing file numbers

Parameters:
txt_file_nameslist

list of SymphoniePRO text file exports

Returns:
list

“missing” text file numbers

nrgpy.quality.quality.check_intervals(df: DataFrame, verbose: bool = True, return_info: bool = False, show_all_missing_timestamps: bool = False, show_all_duplicate_timestamps: bool = False, interval: int | str = '') dict | None[source]#

checks for missing or duplicate intervals in a pandas dataframe with a “Timestamp” column

Parameters:
dfobject

the dataframe to be checked

intervalint

[deprecated] the averaging interval in seconds

verbosebool

print results to terminal; False to skip

return_infobool

set to True to return dict with below values

show_all_missing_timestampsbool

set to True to show all missing timestamps in verbose option. otherwise, shows first and last 3.

show_all_duplicate_timestampsbool

set to True to show all duplicate timestamps in verbose option. otherwise, shows first and last 3.

Returns:
dict
actual_rowsint

actual number of rows in data section of export file (1 subtracted for column headers)

expected_rowsint

expected number of rows (assumes 10 min. AVG), converts result to whole integer

time_rangestr

range of time represented in export file

first_intervalstr

file starting timestamp

last_intervalstr

file ending timestamp

missing_timestampslist

a list of missing timestamps

duplicate_timestampslist

a list of duplicate timestamps

Examples

ex. pass a reader.data dataframe for an interval check:

>>>  reader = nrgpy.sympro_txt_read()
instance created, no filename specified
>>> reader.concat_txt(txt_dir="C:/data/sympro_data/000110/")
...
>>> nrgpy.check_intervals(reader.data, interval=600)
Starting timestamp        : 2019-01-01 00:00:00
Ending timestamp          : 2019-07-01 04:50:00
Data set Duration         : 181 days, 4:50:00
Expected rows in data set : 26093
Actual rows in data set   : 26093
Data set complete.
nrgpy.quality.quality.find_duplicate_intervals(__df: DataFrame) tuple[source]#

find duplicate interval timestamps

Returns:
list

a list of all duplicate intervals

nrgpy.quality.quality.find_missing_intervals(__df: DataFrame, interval: int | str) tuple[source]#

find gaps in data dataframe

Returns:
list

a list of all missing intervals

nrgpy.quality.quality.select_interval_length(df: DataFrame, seconds: bool = True) int | float[source]#

returns the mode of the first 10 intervals of the data set

Parameters:
readernrgpy reader object
secondsbool

(True) set to False to get interval length in minutes

Returns:
int
nrgpy.quality.quality.select_mode_from_list(lst: list) int[source]#