{ "info": { "author": "Yoel Cortes-Pena", "author_email": "yoelcortes@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "=================\narray_collections\n=================\n\n.. image:: http://img.shields.io/pypi/v/array_collections.svg?style=flat\n :target: https://pypi.python.org/pypi/array_collections\n :alt: Version_status\n.. image:: http://img.shields.io/badge/docs-latest-brightgreen.svg?style=flat\n :target: https://array_collections.readthedocs.io/en/latest/\n :alt: Documentation\n.. image:: http://img.shields.io/badge/license-MIT-blue.svg?style=flat\n :target: https://github.com/yoelcortes/array_collections/blob/master/LICENSE.txt\n :alt: license\n\n\n.. contents::\n\nWhat is array_collections?\n--------------------------\n\narray_collections is a collection of numpy ndarray subclasses. Each array class serves an unrelated but broad purpose of its own. This package features 3 types of arrays: material_array, tuple_array, and property_array.\n\nInstallation\n------------\n\nGet the latest version of array_collections from\nhttps://pypi.python.org/pypi/array_collections/\n\nIf you have an installation of Python with pip, simple install it with:\n\n $ pip install array_collections\n\nTo get the git version, run:\n\n $ git clone git://github.com/yoelcortes/array_collections\n\nDocumentation\n-------------\n\narray_collections's documentation is available on the web:\n\n http://array_collections.readthedocs.io/\n\nGetting started\n---------------\n\nA **material_array** issues a RuntimeWarning when a non-positive or non-finite value is encountered.\n\nCreate material_array:\n\n.. code-block:: python\n \n >>> arr = material_array([1, 18])\n material_array([1, 18])\n \nA negative value issues a RuntimeWarning:\n \n.. code-block:: python\n \n >>> arr[1] = -1\n __main__:1: RuntimeWarning:\n Encountered negative or non-finite value in 'material_array' object.\n\nNew arrays are normal numpy arrays:\n\n.. code-block:: python\n \n >>> arr + 1\n array([2, 19])\n\nA **tuple_array** is an immutable and hashable array:\n\nCreate a tuple_array object:\n \n.. code-block:: python\n \n >>> arr = tuple_array([1, 18])\n tuple_array([1, 18])\n \ntuple_array objects are immutable:\n\n.. code-block:: python\n \n >>> arr[1] = 0\n TypeError: 'tuple_array' objects are immutable.\n \ntuple_array objects are hashable:\n\n.. code-block:: python\n \n >>> hash(arr)\n 3713080549427813581\n\nNew arrays are normal numpy arrays:\n\n.. code-block:: python\n \n >>> arr + 1\n array([2, 19])\n \nA **property_array** allows for array-like manipulation of property objects. All entries in a property_array must be instances of FreeProperty. Setting items of a property_array sets values of Property objects instead.\n\nUse the PropertyFactory to create a Weight property class which calculates weight based on density and volume:\n \n.. code-block:: python\n \n >>> from array_collections import PropertyFactory\n >>> \n >>> @PropertyFactory\n >>> def Weight(self):\n ... '''Weight (kg) based on volume (m^3).'''\n ... data = self.data\n ... rho = data['rho'] # Density (kg/m^3)\n ... vol = data['vol'] # Volume (m^3)\n ... return rho * vol\n >>>\n >>> @Weight.setter\n >>> def Weight(self, weight):\n ... data = self.data\n ... rho = data['rho'] # Density (kg/m^3)\n ... data['vol'] = weight / rho\n \nCreate dictionaries of data and initialize new properties:\n \n.. code-block:: python\n \n >>> water_data = {'rho': 1000, 'vol': 3}\n >>> ethanol_data = {'rho': 789, 'vol': 3}\n >>> weight_water = Weight('Water', water_data)\n >>> weight_ethanol = Weight('Ethanol', ethanol_data)\n >>> weight_water\n Weight(Water) -> 3000 (kg)\n >>> weight_ethanol\n Weight(Ethanol) -> 2367 (kg)\n \nCreate a property_array from data:\n \n.. code-block:: python\n \n >>> prop_arr = property_array([weight_water, weight_water])\n property_array([3000, 2367])\n \nChanging the values of a property_array changes the value of its properties:\n \n.. code-block:: python\n \n >>> # Addition in place\n >>> prop_arr += 3000\n >>> prop_arr\n property_array([6000, 5367])\n >>> # Note how the data also changes\n >>> water_data\n {'rho': 1000, 'vol': 6.0}\n >>> ethanol_data\n {'rho': 789, 'vol': 6.802281368821292}\n >>> # Setting an item changes the property value\n >>> prop_arr[1] = 2367\n >>> ethanol_data\n {'rho': 789, 'vol': 3}\n \nNew arrays have no connection to the property_array:\n \n.. code-block:: python\n \n >>> prop_arr - 1000 # Returns a new array\n array([5000.0, 1367.0], dtype=object)\n >>> water_data # Data remains unchanged\n {'rho': 1000, 'vol': 6.0}\n \nA representative DataFrame can also be made from the property_array:\n \n.. code-block:: python\n \n >>> prop_arr.table()\n Weight (kg)\n Water 6000.0\n Ethanol 2367.0\n \n.. Note:: The DataFrame object contains the values of the properties, not the FreeProperty objects as a property_array would.\n\nLatest source code\n------------------\n\nThe latest development version of array_collections's sources can be obtained at:\n\n https://github.com/yoelcortes/array_collections\n\n\nBug reports\n-----------\n\nTo report bugs, please use the array_collections' Bug Tracker at:\n\n https://github.com/yoelcortes/array_collections\n\nLicense information\n-------------------\n\nSee ``LICENSE.txt`` for information on the terms & conditions for usage\nof this software, and a DISCLAIMER OF ALL WARRANTIES.\n\nAlthough not required by the array_collections' license, if it is convenient for you,\nplease cite array_collections if used in your work. Please also consider contributing\nany changes you make back, and benefit the community.\n\n\nCitation\n--------\n\nTo cite array_collections in publications use::\n\n Yoel Cortes-Pena (2019). array_collections: A collection of numpy ndarray subclasses.\n https://github.com/yoelcortes/array_collections\n", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/yoelcortes/array_collections.git", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/yoelcortes/array_collections", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "array_collections", "package_url": "https://pypi.org/project/array_collections/", "platform": "Windows", "project_url": "https://pypi.org/project/array_collections/", "project_urls": { "Download": "https://github.com/yoelcortes/array_collections.git", "Homepage": "https://github.com/yoelcortes/array_collections" }, "release_url": "https://pypi.org/project/array_collections/0.1.9/", "requires_dist": null, "requires_python": "", "summary": "A collection of numpy ndarray subclasses.", "version": "0.1.9" }, "last_serial": 5485631, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "bab345f08ee62436fc250c2940cc4072", "sha256": "df46b9958c0b3be0eb407372cee29bf14c83b4ab71843f8c545dfb394d932e7e" }, "downloads": -1, "filename": "array_collections-0.1.0.tar.gz", "has_sig": false, "md5_digest": "bab345f08ee62436fc250c2940cc4072", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7403, "upload_time": "2019-01-20T00:36:33", "url": "https://files.pythonhosted.org/packages/71/32/bcda8df775d508f49c59eb4cd93060ad9afbd0bc4d4ac996273b48d86736/array_collections-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "b965dec86ea44a203f99a5a187b37723", "sha256": "910a52bf89f5cf70f4c856e5d913d8b058a774d4f2ac4fb119a86ec81807bd06" }, "downloads": -1, "filename": "array_collections-0.1.1.tar.gz", "has_sig": false, "md5_digest": "b965dec86ea44a203f99a5a187b37723", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7422, "upload_time": "2019-01-20T00:41:31", "url": "https://files.pythonhosted.org/packages/bb/a5/2ccb58232363ad8c96d5f2a86a0834c77313c8708ea1317b3e99ae8c6128/array_collections-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "28e0a5f9495bce14bac353de636e7686", "sha256": "9007d2d66aae1b69ae33a0b6d2d013f0439ac3867f9cb6da4c70babf80279b26" }, "downloads": -1, "filename": "array_collections-0.1.2.tar.gz", "has_sig": false, "md5_digest": "28e0a5f9495bce14bac353de636e7686", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7423, "upload_time": "2019-01-20T01:27:55", "url": "https://files.pythonhosted.org/packages/ea/1d/dc593d9aad0e38b7a57784f12b0a2dfe53dbef032f0f6f2c3aed9a2304eb/array_collections-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "8cf9a160894347edc6322b2b1c51b871", "sha256": "9817ff0e7c914529cae93e35f2e5547fc3017910b01305ab341c11d436048863" }, "downloads": -1, "filename": "array_collections-0.1.3.tar.gz", "has_sig": false, "md5_digest": "8cf9a160894347edc6322b2b1c51b871", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7610, "upload_time": "2019-01-26T18:59:49", "url": "https://files.pythonhosted.org/packages/12/0d/d3838af8b31407cdfd50a79c5d805a915c89cd616f0580aa0b9d6ca007d7/array_collections-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "8cac8bf9347a0a0686789efd0a8bd4d2", "sha256": "792d8993b4ed4af7c1b604e8a8544789738511861bd1a7612abc46a55b544684" }, "downloads": -1, "filename": "array_collections-0.1.4.tar.gz", "has_sig": false, "md5_digest": "8cac8bf9347a0a0686789efd0a8bd4d2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7066, "upload_time": "2019-04-05T00:11:22", "url": "https://files.pythonhosted.org/packages/4d/5b/1d86e54270d7211bdeba8438c824f25bea71e98fdb0d26e9ebb9e5e84e0a/array_collections-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "40c498849b21e3e1e7e9e058df00d948", "sha256": "4701d9a234605b5fdadcd1dd72bf8ad65622a42229fdbe3ff7d78c189db8cb2b" }, "downloads": -1, "filename": "array_collections-0.1.5.tar.gz", "has_sig": false, "md5_digest": "40c498849b21e3e1e7e9e058df00d948", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6917, "upload_time": "2019-04-05T20:09:39", "url": "https://files.pythonhosted.org/packages/be/fa/27f3a0dbabd619f7dc40b7e4a11f7c02af2072b9a4737f84216422e4b5e6/array_collections-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "c0bc9fba37255dc3aa9030b75e203589", "sha256": "99bd908a38c54f186bfedddeb26b3681c4120f9a9ed3ffb4bbd5e9595b31b69b" }, "downloads": -1, "filename": "array_collections-0.1.6.tar.gz", "has_sig": false, "md5_digest": "c0bc9fba37255dc3aa9030b75e203589", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6927, "upload_time": "2019-04-07T17:50:11", "url": "https://files.pythonhosted.org/packages/e6/ce/f212015a3bf03fc92f3626ead94cb9ae25b078cd6dccb4bf159b642cc99c/array_collections-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "e007d1d4a07c0fa1551c59dcd4062e3a", "sha256": "be9dad1a1cff3694e1572f81ff8380180c84e0d14b2023583ce57b061141d450" }, "downloads": -1, "filename": "array_collections-0.1.7.tar.gz", "has_sig": false, "md5_digest": "e007d1d4a07c0fa1551c59dcd4062e3a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6958, "upload_time": "2019-04-25T06:32:57", "url": "https://files.pythonhosted.org/packages/d9/28/4a09e67c44839e812b1345bcc29bd6f28fa02fc92f887c332ab301164a8e/array_collections-0.1.7.tar.gz" } ], "0.1.8": [ { "comment_text": "", "digests": { "md5": "39886e3c56fe2358cd209212c9183401", "sha256": "a714db65fc5c35a4117fba05facb8fa64532e5852166a46f43f59ad4eb43685d" }, "downloads": -1, "filename": "array_collections-0.1.8.tar.gz", "has_sig": false, "md5_digest": "39886e3c56fe2358cd209212c9183401", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6361, "upload_time": "2019-06-11T12:01:34", "url": "https://files.pythonhosted.org/packages/35/b4/31f615b1c7ad564f65e7fa46f589ff58ec25064a3ac68deca9810a3e6c62/array_collections-0.1.8.tar.gz" } ], "0.1.9": [ { "comment_text": "", "digests": { "md5": "5a6ea1998b83942e1f0ce195deb7f1a6", "sha256": "ee54f73f7a2eb02e6b87537d60c9276fe0bb547c7788f041f34be2321f45f584" }, "downloads": -1, "filename": "array_collections-0.1.9.tar.gz", "has_sig": false, "md5_digest": "5a6ea1998b83942e1f0ce195deb7f1a6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6367, "upload_time": "2019-07-04T08:49:59", "url": "https://files.pythonhosted.org/packages/fe/ec/4ad0e190a10b4fc966e0a5924ef860b5310ba048bd8896df2766a01f2981/array_collections-0.1.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5a6ea1998b83942e1f0ce195deb7f1a6", "sha256": "ee54f73f7a2eb02e6b87537d60c9276fe0bb547c7788f041f34be2321f45f584" }, "downloads": -1, "filename": "array_collections-0.1.9.tar.gz", "has_sig": false, "md5_digest": "5a6ea1998b83942e1f0ce195deb7f1a6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6367, "upload_time": "2019-07-04T08:49:59", "url": "https://files.pythonhosted.org/packages/fe/ec/4ad0e190a10b4fc966e0a5924ef860b5310ba048bd8896df2766a01f2981/array_collections-0.1.9.tar.gz" } ] }