mcvoronoi package
Project description
mcvoronoi
Computing voronoi areas using monte carlo simulation
Prerequisites (required modules)
- python_requires='>=3.6'
$ python3 --version
If not installed, visit official site for python here and download the latest version of Python.
- numpy
$ pip3 install numpy
- sklearn
$ pip3 install sklearn
- matplotlib
$ pip3 install matplotlib
Installation
$ pip3 install mcvoronoi
- in main.py file example code to use the module:
import numpy as np
import mcvoronoi
points = np.random.rand(10, 2) # a numpy array of 10 input co-ordinates
lat_lon_area, mean_percentage_error = mcvoronoi.voronoi_area(points, voronoi_plot_enabled=True, NUM_COLORS=5)
Parameters to the function
| Input Type | Input | Default_Value |
|---|---|---|
| numpy array | input_coordinates | No default value |
| integer | number_of_iterations | 50 |
| integer | number_of_trials_per_iteration | 10000 |
| boolean | error_plot_enabled | True |
| boolean | voronoi_plot_enabled | False |
| float | sizeOfMarker | 0.5 |
| integer | NUM_COLORS | 20 |
Returned values
| Return Type | Output |
|---|---|
| python dict | key = (x,y), value = % of area of the smallest rectangle enclosing all input_coordinates, len(lat_lon_area) is same as number of input_coordinates |
| plot | line graph of % error vs trial number (saved as .png) |
| plot | voronoi Diagram with pts & random pts closest to points marked in NUM_COLORS(saved as .png) |
| float | mean % error at the last trial |
Credits
| Author | Contribution | |
|---|---|---|
| Kusum Kumari | code standardization; code extension to include useful functionalities; creation and maintenance of mcvoronoi python library | kusum.kumarisjce@gmail.com |
| Nishant Kumar | initial working solution using MC simulation for voronoi areas | abc.nishant007@gmail.com |
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to add/change.
License
Output plots
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mcvoronoi-0.0.3.tar.gz
(3.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcvoronoi-0.0.3.tar.gz.
File metadata
- Download URL: mcvoronoi-0.0.3.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eca81d69e1c3a051fe4268e259ccbaf97d4ae645a25a0911411cda58990c0d45
|
|
| MD5 |
ead9043239d8485cd93db75e5ac86444
|
|
| BLAKE2b-256 |
f545ca2347b5b68295005a26508ff0e4a2fc09bb3d8dc870d743aa97476d4c28
|
File details
Details for the file mcvoronoi-0.0.3-py3-none-any.whl.
File metadata
- Download URL: mcvoronoi-0.0.3-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d02768fe2285388a3e572ab7a5edc48e679287276a8cb24d9d76aa86dd4737c5
|
|
| MD5 |
98525c50dc8fe79b4d813758a25b2782
|
|
| BLAKE2b-256 |
7fbb2494ebb7901a9eeb3d11d902902be1eb91f05528fe9156a6f48cc3c18593
|