From c4552e04e1271a9210a934233beae5be1943d034 Mon Sep 17 00:00:00 2001 From: Théo de la Hogue Date: Wed, 7 Jun 2023 14:34:14 +0200 Subject: Writing User guide and use cases section. --- .../user_guide/timestamped_data/ordered_dictionary.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 docs/user_guide/timestamped_data/ordered_dictionary.md (limited to 'docs/user_guide/timestamped_data/ordered_dictionary.md') 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} +... +``` -- cgit v1.1