aboutsummaryrefslogtreecommitdiff
path: root/docs/user_guide/timestamped_data/ordered_dictionary.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/user_guide/timestamped_data/ordered_dictionary.md')
-rw-r--r--docs/user_guide/timestamped_data/ordered_dictionary.md19
1 files changed, 19 insertions, 0 deletions
diff --git a/docs/user_guide/timestamped_data/ordered_dictionary.md b/docs/user_guide/timestamped_data/ordered_dictionary.md
new file mode 100644
index 0000000..8c93fc6
--- /dev/null
+++ b/docs/user_guide/timestamped_data/ordered_dictionary.md
@@ -0,0 +1,19 @@
+Ordered dictionary
+==================
+
+[TimeStampedBuffer](/argaze/#argaze.DataStructures.TimeStampedBuffer) class inherits from [OrderedDict](https://docs.python.org/3/library/collections.html#collections.OrderedDict) as data are de facto ordered by time.
+
+Any data type can be stored using int or float keys as timestamp.
+
+```python
+from argaze import DataStructures
+
+# Create a timestamped data buffer
+ts_data = DataStructures.TimeStampedBuffer()
+
+# Store any data type using numeric keys
+ts_data[0] = 123
+ts_data[0.1] = "message"
+ts_data[0.23] = {"key": value}
+...
+```