Changeset 9094


Ignore:
Timestamp:
Apr 26, 2014, 1:56:02 PM (11 years ago)
Author:
steve
Message:

Change to deal with scipy interp1d function when it throws valueException

Location:
trunk/anuga_core/source/anuga
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/__init__.py

    r9059 r9094  
    160160from anuga.operators.set_friction_operators import Depth_friction_operator
    161161
     162from anuga.operators.set_elevation_operator import Set_elevation_operator
     163from anuga.operators.set_quantity_operator import Set_quantity_operator
     164from anuga.operators.set_stage_operator import Set_stage_operator
     165
     166from anuga.operators.erosion_operators import Bed_shear_erosion_operator
     167from anuga.operators.erosion_operators import Flat_slice_erosion_operator
     168from anuga.operators.erosion_operators import Flat_fill_slice_erosion_operator
    162169
    163170#---------------------------
  • trunk/anuga_core/source/anuga/utilities/function_utils.py

    r9029 r9094  
    3939        t =0.0
    4040
     41        #function(x,y,t)
    4142        try:
    4243            function(x,y,t)
    43         except:
     44        except TypeError:
    4445            #print 'Problem calling with three arguments'
    4546            try:
    4647                function(x,y)
    47             except:
     48            except TypeError:
    4849                #print 'Problem calling with 2 array arguments'
    4950                try:
    5051                    function(t)
    51                 except:
     52                except TypeError:
    5253                    #print 'problem calling with one scalar argument'
    5354                    msg = 'Input argument cannot be called as f(t), f(x,y) or f(x,y,t)'
    5455                    raise Exception, msg
     56                except ValueError:
     57                    #print 'problem calling out of range'
     58                    return 't'
    5559                else:
    5660                    return 't'
     61            except ValueError:
     62                return 'x,y'
    5763            else:
    5864                return 'x,y'
     65        except ValueError:
     66            return 'x,y,t'
    5967        else:
    6068            return 'x,y,t'
Note: See TracChangeset for help on using the changeset viewer.