ecopipeline 0.11.3__py3-none-any.whl → 0.11.5__py3-none-any.whl

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.
@@ -293,6 +293,9 @@ def power_ratio_alarm(daily_df: pd.DataFrame, config : ConfigManager, day_table_
293
293
  for required_column in required_columns:
294
294
  if not required_column in ratios_df.columns:
295
295
  raise Exception(f"{required_column} is not present in Variable_Names.csv")
296
+ if ratios_df['alarm_codes'].isna().all() or ratios_df['alarm_codes'].isnull().all():
297
+ print("No alarm codes in ", variable_names_path)
298
+ return pd.DataFrame()
296
299
  if not 'pretty_name' in ratios_df.columns:
297
300
  ratios_df['pretty_name'] = ratios_df['variable_name']
298
301
  else:
@@ -295,6 +295,9 @@ def csv_to_df(csv_filenames: List[str], mb_prefix : bool = False, round_time_ind
295
295
  continue
296
296
 
297
297
  temp_dfs.append(data)
298
+ if len(temp_dfs) <= 0:
299
+ print("no data for timefarme.")
300
+ return pd.DataFrame()
298
301
  df = pd.concat(temp_dfs, ignore_index=False)
299
302
 
300
303
  if create_time_pt_idx:
@@ -306,7 +306,7 @@ def ffill_missing(original_df: pd.DataFrame, config : ConfigManager, previous_fi
306
306
  return df
307
307
 
308
308
  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
- drop_ls_from_df : bool = True):
309
+ drop_ls_from_df : bool = False):
310
310
  """
311
311
  Function takes aggregated dfs and adds loadshift signals to hourly df and loadshift days to daily_df
312
312
 
@@ -342,12 +342,17 @@ def process_ls_signal(df: pd.DataFrame, hourly_df: pd.DataFrame, daily_df: pd.Da
342
342
  df_copy = df.copy()
343
343
 
344
344
  if ls_column in df_copy.columns:
345
+ # print("1",df_copy[np.isfinite(df_copy[ls_column])])
345
346
  df_copy = df_copy[df_copy[ls_column].notna() & np.isfinite(df_copy[ls_column])]
346
-
347
+ # print("2",df_copy[np.isfinite(df_copy[ls_column])])
348
+
347
349
  # Process hourly data - aggregate ls_column values by hour and map to system_state
348
- if ls_column in df.columns:
350
+ if ls_column in df_copy.columns:
349
351
  # Group by hour and calculate mean of ls_column, then round to nearest integer
350
- hourly_ls = df_copy[ls_column].resample('H').mean().round().astype(int)
352
+ hourly_ls = df_copy[ls_column].resample('H').mean().round()
353
+
354
+ # Convert to int only for non-NaN values
355
+ hourly_ls = hourly_ls.apply(lambda x: int(x) if pd.notna(x) else x)
351
356
 
352
357
  # Map the rounded integer values to load_dict, using None for unmapped values
353
358
  hourly_df['system_state'] = hourly_ls.map(load_dict)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ecopipeline
3
- Version: 0.11.3
3
+ Version: 0.11.5
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,20 +1,20 @@
1
1
  ecopipeline/__init__.py,sha256=pjC00JWsjVAhS0jUKHD-wyi4UIpTsWbIg9JaxLS1mlc,275
2
2
  ecopipeline/event_tracking/__init__.py,sha256=SV2kkvJgptjeyLQlqHWcDRpQO6-JC433_dRZ3H9-ZNU,131
3
- ecopipeline/event_tracking/event_tracking.py,sha256=HffWAIAkNJ8INdG3_86RnDgw2bpHwv9hhkZ5oiiugZY,29653
3
+ ecopipeline/event_tracking/event_tracking.py,sha256=uqGfku6QBqFALCedKn9pbOkJtFJ9_aJUUU2nij2y2YQ,29829
4
4
  ecopipeline/extract/__init__.py,sha256=gQ3sak6NJ63Gpo-hZXrtZfeKOTHLRyAVXfTgxxRpqPo,675
5
- ecopipeline/extract/extract.py,sha256=y32feIIzgABwrwfduNQM1hICmkVOU4PYu6-M07zCLpU,51422
5
+ ecopipeline/extract/extract.py,sha256=5C6KrfMAGQhTxHaWc1Lgm8yV5g994Fiinwk-IEVSHbM,51519
6
6
  ecopipeline/load/__init__.py,sha256=NLa_efQJZ8aP-J0Y5xx9DP7mtfRH9jY6Jz1ZMZN_BAA,292
7
7
  ecopipeline/load/load.py,sha256=PaSGWOZI0Xg44_SWN7htn2DPIAU_s8mOtCGibXq25tM,24614
8
8
  ecopipeline/transform/__init__.py,sha256=9au1Rjw7SMtbIxpoq_5XWi6VWTxMU2CBjPksSh4LM1o,2590
9
9
  ecopipeline/transform/bayview.py,sha256=TP24dnTsUD95X-f6732egPZKjepFLJgDm9ImGr-fppY,17899
10
10
  ecopipeline/transform/lbnl.py,sha256=EQ54G4rJXaZ7pwVusKcdK2KBehSdCsNo2ybphtMGs7o,33400
11
- ecopipeline/transform/transform.py,sha256=REdnqimCqI86N_Hy0EF57yDwUnCvHJDeCwcXidSHuwQ,53764
11
+ ecopipeline/transform/transform.py,sha256=UF-sNw4zoxyXv0zsJZk6AqfQxXmAVQ_fsVZtjKiu1sk,54012
12
12
  ecopipeline/utils/ConfigManager.py,sha256=-g1wtExdvhYO5Y6Q3cRbywa__DxRMFruLrB4YanwaPY,12168
13
13
  ecopipeline/utils/NOAADataDownloader.py,sha256=iC2nl_O4PS1KFrchcPXRZxshwZwUMSqXy6BQBUwnOUU,20927
14
14
  ecopipeline/utils/__init__.py,sha256=7dT3tP6SMK4uBW6NBmQ8i6LaNTTuV6fpAZToBBlJ904,62
15
15
  ecopipeline/utils/unit_convert.py,sha256=VFh1we2Y8KV3u21BeWb-U3TlZJXo83q5vdxxkpgcuME,3064
16
- ecopipeline-0.11.3.dist-info/licenses/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
- ecopipeline-0.11.3.dist-info/METADATA,sha256=gKi7lXy39J0EpxToOclUdz3IClHTOMgC161oc42RRSQ,2330
18
- ecopipeline-0.11.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
19
- ecopipeline-0.11.3.dist-info/top_level.txt,sha256=WOPFJH2LIgKqm4lk2OnFF5cgVkYibkaBxIxgvLgO7y0,12
20
- ecopipeline-0.11.3.dist-info/RECORD,,
16
+ ecopipeline-0.11.5.dist-info/licenses/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
+ ecopipeline-0.11.5.dist-info/METADATA,sha256=y6Y85wETutaGhBOT0NbNcsUT-gqjq__93HBm4jxRS8U,2330
18
+ ecopipeline-0.11.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
19
+ ecopipeline-0.11.5.dist-info/top_level.txt,sha256=WOPFJH2LIgKqm4lk2OnFF5cgVkYibkaBxIxgvLgO7y0,12
20
+ ecopipeline-0.11.5.dist-info/RECORD,,