Various utilities

Alphabetical list:

nevis.generate_kml(path, labels=None, trajectory=None, points=None)[source]

Generate a KML (Keyhole Markup Language, used to display geographic data in an Earth browser such as Google Earth) file from given data.

For a description of the KML format, see https://developers.google.com/kml/documentation/kml_tut

Arguments:

path

The path of the file to write to.

labels

An optional dictionary mapping string labels to points (tuples in meters or Coords objects) that will be marked on the map. The points will be shown as green pinpoints with text labels beside them.

trajectory

An optional array of shape (n_points, 2) indicating the trajectory to be plotted (points specified in meters). All the points along the trajectory will be shown as small orange pinpoints with labels of their index prefixed with “T” (e.g. “T3”). The trajectory itself will be shown as a red curve extended down to the ground connecting adjacent points.

points

An optional array of shape (n_points, 2) indicating points on the map (points specified in meters). All the points will be shown as small blue pinpoints with labels of their index prefixed with “P” (e.g. “P3”).

lables, trajectory, and points can be used simultaneously.

nevis.howdy(name='version')[source]

Say hi the old fashioned way.

nevis.print_result(x, y, z)[source]

Print information about an optimisation result.

Arguments:

x

The x-coordinate of the result.

y

The y-coordinate of the result.

z

The z-coordinate of the result.

class nevis.Timer(output=None)[source]

Provides accurate timing.

Example

timer = nevis.Timer()
print(timer.format(timer.time()))
format(time=None)[source]

Formats a (non-integer) number of seconds, returns a string like “5 weeks, 3 days, 1 hour, 4 minutes, 9 seconds”, or “0.0019 seconds”.

reset()[source]

Resets this timer’s start time.

time()[source]

Returns the time (in seconds) since this timer was created, or since meth:reset() was last called.

nevis.write_test_figure(path='gb-small.png')[source]

Creates and writes a test figure.