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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
wendelin
Commits
e816e4d6
Commit
e816e4d6
authored
Feb 28, 2017
by
Klaus Wölfel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enable preview of structured arrays
parent
fb4333c4
Changes
2
Show 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 @
e816e4d6
...
@@ -122,6 +122,13 @@ class DataArray(BigFile):
...
@@ -122,6 +122,13 @@ class DataArray(BigFile):
"""
"""
return
self
.
getArray
().
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'
)
security
.
declareProtected
(
Permissions
.
View
,
'index_html'
)
def
index_html
(
self
,
REQUEST
,
RESPONSE
,
format
=
_MARKER
,
inline
=
_MARKER
,
**
kw
):
def
index_html
(
self
,
REQUEST
,
RESPONSE
,
format
=
_MARKER
,
inline
=
_MARKER
,
**
kw
):
"""
"""
...
...
bt5/erp5_wendelin/SkinTemplateItem/portal_skins/erp5_wendelin/DataArray_getArrayColumnList.py
View file @
e816e4d6
# return columns from shape of axis 1 of ndarray
# 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
# never return more than the first 100 columns
array
=
context
.
getArray
()
array
=
context
.
getArray
()
...
@@ -6,7 +7,9 @@ if array is None:
...
@@ -6,7 +7,9 @@ if array is None:
return
[]
return
[]
else
:
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'
)]
return
[(
'index'
,
'Index'
),
(
'1'
,
'1'
)]
else
:
else
:
return
[(
'index'
,
'Index'
)]
+
[(
str
(
i
),
str
(
i
))
for
i
in
range
(
min
(
context
.
getArrayShape
()[
1
],
100
))]
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