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
914ccdf1
Commit
914ccdf1
authored
Feb 28, 2017
by
Klaus Wölfel
Committed by
Laurent S
Jun 26, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enable preview of structured arrays
parent
0d3d3a6c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
bt5/erp5_wendelin/DocumentTemplateItem/portal_components/document.erp5.DataArray.py
...TemplateItem/portal_components/document.erp5.DataArray.py
+7
-0
bt5/erp5_wendelin/SkinTemplateItem/portal_skins/erp5_wendelin/DataArray_getArrayColumnList.py
...ortal_skins/erp5_wendelin/DataArray_getArrayColumnList.py
+4
-1
No files found.
bt5/erp5_wendelin/DocumentTemplateItem/portal_components/document.erp5.DataArray.py
View file @
914ccdf1
...
...
@@ -121,6 +121,13 @@ class DataArray(BigFile):
Get numpy array dtype
"""
return
self
.
getArray
().
dtype
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getArrayDtypeNames'
)
def
getArrayDtypeNames
(
self
):
"""
Get numpy array dtype names
"""
return
self
.
getArray
().
dtype
.
names
security
.
declareProtected
(
Permissions
.
View
,
'index_html'
)
def
index_html
(
self
,
REQUEST
,
RESPONSE
,
format
=
_MARKER
,
inline
=
_MARKER
,
**
kw
):
...
...
bt5/erp5_wendelin/SkinTemplateItem/portal_skins/erp5_wendelin/DataArray_getArrayColumnList.py
View file @
914ccdf1
# return columns from shape of axis 1 of ndarray
# if it is a structured array, set column names from dtype
# never return more than the first 100 columns
array
=
context
.
getArray
()
...
...
@@ -6,7 +7,9 @@ if array is None:
return
[]
else
:
if
len
(
context
.
getArrayShape
())
<
2
:
if
context
.
getArrayDtypeNames
()
is
not
None
:
return
[(
'index'
,
'Index'
)]
+
[(
str
(
i
),
str
(
i
))
for
i
in
context
.
getArrayDtypeNames
()]
elif
len
(
context
.
getArrayShape
())
<
2
:
return
[(
'index'
,
'Index'
),
(
'1'
,
'1'
)]
else
:
return
[(
'index'
,
'Index'
)]
+
[(
str
(
i
),
str
(
i
))
for
i
in
range
(
min
(
context
.
getArrayShape
()[
1
],
100
))]
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