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

Revert "patch fixing date referenced before assignment" #45

Merged
merged 1 commit into from
May 16, 2023
Merged
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
3 changes: 1 addition & 2 deletions src/rat/data_processing/newdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,6 @@ def process_precip(basin_bounds, srcpath, dstpath, secrets=None, temp_datadir=No
ASCII grid file and saved at `dstpath`. All of this is done in a temporarily created directory
which can be controlled by the `datadir` path
"""
date = pd.to_datetime(src_fn.stem.split('_')[0])

if temp_datadir is not None and not os.path.isdir(temp_datadir):
log.warning(f"ERROR: {temp_datadir} directory doesn't exist")
STATUS='FAILED'
Expand Down Expand Up @@ -422,6 +420,7 @@ def process_precip(basin_bounds, srcpath, dstpath, secrets=None, temp_datadir=No

except subprocess.CalledProcessError as e:
src_fn = Path(srcpath)
date = pd.to_datetime(src_fn.stem.split('_')[0])
log.error(f"subprocess.CalledProcessError in {date}: ", e)
# delete old precipitation file and redownload. retry once
try:
Expand Down