Created
June 14, 2012 00:28
-
-
Save v/2927357 to your computer and use it in GitHub Desktop.
Cython Problems?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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