4.1.2. BaseGridPoint¶
-
class
pyprom.lib.locations.base_gridpoint.BaseGridPoint(x, y)[source]¶ Base Object for GridPoints. These are simple x, y coordinates with no association to a
pyprom.lib.datamap.DataMapThis is a Base class intended to be inherited from in most situations.-
__eq__(other)[source]¶ Determines if this object is equal to another.
- Parameters
other (
BaseGridPoint) – object which we compare against.- Returns
equality
- Return type
bool
- Raises
TypeError if other not of
BaseGridPoint
-
__hash__()[source]¶ Produces the hash representation of this object.
- Returns
Hash representation of this object
- Return type
str
-
__init__(x, y)[source]¶ A basic x,y GridPoint.
- Parameters
x (int) – x coordinate
y (int) – y coordinate
-
__lt__(other)[source]¶ Determines if this object’s elevation is less than another.
- Parameters
other (
pyprom.lib.locations.base_gridpoint.BaseGridPoint) – object which we compare against.- Returns
bool of if self is arbitrarily regarded as lower than the other
- Raises
TypeError if other not of
pyprom.lib.locations.base_gridpoint.BaseGridPoint
-
__str__()¶ - Returns
String representation of this object
-
__unicode__()¶ - Returns
String representation of this object
-
__weakref__¶ list of weak references to the object (if defined)
-
distance(other)[source]¶ Returns the distance between this
BaseGridPointand another (in points)- Parameters
other (
BaseGridPoint) –BaseGridPointto compare for calculating distance.- Returns
distance.
- Return type
float
- Raises
TypeError if other not of
BaseGridPoint
-
classmethod
from_dict(baseGridPointDict)[source]¶ Create this object from dictionary representation
- Parameters
baseGridPointDict (dict) – dict() representation of this object.
- Returns
BaseGridPoint from dict()
- Return type
-
classmethod
from_tuple(tup)[source]¶ Create this object from tuple representation :param tup: :return: BaseGridPoint from tuple() :rtype:
BaseGridPoint
-
to_dict()[source]¶ Create the dictionary representation of this object.
- Returns
dict() representation of
BaseGridPoint- Return type
dict()
-
to_tuple()[source]¶ Create the tuple representation of this object.
- Returns
tuple() representation of
BaseGridPoint- Return type
tuple()
-