nqminds / nqm-iot-database-py

nqm-iot-database-py
https://nqminds.github.io/nqm-iot-database-py/
0 stars 0 forks source link

Make new class NDArray #9

Open aloisklink opened 5 years ago

aloisklink commented 5 years ago

Currently, addData() only accepts numpy.ndarray as things to insert as an ndarray. This makes it impossible to add custom metadata/options, such as whether to compress the saved ndarray or to save it as a Base64 string instead of a file.

We should make a new class called NDArray, which allows setting this option.

Example usage:

data = np.array([47, 32])
# before
db.addData([{"a": data}])
# after
ndarray = NDArray(data, saveFormat="base64")
db.addData([{"a": ndarray}])