core.utils package

Submodules

core.utils.patterns module

Collection of utilities for generic use.

class core.utils.patterns.Singleton

Bases: type

class core.utils.patterns.classproperty(f)

Bases: object

Allows using @property on @classmethod.

The caveat is that you can’t use this for writable properties. Ref.: how-to-make-a-class-property

core.utils.topography module

class core.utils.topography.PointCoordinates(latitude, longitude)

Bases: tuple

Represent a point on the earth surface, identified by its latitude and longitude.

property latitude

Alias for field number 0

property longitude

Alias for field number 1

core.utils.topography.eval_distance_between_two_points(from_point, to_point)

Return the linear distance between two points.

Evaluates the distance according to Haversine formula. This formula provides enough precision for hydraulic calculations.

core.utils.topography.generate_equidistant_points(upstream_point, downstream_point, parts)
core.utils.topography.get_mapquest_json_response(point_list)