polyfemos.front.sohplot.datacontainer.DataPoint¶
-
class
polyfemos.front.sohplot.datacontainer.
DataPoint
(dtstr=None, timestamp=None, utcdatetime=None, y=None, z=None)[source]¶ Bases:
object
A structlike class to store one datapoint in timeseries data
Public Methods
-
__init__
(dtstr=None, timestamp=None, utcdatetime=None, y=None, z=None)[source]¶ The data must have timevalue, given either
dtstr
,timestamp
orutcdatetime
.z
is an optional axis containing arbitrary string values following python dictionary syntax- Parameters
dtstr (str) – utcdatetime compatible string representing time value
timestamp (float) –
utcdatetime (
UTCDateTime
) –y (str or numlike) – string representing float number, if invalid string is provided,
y
will benan
z (str, optional) – Additional arbitrary values contained in string following python dict syntax
-
get_ordinal
()[source]¶ - Return type
- Returns
year and the day of the yeat as a string in format
YEAR.JULDAY
, e.g.2019.023
-
get_utcdatetime
()[source]¶ If
self.__utcdatetime
is not previously defined, the value is read usingself.__dtstr
orself.__timestamp
. If either of those is not provided, error is thrown.- Return type
- Returns
-
get_z
()[source]¶ - Return type
- Returns
Returns the value of
z
attribute. If the type was not previously converted from string to dictionary, the conversion is done in addition.
-
tonan
(inplace=True)[source]¶ Change the
y
attribute to nan. Ifinplace
isFalse
, a copy ofDataPoint
is returned. Note the mutability of theDataPoint
instance ifinplace
isTrue
.
Special Methods
-
__eq__
(other)[source]¶ Compares the timestamp and y values between
self
andother
. If both values are iedntical, returnsTrue
.
-