ecopipeline 0.11.5__tar.gz → 0.11.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. {ecopipeline-0.11.5/src/ecopipeline.egg-info → ecopipeline-0.11.7}/PKG-INFO +1 -1
  2. {ecopipeline-0.11.5 → ecopipeline-0.11.7}/setup.cfg +1 -1
  3. {ecopipeline-0.11.5 → ecopipeline-0.11.7}/src/ecopipeline/event_tracking/event_tracking.py +4 -1
  4. {ecopipeline-0.11.5 → ecopipeline-0.11.7}/src/ecopipeline/transform/__init__.py +2 -2
  5. {ecopipeline-0.11.5 → ecopipeline-0.11.7}/src/ecopipeline/transform/transform.py +36 -1
  6. ecopipeline-0.11.7/src/ecopipeline/utils/pkls/__init__.py +0 -0
  7. {ecopipeline-0.11.5 → ecopipeline-0.11.7/src/ecopipeline.egg-info}/PKG-INFO +1 -1
  8. {ecopipeline-0.11.5 → ecopipeline-0.11.7}/src/ecopipeline.egg-info/SOURCES.txt +2 -1
  9. {ecopipeline-0.11.5 → ecopipeline-0.11.7}/LICENSE +0 -0
  10. {ecopipeline-0.11.5 → ecopipeline-0.11.7}/README.md +0 -0
  11. {ecopipeline-0.11.5 → ecopipeline-0.11.7}/pyproject.toml +0 -0
  12. {ecopipeline-0.11.5 → ecopipeline-0.11.7}/setup.py +0 -0
  13. {ecopipeline-0.11.5 → ecopipeline-0.11.7}/src/ecopipeline/__init__.py +0 -0
  14. {ecopipeline-0.11.5 → ecopipeline-0.11.7}/src/ecopipeline/event_tracking/__init__.py +0 -0
  15. {ecopipeline-0.11.5 → ecopipeline-0.11.7}/src/ecopipeline/extract/__init__.py +0 -0
  16. {ecopipeline-0.11.5 → ecopipeline-0.11.7}/src/ecopipeline/extract/extract.py +0 -0
  17. {ecopipeline-0.11.5 → ecopipeline-0.11.7}/src/ecopipeline/load/__init__.py +0 -0
  18. {ecopipeline-0.11.5 → ecopipeline-0.11.7}/src/ecopipeline/load/load.py +0 -0
  19. {ecopipeline-0.11.5 → ecopipeline-0.11.7}/src/ecopipeline/transform/bayview.py +0 -0
  20. {ecopipeline-0.11.5 → ecopipeline-0.11.7}/src/ecopipeline/transform/lbnl.py +0 -0
  21. {ecopipeline-0.11.5 → ecopipeline-0.11.7}/src/ecopipeline/utils/ConfigManager.py +0 -0
  22. {ecopipeline-0.11.5 → ecopipeline-0.11.7}/src/ecopipeline/utils/NOAADataDownloader.py +0 -0
  23. {ecopipeline-0.11.5 → ecopipeline-0.11.7}/src/ecopipeline/utils/__init__.py +0 -0
  24. {ecopipeline-0.11.5 → ecopipeline-0.11.7}/src/ecopipeline/utils/unit_convert.py +0 -0
  25. {ecopipeline-0.11.5 → ecopipeline-0.11.7}/src/ecopipeline.egg-info/dependency_links.txt +0 -0
  26. {ecopipeline-0.11.5 → ecopipeline-0.11.7}/src/ecopipeline.egg-info/requires.txt +0 -0
  27. {ecopipeline-0.11.5 → ecopipeline-0.11.7}/src/ecopipeline.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ecopipeline
3
- Version: 0.11.5
3
+ Version: 0.11.7
4
4
  Summary: Contains functions for use in Ecotope Datapipelines
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Classifier: License :: OSI Approved :: GNU General Public License (GPL)
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = ecopipeline
3
- version = 0.11.5
3
+ version = 0.11.7
4
4
  authors = ["Carlos Bello, <bellocarlos@seattleu.edu>, Emil Fahrig <fahrigemil@seattleu.edu>, Casey Mang <cmang@seattleu.edu>, Julian Harris <harrisjulian@seattleu.edu>, Roger Tram <rtram@seattleu.edu>, Nolan Price <nolan@ecotope.com>"]
5
5
  description = Contains functions for use in Ecotope Datapipelines
6
6
  long_description = file: README.md
