Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Klaus Wölfel
wendelin
Commits
07dbbed6
Commit
07dbbed6
authored
Jan 28, 2022
by
Klaus Wölfel
2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Data Array View: customize for mic wind
parent
92ce79e8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
14 deletions
+5
-14
bt5/erp5_wendelin/DocumentTemplateItem/portal_components/document.erp5.DataArrayView.py
...lateItem/portal_components/document.erp5.DataArrayView.py
+4
-11
bt5/erp5_wendelin/DocumentTemplateItem/portal_components/document.erp5.DataArrayView.xml
...ateItem/portal_components/document.erp5.DataArrayView.xml
+1
-3
No files found.
bt5/erp5_wendelin/DocumentTemplateItem/portal_components/document.erp5.DataArrayView.py
View file @
07dbbed6
...
@@ -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
bt5/erp5_wendelin/DocumentTemplateItem/portal_components/document.erp5.DataArrayView.xml
View file @
07dbbed6
...
@@ -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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment