ecopipeline 0.4.17__py3-none-any.whl → 0.4.18__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.
- ecopipeline/extract/extract.py +3 -3
- ecopipeline/transform/__init__.py +2 -2
- ecopipeline/transform/transform.py +50 -1
- ecopipeline/utils/unit_convert.py +4 -0
- {ecopipeline-0.4.17.dist-info → ecopipeline-0.4.18.dist-info}/METADATA +1 -1
- {ecopipeline-0.4.17.dist-info → ecopipeline-0.4.18.dist-info}/RECORD +9 -9
- {ecopipeline-0.4.17.dist-info → ecopipeline-0.4.18.dist-info}/LICENSE +0 -0
- {ecopipeline-0.4.17.dist-info → ecopipeline-0.4.18.dist-info}/WHEEL +0 -0
- {ecopipeline-0.4.17.dist-info → ecopipeline-0.4.18.dist-info}/top_level.txt +0 -0
ecopipeline/extract/extract.py
CHANGED
|
@@ -800,8 +800,8 @@ def get_noaa_data(station_names: List[str], config : ConfigManager, station_ids
|
|
|
800
800
|
noaa_dfs = _convert_to_df(station_ids, noaa_filenames, weather_directory)
|
|
801
801
|
formatted_dfs = _format_df(station_ids, noaa_dfs)
|
|
802
802
|
except:
|
|
803
|
-
# temporary solution for NOAA ftp not including
|
|
804
|
-
noaa_df = pd.DataFrame(index=pd.date_range(start='
|
|
803
|
+
# temporary solution for NOAA ftp not including 2025
|
|
804
|
+
noaa_df = pd.DataFrame(index=pd.date_range(start='2025-01-01', periods=10, freq='H'))
|
|
805
805
|
noaa_df['conditions'] = None
|
|
806
806
|
noaa_df['airTemp_F'] = None
|
|
807
807
|
noaa_df['dewPoint_F'] = None
|
|
@@ -940,7 +940,7 @@ def _download_noaa_data(stations: dict, weather_directory : str) -> List[str]:
|
|
|
940
940
|
print("FTP ERROR")
|
|
941
941
|
return
|
|
942
942
|
# Download files for each station from 2010 till present year
|
|
943
|
-
for year in range(2010, year_end
|
|
943
|
+
for year in range(2010, year_end):
|
|
944
944
|
# Set FTP credentials and connect
|
|
945
945
|
wd = f"/pub/data/noaa/isd-lite/{year}/"
|
|
946
946
|
ftp_server.cwd(wd)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from .transform import rename_sensors, avg_duplicate_times, remove_outliers, ffill_missing, nullify_erroneous, sensor_adjustment, round_time, aggregate_df, join_to_hourly, concat_last_row, join_to_daily, cop_method_1, cop_method_2, create_summary_tables, remove_partial_days,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,heat_output_calc
|
|
1
|
+
from .transform import rename_sensors, avg_duplicate_times, remove_outliers, ffill_missing, nullify_erroneous, sensor_adjustment, round_time, aggregate_df, join_to_hourly, concat_last_row, join_to_daily, cop_method_1, cop_method_2, create_summary_tables, remove_partial_days,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,heat_output_calc, add_relative_humidity
|
|
2
2
|
from .lbnl import nclarity_filter_new, site_specific, condensate_calculations, gas_valve_diff, gather_outdoor_conditions, aqsuite_prep_time, nclarity_csv_to_df, _add_date, add_local_time, aqsuite_filter_new, get_refrig_charge, elev_correction, change_ID_to_HVAC, get_hvac_state, get_cop_values, get_cfm_values, replace_humidity, create_fan_curves, lbnl_temperature_conversions, lbnl_pressure_conversions, lbnl_sat_calculations, get_site_cfm_info, get_site_info, merge_indexlike_rows
|
|
3
3
|
from .bayview import calculate_cop_values, aggregate_values, get_energy_by_min, verify_power_energy, get_temp_zones120, get_storage_gals120
|
|
4
4
|
__all__ = ["rename_sensors", "avg_duplicate_times", "remove_outliers", "ffill_missing", "nullify_erroneous", "sensor_adjustment", "round_time", "aggregate_df", "join_to_hourly", "concat_last_row", "join_to_daily",
|
|
@@ -6,4 +6,4 @@ __all__ = ["rename_sensors", "avg_duplicate_times", "remove_outliers", "ffill_mi
|
|
|
6
6
|
"nclarity_csv_to_df", "_add_date", "add_local_time", "aqsuite_filter_new", "get_refrig_charge", "elev_correction", "change_ID_to_HVAC", "get_hvac_state", "get_cop_values", "get_cfm_values", "replace_humidity",
|
|
7
7
|
"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",
|
|
8
8
|
"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",
|
|
9
|
-
"shift_accumulative_columns","heat_output_calc"]
|
|
9
|
+
"shift_accumulative_columns","heat_output_calc", "add_relative_humidity"]
|
|
@@ -3,7 +3,7 @@ import numpy as np
|
|
|
3
3
|
import datetime as dt
|
|
4
4
|
import csv
|
|
5
5
|
import os
|
|
6
|
-
from ecopipeline.utils.unit_convert import temp_c_to_f_non_noaa, volume_l_to_g, power_btuhr_to_kw
|
|
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
|
|
8
8
|
|
|
9
9
|
pd.set_option('display.max_columns', None)
|
|
@@ -425,6 +425,55 @@ def sensor_adjustment(df: pd.DataFrame, config : ConfigManager) -> pd.DataFrame:
|
|
|
425
425
|
|
|
426
426
|
return df
|
|
427
427
|
|
|
428
|
+
def add_relative_humidity(df : pd.DataFrame, temp_col : str ='airTemp_F', dew_point_col : str ='dewPoint_F', degree_f : bool = True):
|
|
429
|
+
"""
|
|
430
|
+
Add a column for relative humidity to the DataFrame.
|
|
431
|
+
|
|
432
|
+
Parameters
|
|
433
|
+
----------
|
|
434
|
+
df : pd.DataFrame
|
|
435
|
+
DataFrame containing air temperature and dew point temperature.
|
|
436
|
+
temp_col : str
|
|
437
|
+
Column name for air temperature.
|
|
438
|
+
dew_point_col : str
|
|
439
|
+
Column name for dew point temperature.
|
|
440
|
+
degree_f : bool
|
|
441
|
+
True if temperature columns are in °F, false if in °C
|
|
442
|
+
|
|
443
|
+
Returns
|
|
444
|
+
-------
|
|
445
|
+
pd.DataFrame:
|
|
446
|
+
DataFrame with an added column for relative humidity.
|
|
447
|
+
"""
|
|
448
|
+
# Define constants
|
|
449
|
+
A = 6.11
|
|
450
|
+
B = 7.5
|
|
451
|
+
C = 237.3
|
|
452
|
+
|
|
453
|
+
if degree_f:
|
|
454
|
+
df[f"{temp_col}_C"] = df[temp_col].apply(temp_f_to_c)
|
|
455
|
+
df[f"{dew_point_col}_C"] = df[dew_point_col].apply(temp_f_to_c)
|
|
456
|
+
temp_col_c = f"{temp_col}_C"
|
|
457
|
+
dew_point_col_c = f"{dew_point_col}_C"
|
|
458
|
+
else:
|
|
459
|
+
temp_col_c = temp_col
|
|
460
|
+
dew_point_col_c = dew_point_col
|
|
461
|
+
|
|
462
|
+
# Calculate saturation vapor pressure (e_s) and actual vapor pressure (e)
|
|
463
|
+
e_s = A * 10 ** ((B * df[temp_col_c]) / (df[temp_col_c] + C))
|
|
464
|
+
e = A * 10 ** ((B * df[dew_point_col_c]) / (df[dew_point_col_c] + C))
|
|
465
|
+
|
|
466
|
+
# Calculate relative humidity
|
|
467
|
+
df['relative_humidity'] = (e / e_s) * 100.0
|
|
468
|
+
|
|
469
|
+
# Handle cases where relative humidity exceeds 100% due to rounding
|
|
470
|
+
df['relative_humidity'] = np.clip(df['relative_humidity'], 0.0, 100.0)
|
|
471
|
+
|
|
472
|
+
if degree_f:
|
|
473
|
+
df.drop(columns=[temp_col_c, dew_point_col_c])
|
|
474
|
+
|
|
475
|
+
return df
|
|
476
|
+
|
|
428
477
|
def cop_method_1(df: pd.DataFrame, recircLosses, heatout_primary_column : str = 'HeatOut_Primary', total_input_power_column : str = 'PowerIn_Total') -> pd.DataFrame:
|
|
429
478
|
"""
|
|
430
479
|
Performs COP calculation method 1 (original AWS method).
|
|
@@ -14,6 +14,10 @@ def temp_c_to_f_non_noaa(temp_c : float):
|
|
|
14
14
|
temp_f = 32 + (temp_c * 1.8)
|
|
15
15
|
return temp_f
|
|
16
16
|
|
|
17
|
+
def temp_f_to_c(temp_f : float):
|
|
18
|
+
temp_c = (temp_f - 32) * 5.0 / 9.0
|
|
19
|
+
return temp_c
|
|
20
|
+
|
|
17
21
|
def power_btuhr_to_kw(power_btuhr : float):
|
|
18
22
|
power_kw = power_btuhr / 3412.0
|
|
19
23
|
return power_kw
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
ecopipeline/__init__.py,sha256=vCRzwd781ciCSXMP1ycM_BXAqxj3KVaNKIjsLOPcbwc,171
|
|
2
2
|
ecopipeline/extract/__init__.py,sha256=3u_CUMdCguVewU3kN8x6xhVNyo1-p-gwTrhjOh7Psqg,645
|
|
3
|
-
ecopipeline/extract/extract.py,sha256=
|
|
3
|
+
ecopipeline/extract/extract.py,sha256=Ldlc3dUEyW8SfIU7KI7rmCYaIXofHm3-vfxB2igpIRE,43365
|
|
4
4
|
ecopipeline/load/__init__.py,sha256=7ipv7GJfZ5382lcrdNm4MyM-WiCEVuRWTqxyzDSZhqg,197
|
|
5
5
|
ecopipeline/load/load.py,sha256=RbGZSsigkChZpX1SZzYvZuS6-DS0k-d2IYUsJvZDvmk,17485
|
|
6
|
-
ecopipeline/transform/__init__.py,sha256=
|
|
6
|
+
ecopipeline/transform/__init__.py,sha256=DcIJfkRs4OmZzDeEfW_OiOIXNqN6CUl1_lW0SS7-eN8,2280
|
|
7
7
|
ecopipeline/transform/bayview.py,sha256=TP24dnTsUD95X-f6732egPZKjepFLJgDm9ImGr-fppY,17899
|
|
8
8
|
ecopipeline/transform/lbnl.py,sha256=EQ54G4rJXaZ7pwVusKcdK2KBehSdCsNo2ybphtMGs7o,33400
|
|
9
|
-
ecopipeline/transform/transform.py,sha256=
|
|
9
|
+
ecopipeline/transform/transform.py,sha256=9jVIFPGa_xVqcIg--2Wj2Fu8WGp3_C6tWGDvBYmt_Jc,43181
|
|
10
10
|
ecopipeline/utils/ConfigManager.py,sha256=t4sfTjGO0g5P50XBQqGVFWaXfAlW1GMDh1DLoBuFGks,9826
|
|
11
11
|
ecopipeline/utils/__init__.py,sha256=ccWUR0m7gD9DfcgsxBCLOfi4lho6RdYuB2Ugy_g6ZdQ,28
|
|
12
|
-
ecopipeline/utils/unit_convert.py,sha256=
|
|
13
|
-
ecopipeline-0.4.
|
|
14
|
-
ecopipeline-0.4.
|
|
15
|
-
ecopipeline-0.4.
|
|
16
|
-
ecopipeline-0.4.
|
|
17
|
-
ecopipeline-0.4.
|
|
12
|
+
ecopipeline/utils/unit_convert.py,sha256=VFh1we2Y8KV3u21BeWb-U3TlZJXo83q5vdxxkpgcuME,3064
|
|
13
|
+
ecopipeline-0.4.18.dist-info/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
|
+
ecopipeline-0.4.18.dist-info/METADATA,sha256=8lh7Wpk6OSMqe-I9v6EXr9E2giiqsskXUTK9xtmjH1Q,2308
|
|
15
|
+
ecopipeline-0.4.18.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
|
16
|
+
ecopipeline-0.4.18.dist-info/top_level.txt,sha256=WOPFJH2LIgKqm4lk2OnFF5cgVkYibkaBxIxgvLgO7y0,12
|
|
17
|
+
ecopipeline-0.4.18.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|