ecopipeline 0.4.18__py3-none-any.whl → 0.5.0__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.
@@ -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 + 1):
944
944
  # Set FTP credentials and connect
945
945
  wd = f"/pub/data/noaa/isd-lite/{year}/"
946
946
  ftp_server.cwd(wd)
@@ -449,28 +449,32 @@ def add_relative_humidity(df : pd.DataFrame, temp_col : str ='airTemp_F', dew_po
449
449
  A = 6.11
450
450
  B = 7.5
451
451
  C = 237.3
452
+ try:
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
452
461
 
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))
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
465
 
466
- # Calculate relative humidity
467
- df['relative_humidity'] = (e / e_s) * 100.0
466
+ # Calculate relative humidity
467
+ df['relative_humidity'] = (e / e_s) * 100.0
468
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)
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
471
 
472
- if degree_f:
473
- df.drop(columns=[temp_col_c, dew_point_col_c])
472
+ if degree_f:
473
+ df.drop(columns=[temp_col_c, dew_point_col_c])
474
+ except:
475
+
476
+ df['relative_humidity'] = None
477
+ print("Unable to calculate relative humidity data for timeframe")
474
478
 
475
479
  return df
476
480
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ecopipeline
3
- Version: 0.4.18
3
+ Version: 0.5.0
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,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=Ldlc3dUEyW8SfIU7KI7rmCYaIXofHm3-vfxB2igpIRE,43365
3
+ ecopipeline/extract/extract.py,sha256=ryorqnu1RgyNK7joZRcbMmTajlTlB5hwaYzzpo8Z8Ho,43369
4
4
  ecopipeline/load/__init__.py,sha256=7ipv7GJfZ5382lcrdNm4MyM-WiCEVuRWTqxyzDSZhqg,197
5
5
  ecopipeline/load/load.py,sha256=RbGZSsigkChZpX1SZzYvZuS6-DS0k-d2IYUsJvZDvmk,17485
6
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=9jVIFPGa_xVqcIg--2Wj2Fu8WGp3_C6tWGDvBYmt_Jc,43181
9
+ ecopipeline/transform/transform.py,sha256=uyBIXKCXUCT6zVnZyQohripGAzmY1yV9T1GxsXOtS-s,43390
10
10
  ecopipeline/utils/ConfigManager.py,sha256=t4sfTjGO0g5P50XBQqGVFWaXfAlW1GMDh1DLoBuFGks,9826
11
11
  ecopipeline/utils/__init__.py,sha256=ccWUR0m7gD9DfcgsxBCLOfi4lho6RdYuB2Ugy_g6ZdQ,28
12
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,,
13
+ ecopipeline-0.5.0.dist-info/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
+ ecopipeline-0.5.0.dist-info/METADATA,sha256=gb550ta4s3kOYQCt52JECXo_HaSEeXKkWGeIF3mTVr8,2307
15
+ ecopipeline-0.5.0.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
16
+ ecopipeline-0.5.0.dist-info/top_level.txt,sha256=WOPFJH2LIgKqm4lk2OnFF5cgVkYibkaBxIxgvLgO7y0,12
17
+ ecopipeline-0.5.0.dist-info/RECORD,,