Commit 07dbbed6 authored by Klaus Wölfel's avatar Klaus Wölfel

Data Array View: customize for mic wind

parent 92ce79e8
......@@ -26,8 +26,8 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import numpy as np
from erp5.component.document.DataArray import DataArray
from numpy import dtype
from numpy.lib.recfunctions import merge_arrays
from wendelin.lib.calc import mul
import sys
......@@ -53,10 +53,11 @@ class MergedArray(object):
return (self.itemsize,)
@property
def dtype(self):
return dtype(reduce(lambda x, y: [(n, x.dtype.fields[n][0]) for n in x.dtype.names] + [(n, y.dtype.fields[n][0]) for n in y.dtype.names], self.array_list))
#return np.dtype(reduce(lambda x, y: [(n, x.dtype.fields[n][0]) for n in x.dtype.names] + [(n, y.dtype.fields[n][0]) for n in y.dtype.names], self.array_list))
return np.dtype("float64")
@property
def shape(self):
return (min((len(a) for a in self.array_list)),)
return (min([len(a) for a in self.array_list]), sum([len(a.dtype.names) for a in self.array_list]))
@property
def size(self):
return mul(self.shape)
......@@ -92,11 +93,3 @@ class DataArrayView(DataArray):
if not line_list:
return None
return MergedArray([l[1] for l in sorted(line_list)])
def getArrayDtype(self):
"""Standard dtype"""
return "float64"
def getArrayShape(self):
"""Standard shape"""
return (self.getArray().shape[0], 48)
\ No newline at end of file
......@@ -45,9 +45,7 @@
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple>
<string>W: 81, 29: Redefining name \'dtype\' from outer scope (line 30) (redefined-outer-name)</string>
</tuple>
<tuple/>
</value>
</item>
<item>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment