Changeset 9392


Ignore:
Timestamp:
Jan 13, 2015, 2:06:42 PM (10 years ago)
Author:
davies
Message:

More informative error message in quantity_setting_functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/utilities/quantity_setting_functions.py

    r9352 r9392  
    369369                    quantityVal[fInds], upper_bound)
    370370
     371        # End of loop
     372
    371373        if( min(isSet) != 1):
    372             raise Exception('Some points were not inside any polygon')
     374            print 'Some points were not inside any polygon, ',\
     375                  'or evalute to nan over all datasets'
     376            unset_inds = (isSet!=1).nonzero()[0]
     377            lui = min(5, length(unset_inds))
     378            print 'There are ', length(unset_inds), ' such points'
     379            print 'Here are a few:'
     380            for i in range(lui):
     381                print x[i]+xll, y[i]+yll
     382            raise Exception('It seems the input data needs to be fixed')
    373383
    374384        return quantityVal
Note: See TracChangeset for help on using the changeset viewer.