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

Update for new get_gis_type behavior #1134

Merged
merged 5 commits into from
Dec 14, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
I. #1133 simplify get_gis_type handling
dcdenu4 committed Dec 13, 2022
commit aecef329e3d2bb48a0484c24cfec1d0751644643
11 changes: 2 additions & 9 deletions src/natcap/invest/hra.py
Original file line number Diff line number Diff line change
@@ -1966,17 +1966,10 @@ def _parse_criteria_table(criteria_table_path, target_composite_csv_path):
os.path.dirname(criteria_table_path),
attribute_value).replace('\\', '/')

spatial_file_ok = True
try:
if (pygeoprocessing.get_gis_type(attribute_value) ==
pygeoprocessing.UNKNOWN_TYPE):
# File is not a spatial file
spatial_file_ok = False
_ = pygeoprocessing.get_gis_type(attribute_value)
except ValueError:
# file not found
spatial_file_ok = False

if not spatial_file_ok:
# File is not a spatial file or file not found
raise ValueError(
"Criterion could not be opened as a spatial "
f"file {attribute_value}")