Skip to content

Commit 90deabc

Browse files
EliEli
authored andcommitted
Eliminate temp file creation
1 parent e019f40 commit 90deabc

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

dms_datastore/download_nwis.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -279,13 +279,7 @@ def download_station(
279279
else:
280280
# We know download code was success and file is big enough to test.
281281
# The length threshold is conservative so could still be empty or bogus
282-
# Todo get rid of this
283-
with open(f"temp_out_{attempt}_{int(param):05}.txt", "w") as fl:
284-
fl.write(station_html)
285-
if (
286-
"No sites found matching" in station_html
287-
or '"timeSeries":[]' in station_html
288-
):
282+
if "No sites found matching" in station_html or "\"timeSeries\":[]" in station_html:
289283
found = False
290284
logger.debug(
291285
f"Based on typical indicators, attempt yielded no data for vari {int(param):05}.txt"

0 commit comments

Comments
 (0)