Changeset 722
- Timestamp:
- 08/09/10 17:15:21 (1 year ago)
- Files:
-
- PythonPackages/FuncDesigner/FuncDesigner/ooPoint.py (modified) (1 diff)
- PythonPackages/FuncDesigner/FuncDesigner/ooVar.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
PythonPackages/FuncDesigner/FuncDesigner/ooPoint.py
r516 r722 8 8 9 9 from misc import FuncDesignerException 10 from numpy import asfarray, ndarray 10 11 11 12 class ooPoint(dict): 12 13 _id = 0 13 14 def __init__(self, *args, **kwargs): 14 dict.__init__(self, *args, **kwargs) 15 if args: 16 items = [(key, asfarray(val) if type(val) != ndarray else val) for key, val in args[0]] 17 elif kwargs: 18 items = [(key, asfarray(val) if type(val) != ndarray else val) for key, val in kwargs.items()] 19 else: 20 raise FuncDesignerException('incorrect oopoint constructor arguments') 21 22 dict.__init__(self, items) 23 15 24 ooPoint._id += 1 16 25 self._id = ooPoint._id PythonPackages/FuncDesigner/FuncDesigner/ooVar.py
r719 r722 26 26 tmp = x.get(self, None) 27 27 if tmp is not None: 28 r = tmp if type(tmp)==ndarray else asfarray(tmp)28 r = tmp #if type(tmp)==ndarray else asfarray(tmp) 29 29 elif self.name in x: 30 30 r = asfarray(x[self.name]) … … 38 38 else: 39 39 raise FuncDesignerException('Incorrect data type (%s) while obtaining oovar %s value' %(type(x), self.name)) 40 41 40 42 41 if 'size' in self.__dict__ and type(self.size) == int and Len(r) != self.size: # len(r) for lists/tuples
