scipy/weave/ext_tools.py
def downcast(var_specs):
    """ Cast python scalars down to most common type of
         arrays used.

         Right now, focus on complex and float types. Ignore int types.
         Require all arrays to have same type before forcing downcasts.

         Note: var_specs are currently altered in place (horrors...!)
    """
    numeric_types = []

    #grab all the numeric types associated with a variables.
    for var in var_specs:
        if hasattr(var,'numeric_type'):
            numeric_types.append(var.numeric_type)

    # if arrays are present, but none of them are double precision,
    # make all numeric types float or complex(float)
    if (('f' in numeric_types or 'F' in numeric_types) and not (
            'd' in numeric_types or 'D' in numeric_types)):
        for var in var_specs:
            if hasattr(var,'numeric_type'):
                if issubclass(var.numeric_type, complex):
                    var.numeric_type = 'F'
                elif issubclass(var.numeric_type, float):
                    var.numeric_type = 'f'
    return var_specs
 Cast python scalars down to most common type of
         arrays used.

         Right now, focus on complex and float types. Ignore int types.
         Require all arrays to have same type before forcing downcasts.

         Note: var_specs are currently altered in place (horrors...!)
    
Cast python scalars down to most common type of
arrays used.

Right now, focus on complex and float types. Ignore int types.
Require all arrays to have same type before forcing downcasts.

var_specs are currently altered in place (horrors...!)
Cast python scalars down to most common type of arrays used . Right now focus on complex and float types . Ignore int types . Require all arrays to have same type before forcing downcasts . var_specs are currently altered in place ( horrors ... ! )
def downcast(var_specs):
    numeric_types = []
    for var in var_specs:
        if hasattr(var,'numeric_type'):
            numeric_types.append(var.numeric_type)
    if (('f' in numeric_types or 'F' in numeric_types) and not (
            'd' in numeric_types or 'D' in numeric_types)):
        for var in var_specs:
            if hasattr(var,'numeric_type'):
                if issubclass(var.numeric_type, complex):
                    var.numeric_type = 'F'
                elif issubclass(var.numeric_type, float):
                    var.numeric_type = 'f'
    return var_specs
def downcast ( var_specs ) : numeric_types = [ ] for var in var_specs : if hasattr ( var , 'numeric_type' ) : numeric_types . append ( var . numeric_type ) if ( ( 'f' in numeric_types or 'F' in numeric_types ) and not ( 'd' in numeric_types or 'D' in numeric_types ) ) : for var in var_specs : if hasattr ( var , 'numeric_type' ) : if issubclass ( var . numeric_type , complex ) : var . numeric_type = 'F' elif issubclass ( var . numeric_type , float ) : var . numeric_type = 'f' return var_specs
Cast python scalars down to most common type of
arrays used.
Cast python scalars down to most common type of arrays used .
""" Cast python scalars down to most common type of
         arrays used.

         Right now, focus on complex and float types. Ignore int types.
         Require all arrays to have same type before forcing downcasts.

         Note: var_specs are currently altered in place (horrors...!)
    """ #grab all the numeric types associated with a variables. # if arrays are present, but none of them are double precision, # make all numeric types float or complex(float)
var_specs