{ "info": { "author": "Shapelets.io", "author_email": "dev@shapelets.io", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Science/Research", "Operating System :: MacOS", "Operating System :: Microsoft :: Windows", "Operating System :: Unix", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Scientific/Engineering", "Topic :: Software Development" ], "description": "Khiva\n======\n\nThis is the Khiva binding for connecting the Python programming language\nand the Khiva C++ library.\n\nLicense\n-------\n\nThis project is licensed under\n`MPL-v2 `__.\n\n\nInstall Khiva\n---------------\n\nFirst of all, the Khiva C++ library should be installed:\n\n`Khiva documentation `__.\n\n\nThen, install the compiled Khiva package that is hosted on the Python Package Index (PyPI) with pip:\n\n.. code:: shell\n\n pip install khiva\n\n\nDive in\n-------\n\nDive quickly into Khiva with the following example:\nFirst, set the backend and device you want to use. There is a backend and a device set by default:\n\n.. code-block:: python\n\n from khiva.library import *\n set_backend(KHIVABackend.KHIVA_BACKEND_OPENCL)\n set_device(0)\n\n\nThen, you can create an array in the device:\n\n.. code-block:: python\n\n from khiva.array import *\n a = Array([1, 2, 3, 4, 5, 6, 7, 8])\n a.display()\n\nThe previous lines print the dimensions and the content of the created array:\n\n+-----------+\n| [8 1 1 1] |\n+===========+\n|1.0000 |\n+-----------+\n|2.0000 |\n+-----------+\n|3.0000 |\n+-----------+\n|4.0000 |\n+-----------+\n|5.0000 |\n+-----------+\n|6.0000 |\n+-----------+\n|7.0000 |\n+-----------+\n|8.0000 |\n+-----------+\n\nOnce the array is created in device memory, we can concatenate operations with this\narray in an asynchronous way and receive the data only in the host when `to_list()`,\n`to_numpy()` or `to_pandas()` (the latter only supports bi-dimensional time series)\nfunctions are called.\n\n.. code-block:: python\n\n a = a.to_pandas()\n print(a)\n\nThe result is the next one:\n\n+-+-------+\n| | 0 |\n+=+=======+\n|1|1.0 |\n+-+-------+\n|2|2.00 |\n+-+-------+\n|3|3.00 |\n+-+-------+\n|4|4.00 |\n+-+-------+\n|5|5.00 |\n+-+-------+\n|6|6.00 |\n+-+-------+\n|7|7.00 |\n+-+-------+\n|8|8.00 |\n+-+-------+\n\nNow let's dive into the asynchronous usage of the library.\nKhiva library provides us several time series analysis functionalities which include features extraction,\ntime-series re-dimension, distance calculations, motifs and discords detection, tools for similarity study,\nstatistical parameters extraction or time series normalization.\n\nAll these functionalities can be concatenated to improve the performance, so you can get the data just in\nthe moment that you do not use the functions of this library:\n\n.. code-block:: python\n\n from khiva.matrix import *\n stomp_result = stomp(Array(np.array([11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11])),\n Array(np.array([9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 9])),\n 3)\n find_best_n_discords_result = find_best_n_discords(stomp_result[0],\n stomp_result[1], 2)\n a = find_best_n_discords_result[2].to_numpy()\n print(a)\n\nThe previous produces the following output:\n\n+-------------------------------------+\n| [1.73190141 1.73185158] [8 8] [0 9] |\n+-------------------------------------+\n\nThe first numpy array represents the minimum distances between the subsequences of length 3 between the two time-series.\nThe second numpy array represents the location of those subsequences in the first time-series and the third one\nrepresents the indices in the second time-series.\n\nWe want to highlight the possibility of using the library for computing the functions in different backends and with\ndifferent devices, knowing that the operations should be executed in the same device where the array was created.\n\n.. code-block:: python\n\n #Adding operations in the different backends and devices.\n from khiva.features import *\n set_backend(KHIVABackend.KHIVA_BACKEND_OPENCL)\n set_device(0)\n a = Array([1, 2, 3, 4, 5, 6, 7, 8])\n b = mean(a)\n\n set_device(1)\n c = Array([1, 2, 3, 4, 5, 6, 7, 8])\n d = mean(c)\n\n set_backend(KHIVABackend.KHIVA_BACKEND_CPU)\n set_device(0)\n e = Array([1, 2, 3, 4, 5, 6, 7, 8])\n f = mean(e)\n\n #Retrieving the results of the previous operations\n set_backend(KHIVABackend.KHIVA_BACKEND_OPENCL)\n set_device(0)\n print(b.to_numpy())\n\n set_device(1)\n print(d.to_numpy())\n\n set_backend(KHIVABackend.KHIVA_BACKEND_CPU)\n set_device(0)\n print(f.to_numpy())\n\n\nThe output is the next one:\n\n+-----+\n| 4.5 |\n+-----+\n| 4.5 |\n+-----+\n| 4.5 |\n+-----+\n\nNote that the data type used by default is floating point of 32 bits in order to avoid problems with the different\ndevices, but it can be changed deliberately.\n\nThe available data types are the next ones:\n\n+-----------+----------------------+\n| Data type | Explanation |\n+===========+======================+\n| f32 | 32 bits Float |\n+-----------+----------------------+\n| c32 | 32 bits Complex |\n+-----------+----------------------+\n| f64 | 64 bits Double |\n+-----------+----------------------+\n| c64 | 64 bits Complex |\n+-----------+----------------------+\n| b8 | 8 bits Boolean |\n+-----------+----------------------+\n| s32 | 32 bits Int |\n+-----------+----------------------+\n| 32u | 32 bits Unsigned Int |\n+-----------+----------------------+\n| u8 | 8 bits Unsigned Int |\n+-----------+----------------------+\n| s64 | 64 bits Int |\n+-----------+----------------------+\n| u64 | 64 bits Unsigned Int |\n+-----------+----------------------+\n| s16 | 16 bits Int |\n+-----------+----------------------+\n| u16 | 16 bits Unsigned Int |\n+-----------+----------------------+\n\n\nThere are functions that do not support 32 bits floating point data type, so it is necessary to indicate the data type.\nThe following is an example function requiring a 32-bit signed integer array:\n\n.. code-block:: python\n\n cwt_coefficients_result = cwt_coefficients(Array([[0.1, 0.2, 0.3], [0.1, 0.2, 0.3]]),\n Array(data=[1, 2, 3], khiva_type=dtype.s32), 2, 2).to_numpy()\n print(cwt_coefficients_result)\n\n\nThe output is:\n\n+-------------------------+\n| [0.26517162 0.26517162] |\n+-------------------------+\n\n\nLimitations\n-----------\n\nThis open-source library provides a very good performance, but it has got memory limitations.\nFor cases where you need to apply a time series analysis over a huge amount of data and in short-term fashion,\nplease, `contact us `__.\n\n\nLet's Rock!\n-----------\n\nNow, you have the basic concepts to start using the library. Please, follow the documentation of each function to know\nhow to use them. Each function has its corresponding tests so you can check how to use each of them.\n\nFurthermore, we provide use cases and examples that you can use to learn where and how to apply the library.\n\n\nDocumentation\n-------------\n\nThis Python library follows the standard way of writing documentation of Python by using Sphinx.\n\nThe documentation is located in:\n\n`Khiva Python documentation `__.", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://shapelets.io", "keywords": "", "license": "MPL 2.0", "maintainer": "", "maintainer_email": "", "name": "khiva", "package_url": "https://pypi.org/project/khiva/", "platform": "", "project_url": "https://pypi.org/project/khiva/", "project_urls": { "Homepage": "http://shapelets.io" }, "release_url": "https://pypi.org/project/khiva/0.3.0/", "requires_dist": null, "requires_python": "", "summary": "Python bindings for khiva", "version": "0.3.0" }, "last_serial": 5622515, "releases": { "0.1.2": [ { "comment_text": "", "digests": { "md5": "113188be84422bc2ebad731a84625918", "sha256": "d305b70cffe2d8f45d84ac9ea247681f8304e2fac344cb60003f21a8453cfbe2" }, "downloads": -1, "filename": "khiva-0.1.2.tar.gz", "has_sig": false, "md5_digest": "113188be84422bc2ebad731a84625918", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 34451, "upload_time": "2018-06-08T10:51:10", "url": "https://files.pythonhosted.org/packages/cd/a7/53207121efb291aa343b00c30ad536e6125d9c90dc1e15f3d57c23d809bf/khiva-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "2b89f0ad20f17c714c482a69151af685", "sha256": "cc9d30a66353e0d7458435225e63eda4998b366ac5ed3c7ccfcd9c5f096f6dcb" }, "downloads": -1, "filename": "khiva-0.1.3.tar.gz", "has_sig": false, "md5_digest": "2b89f0ad20f17c714c482a69151af685", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 34431, "upload_time": "2018-06-12T16:34:25", "url": "https://files.pythonhosted.org/packages/18/6d/9ddb1cb6af0de4aa08b0bc2bff60ff9c1b78721982983e333cc392bf0f4b/khiva-0.1.3.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "5066847ab7bf164cb5e4d652f68dd6e3", "sha256": "96f1187cdf4c475f8903f932cf33e3ee3f2149cd55824121d12efdcded14571b" }, "downloads": -1, "filename": "khiva-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "5066847ab7bf164cb5e4d652f68dd6e3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 56391, "upload_time": "2019-03-04T15:02:02", "url": "https://files.pythonhosted.org/packages/4c/ab/2a5ebcce28c4d7783f1593bfc09343cf621e3d4d082ed0d2184da2b7e45a/khiva-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2e216ea2dfb9622623310f4e78edb1eb", "sha256": "5dc4240fdeadd2f8b4be2913a4f0744b3d341b50866a22eab6d70a8efa7aa119" }, "downloads": -1, "filename": "khiva-0.2.0.tar.gz", "has_sig": false, "md5_digest": "2e216ea2dfb9622623310f4e78edb1eb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 37298, "upload_time": "2019-03-04T15:02:04", "url": "https://files.pythonhosted.org/packages/ec/eb/795d786885a8a893dc2ea531fb374154e836281fe34760bb4726f1f79853/khiva-0.2.0.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "a78bce10f7d80898d3750091985f4f50", "sha256": "c4042a08f60730b0064d5669b24763374e362d6c31f6a534d7d9a664f607e66a" }, "downloads": -1, "filename": "khiva-0.2.2-py3.6.egg", "has_sig": false, "md5_digest": "a78bce10f7d80898d3750091985f4f50", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 114230, "upload_time": "2019-05-07T07:41:34", "url": "https://files.pythonhosted.org/packages/2b/fa/b5c002e5eb654c2228fad12053080aff4479ee5248ef11dad90c00122da6/khiva-0.2.2-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "ad24c8c17ea3e2c54f3861e7519cbca6", "sha256": "5124e013c5140999fdcae05588330a31d9c2677bd2d751fd200d5c6d58db82da" }, "downloads": -1, "filename": "khiva-0.2.2-py3.7.egg", "has_sig": false, "md5_digest": "ad24c8c17ea3e2c54f3861e7519cbca6", "packagetype": "bdist_egg", "python_version": "3.7", "requires_python": null, "size": 113568, "upload_time": "2019-06-11T08:51:08", "url": "https://files.pythonhosted.org/packages/ef/35/88a89c496bb89431560773c1c23a431843ea4c9b6b346186ffd2f7c906b1/khiva-0.2.2-py3.7.egg" }, { "comment_text": "", "digests": { "md5": "a8d9969e704d7c9f42ae34cf201c7893", "sha256": "d704d1fe6447f925ca3671e40184679a35ab130d7e333f143b17c32b46b2f09d" }, "downloads": -1, "filename": "khiva-0.2.2-py3-none-any.whl", "has_sig": false, "md5_digest": "a8d9969e704d7c9f42ae34cf201c7893", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 56626, "upload_time": "2019-05-07T07:41:32", "url": "https://files.pythonhosted.org/packages/78/3e/38c0b45df0c2539dd63dfebf74c456f2caa56a5feef0a60d747a33503ca4/khiva-0.2.2-py3-none-any.whl" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "1b02ae32d6982d8ad0ecb36b861a312d", "sha256": "a6e5e85e8d6d8765e1b7c81b5325e10b491e4f9d0a0a00635a1e7e26a4de74a7" }, "downloads": -1, "filename": "khiva-0.3.0.tar.gz", "has_sig": false, "md5_digest": "1b02ae32d6982d8ad0ecb36b861a312d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 39007, "upload_time": "2019-06-11T08:51:10", "url": "https://files.pythonhosted.org/packages/af/c5/b854648d7c8ef89b2eb109f74063570b0716a955151e44f34dff8f59b3f2/khiva-0.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1b02ae32d6982d8ad0ecb36b861a312d", "sha256": "a6e5e85e8d6d8765e1b7c81b5325e10b491e4f9d0a0a00635a1e7e26a4de74a7" }, "downloads": -1, "filename": "khiva-0.3.0.tar.gz", "has_sig": false, "md5_digest": "1b02ae32d6982d8ad0ecb36b861a312d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 39007, "upload_time": "2019-06-11T08:51:10", "url": "https://files.pythonhosted.org/packages/af/c5/b854648d7c8ef89b2eb109f74063570b0716a955151e44f34dff8f59b3f2/khiva-0.3.0.tar.gz" } ] }