コード例 #1
0
ファイル: handle_TimeSet.py プロジェクト: rickpaul/becon-0.1
	def shift_backward(self, numPeriods):
		if self.periodicity == SECONDS:
			self.startDT = dt_subtract_seconds(self.startDT, numPeriods)
			self.endDT = dt_subtract_seconds(self.endDT, numPeriods)
		elif self.periodicity == MONTHS:
			self.startDT = dt_subtract_months(self.startDT, numPeriods)
			self.endDT = dt_subtract_months(self.endDT, numPeriods)
		elif self.periodicity == QUARTERS:
			self.startDT = dt_subtract_months(self.startDT, 3*numPeriods)
			self.endDT = dt_subtract_months(self.endDT, 3*numPeriods)
		elif self.periodicity == YEARS:
			self.startDT = dt_subtract_months(self.startDT, 12*numPeriods)
			self.endDT = dt_subtract_months(self.endDT, 12*numPeriods)
		else:
			raise NotImplementedError
コード例 #2
0
ファイル: handle_TimeSet.py プロジェクト: rickpaul/becon-0.1
	def truncate_end(self, numPeriods):
		if self.periodicity == SECONDS:
			self.endDT = dt_subtract_seconds(self.endDT, numPeriods)
		elif self.periodicity == MONTHS:
			self.endDT = dt_subtract_months(self.endDT, numPeriods)
		elif self.periodicity == QUARTERS:
			self.endDT = dt_subtract_months(self.endDT, 3*numPeriods)
		elif self.periodicity == YEARS:
			self.endDT = dt_subtract_months(self.endDT, 12*numPeriods)
		else:
			raise NotImplementedError