{ "info": { "author": "Anthony Shaw", "author_email": "anthonyshaw@apache.org", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: Apache Software License" ], "description": "# Notations\n\nStatically estimate [asymptotic notation](https://www.geeksforgeeks.org/analysis-of-algorithms-set-3asymptotic-notations/) for a given Python function by looking at the level of loop-nesting inside the function.\n\n**this is an early prototype**\n\n## Example\n\n```python\nfrom notations import notation\n\ndef my_example_function(arg1, arg2):\n f = 0\n for a in arg1:\n for i in a:\n f+=1\n for b in arg2:\n for j in b:\n f+=1\n\nprint(notation(my_example_function))\n```\n\nWill print `\u0398(n^2)`\n\nSee `test_notations.py` for more examples.\n\n## TODO\n\nThis is a rough sketch of a concept at this stage.\n\n- `while` operators\n- Look at the relationship between input arguments in a function, just because a loop is nested, doesn't mean the `O(n_n)` is correct\n- branches inside loops\n- test comprehensions\n\n## FAQ\n\n* **Why not use the AST?** The AST cannot be built at runtime (easily) from a code object, this library is intended to be used to evaluate the execution-order of a compiled function. \n* **How could you possibly calculate the order without running the code?** This function equates the order by looking at the level of loop-nesting in a function, the use of comprehensions and the relationships between arguments. Dynamic runtime benchmarks are susceptible to environmental conditions (noisy neighbours) and there are already plenty of tools out there that do this\n\n## Research notes\n\n* [Paper on asymptotic heirarchy](https://www.d.umn.edu/~ddunham/cs3512s10/notes/l12.pdf)\n* [Notes on theta, O and omega functions](https://www.geeksforgeeks.org/analysis-of-algorithms-set-3asymptotic-notations/)\n\n## Changes\n\n### 0.2.0 \n\n* Change to theta values for __repr__\n\n### 0.1.0\n\n* Initial prototype supporting basic for loops", "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/tonybaloney/notations", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "notations", "package_url": "https://pypi.org/project/notations/", "platform": "", "project_url": "https://pypi.org/project/notations/", "project_urls": { "Homepage": "https://github.com/tonybaloney/notations" }, "release_url": "https://pypi.org/project/notations/0.2.0/", "requires_dist": null, "requires_python": "", "summary": "Notations", "version": "0.2.0" }, "last_serial": 4784297, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "9eeb0fcb777e7cc5605fe45648ad7a8a", "sha256": "ac16884b4d0f0e160f78eadec449e162b94b8c72474ac424cb67e189517768d7" }, "downloads": -1, "filename": "notations-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9eeb0fcb777e7cc5605fe45648ad7a8a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 12676, "upload_time": "2019-02-05T23:01:52", "url": "https://files.pythonhosted.org/packages/fe/36/27837f5ff6bc6f09b5e058880d0c9eed3e9e76085cf58ede8dafd9de1e21/notations-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d09b205d399165786bd9c9217bb2e549", "sha256": "834301b3686202e0fbb0ce88e1fb889b7bacd1603d16a3cc0a6773aabcbdb5e7" }, "downloads": -1, "filename": "notations-0.1.0.tar.gz", "has_sig": false, "md5_digest": "d09b205d399165786bd9c9217bb2e549", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6065, "upload_time": "2019-02-05T23:01:58", "url": "https://files.pythonhosted.org/packages/82/79/1c37f49b465936ad9413a1de05f962f975e78167b4fc9ed107c5486222d0/notations-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "973fc2b05a64ca4bc504fb8afbd335de", "sha256": "c8a77e6974cfad5e7112da3e474df2255048fdb930021070486bcbffd8a85386" }, "downloads": -1, "filename": "notations-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "973fc2b05a64ca4bc504fb8afbd335de", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13560, "upload_time": "2019-02-05T23:10:59", "url": "https://files.pythonhosted.org/packages/f0/8d/f9f88c72ff6e26225fa78068d5933555b49f969faa48857c9dc52aac9d55/notations-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0e718b3bd010231f68d62d4cbad4d7fd", "sha256": "06177c0988ea986a3c7763692ff41b3262e0ba47528ad88898927a01efd1d522" }, "downloads": -1, "filename": "notations-0.2.0.tar.gz", "has_sig": false, "md5_digest": "0e718b3bd010231f68d62d4cbad4d7fd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6222, "upload_time": "2019-02-05T23:11:03", "url": "https://files.pythonhosted.org/packages/4d/cc/f169ddf9b47f3b3b49c7ac2b33301de6d1484d74be701ab928814d8ccf93/notations-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "973fc2b05a64ca4bc504fb8afbd335de", "sha256": "c8a77e6974cfad5e7112da3e474df2255048fdb930021070486bcbffd8a85386" }, "downloads": -1, "filename": "notations-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "973fc2b05a64ca4bc504fb8afbd335de", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13560, "upload_time": "2019-02-05T23:10:59", "url": "https://files.pythonhosted.org/packages/f0/8d/f9f88c72ff6e26225fa78068d5933555b49f969faa48857c9dc52aac9d55/notations-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0e718b3bd010231f68d62d4cbad4d7fd", "sha256": "06177c0988ea986a3c7763692ff41b3262e0ba47528ad88898927a01efd1d522" }, "downloads": -1, "filename": "notations-0.2.0.tar.gz", "has_sig": false, "md5_digest": "0e718b3bd010231f68d62d4cbad4d7fd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6222, "upload_time": "2019-02-05T23:11:03", "url": "https://files.pythonhosted.org/packages/4d/cc/f169ddf9b47f3b3b49c7ac2b33301de6d1484d74be701ab928814d8ccf93/notations-0.2.0.tar.gz" } ] }