Skip to content

Commit 8d6f5b7

Browse files
Move 0.1.5
1 parent d8761d9 commit 8d6f5b7

File tree

4 files changed

+16
-11
lines changed

4 files changed

+16
-11
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "rtta"
3-
version = "0.1.3"
3+
version = "0.1.5"
44
description = "Low latency incremental technical analysis"
55
readme = "README.md"
66
authors = [

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = rtta
3-
version = 0.1.4
3+
version = 0.1.5
44
description = Low latency incremental technical analysis
55
long_description = file: README.md
66
long_description_content_type = text/markdown

src/rtta.pyx

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,8 @@ cdef class SMA():
331331
cdef int window
332332
cdef bint fillna
333333
cdef double tally
334-
cdef double mean
334+
cdef double _stored_mean
335+
cdef double _mean
335336

336337
def __init__(self, int window, bint fillna=False):
337338
self.history = np.zeros(window)
@@ -341,7 +342,11 @@ cdef class SMA():
341342
self.window = window
342343
self.fillna = fillna
343344
self.tally = 0
344-
self.mean = float('nan')
345+
self._mean = float('nan')
346+
347+
348+
cpdef double mean(self):
349+
return self._stored_mean
345350

346351
@cython.boundscheck(False) # turn off bounds-checking for entire function
347352
@cython.wraparound(False)
@@ -358,12 +363,12 @@ cdef class SMA():
358363

359364
if self.first_pass:
360365
if not self.fillna:
361-
self.mean = np.nan
362-
return self.mean
363-
self.mean = self.tally / self.index
364-
return self.mean
365-
self.mean = self.tally/self.window
366-
return self.mean
366+
self._mean = np.nan
367+
return self._mean
368+
self._mean = self.tally / self.index
369+
return self._mean
370+
self._mean = self.tally/self.window
371+
return self._mean
367372

368373
cpdef batch(self, input):
369374
cdef long i

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)