Skip to content

Instantly share code, notes, and snippets.

@v
Created June 14, 2012 00:28
Show Gist options
  • Save v/2927357 to your computer and use it in GitHub Desktop.
Save v/2927357 to your computer and use it in GitHub Desktop.
Cython Problems?
class TimeInterval(Feature):
""" A Time Interval represents a period of time in a given day. It does not understand dates or days of the week.
It understands no unit of time that it smaller than a minute."""
def __init__(self, start, end):
""" start and end are represented as minutes from midnight """
start = minutes_from_midnight(start)
end = minutes_from_midnight(end)
self.start = start
self.stop = end
self.strand = 0
Feature.__cinit__(self, int(start), int(end))
def __repr__(self):
start_time = minutes_to_time(self.start)
end_time = minutes_to_time(self.end)
tstr = 'TimeInterval(%s, %s)' % (start_time, end_time)
return tstr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment