ecopipeline 0.11.3__tar.gz → 0.11.5__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.
- {ecopipeline-0.11.3/src/ecopipeline.egg-info → ecopipeline-0.11.5}/PKG-INFO +1 -1
- {ecopipeline-0.11.3 → ecopipeline-0.11.5}/setup.cfg +1 -1
- {ecopipeline-0.11.3 → ecopipeline-0.11.5}/src/ecopipeline/event_tracking/event_tracking.py +3 -0
- {ecopipeline-0.11.3 → ecopipeline-0.11.5}/src/ecopipeline/extract/extract.py +3 -0
- {ecopipeline-0.11.3 → ecopipeline-0.11.5}/src/ecopipeline/transform/transform.py +9 -4
- {ecopipeline-0.11.3 → ecopipeline-0.11.5/src/ecopipeline.egg-info}/PKG-INFO +1 -1
- {ecopipeline-0.11.3 → ecopipeline-0.11.5}/LICENSE +0 -0
- {ecopipeline-0.11.3 → ecopipeline-0.11.5}/README.md +0 -0
- {ecopipeline-0.11.3 → ecopipeline-0.11.5}/pyproject.toml +0 -0
- {ecopipeline-0.11.3 → ecopipeline-0.11.5}/setup.py +0 -0
- {ecopipeline-0.11.3 → ecopipeline-0.11.5}/src/ecopipeline/__init__.py +0 -0
- {ecopipeline-0.11.3 → ecopipeline-0.11.5}/src/ecopipeline/event_tracking/__init__.py +0 -0
- {ecopipeline-0.11.3 → ecopipeline-0.11.5}/src/ecopipeline/extract/__init__.py +0 -0
- {ecopipeline-0.11.3 → ecopipeline-0.11.5}/src/ecopipeline/load/__init__.py +0 -0
- {ecopipeline-0.11.3 → ecopipeline-0.11.5}/src/ecopipeline/load/load.py +0 -0
- {ecopipeline-0.11.3 → ecopipeline-0.11.5}/src/ecopipeline/transform/__init__.py +0 -0
- {ecopipeline-0.11.3 → ecopipeline-0.11.5}/src/ecopipeline/transform/bayview.py +0 -0
- {ecopipeline-0.11.3 → ecopipeline-0.11.5}/src/ecopipeline/transform/lbnl.py +0 -0
- {ecopipeline-0.11.3 → ecopipeline-0.11.5}/src/ecopipeline/utils/ConfigManager.py +0 -0
- {ecopipeline-0.11.3 → ecopipeline-0.11.5}/src/ecopipeline/utils/NOAADataDownloader.py +0 -0
- {ecopipeline-0.11.3 → ecopipeline-0.11.5}/src/ecopipeline/utils/__init__.py +0 -0
- {ecopipeline-0.11.3 → ecopipeline-0.11.5}/src/ecopipeline/utils/unit_convert.py +0 -0
- {ecopipeline-0.11.3 → ecopipeline-0.11.5}/src/ecopipeline.egg-info/SOURCES.txt +0 -0
- {ecopipeline-0.11.3 → ecopipeline-0.11.5}/src/ecopipeline.egg-info/dependency_links.txt +0 -0
- {ecopipeline-0.11.3 → ecopipeline-0.11.5}/src/ecopipeline.egg-info/requires.txt +0 -0
- {ecopipeline-0.11.3 → ecopipeline-0.11.5}/src/ecopipeline.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[metadata]
|
|
2
2
|
name = ecopipeline
|
|
3
|
-
version = 0.11.
|
|
3
|
+
version = 0.11.5
|
|
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
|
|
@@ -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 =
|
|
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
|
|
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()
|
|
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)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|