{ "info": { "author": "Dis.co", "author_email": "service@dis.co", "bugtrack_url": null, "classifiers": [ "License :: Other/Proprietary License", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "
\n\"Dis.co\"\n\n# discomp\nDis.co multi-processing python package\n\nThe discomp is a package that distributes computing jobs using the Dis.co service.\nIt introduces an API similar to the multiprocessing python package.\n\nFor more information about Dis.co itself, please check out the [Dis.co homepage](https://www.dis.co/)\n\n## Overview\n\n### class discomp.Process(name, target, args=())\nInstantiating the Process class creates a new job with a single task in a 'waiting state' and submits it to Dis.co computing service \n\n##### name\nThe job's name.\nThe name is a string used for identification purposes only. It does not have to be unique.\n\n##### target\nThe target is the callable object to be invoked by the running job.\n\n##### args\nThe args is the argument tuple for the target invocation. By default, no arguments are passed to target.\n\n#### start()\nStart running the job on one of the machines .\n\nThis must be called at most once per process object.\n\n#### join(timeout=None)\n\nJoin blocks the calling thread until the job is done. Upon successful completion of the job, results files are downloaded to a new directory, given the job's name within the working directory. \n\nCurrently, timeout must always be 'None'.\n\nA process should be joined at most once.\nA job may be already done by the time join was called. However, the results are downloaded only upon calling join.\n\n\n### class discomp.Pool(processes=None)\nInstantiating the Pool class creates an object to be later used to run a job with one or more tasks executed in many machines, by invoking it's map() method.\nThe Pool class does not take any arguments and has a no control on the number of machines used to run the job tasks.\nThe number of machines are determined separately.\n\n#### map(func, iterable, chunksize=None)\n1. Pool.map applies the same function to many sets of arguments.\n2. It creates a job that runs each set of arguments as a separate task on one of the machines in the \"pool\".\n3. It blocks until the result is ready (i.e. all job's tasks are done).\n4. The results are returned back in the original order (corresponding to the order of the arguments).\n5. Job related files (in addition to script, input, config files that were used to run the task) are downloaded automatically when the job is done under a directory named as the function's name, within the working directory.\n6. The function's arguments should be provided an iterable.\n\n#### starmap(func, iterable, chunksize=None)\n1. Pool.starmap is similar to Pool.map but it can apply the same function to many sets of multiple arguments.\n2. The function's arguments should be provided an iterable. Elements of the iterable are expected to be iterables as well that are unpacked as arguments.\nHence an iterable of [(1,2), (3, 4)] results in [func(1,2), func(3,4)].\n\n\n## Installation:\n\n1. Install Dis.co CLI:\n```\n curl https://s3.us-east-2.amazonaws.com/disco.cli/install.sh | sh\n```\n2. Sign-Up in Dis.co dashboard:\n\n https://app.dis.co/signup\n\n3. Install discomp package:\n```\n pip install discomp\n```\nor \n```\n pip3 install discomp\n```\n\n## Usage:\n\n1. You keep writing your python script as if you were using the multiprocessing package, but instead of importing the process and pool modules from multiprocessing, you import them from discomp.\n2. Setup the environment variables with your Dis.co account's user-name and password (see the examples below).\n\n## Examples:\n\nA trivial example using the Process class:\n```ts\nimport os\nfrom discomp import Process\n\nos.environ['DISCO_LOGIN_USER'] = 'username@mail.com'\nos.environ['DISCO_LOGIN_PASSWORD'] = 'password'\n\ndef func(name):\n print ('Hello', name)\n\np = Process(\n name='MyFirstJobExample',\n target=func,\n args=('Bob',))\n\np.start()\np.join()\n```\n\nOutput:\n
\n\"Process\"\n\n\n\n\n\n\nA basic example using the Pool class:\n```ts\nimport os\nfrom discomp import Pool\n\nos.environ['DISCO_LOGIN_USER'] = 'username@mail.com'\nos.environ['DISCO_LOGIN_PASSWORD'] = 'password'\n\ndef pow3(x):\n print (x**3)\n return (x**3)\n\np = Pool()\nresults = p.map(pow3, range(10))\nprint(results)\n```\n\nOutput:\n
\n\"Process\"\n\n\n\n\n\n\n\n### Contact us:\nPlease feel free to contact us in Dis.co for further information \n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Iqoqo/iqoqomp", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "discomp", "package_url": "https://pypi.org/project/discomp/", "platform": "", "project_url": "https://pypi.org/project/discomp/", "project_urls": { "Homepage": "https://github.com/Iqoqo/iqoqomp" }, "release_url": "https://pypi.org/project/discomp/1.5.0/", "requires_dist": [ "dill (>=0.2.9)", "analytics-python" ], "requires_python": "", "summary": "Dis.co multi-processing python package", "version": "1.5.0" }, "last_serial": 5708236, "releases": { "1.5.0": [ { "comment_text": "", "digests": { "md5": "d0bc0e9a6520075ad42bac4df1e12977", "sha256": "6f579ad09014be35b1f131bcaae0a974e0cda6b721d845b114c8a717a94cf667" }, "downloads": -1, "filename": "discomp-1.5.0-py3-none-any.whl", "has_sig": false, "md5_digest": "d0bc0e9a6520075ad42bac4df1e12977", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14041, "upload_time": "2019-08-21T09:44:53", "url": "https://files.pythonhosted.org/packages/ec/36/7f59fb88397916cd9d422a54f5d930d687041661d518049f3fead3079966/discomp-1.5.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1c30da7b8fd15c5c6ed6c32b91134846", "sha256": "e47583cbedcf3652ee0a61ccb2c3a4611a1d969d4983d122a478cbce970e3678" }, "downloads": -1, "filename": "discomp-1.5.0.tar.gz", "has_sig": false, "md5_digest": "1c30da7b8fd15c5c6ed6c32b91134846", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10097, "upload_time": "2019-08-21T09:44:56", "url": "https://files.pythonhosted.org/packages/21/84/1984f631f41287bef659f5185d2301aff7d16ad435b1ab5515ade2323280/discomp-1.5.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d0bc0e9a6520075ad42bac4df1e12977", "sha256": "6f579ad09014be35b1f131bcaae0a974e0cda6b721d845b114c8a717a94cf667" }, "downloads": -1, "filename": "discomp-1.5.0-py3-none-any.whl", "has_sig": false, "md5_digest": "d0bc0e9a6520075ad42bac4df1e12977", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14041, "upload_time": "2019-08-21T09:44:53", "url": "https://files.pythonhosted.org/packages/ec/36/7f59fb88397916cd9d422a54f5d930d687041661d518049f3fead3079966/discomp-1.5.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1c30da7b8fd15c5c6ed6c32b91134846", "sha256": "e47583cbedcf3652ee0a61ccb2c3a4611a1d969d4983d122a478cbce970e3678" }, "downloads": -1, "filename": "discomp-1.5.0.tar.gz", "has_sig": false, "md5_digest": "1c30da7b8fd15c5c6ed6c32b91134846", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10097, "upload_time": "2019-08-21T09:44:56", "url": "https://files.pythonhosted.org/packages/21/84/1984f631f41287bef659f5185d2301aff7d16ad435b1ab5515ade2323280/discomp-1.5.0.tar.gz" } ] }