Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
4674fc09
Commit
4674fc09
authored
Mar 05, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
joblib: python3
parent
3a8ec42f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
9 deletions
+23
-9
bt5/erp5_joblib/ExtensionTemplateItem/portal_components/extension.erp5.joblibUseCaseExamples.py
...portal_components/extension.erp5.joblibUseCaseExamples.py
+7
-2
bt5/erp5_joblib/TestTemplateItem/portal_components/test.erp5.testJoblibActivityUseCase.py
.../portal_components/test.erp5.testJoblibActivityUseCase.py
+1
-1
product/CMFActivity/joblib/CMFActivityParallelBackend.py
product/CMFActivity/joblib/CMFActivityParallelBackend.py
+15
-6
No files found.
bt5/erp5_joblib/ExtensionTemplateItem/portal_components/extension.erp5.joblibUseCaseExamples.py
View file @
4674fc09
...
...
@@ -27,6 +27,7 @@
##############################################################################
import
time
import
six
import
numpy
as
np
from
copy
import
copy
...
...
@@ -38,8 +39,12 @@ from sklearn.base import clone
from
sklearn.utils
import
check_random_state
from
sklearn.model_selection
import
train_test_split
from
sklearn.ensemble
import
RandomForestClassifier
from
sklearn.externals
import
joblib
from
sklearn.externals.joblib.parallel
import
parallel_backend
,
Parallel
,
delayed
if
six
.
PY2
:
from
sklearn.externals
import
joblib
from
sklearn.externals.joblib.parallel
import
parallel_backend
,
Parallel
,
delayed
else
:
import
joblib
from
joblib.parallel
import
parallel_backend
,
Parallel
,
delayed
from
sklearn.datasets
import
load_digits
from
sklearn.svm
import
SVC
from
sklearn.model_selection
import
GridSearchCV
...
...
bt5/erp5_joblib/TestTemplateItem/portal_components/test.erp5.testJoblibActivityUseCase.py
View file @
4674fc09
...
...
@@ -40,7 +40,7 @@ class Test(ERP5TypeTestCase):
self
.
tic
()
active_process
=
self
.
portal
.
portal_activities
.
unrestrictedTraverse
(
path
)
result
=
active_process
.
getResultList
()
self
.
assertAlmostEqual
(
0.9
8444444444444446
,
result
[
0
].
result
)
self
.
assertAlmostEqual
(
0.9
,
result
[
0
].
result
,
0
)
def
test_UnderRootOfSquaresFunction
(
self
):
path
=
self
.
portal
.
Base_driverScriptSquareRoot
()
...
...
product/CMFActivity/joblib/CMFActivityParallelBackend.py
View file @
4674fc09
...
...
@@ -25,18 +25,27 @@
#
##############################################################################
from
zLOG
import
LOG
,
INFO
,
WARNING
import
logging
from
ZODB.POSException
import
ConflictError
from
Products.CMFActivity.ActivityRuntimeEnvironment
import
\
getActivityRuntimeEnvironment
import
six
logger
=
logging
.
getLogger
(
__name__
)
try
:
from
sklearn.externals.joblib
import
register_parallel_backend
from
sklearn.externals.joblib.parallel
import
ParallelBackendBase
,
parallel_backend
from
sklearn.externals.joblib.parallel
import
FallbackToBackend
,
SequentialBackend
from
sklearn.externals.joblib.hashing
import
hash
as
joblib_hash
if
six
.
PY2
:
from
sklearn.externals.joblib
import
register_parallel_backend
from
sklearn.externals.joblib.parallel
import
ParallelBackendBase
,
parallel_backend
from
sklearn.externals.joblib.parallel
import
FallbackToBackend
,
SequentialBackend
from
sklearn.externals.joblib.hashing
import
hash
as
joblib_hash
else
:
from
joblib
import
register_parallel_backend
from
joblib.parallel
import
ParallelBackendBase
,
parallel_backend
from
joblib.parallel
import
FallbackToBackend
,
SequentialBackend
from
joblib.hashing
import
hash
as
joblib_hash
except
ImportError
:
LOG
(
__name__
,
WARNING
,
"Joblib cannot be imported, support disabled"
)
logger
.
warn
(
"Joblib cannot be imported, support disabled"
)
else
:
class
JoblibResult
(
object
):
...
...
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