Changeset 3093 for trunk


Ignore:
Timestamp:
02/15/16 20:12:31 (8 years ago)
Author:
Kana Sugimoto
Message:

New Development: No

JIRA Issue: No (bug fixes)

Ready for Test: Yes

Interface Changes: No

What Interface Changed:

Test Programs:

Put in Release Notes: No

Module(s): asap._to_list()

Description: A fix to have asap._to_list() return a list not tuple nor numpy.ndarray.

A fix to have asap._is_sequence_or_number understand numpy.ndarray.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/utils.py

    r2456 r3093  
    1616
    1717def _is_sequence_or_number(param, ptype=int):
    18     if isinstance(param,tuple) or isinstance(param,list):
     18    import numpy
     19    #if isinstance(param,tuple) or isinstance(param,list):
     20    if type(param) in (tuple, list, numpy.ndarray):
    1921        if len(param) == 0: return True # empty list
    2022        out = True
     
    3133        else: return [param]
    3234    if _is_sequence_or_number(param, ptype):
    33         return param
     35        return list(param)
    3436    return None
    3537
Note: See TracChangeset for help on using the changeset viewer.