API Reference

pyrandonaut

This module interfaces with a QRNG (Quantum Random Number Generator) where it gets a list of n truly random numbers, converts them to coordinates and computes the gaussian kernel density estimate of those coordinates, returning the point within the defined radius, where the density of random coordinates is highest, similar to how an Attractor point is calculated by the Randonautica app.

exception pyrandonaut.Error[source]

Base class for other exceptions

exception pyrandonaut.DivisionError[source]

Raised when number of requested points isn’t divisible by 1024

pyrandonaut.get_data(amount)[source]

Gets a string of 4096 bytes from Randonautica’s QRNG and turns it into a list of uint16 values

Parameters:

amount (int) –

pyrandonaut.int_to_float(input_integer)[source]

Converts an integer to a floating point value

Parameters:

input_integer (int) –

Return type:

float

pyrandonaut.pairwise(iterable)[source]

Returns an iterable in pairs

Return type:

zip

pyrandonaut.random_location(start_lat, start_lon, max_radius, rand_float_1, rand_float_2)[source]

Converts 2 floating point values to coordinates within the defined radius from the starting position

Parameters:
  • start_lat (float) –

  • start_lon (float) –

  • max_radius (int) –

  • rand_float_1 (float) –

  • rand_float_2 (float) –

Return type:

tuple

pyrandonaut.calculate_kde(coord_list)[source]

Calculates the point with the highest density of points using kernel density estimation

Parameters:

coord_list (list) –

Return type:

tuple

pyrandonaut.get_coordinate(start_lat, start_lon=<class 'float'>, radius=5000, num_points=1024)[source]

Takes a starting position, radius and the number of random points to base the calculation on, and returns the gaussian kernel desity estimate of the generated points as a set of coordinates

Parameters:
  • start_lat (float) –

  • radius (int) –

  • num_points (int) –

Return type:

dict

pyrandonaut.main()[source]

If run as a script, take arguments using argparse and print result to stdout