API Reference for Enthought Tool Suite 3.2.0
A scale for time and calendar intervals.
Labels for date and time units.
datetime_scale = [ 'microsecond', 'second', 'minute', 'hour', 'day', 'month', 'year' ]
datetime_zeros = zip(datetime_scale, [ 0, 0, 0, 0, 1, 1, 1 ])
Default time scale for hours, minutes, seconds, and milliseconds.
HMSScales = ((([ TimeScale(microseconds = 1), TimeScale(milliseconds = 1) ] + [ %s for dt in (1, 5, 15, 30) ]) + [ %s for dt in (1, 5, 15, 30) ]) + [ %s for dt in (1, 2, 3, 4, 6, 12, 24) ])
Default time scale for months, days, and years.
MDYScales = [ TimeScale(day_of_month = range(1, 31, 3)), TimeScale(day_of_month = (1, 8, 15, 22)), TimeScale(day_of_month = (1, 15)), TimeScale(month_of_year = range(1, 13)), TimeScale(month_of_year = range(1, 13, 3)), TimeScale(month_of_year = (1, 7)), TimeScale(month_of_year = (1)) ]
Returns the floating point number of seconds since the UNIX epoch corresponding to the given datetime instance.
This value is more accurate than mktime(t.timetuple()) because it preserves milliseconds.
Returns the floating point number of seconds in a timedelta object.
Performs a calendar-aware split of a time into (aligned_time, frac) over an interval that is a multiple of one of the following time units:
"microseconds" "milliseconds", "seconds", "minutes", "hours", "days", "years"
Settings of milliseconds..hours are truncated towards 0, days are counted from January 1st of their respective year, and years are counted from 1 AD. This may lead to unexpected rounding if multi-day or multi-year intervals are used.
For example:
If it is currently 4:15pm on January 3rd, 2007, calling: tfrac(time.time(), hours=3) returns the UNIX number of seconds corresponding to "January 3rd, 2007 15:00:00" as the aligned time, and the number of seconds in 1 hour and 15 minutes as the fractional part.
A tuple: (aligned time as UNIX time, remainder in seconds)
Like range(), but for times, and with "natural" alignment depending on the interval.
For example:
t_range(time.time(), time.time()+76*3600, days=2) t_range(start, end, months=3)
A list of times that nicely span the interval, or an empty list if start and end fall within the same interval.
| Local name | Refers to |
|---|---|
| AbstractScale | enthought.chaco.scales.scales.AbstractScale |
| datetime | datetime.datetime |
| EPOCH | enthought.chaco.scales.safetime.EPOCH |
| floor | math.floor |
| frange | enthought.chaco.scales.scales.frange |
| heckbert_interval | enthought.chaco.scales.scales.heckbert_interval |
| MAXYEAR | datetime.MAXYEAR |
| MINYEAR | datetime.MINYEAR |
| mktime | enthought.chaco.scales.safetime.mktime |
| safe_fromtimestamp | enthought.chaco.scales.safetime.safe_fromtimestamp |
| ScaleSystem | enthought.chaco.scales.scales.ScaleSystem |
| timedelta | datetime.timedelta |
| TimeFormatter | enthought.chaco.scales.formatters.TimeFormatter |
© Copyright 2002-2009 Enthought, Inc.