StevensDeptECE / GrailGUI

GrailGUI is a prototype of a replacement for web programming (HTTP, HTML, CSS, JavaScript) and GUI programming. It includes a client graphical API, a browser implemented in C++ and OpenGL, a protocol to transmit metadata and data in binary, a language (XDL) to describe the binary data, and local storage to retain data on the client should that be necessary. Encrypted communications (equivalent of TLS) have not yet been implemented.
GNU General Public License v3.0
7 stars 14 forks source link

Should Stats1D store copies of the data its given? #50

Closed dkrautha closed 3 years ago

dkrautha commented 3 years ago

Does Stats1D actually need to store its own copy of the data? Is there anything preventing us from just doing something similar to what python (https://docs.python.org/3/library/statistics.html) does, and just take an iterable in as a parameter and return the value the user wants?

This would negate the need for any sort of caching nonesense (functions which could have a cached value take an optional parameter in python), and prevent the need of creating a new object to perform these operations. This also seems to be the approach that numpy (https://numpy.org/doc/stable/reference/generated/numpy.mean.html) and scipy (https://docs.scipy.org/doc/scipy-0.8.x/reference/generated/scipy.stats.mean.html) take with their implementations.

Doing something like this would also allow us to do math on matrices or multidimensional iterables as we wouldn't be tied to a single internal vector with the data.