{ "info": { "author": "", "author_email": "fastats@googlegroups.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3 :: Only", "Topic :: Scientific/Engineering" ], "description": "# fastats\n[![Build Status](https://travis-ci.org/fastats/fastats.svg?branch=master)](https://travis-ci.org/fastats/fastats)\n[![Build Status (windows)](https://ci.appveyor.com/api/projects/status/9ufvyclit358sfb8/branch/master?svg=true)](https://ci.appveyor.com/project/pawroman/fastats/branch/master)\n[![codecov](https://codecov.io/gh/fastats/fastats/branch/master/graph/badge.svg)](https://codecov.io/gh/fastats/fastats)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/2199521147834d58b9f0e8e155c97309)](https://www.codacy.com/app/dave.willmer/fastats?utm_source=github.com&utm_medium=referral&utm_content=fastats/fastats&utm_campaign=Badge_Grade)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\nA pure Python library for benchmarked, scalable numerics, built using [numba](https://numba.pydata.org/).\n\n[Fastats mailing list](https://groups.google.com/forum/#!forum/fastats)\n\n\n---\n\n### Latest Release: 2019.1, get it using ``pip install fastats``\n\n## Aims/Reasoning\n\n\nCurrent state-of-the-art in numerics / algorithmics / machine learning has many big problems, two of which are:\n\n1. The data is getting bigger and more complex, and code is having trouble scaling to these levels.\n2. The code is getting bigger and more complex, and developers are having trouble scaling to these levels.\n\nTo fix (1) we need better algorithms, code which vectorises to SIMD instructions, and code which parallelises across CPU cores.\n\nTo fix (2) we need to focus on simpler code which is easier to debug.\n\n``fastats`` (ie, fast-stats) tries to help with both of these by; using Linear Algebra for performance optimizations in common functions,\nusing [numba](https://numba.pydata.org/)\nfrom [Anaconda](https://www.anaconda.com/) to JIT compile the optimized Python code to\nvectorised native code, whilst being trivial to run in pure Python mode for debugging.\n\n## Usage\n\nFinding the roots of an equation is central to much of data science and machine learning. For monotonic functions we can use a Newton-Raphson solver to find the root:\n\n```python\nfrom fastats import newton_raphson\n\ndef my_func(x):\n return x**3 - x - 1\n\nresult = newton_raphson(0.025, 1e-6, root=my_func)\n```\n\nThis uses [numba](https://numba.pydata.org/) under-the-hood to JIT compile the python code to native code, and uses fastats transforms to call ``my_func`` where required.\n\nHowever, we usually wish to take a fast function and apply it to a large data set, so ``fastats`` allows you to get the optimized function back as a callable:\n\n```python\nnewton_opt = newton_raphson(0.025, 1e-6, root=my_func, return_callable=True)\n\nresult = newton_opt(0.03, 1e-6)\n```\n\nIf you profile this you will find it's extremely fast (from a 2015 Macbook Pro):\n\n```bash\n>>> %timeit newton_opt(0.03, 1e-6)\n785 ns \u00b1 8.2 ns per loop (mean \u00b1 std. dev. of 7 runs, 1000000 loops each)\n```\n\ncompared with SciPy 1.0.1:\n\n ```bash\n >>> import scipy\n >>> scipy.__version__\n >>> from scipy.optimize import newton\n >>> %timeit newton(my_func, x0=0.03, tol=1e-6)\n25.6 \u00b5s \u00b1 954 ns per loop (mean \u00b1 std. dev. of 7 runs, 10000 loops each)\n ```\n\n\n#### What does this show?\n\nMost high-level languages like Python/Lua/Ruby have a formal C-API which allows us to 'drop' down to native code easily (such as SciPy shown above). However, not only is this time-consuming, error-prone and off-putting to many developers, but as you can see from the example above, the specialised C extensions do not automatically scale to larger data.\n\nThrough the use of [numba](https://numba.pydata.org/) to JIT-compile the entire function down to native code, we can quickly scale to much larger data sizes without leaving the simplicity of Python.\n\n#### What does fastats actually do?\n\nThe secret is in the handling of the function arguments.\n\nWhen we write C-extensions to high-level languages, we are usually trying to speed up a certain algorithm which is taking too long. This works well for specialised libraries, however in this world of `big` data, the next step is usually `now I want to apply that function to this array of 10 million items`. This is where the C-extension / native library technique falls down.\n\nC-extensions to high-level languages are necessarily limited by the defined API - ie, you can write a C function to take 3 floats, or 3 arrays of floats, but it's very difficult to deal with arbitrary inputs.\n\n``fastats`` allows you to pass functions as arguments into ``numba``, and therefore abstract away the specific looping or concurrency constructs, resulting in faster, cleaner development time, as well as faster execution time.\n\n#### Requirements\n\nPython >= 3.5 only. Python 3.6 or newer is strongly recommended.\n\nSee [setup.py](setup.py) - `install_requires` for installation requirements.\n\nThe [contribution guide](.github/CONTRIBUTING.md) contains information on how to install\ndevelopment requirements.\n\n##### Test requirements\n\nFor test requirements, take a look at [.travis.yml](.travis.yml) or [.appveyor.yml](.appveyor.yml).\n\n#### Contributing\n\nPlease make sure you've read the contribution guide: [CONTRIBUTING.md](.github/CONTRIBUTING.md)\n\nIn short, we use PRs for everything.\n\n\n#### Sponsors\n\n\"Pico", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/fastats/fastats", "keywords": "algorithmics ast linear-algebra numba numerics", "license": "", "maintainer": "", "maintainer_email": "", "name": "fastats", "package_url": "https://pypi.org/project/fastats/", "platform": "", "project_url": "https://pypi.org/project/fastats/", "project_urls": { "Homepage": "https://github.com/fastats/fastats" }, "release_url": "https://pypi.org/project/fastats/2019.1/", "requires_dist": null, "requires_python": "", "summary": "A pure Python library for benchmarked, scalable numerics using numba", "version": "2019.1" }, "last_serial": 4650653, "releases": { "2017.1rc0": [ { "comment_text": "", "digests": { "md5": "89e12d1e247532407972d34209c9a4f7", "sha256": "1d23f4889f089f773f891c95dfa901609a6bc5e9da1d2e24e9fd1daade59cc80" }, "downloads": -1, "filename": "fastats-2017.1rc0-py3-none-any.whl", "has_sig": false, "md5_digest": "89e12d1e247532407972d34209c9a4f7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 33642, "upload_time": "2018-04-07T18:02:13", "url": "https://files.pythonhosted.org/packages/20/ce/378865306d1364eaea5de417270c52cc96b669809c222101854d424c2230/fastats-2017.1rc0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e337f88d2b2b38ecfeaabb95bc4654cb", "sha256": "fd0854040edcf5a08137561e11706a53bc7e1b3bceb0fdb24bd27a605aafa700" }, "downloads": -1, "filename": "fastats-2017.1rc0.tar.gz", "has_sig": false, "md5_digest": "e337f88d2b2b38ecfeaabb95bc4654cb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20604, "upload_time": "2018-04-07T18:02:22", "url": "https://files.pythonhosted.org/packages/38/fb/01a065b46eff3562f5e5ae1e4d114507ec73deef3ccdc28c3610e4c7b360/fastats-2017.1rc0.tar.gz" } ], "2018.1": [ { "comment_text": "", "digests": { "md5": "3d14e92adf454d6370a91e65a6a7085d", "sha256": "a4501b976c1860a16a282ca27fda0b8c4fad2c1d263a5029181336bbf100b6e1" }, "downloads": -1, "filename": "fastats-2018.1-py3-none-any.whl", "has_sig": false, "md5_digest": "3d14e92adf454d6370a91e65a6a7085d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 35474, "upload_time": "2018-12-31T18:17:39", "url": "https://files.pythonhosted.org/packages/5c/15/146eff1e108f52977cabdbb26d9a4fb825ee922f7e85f3689fc6913b7e86/fastats-2018.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0df05b49e2931e1a8d767477a78ba69c", "sha256": "ec3aad7347ec5adf4313ca32fa4aa6bbfb59bcd81ff7ec6a40064c002c847eee" }, "downloads": -1, "filename": "fastats-2018.1.tar.gz", "has_sig": false, "md5_digest": "0df05b49e2931e1a8d767477a78ba69c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21888, "upload_time": "2018-12-31T18:17:26", "url": "https://files.pythonhosted.org/packages/f8/37/ebbb70604fc09e7838ac1d287f48c98c8fafff20fd6925fc95f6af50c15b/fastats-2018.1.tar.gz" } ], "2019.1": [ { "comment_text": "", "digests": { "md5": "0ca2667c51b4bb0182e30309ab1a1569", "sha256": "6d05b1387da913549acdb0ee9a7340f718ae58df1ef37eefb3165227ed5b43e9" }, "downloads": -1, "filename": "fastats-2019.1-py3-none-any.whl", "has_sig": false, "md5_digest": "0ca2667c51b4bb0182e30309ab1a1569", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 35415, "upload_time": "2019-01-01T17:49:41", "url": "https://files.pythonhosted.org/packages/2e/f6/004ae90f872c4f504474b10966e3073c3652cc71cc1c0a3aefb067ab7c1c/fastats-2019.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d73d8a9ad20cab38aaef8a89852599bb", "sha256": "fd00f7976ae892c81c7bc8cb954996a81723013c5f9e70e977a5cecd94995db8" }, "downloads": -1, "filename": "fastats-2019.1.tar.gz", "has_sig": false, "md5_digest": "d73d8a9ad20cab38aaef8a89852599bb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22035, "upload_time": "2019-01-01T17:49:18", "url": "https://files.pythonhosted.org/packages/dc/d9/b40879ba38590b344e5d3add9a060047e30cd1f4a5c5e5b6db30200a12b6/fastats-2019.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0ca2667c51b4bb0182e30309ab1a1569", "sha256": "6d05b1387da913549acdb0ee9a7340f718ae58df1ef37eefb3165227ed5b43e9" }, "downloads": -1, "filename": "fastats-2019.1-py3-none-any.whl", "has_sig": false, "md5_digest": "0ca2667c51b4bb0182e30309ab1a1569", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 35415, "upload_time": "2019-01-01T17:49:41", "url": "https://files.pythonhosted.org/packages/2e/f6/004ae90f872c4f504474b10966e3073c3652cc71cc1c0a3aefb067ab7c1c/fastats-2019.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d73d8a9ad20cab38aaef8a89852599bb", "sha256": "fd00f7976ae892c81c7bc8cb954996a81723013c5f9e70e977a5cecd94995db8" }, "downloads": -1, "filename": "fastats-2019.1.tar.gz", "has_sig": false, "md5_digest": "d73d8a9ad20cab38aaef8a89852599bb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22035, "upload_time": "2019-01-01T17:49:18", "url": "https://files.pythonhosted.org/packages/dc/d9/b40879ba38590b344e5d3add9a060047e30cd1f4a5c5e5b6db30200a12b6/fastats-2019.1.tar.gz" } ] }