random-geometry-points
This module provides classes to generate random points on geometry surfaces. These points can then be used as test data, e.g. to simulate measurements of a measurement device.
Installation
You can install this module using pip globally
pip install random-geometry-points
or using pipenv
cd <your project folder>
pipenv install random-geometry-points
Basic Usage
Currently the geometry types Plane, Sphere and 2D Circle are supported. You can import the geometry classes by using the following import statements.
from random_geometry_points.plane import Plane
from random_geometry_points.sphere import Sphere
from random_geometry_points.circle2d import Circle2D
Now you can create an arbitrary number of random points lying on a geometry surface.
# create a plane object with n = (1, 0, 0), x0 = (0, 0, 0), d = 0 and radius = 10
normal_vec = (1.0, 0.0, 0.0)
ref_point = (0.0, 0.0, 0.0)
plane = Plane(normal_vec, 0.0, ref_point, 10.0)
# create and print 3 random points lying on the plane
random_plane_points = plane.create_random_points(3)
print(random_plane_points)
# example output: [(0.0, -2.058506783308933, -5.777518695971468), (0.0, 2.501766732323411, 6.740902158795952), (0.0, 7.846400008799242, 5.304670974614023)]
# create a sphere object with x = 1.0, y = -4.5, z = 3.3 and radius = 11.35
sphere = Sphere(1.0, -4.5, 3.3, 11.35)
# create and print 3 random points lying on the sphere
random_sphere_points = sphere.create_random_points(3)
print(random_sphere_points)
# example output: [(4.442124959724451, -1.593759345598388, -7.1176792530940025), (-7.102728837759106, -6.022944977793705, -4.500572028791214), (-10.190814503489936, -4.676727604583875, 5.1859846505890115)]
# create a circle object with x = 1.0, y = -4.5 and radius = 11.35
circle = Circle2D(1.0, -4.5, 11.35)
# create and print 3 random points lying on the circle
random_circle_points = circle.create_random_points(3)
print(random_circle_points)
# example output: [(4.057509245253113, -15.430422554283604), (2.2509595260473114, 6.780851043436018), (9.330996610075898, 3.2082420488010035)]
Documentation
Please take a look at the Wiki for a more detailed description. There you get more detailed information on how you can use the geometry classes, the meaning of the geometry parameters and error handling.
Deployment
Update packages
pipenv update --dev setuptools wheel twine
Update setup.py
Update the content of setup.py, especially the version information.
Commit and tag
Commit and push the changes along with a new version tag. Travis will run the test cases automatically when pushing to the master branch.
Build source archive and built distribution
pipenv run python setup.py sdist bdist_wheel
Deploy to PyPi or TestPyPi to test things first
pipenv run twine upload --skip-existing --repository-url https://test.pypi.org/legacy/ dist/*
pipenv run twine upload --skip-existing dist/*
Useful links
Metadata
Release files for random-geometry-points 1.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| random_geometry_points-1.1.2.tar.gz | 9.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| random_geometry_points-1.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.7 kB
Release files / random_geometry_points-1.1.2.tar.gz
| Download URL | random_geometry_points-1.1.2.tar.gz |
|---|---|
| Size | 9.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b0d8dbc49652eeed1d9b3a9e4ca24ed2ae78feab52448391c199c7e938cb3164
|
|
BLAKE2b-256 checksum How to use checksums |
c67e52115b81ff0cb10b41a04a5125cb6b4ce781c5994807b1d4b9844921fc2c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / random_geometry_points-1.1.2-py3-none-any.whl
| Download URL | random_geometry_points-1.1.2-py3-none-any.whl |
|---|---|
| Size | 10.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e1841437ea2a63e3d493981ee85ff224ea4f9a11c357859315fd7bb5b86674b6
|
|
BLAKE2b-256 checksum How to use checksums |
19303e9f632f9b0a6f93c972025b93827d5ffc917619877694f0f5a084e564a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for random-geometry-points 1.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.