~ubuntu-branches/ubuntu/raring/python-scipy/raring-proposed

« back to all changes in this revision

Viewing changes to Lib/integrate/common_routines.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-01-07 14:12:12 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070107141212-mm0ebkh5b37hcpzn
* Remove build dependency on python-numpy-dev.
* python-scipy: Depend on python-numpy instead of python-numpy-dev.
* Package builds on other archs than i386. Closes: #402783.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
from scipy_base import *
3
 
from scipy_base.fastumath import *
4
 
 
5
 
def myasarray(a):
6
 
    if type(a) in [type(1.0),type(1L),type(1),type(1j)]:
7
 
        return asarray([a])
8
 
    else:
9
 
        return asarray(a)
10
 
 
11
 
def check_func(thefunc, x0, args, numinputs, output_shape=None):
12
 
    args = (x0[:numinputs],) + args
13
 
    res = myasarray(apply(thefunc,args))
14
 
    if (output_shape != None) and (res.shape != output_shape):
15
 
        if (output_shape[0] != 1):
16
 
            if len(output_shape) > 1:
17
 
                if output_shape[1] == 1:
18
 
                    return res.shape
19
 
            raise TypeError, "There is a mismatch between the input and output shape of %s." % thefunc.func_name
20
 
    return res.shape
21
 
 
22
 
 
23