{ "info": { "author": "Valentin", "author_email": "", "bugtrack_url": null, "classifiers": [], "description": "Taskpacker\n===========\n\n.. image:: https://raw.githubusercontent.com/Edinburgh-Genome-Foundry/Taskpacker/master/docs/_static/images/title.png\n :alt: [logo]\n :align: center\n :width: 600px\n\nTaskpacker is a generic schedule optimization and visualization library for Python.\nFor instance, below is the optimized schedule of 20 batches of 96 DNA assemblies,\nassuming a robotic foundry running 24/7:\n\n.. image:: https://raw.githubusercontent.com/Edinburgh-Genome-Foundry/Taskpacker/master/examples/dna_assembly.png\n :alt: [dna_assembly.png]\n :align: center\n :width: 600px\n\nSuch plots enable you to spot the bottlenecks of your factory. In this example,\nit appears that ovens are the limiting elements (the only machines packed full\nwith no downtime) and that buying a third oven will increase your factory's\nthroughput.\n\nMain features\n--------------\n\nTaskpacker was built as a toy project to have an easily-extensible scheduling tool in Python.\nOnly Python2 is supported right now (sorry for that, there is a complex bug with Numberjack in Python3).\nIt is pretty simple and limited (the core code is ~200 lines) but comes with enough features to cover many cases:\n\n- Supports resources (typically, people or robots) and resource capacity\n (= how much jobs a resource can do at the same time)\n- Supports tasks dependencies (some tasks must be finished before other tasks\n can be started) and maximum waiting time (i.e. some tasks must be started at the\n latest X minutes after their *parents* are completed)\n- Supports pre-scheduled tasks (such as breaks for human operators, scheduled robotic maintenance etc.)\n\nWork in progress - contribute !\n------------------------------------------\n\nTaskpacker is an open-source software originally written to optimize the robot-operated DNA assembly operations at the `Edinburgh Genome Foundry `_. It is `released on Github `_\nunder the MIT licence (\u00a2 Edinburgh Genome Foundry), with no warranties: this is\nan experimental piece of software which we hope will be as useful for you as it was for us.\nAnd everyone is welcome to contribute !\n\nInstallation\n--------------\n\nTaskpacker can be installed by unzipping the source code in one directory and using this command: ::\n\n sudo python setup.py install\n\nYou can also install it directly from the Python Package Index with this command: ::\n\n sudo pip taskpacker install\n\n\nBasic Example\n--------------\n\nIn this example two labbies have been assigned a list of chores.\nAlice will visit the GMO plants, cook the hamsters, and feed the gremlins.\nBob will clean the scalpels, dice the hamsters once they are cooked, then\nassist Alice in gremlins feeding (a task that takes two people).\nCertain tasks can only be done after other tasks have been completed.\nAlice has a stereotypical predisposition to multitasking: she can do 2 jobs at\nthe same time, while Bob can't.\n\nHere is how you would use Taskpacker to find when they will do each task so as\nto finish as early as possible:\n\n.. code:: python\n\n from taskpacker import Task, Resource, numberjack_scheduler, plot_schedule\n alice = Resource(\"Alice\", capacity=2)\n bob = Resource(\"Bob\", capacity=1)\n\n\n\n clean_scalpels = Task(\"Clean the scalpels\", resources=[bob], duration=20,\n color=\"white\")\n visit_plants = Task(\"Visit the plants\", resources=[alice], duration=60,\n color=\"yellow\")\n cook_hamsters = Task(\"Cook the hamsters\", resources=[alice], duration=30,\n color=\"red\")\n dice_hamsters = Task(\"Dice the hamsters\", resources=[bob], duration=40,\n color=\"blue\", follows=[cook_hamsters, clean_scalpels])\n feed_gremlins = Task(\"Feed the gremlins\", resources=[alice, bob], duration=50,\n color=\"orange\", follows=[dice_hamsters])\n\n\n all_tasks = [clean_scalpels, visit_plants, cook_hamsters, dice_hamsters,\n feed_gremlins]\n scheduled_tasks = numberjack_scheduler(all_tasks)\n fig, ax = plot_schedule(scheduled_tasks)\n ax.figure.set_size_inches(7, 3)\n ax.figure.savefig(\"alice_and_bod.png\", bbox_inches=\"tight\")\n\n## Modeling tasks and reources with spreadsheets\n\nAssume that you have a process consisting in several tasks, each task depending\non some resources to be available, and possibly on other tasks. Such process can\nbe summarized in a spreadsheet like this one `this file <>`_, which is loaded in\nTaskpacker as follows:\n\n.. code:: python\n\n from taskpacker import (get_resources_from_spreadsheet,\n get_process_from_spreadsheet)\n\n resources = get_resources_from_spreadsheet(\n spreadsheet_path=\"path/to/spreadsheet.xls\", sheetname=\"resources\")\n\n process_tasks = get_process_from_spreadsheet(\n spreadsheet_path=\"path/to/spreadsheet.xls\",\n sheetname=\"process\",\n resources_dict=resources\n )\n\n\nThen you can for instance plot the dependency graph of the tasks:\n\n.. code:: python\n\n from taskpacker import plot_tasks_dependency_graph\n plot_tasks_dependency_graph(process_tasks)\n\n.. image:: https://raw.githubusercontent.com/Edinburgh-Genome-Foundry/Taskpacker/master/docs/_static/images/process_plan.png\n :alt: [logo]\n :align: center\n :width: 600px\n\nOr simply schedule the tasks:\n\n.. code:: python\n\n from taskpacker import numberjack_scheduler\n scheduled_tasks = numberjack_scheduler(process_tasks)\n\n\nThroughput estimations\n-----------------------\n\nGiven a list of tasks forming a process, you might ask \"how many of these processes\ncan my factory run in a day ?\". The following code loads 20 of these processes\nand asks Taskpacker to stack them one by one as compactly as possible:\n\n.. code:: python\n\n from taskpacker import (get_process_from_spreadsheet,\n get_resources_from_spreadsheet,\n schedule_processes_series,\n plot_tasks_dependency_tree,\n plot_schedule, Task)\n import matplotlib.cm as cm\n\n\n colors = [cm.Paired(0.21 * i % 1.0) for i in range(30)]\n\n resources = get_resources_from_spreadsheet(\n spreadsheet_path=\"path/to/spreadsheet.xls\", sheetname=\"resources\")\n\n processes = [\n get_process_from_spreadsheet(spreadsheet_path=\"path/to/spreadsheet.xls\",\n sheetname=\"process\",\n resources_dict=resources,\n tasks_color=colors[i],\n task_name_prefix=\"WU%d_\" % (i + 1))\n for i in range(20)\n ]\n\n # OPTIMIZE THE SCHEDULE\n new_processes = schedule_processes_series(\n processes, est_process_duration=5000, time_limit=5)\n\n # PLOT THE OPTIMIZED SCHEDULE\n\n all_tasks = [t for process in new_processes for t in process]\n fig, ax = plot_schedule(all_tasks)\n ax.set_xlabel(\"time (min)\")\n ax.figure.savefig(\"dna_assembly_schedule.png\", bbox_inches=\"tight\")\n\n.. image:: https://raw.githubusercontent.com/Edinburgh-Genome-Foundry/Taskpacker/master/examples/dna_assembly.png\n :alt: [dna_assembly.png]\n :align: center\n :width: 600px\n\nNote that it is also possible to add scheduled breaks so that your Igor can rest:\n\n.. code:: python\n\n scheduled_breaks = [\n Task(\"break_%03d\" % i,\n resources=[resources[\"igor\"]],\n scheduled_resource={resources[\"igor\"]: 1},\n duration=12 * 60, # The break lasts 12H\n scheduled_start=24 * 60 * i, # The break happens every 24H\n color='white')\n for i in range(6)\n ]\n\n new_processes = schedule_processes_series(\n processes, est_process_duration=5000, time_limit=5,\n scheduled_tasks=scheduled_breaks)\n\n.. image:: https://raw.githubusercontent.com/Edinburgh-Genome-Foundry/Taskpacker/master/examples/dna_assembly_with_breaks.png\n :alt: [dna_assembly_with_breaks.png]\n :align: center\n :width: 600px\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "taskpacker", "package_url": "https://pypi.org/project/taskpacker/", "platform": "", "project_url": "https://pypi.org/project/taskpacker/", "project_urls": null, "release_url": "https://pypi.org/project/taskpacker/0.1.1/", "requires_dist": null, "requires_python": "", "summary": "", "version": "0.1.1" }, "last_serial": 3349688, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "761fa5114f59836cc1fcd53bb452dd3d", "sha256": "481af41c70c56eec2055eccb67f8354d282aed35b3b6b4be4480df77bfeb9905" }, "downloads": -1, "filename": "taskpacker-0.1.0.tar.gz", "has_sig": false, "md5_digest": "761fa5114f59836cc1fcd53bb452dd3d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 191103, "upload_time": "2017-06-01T17:55:03", "url": "https://files.pythonhosted.org/packages/30/0f/7fbb33edbaaff47d45505856a092baa42b6e2c8771eb77c20819919768c4/taskpacker-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "e5505a15499672155d8ecfe7378bc401", "sha256": "91c679785fa444001ead0fb9b28fc30d2f0cc53c84d54c81f54ec67885369599" }, "downloads": -1, "filename": "taskpacker-0.1.1.tar.gz", "has_sig": false, "md5_digest": "e5505a15499672155d8ecfe7378bc401", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 212032, "upload_time": "2017-11-20T17:01:10", "url": "https://files.pythonhosted.org/packages/e0/e1/f7bad5f6528322f9d16ea5dc7327192073372fc31e29db5b63e4a7309263/taskpacker-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e5505a15499672155d8ecfe7378bc401", "sha256": "91c679785fa444001ead0fb9b28fc30d2f0cc53c84d54c81f54ec67885369599" }, "downloads": -1, "filename": "taskpacker-0.1.1.tar.gz", "has_sig": false, "md5_digest": "e5505a15499672155d8ecfe7378bc401", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 212032, "upload_time": "2017-11-20T17:01:10", "url": "https://files.pythonhosted.org/packages/e0/e1/f7bad5f6528322f9d16ea5dc7327192073372fc31e29db5b63e4a7309263/taskpacker-0.1.1.tar.gz" } ] }