@@ -9,12 +9,12 @@ related performance benefits.
99
1010View Individual Data Points
1111----------------------------
12- To view the values directly, call the :code: `values ` method which will
12+ To view the values directly, call the :code: `Stream. values ` method which will
1313fully materialize the stream values at the stream version you specify (use the
1414default value of zero as the latest version). A :code: `start ` and :code: `end `
1515argument is required when making this request.
1616
17- Calling :code: `values ` will return a series of :code: `tuple `, with each item containing a
17+ Calling :code: `Stream. values ` will return a series of :code: `tuple `, with each item containing a
1818:code: `RawPoint `, and version of the stream (:code: `int `). As described in the
1919API reference, a :code: `RawPoint ` has both a :code: `time ` and :code: `value `
2020property.
@@ -33,6 +33,29 @@ property.
3333 ...
3434
3535
36+ Helpers for Dates/Times
37+ ~~~~~~~~~~~~~~~~~~~~~~~~~
38+
39+ If you are interested in finding the closest point to a particular datetime, there
40+ is the :code: `Stream.nearest ` method. Alternatively, if you want to know the first or
41+ last points in a stream, you can call the :code: `Stream.earliest ` and :code: `Stream.latest `
42+ methods. These two are often useful if you would like to view all of the data
43+ within the stream using the :code: `Stream.windows ` method below (it is not recommended that
44+ you query for all the data using the :code: `Stream.values ` method due to the memory
45+ consumption implied). Each of these three methods returns a tuple containing a
46+ RawPoint and the data version number. The exact timestamp can be obtained from the
47+ RawPoint. Keep in mind that all of these methods accept a :code: `version ` argument so that
48+ you can ask for the earliest, latest, or nearest point from a previous version of the stream.
49+
50+ .. code-block :: python
51+
52+ stream = db.stream_from_uuid(" 6f8ebaf0-78ea-416e-a0ff-5c3c5d83c279" )
53+ stream.earliest()
54+ >> (RawPoint(1364860800000000000 , 42516.03 ), 3934 )
55+ stream.earliest()[0 ].time
56+ >> 1364860800000000000
57+
58+
3659 View Windows of Data
3760--------------------
3861If you don't need to view every single point of data, then it is faster to view
5780
5881aligned_windows
5982^^^^^^^^^^^^^^^^
60- For statistical aggregates of your data, the :code: `aligned_windows ` method is
83+ For statistical aggregates of your data, the :code: `Stream. aligned_windows ` method is
6184the fastest way to query your data. Each point returned is a statistical
6285aggregate of all the raw data within a window of width 2^pointwidth
6386nanoseconds.
@@ -103,7 +126,7 @@ with count == 0 will be omitted.
103126
104127 windows
105128^^^^^^^^
106- The :code: `windows ` method of a Stream allows you to request windows of data
129+ The :code: `Stream. windows ` method of a Stream allows you to request windows of data
107130while specifying the precision of the data you require. Each window will cover
108131:code: `width ` nanoseconds in length. Precision of the result is determined by
109132the :code: `depth ` parameter such that each window will be accurate to
0 commit comments