Commit 129a69d8 authored by Rafael Monnerat's avatar Rafael Monnerat

Joblib: Monkey-patch Parallel._print to verbose information on zope logs.

parent 2bb3cf1d
...@@ -87,6 +87,7 @@ from Products.ERP5Type.patches import CMFCoreUtils ...@@ -87,6 +87,7 @@ from Products.ERP5Type.patches import CMFCoreUtils
from Products.ERP5Type.patches import ZopePageTemplate from Products.ERP5Type.patches import ZopePageTemplate
from Products.ERP5Type.patches import ZSQLMethod from Products.ERP5Type.patches import ZSQLMethod
from Products.ERP5Type.patches import MimetypesRegistry from Products.ERP5Type.patches import MimetypesRegistry
from Products.ERP5Type.patches import JoblibParallelPrint
# These symbols are required for backward compatibility # These symbols are required for backward compatibility
from Products.ERP5Type.patches.PropertyManager import ERP5PropertyManager from Products.ERP5Type.patches.PropertyManager import ERP5PropertyManager
......
ENABLE_PATCH = True
try:
import sklearn
#from sklearn.externals import joblib
#from sklearn.externals.joblib.parallel import Parallel
from joblib.parallel import Parallel
except ImportError:
ENABLE_PATCH = False
if ENABLE_PATCH:
from zLOG import LOG, WARNING
def _print(self, msg, msg_args):
msg = msg % msg_args
LOG('Parallel._print', WARNING, '[%s]: %s\n' % (self, msg))
Parallel._print = _print
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment