Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Omninbus #296

Merged
merged 2 commits into from
Nov 18, 2024
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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.7.3"
rev: "v0.7.4"
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
2 changes: 1 addition & 1 deletion scripts/import/flowpath2prj.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

LOG = logger()
MISSED_SOILS = {}
YEARS = 2024 - 2006
YEARS = 2025 - 2006
# WEPP can not handle a zero slope, so we ensure that all slopes are >= 0.3%
MIN_SLOPE = 0.003

Expand Down
6 changes: 3 additions & 3 deletions scripts/import/flowpath_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
print(" * VERIFY that the GeoJSON is the 5070 grid value")
print(" * This will generate a `myhucs.txt` file with found HUCs")

YEARS = 2024 - 2007 + 1
YEARS = 2025 - 2007 + 1
SOILFY = 2023
SOILCOL = f"SOL_FY_{SOILFY}"
PREFIX = "fp"
Expand Down Expand Up @@ -80,11 +80,11 @@ def create_flowpath_id(cursor, scenario, huc12, fpath) -> int:
def fillout_codes(df):
""" "Get the right full-string codes."""
s = df["CropRotatn_CY_2022"].str
df["landuse"] = s[1] + s[0] + s[1] + s[:] + s[-2] + s[-1]
df["landuse"] = s[1] + s[0] + s[1] + s[:] + s[-2] + s[-1] + s[-2]
if df["landuse"].str.len().min() != YEARS:
raise ValueError(f"landuse is not {YEARS} chars")
s = df["Management_CY_2022"].str
df["management"] = s[1] + s[0] + s[1] + s[:] + s[-2] + s[-1]
df["management"] = s[1] + s[0] + s[1] + s[:] + s[-2] + s[-1] + s[-2]
if df["management"].str.len().min() != YEARS:
raise ValueError(f"management is not {YEARS} chars")

Expand Down
Loading