{ "info": { "author": "Joe Jordan", "author_email": "joe.jordan@imperial.ac.uk", "bugtrack_url": null, "classifiers": [], "description": "pyvoro\n======\n\n3D Voronoi tessellations: a python entry point for the [voro++ library](http://math.lbl.gov/voro++/)\n\n**Recently Added Features:**\n\n*Released on PyPI* - thanks to a contribution from @ansobolev, you can now install the project with\n`pip` - just type `pip install pyvoro`, with sudo if that's your thing.\n\n*support for numpy arrays* - thanks to a contribution from @christopherpoole, you can now pass in\na 2D (Nx3 or Nx2) numpy array.\n\n*2D helper*, which translates the results of a 3D tesselation of points on the plane back into\n2D vectors and cells (see below for an example.)\n\n*Radical (weighted) option*, which weights the voronoi cell sizes according to a set of supplied\nradius values.\n\n*periodic boundary support*, note that each cell is returned in the frame of reference of its source\npoint, so points can (and will) be outside the bounding box.\n\nInstallation\n------------\n\nRecommended - installation via `pip`:\n\n pip install pyvoro\n\nInstallation from source is the same as for any other python module. Issuing \n \n python setup.py install\n \nwill install pyvoro system-wide, while \n\n python setup.py install --user\n\nwill install it only for the current user. Any \n[other](https://pythonhosted.org/an_example_pypi_project/setuptools.html#using-setup-py) `setup.py` keywords \ncan also be used, including \n \n python setup.py develop\n \nto install the package in 'development' mode. Alternatively, if you want all the dependencies pulled in automatically, \nyou can still use `pip`:\n\n pip install -e .\n\n`-e` option makes pip install package from source in development mode. \n\nYou can then use the code with:\n\n import pyvoro\n pyvoro.compute_voronoi( ... )\n pyvoro.compute_2d_voronoi( ... )\n\nExample:\n--------\n\n```python\nimport pyvoro\npyvoro.compute_voronoi(\n [[1.0, 2.0, 3.0], [4.0, 5.5, 6.0]], # point positions\n [[0.0, 10.0], [0.0, 10.0], [0.0, 10.0]], # limits\n 2.0, # block size\n radii=[1.3, 1.4] # particle radii -- optional, and keyword-compatible arg.\n)\n```\n\nreturning an array of voronoi cells in the form:\n\n```python\n{ # (note, this cell is not calculated using the above example)\n 'volume': 6.07031902214448,\n 'faces': [\n {'adjacent_cell': 1, 'vertices': [1, 5, 8, 3]}, \n {'adjacent_cell': -3, 'vertices': [1, 0, 2, 6, 5]},\n {'adjacent_cell': -5, 'vertices': [1, 3, 9, 7, 0]},\n {'adjacent_cell': 146, 'vertices': [2, 4, 11, 10, 6]},\n {'adjacent_cell': -1, 'vertices': [2, 0, 7, 4]},\n {'adjacent_cell': 9, 'vertices': [3, 8, 10, 11, 9]},\n {'adjacent_cell': 11, 'vertices': [4, 7, 9, 11]},\n {'adjacent_cell': 139, 'vertices': [5, 6, 10, 8]}\n ],\n 'adjacency': [\n [1, 2, 7],\n [5, 0, 3],\n [4, 0, 6],\n [8, 1, 9],\n [11, 7, 2],\n [6, 1, 8],\n [2, 5, 10],\n [9, 0, 4],\n [5, 3, 10],\n [11, 3, 7],\n [6, 8, 11],\n [10, 9, 4]\n ],\n 'original': [1.58347382116, 0.830481034382, 0.84264445125],\n 'vertices': [\n [0.0, 0.0, 0.0],\n [2.6952010660213537, 0.0, 0.0],\n [0.0, 0.0, 1.3157105644765856],\n [2.6796085747800173, 0.9893738662896467, 0.0],\n [0.0, 1.1577688788929044, 0.9667194826924593],\n [2.685575135451888, 0.0, 1.2139446383811037],\n [1.5434724537773115, 0.0, 2.064891808748473],\n [0.0, 1.2236852383897006, 0.0],\n [2.6700186049990116, 1.0246853171897545, 1.1392273839598812],\n [1.6298653128290692, 1.8592211309121414, 0.0],\n [1.8470793965350985, 1.7199178301499591, 1.6938166537039874],\n [1.7528279426840703, 1.7963648490662445, 1.625024494263244]\n ]\n}\n```\n\nNote that this particle was the closest to the coord system origin - hence\n(unimportantly) lots of vertex positions that are zero or roughly zero, and\n(importantly) **negative cell ids** which correspond to the boundaries (of which\nthere are three at the corner of a box, specifically ids `1`, `3` and `5`, (the\n`x_i = 0` boundaries, represented with negative ids hence `-1`, `-3` and `-5` --\nthis is voro++'s conventional way of referring to boundary interfaces.)\n\nInitially only non-radical tessellation, and computing *all* information \n(including cell adjacency). Other code paths may be added later.\n\n2D tessellation\n---------------\n\nYou can now run a simpler function to get the 2D cells around your points, with all the details\nhandled for you:\n\n```python\nimport pyvoro\ncells = pyvoro.compute_2d_voronoi(\n [[5.0, 7.0], [1.7, 3.2], ...], # point positions, 2D vectors this time.\n [[0.0, 10.0], [0.0, 10.0]], # box size, again only 2D this time.\n 2.0, # block size; same as before.\n radii=[1.2, 0.9, ...] # particle radii -- optional and keyword-compatible.\n)\n```\n\nthe output follows the same schema as the 3D for now, since this is not as annoying as having a \nwhole new schema to handle. The adjacency is now a bit redundant since the cell is a polygon and the\nvertices are returned in the correct order. The cells look like a list of these:\n\n```python\n{ # note that again, this is computed with a different example\n 'adjacency': [\n [5, 1],\n [0, 2],\n [1, 3],\n [2, 4],\n [3, 5],\n [4, 0]\n ],\n 'faces': [\n { 'adjacent_cell': 23, 'vertices': [0, 5]},\n { 'adjacent_cell': -2, 'vertices': [0, 1]},\n { 'adjacent_cell': 39, 'vertices': [2, 1]},\n { 'adjacent_cell': 25, 'vertices': [2, 3]},\n { 'adjacent_cell': 12, 'vertices': [4, 3]},\n { 'adjacent_cell': 9, 'vertices': [5, 4]}\n ],\n 'original': [8.168525781010283, 5.943711239620341],\n 'vertices': [\n [10.0, 5.324580764844442],\n [10.0, 6.442713105218478],\n [9.088894888250326, 7.118847221681966],\n [6.740750220282158, 6.444386346261051],\n [6.675322891805883, 5.678806294642725],\n [7.77400067532073, 5.02320427474993]\n ],\n 'volume': 5.102702932807149\n}\n```\n\n*(note that the edges will now be indexed -1 to -4, and the 'volume' key is in fact the area.)*\n\nNOTES:\n* on compilation: if a cython .pyx file is being compiled in C++ mode, all cython-visible code must be compiled \"as c++\" - this will not be compatible with any C functions declared `extern \"C\" { ... }`. In this library, the author just used c++ functions for everything, in order to be able to utilise the c++ `std::vector` classes to represent the (ridiculously non-specific) geometry of a Voronoi cell.\n* A checkout of voro++ itself is included in this project. moving `setup.py` and the `pyvoro` folder into a newer checkout of the voro++ source may well also work, but if any of the definitions used are changed then it will fail to compile. by all means open a support issue if you need this library to work with a newer version of voro++; better still fix it and send me a pull request :)\n", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/joe-jordan/pyvoro/tarball/v1.3.2", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/joe-jordan/pyvoro", "keywords": "geometry,mathematics,Voronoi", "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "pyvoro", "package_url": "https://pypi.org/project/pyvoro/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pyvoro/", "project_urls": { "Download": "https://github.com/joe-jordan/pyvoro/tarball/v1.3.2", "Homepage": "https://github.com/joe-jordan/pyvoro" }, "release_url": "https://pypi.org/project/pyvoro/1.3.2/", "requires_dist": null, "requires_python": null, "summary": "2D and 3D Voronoi tessellations: a python entry point for the voro++ library.", "version": "1.3.2" }, "last_serial": 1210101, "releases": { "1.3.1": [ { "comment_text": "", "digests": { "md5": "e4e7c9a37e2e3fcc473cde44fd68e2b6", "sha256": "880a6fdb85469fca1c5f2e836588850ddace2a5b84ceb03a16b8fba53552e4fb" }, "downloads": -1, "filename": "pyvoro-1.3.1.tar.gz", "has_sig": false, "md5_digest": "e4e7c9a37e2e3fcc473cde44fd68e2b6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32532, "upload_time": "2014-08-29T18:19:25", "url": "https://files.pythonhosted.org/packages/dc/82/525360e13bde219739270ee8fd5ef1df37b0cccd7632fd6504dbbdcd32c5/pyvoro-1.3.1.tar.gz" } ], "1.3.2": [ { "comment_text": "", "digests": { "md5": "1d437c243c2d6ac9d43e1dd2a6c05946", "sha256": "f31c047f6e4fc5f66eb0ab43afd046ba82ce247e18071141791364c4998716fc" }, "downloads": -1, "filename": "pyvoro-1.3.2.tar.gz", "has_sig": false, "md5_digest": "1d437c243c2d6ac9d43e1dd2a6c05946", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 123537, "upload_time": "2014-09-02T09:08:58", "url": "https://files.pythonhosted.org/packages/02/2c/2c83cf9dbeab39611e23248e303e705c76f7e3248eaa0837a1f939cabb21/pyvoro-1.3.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1d437c243c2d6ac9d43e1dd2a6c05946", "sha256": "f31c047f6e4fc5f66eb0ab43afd046ba82ce247e18071141791364c4998716fc" }, "downloads": -1, "filename": "pyvoro-1.3.2.tar.gz", "has_sig": false, "md5_digest": "1d437c243c2d6ac9d43e1dd2a6c05946", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 123537, "upload_time": "2014-09-02T09:08:58", "url": "https://files.pythonhosted.org/packages/02/2c/2c83cf9dbeab39611e23248e303e705c76f7e3248eaa0837a1f939cabb21/pyvoro-1.3.2.tar.gz" } ] }