ngiab-data-preprocess 4.5.0__py3-none-any.whl → 4.5.1__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.
@@ -1,16 +1,16 @@
1
1
  import json
2
2
  import logging
3
3
  import multiprocessing
4
+ import os
4
5
  import shutil
5
6
  import sqlite3
6
7
  from datetime import datetime
7
8
  from pathlib import Path
8
9
  from typing import Dict, Optional
9
- import psutil
10
- import os
11
10
 
12
11
  import numpy as np
13
12
  import pandas
13
+ import psutil
14
14
  import requests
15
15
  import s3fs
16
16
  import xarray as xr
@@ -169,7 +169,7 @@ def make_lstm_config(
169
169
  lat=row["latitude"],
170
170
  lon=row["longitude"],
171
171
  slope_mean=row["mean_slope_mpkm"],
172
- elevation_mean=row["mean.elevation"] / 1000, # convert mm in hf to m
172
+ elevation_mean=row["mean.elevation"] / 100, # convert cm in hf to m
173
173
  )
174
174
  )
175
175
 
@@ -180,14 +180,16 @@ def configure_troute(
180
180
  with open(file_paths.template_troute_config, "r") as file:
181
181
  troute_template = file.read()
182
182
  time_step_size = 300
183
- gpkg_file_path=f"{config_dir}/{cat_id}_subset.gpkg"
183
+ gpkg_file_path = f"{config_dir}/{cat_id}_subset.gpkg"
184
184
  nts = (end_time - start_time).total_seconds() / time_step_size
185
185
  with sqlite3.connect(gpkg_file_path) as conn:
186
186
  ncats_df = pandas.read_sql_query("SELECT COUNT(id) FROM 'divides';", conn)
187
- ncats = ncats_df['COUNT(id)'][0]
187
+ ncats = ncats_df["COUNT(id)"][0]
188
188
 
189
- est_bytes_required = nts * ncats * 45 # extremely rough calculation based on about 3 tests :)
190
- local_ram_available = 0.8 * psutil.virtual_memory().available # buffer to not accidentally explode machine
189
+ est_bytes_required = nts * ncats * 45 # extremely rough calculation based on about 3 tests :)
190
+ local_ram_available = (
191
+ 0.8 * psutil.virtual_memory().available
192
+ ) # buffer to not accidentally explode machine
191
193
 
192
194
  if est_bytes_required > local_ram_available:
193
195
  max_loop_size = nts // (est_bytes_required // local_ram_available)
@@ -210,7 +212,7 @@ def configure_troute(
210
212
  start_datetime=start_time.strftime("%Y-%m-%d %H:%M:%S"),
211
213
  nts=nts,
212
214
  max_loop_size=max_loop_size,
213
- binary_nexus_file_folder_comment=binary_nexus_file_folder_comment
215
+ binary_nexus_file_folder_comment=binary_nexus_file_folder_comment,
214
216
  )
215
217
 
216
218
  with open(config_dir / "troute.yaml", "w") as file:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ngiab_data_preprocess
3
- Version: 4.5.0
3
+ Version: 4.5.1
4
4
  Summary: Graphical Tools for creating Next Gen Water model input data.
5
5
  Author-email: Josh Cunningham <jcunningham8@ua.edu>
6
6
  Project-URL: Homepage, https://github.com/CIROH-UA/NGIAB_data_preprocess
@@ -1,4 +1,4 @@
1
- data_processing/create_realization.py,sha256=0MwejpLd6Kgt1MNvWbzO5cUZQ541T4BQIvN7H6eIQHQ,10776
1
+ data_processing/create_realization.py,sha256=deRP3p4zfV9PF_vUikYKRiKA994bgj2GtPGCjQDSsTE,10795
2
2
  data_processing/dask_utils.py,sha256=A2IP94WAz8W9nek3etXKEKTOxGPf0NWSFLh8cZ5S-xU,2454
3
3
  data_processing/dataset_utils.py,sha256=AJOxE2nRfZnWYon_qqGcfkpRZuRW8Yy8YI86SxVDU3M,11168
4
4
  data_processing/datasets.py,sha256=_EJ1uZSWTU1HWpvF7TQSikneJqWZFikTrdo9usCV8A0,4665
@@ -34,9 +34,9 @@ ngiab_data_cli/__main__.py,sha256=io9YbZY65tQC66gpcP02ECRnGpM-fnjLxQHa1EKDKzc,10
34
34
  ngiab_data_cli/arguments.py,sha256=qS8RupcT3Ax7ZRT0uKKzFdUvkDdVugBlYyuzljY_bxo,4290
35
35
  ngiab_data_cli/custom_logging.py,sha256=iS2XozaxudcxQj17qAsrCgbVK9LJAYAPmarJuVWJo1k,1280
36
36
  ngiab_data_cli/forcing_cli.py,sha256=eIWRxRWUwPqR16fihFDEIV4VzGlNuvcD6lJW5VYjkPU,3635
37
- ngiab_data_preprocess-4.5.0.dist-info/licenses/LICENSE,sha256=6dMSprwwnsRzEm02mEDbKHD9dUbL8bPIt9Vhrhb0Ulk,1081
38
- ngiab_data_preprocess-4.5.0.dist-info/METADATA,sha256=Bi0eWXPdCRdlSaaX2gomdRU9GxfjhS2U-xLagpScUQc,13344
39
- ngiab_data_preprocess-4.5.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
40
- ngiab_data_preprocess-4.5.0.dist-info/entry_points.txt,sha256=spwlhKEJ3ZnNETQsJGeTjD7Vwy8O_zGHb9GdX8ACCtw,128
41
- ngiab_data_preprocess-4.5.0.dist-info/top_level.txt,sha256=CjhYAUZrdveR2fOK6rxffU09VIN2IuPD7hk4V3l3pV0,52
42
- ngiab_data_preprocess-4.5.0.dist-info/RECORD,,
37
+ ngiab_data_preprocess-4.5.1.dist-info/licenses/LICENSE,sha256=6dMSprwwnsRzEm02mEDbKHD9dUbL8bPIt9Vhrhb0Ulk,1081
38
+ ngiab_data_preprocess-4.5.1.dist-info/METADATA,sha256=Sa-C8mvOi-1Qn5u27X2Dz5wYeMPLnjle-nuC_VJ2kZo,13344
39
+ ngiab_data_preprocess-4.5.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
40
+ ngiab_data_preprocess-4.5.1.dist-info/entry_points.txt,sha256=spwlhKEJ3ZnNETQsJGeTjD7Vwy8O_zGHb9GdX8ACCtw,128
41
+ ngiab_data_preprocess-4.5.1.dist-info/top_level.txt,sha256=CjhYAUZrdveR2fOK6rxffU09VIN2IuPD7hk4V3l3pV0,52
42
+ ngiab_data_preprocess-4.5.1.dist-info/RECORD,,