Commit 75d3af72 authored by Kipp Cannon's avatar Kipp Cannon

snglcoinc.py: add .age properties

parent f1223ccd
......@@ -139,6 +139,15 @@ class singlesqueue(object):
# id() --> event mapping for the contents of queue
self.index = {}
@property
def age(self):
"""
Using .event_time() to define the times of events, the time
of the oldest event in the queue or segments.NegInfinity if
the queue is empty.
"""
return self.end_time(self.queue[0]) if self.queue else NegInfinity
@property
def t_coinc_complete(self):
"""
......@@ -354,6 +363,13 @@ class coincgen_doubles(object):
# been reported in coincidences
self.used = set()
@property
def age(self):
"""
The earliest of the internal queues' .age.
"""
return min(queue.age for queue in self.queues.values())
@property
def t_complete(self):
"""
......@@ -525,6 +541,13 @@ class TimeSlideGraphNode(object):
else:
raise ValueError("offset_vector cannot be empty")
@property
def age(self):
"""
The earliest of the component nodes' .age.
"""
return min(node.age for node in self.components)
@property
def t_complete(self):
"""
......@@ -799,6 +822,14 @@ class TimeSlideGraph(object):
print("graph contains %d fundamental nodes, %d higher-order nodes" % tuple(sum(walk(node) for node in self.head)), file=sys.stderr)
@property
def age(self):
"""
The earliest of the graph's head nodes' .age.
"""
return min(node.age for node in self.head)
def push(self, instrument, events, t_complete):
"""
Push new events from some instrument into the internal
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment