- Timestamp:
- Mar 4, 2009, 3:04:42 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/numpy/anuga/shallow_water/shallow_water_domain.py
r6441 r6451 1602 1602 msg = 'Function %s could not be executed:\n%s' %(f, e) 1603 1603 # FIXME: Reconsider this semantics 1604 raise msg1604 raise Exception, msg 1605 1605 1606 1606 try: 1607 1607 q = num.array(q, num.float) 1608 1608 except: 1609 msg = 'Return value from vector function %s could ' %f1610 msg += 'not be converted into a numeric array of floats.\n'1611 msg += 'Specified function should return either list or array.'1609 msg = ('Return value from vector function %s could not ' 1610 'be converted into a numeric array of floats.\nSpecified ' 1611 'function should return either list or array.' % f) 1612 1612 raise Exception, msg 1613 1613 … … 1616 1616 func_info = (f.func_name, f.func_code.co_filename, 1617 1617 f.func_code.co_firstlineno) 1618 msg = ('Function %s() must return vector (defined in %s, line %d)' 1619 % func_info) 1620 assert hasattr(q, 'len'), msg 1621 1622 msg = ('Return vector from function %s() must have same ' 1623 'length as input vectors\nq=%s' % (f.func_name, str(q))) 1624 assert len(q) == N, msg 1618 func_msg = 'Function %s (defined in %s, line %d)' % func_info 1619 try: 1620 result_len = len(q) 1621 except: 1622 msg = '%s must return vector' % func_msg 1623 self.fail(msg) 1624 msg = '%s must return vector of length %d' % (func_msg, N) 1625 assert result_len == N, msg 1625 1626 else: 1626 1627 try:
Note: See TracChangeset
for help on using the changeset viewer.