Skip to content

Commit ca5346c

Browse files
Merge pull request BTrDB#96 from PingThingsIO/sc-17506-update-depth-documentation
remove depth parameter
2 parents aa08c59 + a4f9e63 commit ca5346c

File tree

1 file changed

+7
-20
lines changed

1 file changed

+7
-20
lines changed

btrdb/stream.py

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -690,11 +690,7 @@ def windows(self, start, end, width, depth=0, version=0):
690690
The end time in nanoseconds for the range to be queried. (see
691691
:func:`btrdb.utils.timez.to_nanoseconds` for valid input types)
692692
width : int
693-
The number of nanoseconds in each window, subject to the depth
694-
parameter.
695-
depth : int
696-
The precision of the window duration as a power of 2 in nanoseconds.
697-
E.g 30 would make the window duration accurate to roughly 1 second
693+
The number of nanoseconds in each window.
698694
version : int
699695
The version of the stream to query.
700696
@@ -716,13 +712,8 @@ def windows(self, start, end, width, depth=0, version=0):
716712
multiple of width, then end will be decreased to the greatest value less
717713
than end such that (end - start) is a multiple of `width` (i.e., we set
718714
end = start + width * floordiv(end - start, width). The `depth`
719-
parameter is an optimization that can be used to speed up queries on
720-
fast queries. Each window will be accurate to 2^depth nanoseconds. If
721-
depth is zero, the results are accurate to the nanosecond. On a dense
722-
stream for large windows, this accuracy may not be required. For example
723-
for a window of a day, +- one second may be appropriate, so a depth of
724-
30 can be specified. This is much faster to execute on the database
725-
side.
715+
parameter previously available has been deprecated. The only valid value
716+
for depth is now 0.
726717
727718
"""
728719
materialized = []
@@ -1118,7 +1109,8 @@ def windows(self, width, depth):
11181109
The number of nanoseconds to use for each window size.
11191110
depth : int
11201111
The requested accuracy of the data up to 2^depth nanoseconds. A
1121-
depth of 0 is accurate to the nanosecond.
1112+
depth of 0 is accurate to the nanosecond. This is now the only
1113+
valid value for depth.
11221114
11231115
Returns
11241116
-------
@@ -1136,13 +1128,8 @@ def windows(self, width, depth):
11361128
less than the end timestamp. If (end - start) is not a multiple of
11371129
width, then end will be decreased to the greatest value less than end
11381130
such that (end - start) is a multiple of width (i.e., we set end = start
1139-
+ width * floordiv(end - start, width). The depth parameter is an
1140-
optimization that can be used to speed up queries on fast queries. Each
1141-
window will be accurate to 2^depth nanoseconds. If depth is zero, the
1142-
results are accurate to the nanosecond. On a dense stream for large
1143-
windows, this accuracy may not be required. For example for a window of
1144-
a day, +- one second may be appropriate, so a depth of 30 can be
1145-
specified. This is much faster to execute on the database side.
1131+
+ width * floordiv(end - start, width). The `depth` parameter previously
1132+
available has been deprecated. The only valid value for depth is now 0.
11461133
11471134
"""
11481135
if not self.allow_window:

0 commit comments

Comments
 (0)