{ "info": { "author": "Andrew M. Hogan", "author_email": "drewthedruid@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Scientific/Engineering :: Mathematics", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Utilities" ], "description": "# EasyMunk Python add-on for Munkres\n\nEasyMunk provides a versatile interface alternative and pre-processing handler to the Munkres module for score-based (Hungarian algorithm) assignments.\n\n## Purpose\n\nThe EasyMunk module interfaces with the Munkres module to:\n1. Provide an easy and adaptable method of pair assignment.\n2. Reduce the amount of pre-processing required for munkres.\n3. Automatically account for some special-case munkres decisions.\n4. Do all of the above without reducing munkres' functionality.\n\nWhat might one use the Hungarian algorithm to accomplish?\n\n* Assigning pairs.\n * For example: objects in images to information about those objects.\n* Assigning tasks.\n* Evaluating changing cost attributes over function iterations. (duplicate your primaries per iteration and forbid!)\n* Handling and evaluating all potential values for the best single value for every actor.\n* And more!\n\nSee this module's easymunk.py for use instructions, or the [munkres documentation][] for more algorithm details.\n\n[munkres documentation]: https://github.com/bmc/munkres\n\n## Installation\n\n1. Ensure Python and Pip are in the environment path variable.\n2. Inside a terminal; enter the command \"pip install easymunk\"\n\nBuilt in Python 3.6 - should now be compatible with Python 2.6+ and Python 3.6+.\n\n## Use\n\n* At the top of your .py file, add \"from easymunk import EasyMunk\"\n* Although EasyMunk is a class, self is never used. You can call easymunk.EasyMunk class methods without creating an instance.\n* The two public methods are EasyMunk.print_info() and EasyMunk.sort()\n\n### EasyMunk.print_info()\nPrints the most recent .sort() method's profit (if it exists) and cost matrices using munkres.print_matrix() for readability, the chosen indices in the (primary objects, secondary objects) array created by EasyMunk, and the sum total cost & profit for the chosen solution.\n\n### EasyMunk.sort()\n\nPlease see this module's Documentation at the top of ./easymunk/easymunk.py for further explanation & examples, and at the top of the EasyMunk.score() method definition for further details on parameters and functions.\n\n### External Functions\n\nAll external function parameters passed as positional, excluding \\*\\*kwargs. Optional parameters (such as list of lists of dicts containing pair score / primary object / secondary object, or \\*args) which conflict with an external function's call are removed starting with \\*args, then \\*\\*kwargs; at which point the least likely optional parameter is removed and \\*args and \\*\\*kwargs are introduced again before continuing the cull cycle to just the minimum parameters. The working function parameter syntax is cached, but this process will always run a full cycle starting with the last cached syntax if a TypeError is met - meaning you can have dynamic method parameters or methods.\n\n### Parameters\n\n* list primary_objects: List of anything you wish to assign an object/task/etc.\n* list secondary_objects: List of anything you wish to assign primary_objects to.\n* function score_function: Score function for each possible pair; must return a numeric metric.\n * score_function input: primary_object, secondary_object. \n * *dynamically-detected **optional*** input: \\*args, \\*\\*kwargs.\n * score_function return float: Your cost function's return should be an int or float or long int or munkres.DISALLOWED \n representing that match's cost or profit.\n* function assignment_function: Function for operating on pair assignments externally.\n * assignment_function input: primary_object, secondary_object. \n * *dynamically-detected **optional*** input: \\*args, \\*\\*kwargs.\n * assignment_function return None: Your assignment function should not return anything.\n* **optional** bool convert_profit_to_cost: Determine if profit to cost function is used. Default is False.\n* **optional** function profit_to_cost_function: Run after score_function if convert_profit_to_cost is True. \n * A default conversion function of (cost_index_value = max(profit_array) - profit_index_value) is used if left as None.\n * profit_to_cost_function input: single profit value. \n * *dynamically-detected **optional*** input: value's primary object, value's secondary object, entire list of lists of \n profit dicts as {\"score\": profit, \"primary\": primary_object, \"secondary\": secondary_object}, \\*args, \\*\\*kwargs.\n * profit_to_cost_function return float: Your conversion function's return should be the same\n type as the cost_function's return; in other words, a numeric value for pair score.\n* **optional** tuple \\*args: Optional arguments passed to score_function, assignment_function, and profit_to_cost_function.\n* **optional** dict \\*\\*kwargs: Optional keyword arguments passed to score_function, assignment_function, and profit_to_cost_function.\n\n### Class Variables\n\nEasyMunk.change_function_syntax_defaults_and_order() & EasyMunk.change_default_dict_keys()\n\n* There is no need to change either of these. However, you might want to do so anyways without changing a \\_private attribute. Recommendations on using the provided EasyMunk class attributes to change different operations such as dict key names and first-attempt function syntax / syntax attempt order to be completed. However, documentation on what each class variable is responsible for is available within the EasyMunk module.\n\n## Copyright\n\nEasyMunk module by Andrew M. Hogan. (EasyMunk © 2018 Hogan Consulting Group)\n\n## License\n\nLicensed under the Apache License.\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Andrew-Hogan/easymunk", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "easymunk", "package_url": "https://pypi.org/project/easymunk/", "platform": "any", "project_url": "https://pypi.org/project/easymunk/", "project_urls": { "Homepage": "https://github.com/Andrew-Hogan/easymunk" }, "release_url": "https://pypi.org/project/easymunk/1.0.0/", "requires_dist": null, "requires_python": "", "summary": "An easy, versatile interface and processing handler for the munkres module.", "version": "1.0.0" }, "last_serial": 3891681, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "338a5f58a32f5ebd0c29ff9e5057831e", "sha256": "c16f31ea30320381c74948c935cdc8fb809c92ff8a006134ff6f39e23c71183d" }, "downloads": -1, "filename": "easymunk-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "338a5f58a32f5ebd0c29ff9e5057831e", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 8941, "upload_time": "2018-05-21T23:32:34", "url": "https://files.pythonhosted.org/packages/4d/21/68a96908a33056362c23dbc612ed288e3fce573887ea75dffa57d0e7f74b/easymunk-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ac4cd3a545007b7e538a393b1fb81b19", "sha256": "6dc57159481f445af3069b67190c7f5d47947d78d72b2196d1b604b85b01db33" }, "downloads": -1, "filename": "easymunk-0.0.1.tar.gz", "has_sig": false, "md5_digest": "ac4cd3a545007b7e538a393b1fb81b19", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8489, "upload_time": "2018-05-21T23:32:33", "url": "https://files.pythonhosted.org/packages/f8/08/e028e725ed78629c153dfd8ff8c747709b5ed1bccc67c6f9ba492e57b01d/easymunk-0.0.1.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "718e7dca6c1c8ee3dfe8d219ddec41a8", "sha256": "531d2b05caf876ea3c198e7976598a5b7af7c15f2bd3116b6c551ecfd86d0048" }, "downloads": -1, "filename": "easymunk-0.1.0.tar.gz", "has_sig": false, "md5_digest": "718e7dca6c1c8ee3dfe8d219ddec41a8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9946, "upload_time": "2018-05-23T02:19:58", "url": "https://files.pythonhosted.org/packages/8a/07/9e0309e39524947cfb5d5d788887a94265fed491ccec0e2c0c54cc50fa91/easymunk-0.1.0.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "dd45f58ec6992b7225924b12af8262fa", "sha256": "954631a3b38753db523cc1e6d4ab78fd088630917e462be061cd763361e1b663" }, "downloads": -1, "filename": "easymunk-1.0.0.tar.gz", "has_sig": false, "md5_digest": "dd45f58ec6992b7225924b12af8262fa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10882, "upload_time": "2018-05-23T14:46:10", "url": "https://files.pythonhosted.org/packages/13/a5/1a68d79d411011dad6116ec025b447b034850ee6fa203547afd9150afb6a/easymunk-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "dd45f58ec6992b7225924b12af8262fa", "sha256": "954631a3b38753db523cc1e6d4ab78fd088630917e462be061cd763361e1b663" }, "downloads": -1, "filename": "easymunk-1.0.0.tar.gz", "has_sig": false, "md5_digest": "dd45f58ec6992b7225924b12af8262fa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10882, "upload_time": "2018-05-23T14:46:10", "url": "https://files.pythonhosted.org/packages/13/a5/1a68d79d411011dad6116ec025b447b034850ee6fa203547afd9150afb6a/easymunk-1.0.0.tar.gz" } ] }