Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added dist/fimserve-0.1.82-py3-none-any.whl
Binary file not shown.
Binary file added dist/fimserve-0.1.82.tar.gz
Binary file not shown.
1,221 changes: 611 additions & 610 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "fimserve"
version = "0.1.81"
version = "0.1.82"
description = "Framework which is developed with the purpose of quickly generating Flood Inundation Maps (FIM) for emergency response and risk assessment. It is developed under Surface Dynamics Modeling Lab (SDML)."
authors = ["Supath Dhital <sdhital@crimson.ua.edu>"]
license = "GPL-3.0"
Expand Down
23 changes: 17 additions & 6 deletions src/fimserve/datadownload.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,30 @@ def setup_directories():

return code_dir, data_dir, output_dir

# def clone_repository(code_dir):
# repo_path = os.path.join(code_dir)

# # Check if repository folder exists and has files in it
# if os.path.exists(repo_path) and os.listdir(repo_path):
# print(
# f"Repository already exists at {repo_path} and contains files. Skipping clone."
# )
# else:
# # Clone the repository if it doesn't exist or is empty
# repo_url = "https://github.com/NOAA-OWP/inundation-mapping.git"
# subprocess.run(["git", "clone", repo_url, repo_path], check=True)
# print(f"Repository cloned into: {repo_path}")

def clone_repository(code_dir):
repo_path = os.path.join(code_dir)
repo_url = "https://github.com/NOAA-OWP/inundation-mapping.git"
version_tag = "v4.6.1.4"

# Check if repository folder exists and has files in it
if os.path.exists(repo_path) and os.listdir(repo_path):
print(
f"Repository already exists at {repo_path} and contains files. Skipping clone."
)
print(f"Repository already exists at {repo_path}. Skipping clone.")
else:
# Clone the repository if it doesn't exist or is empty
repo_url = "https://github.com/NOAA-OWP/inundation-mapping.git"
subprocess.run(["git", "clone", repo_url, repo_path], check=True)
subprocess.run(["git", "checkout", version_tag], cwd=repo_path, check=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
print(f"Repository cloned into: {repo_path}")


Expand Down
8 changes: 4 additions & 4 deletions tests/test_03020202.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fimserve as fm
import pandas as pd

huc = "03020201"
huc = "03020202"

# Download the data
fm.DownloadHUC8(huc)
Expand All @@ -12,7 +12,7 @@
# #Hindcast data
# Get the NWM data
start_date = "2016-01-01"
end_date = "2016-01-02"
end_date = "2016-01-03"

# #For 12060202
feature_id = ["5513784", "5513550", "5512092", "5512484"]
Expand All @@ -27,7 +27,7 @@
# # usgs_sites = ['0209205053', '02091814', '02089500', '02089000']

# for fixed date or day data
value_times = ["2016-01-01"]
value_times = ["2016-01-02"]
fm.getNWMretrospectivedata(huc, start_date, end_date, value_times)


Expand All @@ -52,4 +52,4 @@
# # )

# Run the FIM model
# fm.runOWPHANDFIM(huc)
fm.runOWPHANDFIM(huc, depth=True)