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

Method update

Data/stocksim.py:104–111  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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

Callers 12

resetMethod · 0.95
incrMethod · 0.95
publishMethod · 0.45
validate.pyFile · 0.45
validate.pyFile · 0.45
validate.pyFile · 0.45
validate.pyFile · 0.45
validate.pyFile · 0.45
validate.pyFile · 0.45
validate.pyFile · 0.45
validate.pyFile · 0.45
validate.pyFile · 0.45

Calls 1

interpolateMethod · 0.95

Tested by

no test coverage detected