Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
erp5 erp5
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Labels
    • Labels
  • Merge requests 139
    • Merge requests 139
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedi
  • erp5erp5
  • Merge requests
  • !243

Merged
Created Mar 27, 2017 by Hardik Juneja@hjunejaContributor

Using CMFActivity as a backend for Joblib

  • Overview 88
  • Commits 5
  • Changes 29

This merge request is an attempt to use CMFActivity as a backend for scikit learn's [joblib] (https://github.com/joblib/joblib) library.

For further reading : https://nexedi.erp5.net/web_page_module/6103/WebPage_viewAsWeb

Tests Results : https://nexedi.erp5.net/test_result_module/20171213-4777F59

In this pull request I introduce new activity type SQLJoblib, this activity type will store the results in a resultDict

Below is a small example for SQLJoblib usage with resultDict

from Products.CMFActivity.Activity.SQLJoblib import sqljoblib_hash

active_process = portal.portal_activities.newActiveProcess() 

# document can be the persistent model array, or the input array for example
#
# it can also be the active_process is the calculation has no context 
# but this is a special case
document = portal.restrictedTraverse(some_url) 

document.activate(activity="SQLJoblib" , active_process=active_process).someMethod(1, 2, 3, 4) 
document.activate(activity="SQLJoblib" , active_process=active_process).someMethod(3, 4, 5, 6) 
document.activate(activity="SQLJoblib" , active_process=active_process).someMethod(7, 8, 9, 10) 

# Print results as dict
result_dict = active_process.getResultDict() 
print result_dict[sqljoblib_hash(1, 2, 3, 4)] # returns 1 
print result_dict[sqljoblib_hash(3, 4, 5, 6)] # returns 2 
print result_dict[sqljoblib_hash(7, 8, 9, 10)] # returns 3 
Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: joblib_improv
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7