MCPcopy Create free account
hub / github.com/dabeaz-course/practical-python / update

Method update

Work/Data/stocksim.py:102–109  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

100
101 # Update all computed values
102 def update(self):
103 self.price = round(self.interpolate(1),2)
104 self.volume = int(self.interpolate(-1))
105 if self.price < self.low:
106 self.low = self.price
107 if self.price >= self.high:
108 self.high = self.price
109 self.change = self.price - self.initial
110
111 # Increment the time by a delta
112 def incr(self,dt):

Callers 3

resetMethod · 0.95
incrMethod · 0.95
publishMethod · 0.45

Calls 1

interpolateMethod · 0.95

Tested by

no test coverage detected