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
55e2b4b0
Commit
55e2b4b0
authored
Jan 11, 2023
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup empty spaces. XML update.
parent
1e0f209e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
51 deletions
+34
-51
bt5/erp5_wendelin_examples/ExtensionTemplateItem/portal_components/extension.erp5.WendelinExamples.py
...Item/portal_components/extension.erp5.WendelinExamples.py
+11
-11
bt5/erp5_wendelin_examples/ExtensionTemplateItem/portal_components/extension.erp5.WendelinExamples.xml
...tem/portal_components/extension.erp5.WendelinExamples.xml
+23
-40
No files found.
bt5/erp5_wendelin_examples/ExtensionTemplateItem/portal_components/extension.erp5.WendelinExamples.py
View file @
55e2b4b0
...
...
@@ -12,7 +12,7 @@ import string
def
getRandomString
():
return
'test_%s'
%
''
.
join
([
random
.
choice
(
string
.
ascii_letters
+
string
.
digits
)
\
for
n
in
xrange
(
32
)])
# Game of Life examples
default_input_ndarray
=
np
.
array
([[
0
,
0
,
0
,
0
,
0
,
0
],
[
0
,
0
,
0
,
1
,
0
,
0
],
...
...
@@ -46,7 +46,7 @@ def game_of_life_out_of_core(self):
reference
=
array_reference
,
version
=
'001'
)
data_array
.
initArray
((
6
,
6
),
uint8
)
life_area
=
data_array
.
getArray
()[:,:]
# ZBigArray -> ndarray view of it
# change the data, exactly as if working with numpy.ndarray but
...
...
@@ -55,10 +55,10 @@ def game_of_life_out_of_core(self):
transaction
.
commit
()
print_list
.
append
(
str
(
life_area
))
for
i
in
range
(
4
):
for
i
in
range
(
4
):
iterate_2
(
life_area
)
print_list
.
append
(
str
(
life_area
))
return
'
\
n
\
n
'
.
join
(
print_list
)
def
ERP5Site_gameOfLife
(
self
,
array_reference
):
...
...
@@ -69,14 +69,14 @@ def ERP5Site_gameOfLife(self, array_reference):
portal_type
=
'Data Array'
,
reference
=
array_reference
)
life_area
=
data_array
.
getArray
()[:,:]
# ZBigArray -> ndarray view of it
# we make a copy, with big volumes maybe not wise
input_life_area
=
np
.
copy
(
life_area
)
# do real calculation on ndarray
iterate_2
(
life_area
)
self
.
log
(
str
(
life_area
))
if
not
(
input_life_area
==
life_area
).
all
():
# input array not equals output array, in this case we can continue
# until we find a solution or an end stage
...
...
@@ -97,10 +97,10 @@ def game_of_life_out_of_core_activities(self):
data_array
.
initArray
((
6
,
6
),
uint8
)
life_area
=
data_array
.
getArray
()[:,:]
# ZBigArray -> ndarray view of it
# initialise
life_area
[:,:]
=
default_input_ndarray
transaction
.
commit
()
# start calculation in background using activities
...
...
@@ -117,12 +117,12 @@ def game_of_life(self):
Z
=
default_input_ndarray
print_list
.
append
(
str
(
Z
))
for
i
in
range
(
4
):
for
i
in
range
(
4
):
iterate_2
(
Z
)
print_list
.
append
(
str
(
Z
))
return
'
\
n
\
n
'
.
join
(
print_list
)
def
DataArray_calculateArraySliceAverageAndStore
(
self
,
start
,
end
):
"""
Compute average on a data array slice and store result on an Active Process.
...
...
bt5/erp5_wendelin_examples/ExtensionTemplateItem/portal_components/extension.erp5.WendelinExamples.xml
View file @
55e2b4b0
...
...
@@ -6,12 +6,6 @@
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
WendelinExamples
</string>
</value>
...
...
@@ -59,28 +53,13 @@
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
...
...
@@ -93,7 +72,7 @@
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
</value>
</item>
</dictionary>
...
...
@@ -102,26 +81,30 @@
</dictionary>
</pickle>
</record>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
patches.WorkflowTool
"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
Workflow
"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</tuple>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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