MCPcopy
hub / github.com/dabeaz-course/python-mastery / incr

Method incr

Data/stocksim.py:114–119  ·  view source on GitHub ↗
(self,dt)

Source from the content-addressed store, hash-verified

112
113 # Increment the time by a delta
114 def incr(self,dt):
115 self.time += dt
116 if self.index < (len(self.history) - 2):
117 while self.index < (len(self.history) - 2) and self.time >= self.history[self.index+1][3]:
118 self.index += 1
119 self.update()
120
121 def make_record(self):
122 return [self.name,round(self.price,2),self.date,minutes_to_str(self.time),round(self.change,2),self.open,round(self.high,2),

Callers 1

runMethod · 0.80

Calls 1

updateMethod · 0.95

Tested by

no test coverage detected