[Scipy-svn] r2617 - trunk/Lib/sandbox/timeseries
scipy-svn at scipy.org
scipy-svn at scipy.org
Fri Jan 26 16:40:43 EST 2007
Author: mattknox_ca
Date: 2007-01-26 15:40:36 -0600 (Fri, 26 Jan 2007)
New Revision: 2617
Modified:
trunk/Lib/sandbox/timeseries/tseries.py
Log:
fixed bugs with size 0 TimeSeries objects
Modified: trunk/Lib/sandbox/timeseries/tseries.py
===================================================================
--- trunk/Lib/sandbox/timeseries/tseries.py 2007-01-26 21:39:45 UTC (rev 2616)
+++ trunk/Lib/sandbox/timeseries/tseries.py 2007-01-26 21:40:36 UTC (rev 2617)
@@ -112,11 +112,13 @@
elif a.start_date != b.start_date:
raise TimeSeriesCompatibilityError('start_date',
a.start_date, b.start_date)
- elif (a._dates.get_steps() != b._dates.get_steps()).any():
- raise TimeSeriesCompatibilityError('time_steps',
- a._dates.get_steps(), b._dates.get_steps())
- elif a.shape != b.shape:
- raise TimeSeriesCompatibilityError('size', "1: %s" % str(a.shape),
+ else:
+ step_diff = a._dates.get_steps() != b._dates.get_steps()
+ if (step_diff is True) or (hasattr(step_diff, "any") and step_diff.any()):
+ raise TimeSeriesCompatibilityError('time_steps',
+ a._dates.get_steps(), b._dates.get_steps())
+ elif a.shape != b.shape:
+ raise TimeSeriesCompatibilityError('size', "1: %s" % str(a.shape),
"2: %s" % str(b.shape))
return True
More information about the Scipy-svn
mailing list