@@ -78,7 +78,7 @@ def flag_abnormal_COP(daily_data: pd.DataFrame, config : ConfigManager, system:
78
78
  for bound_var, bounds in bounds_df.iterrows():
79
79
  if bound_var in cop_columns:
80
80
  for day, day_values in daily_data.iterrows():
81
- if day_values[bound_var] > bounds['high_alarm'] or day_values[bound_var] < bounds['low_alarm']:
81
+ if not day_values[bound_var] is None and (day_values[bound_var] > bounds['high_alarm'] or day_values[bound_var] < bounds['low_alarm']):
82
82
  alarm_str = f"Unexpected COP Value detected: {bounds['pretty_name']} = {round(day_values[bound_var],2)}"
83
83
  if day in alarms_dict:
84
84
  alarms_dict[day].append([bound_var, alarm_str])
@@ -135,6 +135,9 @@ def flag_boundary_alarms(df: pd.DataFrame, config : ConfigManager, default_fault
135
135
  pd.DataFrame:
136
136
  Pandas dataframe with alarm events
137
137
  """
138
+ if df.empty:
139
+ print("cannot flag boundary alarms. Dataframe is empty")
140
+ return pd.DataFrame()
138
141
  variable_names_path = config.get_var_names_path()
139
142
  try:
140
143
  bounds_df = pd.read_csv(variable_names_path)
@@ -2,7 +2,7 @@ from .transform import rename_sensors, avg_duplicate_times, remove_outliers, ffi
2
2
  aggregate_df, join_to_hourly, concat_last_row, join_to_daily, cop_method_1, cop_method_2, create_summary_tables, remove_partial_days, \
3
3
  convert_c_to_f,convert_l_to_g, convert_on_off_col_to_bool, flag_dhw_outage,generate_event_log_df,convert_time_zone, shift_accumulative_columns, \
4
4
  heat_output_calc, add_relative_humidity, apply_equipment_cop_derate, create_data_statistics_df, delete_erroneous_from_time_pt,column_name_change, \
5
- process_ls_signal
5
+ process_ls_signal, convert_temp_resistance_type
6
6
  from .lbnl import nclarity_filter_new, site_specific, condensate_calculations, gas_valve_diff, gather_outdoor_conditions, aqsuite_prep_time, \
7
7
  nclarity_csv_to_df, _add_date, add_local_time, aqsuite_filter_new, get_refrig_charge, elev_correction, change_ID_to_HVAC, get_hvac_state, \
8
8
  get_cop_values, get_cfm_values, replace_humidity, create_fan_curves, lbnl_temperature_conversions, lbnl_pressure_conversions, \
@@ -14,4 +14,4 @@ __all__ = ["rename_sensors", "avg_duplicate_times", "remove_outliers", "ffill_mi
14
14
  "create_fan_curves", "lbnl_temperature_conversions", "lbnl_pressure_conversions", "lbnl_sat_calculations", "get_site_cfm_info", "get_site_info", "merge_indexlike_rows", "calculate_cop_values", "aggregate_values",
15
15
  "get_energy_by_min", "verify_power_energy", "get_temp_zones120", "get_storage_gals120","convert_c_to_f","convert_l_to_g", "convert_on_off_col_to_bool", "flag_dhw_outage","generate_event_log_df","convert_time_zone",
16
16
  "shift_accumulative_columns","heat_output_calc", "add_relative_humidity","apply_equipment_cop_derate","create_data_statistics_df",
17
- "delete_erroneous_from_time_pt","column_name_change","process_ls_signal"]
17
+ "delete_erroneous_from_time_pt","column_name_change","process_ls_signal", "convert_temp_resistance_type"]
@@ -1,7 +1,7 @@
1
1
  import pandas as pd
2
2
  import numpy as np
3
3
  import datetime as dt
4
- import csv
4
+ import pickle
5
5
  import os
6
6
  from ecopipeline.utils.unit_convert import temp_c_to_f_non_noaa, volume_l_to_g, power_btuhr_to_kw, temp_f_to_c
7
7
  from ecopipeline import ConfigManager
@@ -305,6 +305,41 @@ def ffill_missing(original_df: pd.DataFrame, config : ConfigManager, previous_fi
305
305
  df.apply(_ffill, args=(ffill_df,previous_fill))
306
306
  return df
307
307
 
308
+ def convert_temp_resistance_type(df : pd.DataFrame, column_name : str, sensor_model = 'veris') -> pd.DataFrame:
309
+ """
310
+ Convert temperature in Fahrenheit to resistance in Ohms for 10k Type 2 thermistor.
311
+
312
+ Parameters:
313
+ -----------
314
+ temp_F : float or array-like
315
+ Temperature in Fahrenheit
316
+ model_path : str, optional
317
+ Path to a pickle file containing a saved interpolation model.
318
+ If provided, loads and uses that model instead of the global interp_model.
319
+ If None, uses the global interp_model.
320
+
321
+ Returns:
322
+ --------
323
+ float or ndarray
324
+ Resistance in Ohms
325
+ """
326
+ model_path_t_to_r = '../utils/pkls/'
327
+ model_path_r_to_t = '../utils/pkls/'
328
+ if sensor_model == 'veris':
329
+ model_path_t_to_r = model_path_t_to_r + 'veris_temp_to_resistance_2.pkl'
330
+ model_path_r_to_t = model_path_r_to_t + 'veris_resistance_to_temp_3.pkl'
331
+ else:
332
+ raise Exception("unsupported sensor model")
333
+
334
+ with open(os.path.join(os.path.dirname(__file__),model_path_t_to_r), 'rb') as f:
335
+ model = pickle.load(f)
336
+ df['resistance'] = df[column_name].apply(model)
337
+ with open(os.path.join(os.path.dirname(__file__),model_path_r_to_t), 'rb') as f:
338
+ model = pickle.load(f)
339
+ df[column_name] = df['resistance'].apply(model)
340
+ df.drop(columns='resistance')
341
+ return df
342
+
308
343
  def process_ls_signal(df: pd.DataFrame, hourly_df: pd.DataFrame, daily_df: pd.DataFrame, load_dict: dict = {1: "normal", 2: "loadUp", 3 : "shed"}, ls_column: str = 'ls',
309
344
  drop_ls_from_df : bool = False):
310
345
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ecopipeline
3
- Version: 0.11.5
3
+ Version: 0.11.7
4
4
  Summary: Contains functions for use in Ecotope Datapipelines
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Classifier: License :: OSI Approved :: GNU General Public License (GPL)
@@ -22,4 +22,5 @@ src/ecopipeline/transform/transform.py
22
22
  src/ecopipeline/utils/ConfigManager.py
23
23
  src/ecopipeline/utils/NOAADataDownloader.py
24
24
  src/ecopipeline/utils/__init__.py
25
- src/ecopipeline/utils/unit_convert.py
25
+ src/ecopipeline/utils/unit_convert.py
26
+ src/ecopipeline/utils/pkls/__init__.py
File without changes
File without changes
File without changes