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
Sebastian
wendelin
Commits
60a4a1ee
Commit
60a4a1ee
authored
Nov 12, 2015
by
Klaus Wölfel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix data array preview for 1-d an 0-d arrays
parent
457b2ba3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
5 deletions
+23
-5
bt5/erp5_wendelin/SkinTemplateItem/portal_skins/erp5_wendelin/DataArray_getArrayColumnList.xml
...rtal_skins/erp5_wendelin/DataArray_getArrayColumnList.xml
+10
-3
bt5/erp5_wendelin/SkinTemplateItem/portal_skins/erp5_wendelin/DataArray_getArrayRowList.xml
.../portal_skins/erp5_wendelin/DataArray_getArrayRowList.xml
+13
-2
No files found.
bt5/erp5_wendelin/SkinTemplateItem/portal_skins/erp5_wendelin/DataArray_getArrayColumnList.xml
View file @
60a4a1ee
...
@@ -50,7 +50,9 @@
...
@@ -50,7 +50,9 @@
</item>
</item>
<item>
<item>
<key>
<string>
_body
</string>
</key>
<key>
<string>
_body
</string>
</key>
<value>
<string>
# return columns from shape of axis 1 of ndarray\n
<value>
<string
encoding=
"cdata"
>
<![CDATA[
# return columns from shape of axis 1 of ndarray\n
# never return more than the first 100 columns\n
# never return more than the first 100 columns\n
array = context.getArray()\n
array = context.getArray()\n
\n
\n
...
@@ -58,8 +60,13 @@ if array is None:\n
...
@@ -58,8 +60,13 @@ if array is None:\n
return []\n
return []\n
\n
\n
else:\n
else:\n
if len(context.getArrayShape()) < 2:\n
return [(\'index\', \'Index\'), (\'1\', \'1\')]\n
else:\n
return [(\'index\', \'Index\')] + [(str(i), str(i)) for i in range(min(context.getArrayShape()[1], 100))]\n
return [(\'index\', \'Index\')] + [(str(i), str(i)) for i in range(min(context.getArrayShape()[1], 100))]\n
</string>
</value>
]]>
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
...
...
bt5/erp5_wendelin/SkinTemplateItem/portal_skins/erp5_wendelin/DataArray_getArrayRowList.xml
View file @
60a4a1ee
...
@@ -73,11 +73,22 @@ class SequenceSliceMap():\n
...
@@ -73,11 +73,22 @@ class SequenceSliceMap():\n
return self.sequence_slice[index % self.length]\n
return self.sequence_slice[index % self.length]\n
\n
\n
def createTempBase(nr, row):\n
def createTempBase(nr, row):\n
column_iterator = enumerate([col for col in context.DataArray_getArrayColumnList() if col[0] != \'index\'])\n
def getElementFromArray(array, index):\n
return array[index]\n
\n
def getElementFromScalar(scalar, index=None):\n
return scalar\n
\n
column_list = [col for col in context.DataArray_getArrayColumnList() if col[0] != \'index\']\n
column_iterator = enumerate(column_list)\n
if len(column_list) == 1:\n
getElement = getElementFromScalar\n
else:\n
getElement = getElementFromArray\n
return newTempBase(context.getPortalObject(),\n
return newTempBase(context.getPortalObject(),\n
str(id(row)),\n
str(id(row)),\n
index = nr,\n
index = nr,\n
**{col[0]: str(
row[i]
) for i, col in column_iterator})\n
**{col[0]: str(
getElement(row, i)
) for i, col in column_iterator})\n
\n
\n
\n
\n
length = context.getArrayShape()[0]\n
length = context.getArrayShape()[0]\n
...
...
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