Skip to content

Commit

Permalink
Printing the subwatersheds vector for debugging. RE:natcap#1641
Browse files Browse the repository at this point in the history
  • Loading branch information
phargogh committed Oct 10, 2024
1 parent 670cb7d commit 56eb76d
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions scripts/invest-autovalidate.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!python

import os
import tempfile
import logging
import argparse
import unittest
import glob
import importlib
import shutil
import logging
import os
import pprint
import shutil
import tempfile
import unittest

from natcap.invest import datastack

Expand Down Expand Up @@ -82,8 +82,13 @@ def main(sampledatadir):
model_warnings = [] # define here in case of uncaught exception.
try:
LOGGER.info('validating %s ', datastack_path)
model_warnings = getattr(
model_module, 'validate')(paramset.args)
try:
model_warnings = getattr(
model_module, 'validate')(paramset.args)
except RuntimeError:
with open('data/invest-sample-data/Annual_Water_Yield/subwatersheds_gura.shp') as shp:
print(shp.read())
raise
except AttributeError as err:
# If there was no validate function, don't crash but raise it later.
model_warnings = err
Expand Down

0 comments on commit 56eb76d

Please sign in to comment.