stream_graph.ABC
.ITemporalNodeSet¶
-
class
stream_graph.ABC.
ITemporalNodeSet
[source][source]¶ ITemporalNodeSet Object API Specification.
A Instantaneous Temporal NodeSet can be abstractly be defined as a set of nodes
u
associated with a time-stampts
.- Attributes
discrete
Designate if the TemporalNodeSet is on discrete Time.
instantaneous
Defines if the Time Set is instantaneous.
n
Returns number of nodes of the TemporalNodeSet.
nodeset
Return the nodeset that can be derived from this TemporalNodeSet.
- number_of_instants
size
Returns the size of the TemporalNodeSet.
timeset
Return the timeset that can be derived from this TemporalNodeSet.
total_common_time
Returns the total time that each node shares with all the other nodes of the TemporalNodeSet.
total_time
Returns the size of the derived TimeSet.
Methods
common_time
(self[, u])common_time_pair
(self[, l])copy
(self[, deep])Returns a deep or shallow copy of the current TemporalNodeSet.
discretize
(self[, bins, bin_size])Returns a discrete version of the current TemporalNodeSet.
duration_of
(self[, u])issuperset
(self, ns)Check if a temporal_nodeset contains another temporal_nodeset.
n_at
(self[, t])Returns number of nodes of the TemporalNodeSet at a certain time.
nodes_at
(self[, t])Return the nodes at a certain time.
times_of
(self[, u])Returns TimeSet that a nodes appears in the TemporalNodeSet.
-
abstract
__and__
(self, ns)[source]¶ Implementation of the
&
operator for a TemporalNodeSet object.- Parameters
- nsTemporalNodeSet
- Returns
- outTemporalNodeSet
Returns the intersection of Nodes at Intervals.
-
abstract
__bool__
(self)[source]¶ Implementation of the
bool
casting of a TemporalNodeSet object.- Parameters
- None.
- Returns
- outBool
Return True if an object is both initialized and contains information.
-
__class__
[source]¶ alias of
abc.ABCMeta
-
abstract
__contains__
(self, u)[source]¶ Implementation of the
in
operator for LinkStream.- Parameters
- ltuple, len(l) == 2
l[0] :
u
or None l[1] :t
or(ts, tf)
or None
- Returns
- containsBool
Returns True if a node
u
exists att
or through all(ts, tf)
. If an element isNone
,in
will return True if the other elements matches. If both elements areNone
output will be None.
-
__delattr__
(self, name, /)¶ Implement delattr(self, name).
-
__dir__
()¶ default dir() implementation
-
__eq__
(self, value, /)¶ Return self==value.
-
__format__
()¶ default object formatter
-
__ge__
(self, value, /)¶ Return self>=value.
-
__getattribute__
(self, name, /)¶ Return getattr(self, name).
-
__gt__
(self, value, /)¶ Return self>value.
-
__hash__
(self, /)¶ Return hash(self).
-
__init__
(self, /, *args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
__init_subclass__
()¶ This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
-
abstract
__iter__
(self)[source]¶ Implementation of the
iter
function for a TemporalNodeSet object.- Parameters
- None
- Returns
- outIterator of tuple
Each tuple is of the form
(u, ts, tf)
.
-
__le__
(self, value, /)¶ Return self<=value.
-
__lt__
(self, value, /)¶ Return self<value.
-
__ne__
(self, value, /)¶ Return self!=value.
-
__new__
(*args, **kwargs)¶ Create and return a new object. See help(type) for accurate signature.
-
abstract
__or__
(self, ns)[source]¶ Implementation of the
|
operator for a TemporalNodeSet object.- Parameters
- nsTemporalNodeSet
- Returns
- outTemporalNodeSet
Returns the union of Nodes at Intervals.
-
__reduce__
()¶ helper for pickle
-
__reduce_ex__
()¶ helper for pickle
-
__repr__
(self, /)¶ Return repr(self).
-
__setattr__
(self, name, value, /)¶ Implement setattr(self, name, value).
-
__sizeof__
()¶ size of object in memory, in bytes
-
abstract
__sub__
(self, ns)[source]¶ Implementation of the
-
operator for a TemporalNodeSet object.- Parameters
- nsTemporalNodeSet
- Returns
- outTemporalNodeSet
Returns the difference of Nodes at Intervals.
-
__subclasshook__
()¶ Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
-
__weakref__
¶ list of weak references to the object (if defined)
-
copy
(self, deep=True)[source]¶ Returns a deep or shallow copy of the current TemporalNodeSet.
- Parameters
- deepBool
- Returns
- temporal_nodeset_copyTemporalNodeSet
Returns a deep or shallow copy of the current TemporalNodeSet.
-
abstract property
discrete
¶ Designate if the TemporalNodeSet is on discrete Time.
- Parameters
- None. Property.
- Returns
- discreteBool or None
True if the time is discrete. Returns None if empty.
-
discretize
(self, bins=None, bin_size=None)[source]¶ Returns a discrete version of the current TemporalNodeSet.
- Parameters
- binsIterable or None.
If None, step should be provided. If Iterable it should contain n+1 elements that declare the start and the end of all (continuous) bins.
- bin_sizeInt or datetime
If bins is provided this argument is ommited. Else declare the size of each bin.
- Returns
- timeset_discreteTimeSet
Returns a discrete version of the TimeSet.
- binslist
A list of the created bins.
-
property
instantaneous
¶ Defines if the Time Set is instantaneous.
-
abstract
issuperset
(self, ns)[source]¶ Check if a temporal_nodeset contains another temporal_nodeset.
- Parameters
- nsTemporalNodeSet
- Returns
- issuperset_fBool
True if all nodes of ns appear in same or lesser intervals.
-
property
n
¶ Returns number of nodes of the TemporalNodeSet.
- Parameters
- None. Property.
- Returns
- nInt
Returns the number of distinct nodes in the TemporalNodeSet.
-
n_at
(self, t=None)[source]¶ Returns number of nodes of the TemporalNodeSet at a certain time.
- Parameters
- tReal
- Returns
- nInt or TimeCollection(Int)
Returns the number of active nodes at time
t
. If None returns an iterator of tuples containing a timestamp and an Int.
-
abstract
nodes_at
(self, t=None)[source]¶ Return the nodes at a certain time.
- Parameters
- tReal or None
- Returns
- nodesNodeSet or TimeGenerator(NodeSet)
Active nodes at time t. If None returns an TimeGenerator of tuples containing a timestamp and a NodeSet.
-
abstract property
nodeset
¶ Return the nodeset that can be derived from this TemporalNodeSet.
- Parameters
- None. Property.
- Returns
- nodesetNodeSet
Returns all the distinct nodes that appear inside the TemporalNodeSet.
-
abstract
times_of
(self, u=None)[source]¶ Returns TimeSet that a nodes appears in the TemporalNodeSet.
- Parameters
- uNode_Id or None
- Returns
- timesetTimeSet or NodeCollection(TimeSet)
Returns the times that node
u
exists. Return a NodeCollection of the TimeSet for each node u.
-
abstract property
timeset
¶ Return the timeset that can be derived from this TemporalNodeSet.
- Parameters
- None. Property.
- Returns
- timesetTimeSet
Returns all the times that nodes appear inside the TemporalNodeSet.
-
property
total_time
¶ Returns the size of the derived TimeSet.
- Parameters
- None. Property.
- Returns
- total_timeReal
The total amount of time from the union of intervals that nodes exist.