Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
K
klaus_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
Eteri
klaus_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
...
@@ -12,7 +12,7 @@ import string
def
getRandomString
():
def
getRandomString
():
return
'test_%s'
%
''
.
join
([
random
.
choice
(
string
.
ascii_letters
+
string
.
digits
)
\
return
'test_%s'
%
''
.
join
([
random
.
choice
(
string
.
ascii_letters
+
string
.
digits
)
\
for
n
in
xrange
(
32
)])
for
n
in
xrange
(
32
)])
# Game of Life examples
# Game of Life examples
default_input_ndarray
=
np
.
array
([[
0
,
0
,
0
,
0
,
0
,
0
],
default_input_ndarray
=
np
.
array
([[
0
,
0
,
0
,
0
,
0
,
0
],
[
0
,
0
,
0
,
1
,
0
,
0
],
[
0
,
0
,
0
,
1
,
0
,
0
],
...
@@ -46,7 +46,7 @@ def game_of_life_out_of_core(self):
...
@@ -46,7 +46,7 @@ def game_of_life_out_of_core(self):
reference
=
array_reference
,
reference
=
array_reference
,
version
=
'001'
)
version
=
'001'
)
data_array
.
initArray
((
6
,
6
),
uint8
)
data_array
.
initArray
((
6
,
6
),
uint8
)
life_area
=
data_array
.
getArray
()[:,:]
# ZBigArray -> ndarray view of it
life_area
=
data_array
.
getArray
()[:,:]
# ZBigArray -> ndarray view of it
# change the data, exactly as if working with numpy.ndarray but
# change the data, exactly as if working with numpy.ndarray but
...
@@ -55,10 +55,10 @@ def game_of_life_out_of_core(self):
...
@@ -55,10 +55,10 @@ def game_of_life_out_of_core(self):
transaction
.
commit
()
transaction
.
commit
()
print_list
.
append
(
str
(
life_area
))
print_list
.
append
(
str
(
life_area
))
for
i
in
range
(
4
):
for
i
in
range
(
4
):
iterate_2
(
life_area
)
iterate_2
(
life_area
)
print_list
.
append
(
str
(
life_area
))
print_list
.
append
(
str
(
life_area
))
return
'
\
n
\
n
'
.
join
(
print_list
)
return
'
\
n
\
n
'
.
join
(
print_list
)
def
ERP5Site_gameOfLife
(
self
,
array_reference
):
def
ERP5Site_gameOfLife
(
self
,
array_reference
):
...
@@ -69,14 +69,14 @@ def ERP5Site_gameOfLife(self, array_reference):
...
@@ -69,14 +69,14 @@ def ERP5Site_gameOfLife(self, array_reference):
portal_type
=
'Data Array'
,
portal_type
=
'Data Array'
,
reference
=
array_reference
)
reference
=
array_reference
)
life_area
=
data_array
.
getArray
()[:,:]
# ZBigArray -> ndarray view of it
life_area
=
data_array
.
getArray
()[:,:]
# ZBigArray -> ndarray view of it
# we make a copy, with big volumes maybe not wise
# we make a copy, with big volumes maybe not wise
input_life_area
=
np
.
copy
(
life_area
)
input_life_area
=
np
.
copy
(
life_area
)
# do real calculation on ndarray
# do real calculation on ndarray
iterate_2
(
life_area
)
iterate_2
(
life_area
)
self
.
log
(
str
(
life_area
))
self
.
log
(
str
(
life_area
))
if
not
(
input_life_area
==
life_area
).
all
():
if
not
(
input_life_area
==
life_area
).
all
():
# input array not equals output array, in this case we can continue
# input array not equals output array, in this case we can continue
# until we find a solution or an end stage
# until we find a solution or an end stage
...
@@ -97,10 +97,10 @@ def game_of_life_out_of_core_activities(self):
...
@@ -97,10 +97,10 @@ def game_of_life_out_of_core_activities(self):
data_array
.
initArray
((
6
,
6
),
uint8
)
data_array
.
initArray
((
6
,
6
),
uint8
)
life_area
=
data_array
.
getArray
()[:,:]
# ZBigArray -> ndarray view of it
life_area
=
data_array
.
getArray
()[:,:]
# ZBigArray -> ndarray view of it
# initialise
# initialise
life_area
[:,:]
=
default_input_ndarray
life_area
[:,:]
=
default_input_ndarray
transaction
.
commit
()
transaction
.
commit
()
# start calculation in background using activities
# start calculation in background using activities
...
@@ -117,12 +117,12 @@ def game_of_life(self):
...
@@ -117,12 +117,12 @@ def game_of_life(self):
Z
=
default_input_ndarray
Z
=
default_input_ndarray
print_list
.
append
(
str
(
Z
))
print_list
.
append
(
str
(
Z
))
for
i
in
range
(
4
):
for
i
in
range
(
4
):
iterate_2
(
Z
)
iterate_2
(
Z
)
print_list
.
append
(
str
(
Z
))
print_list
.
append
(
str
(
Z
))
return
'
\
n
\
n
'
.
join
(
print_list
)
return
'
\
n
\
n
'
.
join
(
print_list
)
def
DataArray_calculateArraySliceAverageAndStore
(
self
,
start
,
end
):
def
DataArray_calculateArraySliceAverageAndStore
(
self
,
start
,
end
):
"""
"""
Compute average on a data array slice and store result on an Active Process.
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 @@
...
@@ -6,12 +6,6 @@
</pickle>
</pickle>
<pickle>
<pickle>
<dictionary>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<item>
<key>
<string>
default_reference
</string>
</key>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
WendelinExamples
</string>
</value>
<value>
<string>
WendelinExamples
</string>
</value>
...
@@ -59,28 +53,13 @@
...
@@ -59,28 +53,13 @@
<item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<key>
<string>
workflow_history
</string>
</key>
<value>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
</value>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
</record>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<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>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
</pickle>
...
@@ -93,7 +72,7 @@
...
@@ -93,7 +72,7 @@
<item>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
</value>
</value>
</item>
</item>
</dictionary>
</dictionary>
...
@@ -102,26 +81,30 @@
...
@@ -102,26 +81,30 @@
</dictionary>
</dictionary>
</pickle>
</pickle>
</record>
</record>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<pickle>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
patches.WorkflowTool
"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
Workflow
"
/>
</pickle>
</pickle>
<pickle>
<pickle>
<tuple>
<dictionary>
<none/>
<item>
<list>
<key>
<string>
_log
</string>
</key>
<dictionary>
<value>
<item>
<list>
<key>
<string>
action
</string>
</key>
<dictionary>
<value>
<string>
validate
</string>
</value>
<item>
</item>
<key>
<string>
action
</string>
</key>
<item>
<value>
<string>
validate
</string>
</value>
<key>
<string>
validation_state
</string>
</key>
</item>
<value>
<string>
validated
</string>
</value>
<item>
</item>
<key>
<string>
validation_state
</string>
</key>
</dictionary>
<value>
<string>
validated
</string>
</value>
</list>
</item>
</tuple>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</pickle>
</record>
</record>
</ZopeData>
</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