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 @@ ...@@ -26,8 +26,8 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# #
############################################################################## ##############################################################################
import numpy as np
from erp5.component.document.DataArray import DataArray from erp5.component.document.DataArray import DataArray
from numpy import dtype
from numpy.lib.recfunctions import merge_arrays from numpy.lib.recfunctions import merge_arrays
from wendelin.lib.calc import mul from wendelin.lib.calc import mul
import sys import sys
...@@ -53,10 +53,11 @@ class MergedArray(object): ...@@ -53,10 +53,11 @@ class MergedArray(object):
return (self.itemsize,) return (self.itemsize,)
@property @property
def dtype(self): 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 @property
def shape(self): 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 @property
def size(self): def size(self):
return mul(self.shape) return mul(self.shape)
...@@ -92,11 +93,3 @@ class DataArrayView(DataArray): ...@@ -92,11 +93,3 @@ class DataArrayView(DataArray):
if not line_list: if not line_list:
return None return None
return MergedArray([l[1] for l in sorted(line_list)]) 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 @@ ...@@ -45,9 +45,7 @@
<item> <item>
<key> <string>text_content_warning_message</string> </key> <key> <string>text_content_warning_message</string> </key>
<value> <value>
<tuple> <tuple/>
<string>W: 81, 29: Redefining name \'dtype\' from outer scope (line 30) (redefined-outer-name)</string>
</tuple>
</value> </value>
</item> </item>
<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