Skip to content

remove depth parameter #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 7 additions & 20 deletions btrdb/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,11 +690,7 @@ def windows(self, start, end, width, depth=0, version=0):
The end time in nanoseconds for the range to be queried. (see
:func:`btrdb.utils.timez.to_nanoseconds` for valid input types)
width : int
The number of nanoseconds in each window, subject to the depth
parameter.
depth : int
The precision of the window duration as a power of 2 in nanoseconds.
E.g 30 would make the window duration accurate to roughly 1 second
The number of nanoseconds in each window.
version : int
The version of the stream to query.

Expand All @@ -716,13 +712,8 @@ def windows(self, start, end, width, depth=0, version=0):
multiple of width, then end will be decreased to the greatest value less
than end such that (end - start) is a multiple of `width` (i.e., we set
end = start + width * floordiv(end - start, width). The `depth`
parameter is an optimization that can be used to speed up queries on
fast queries. Each window will be accurate to 2^depth nanoseconds. If
depth is zero, the results are accurate to the nanosecond. On a dense
stream for large windows, this accuracy may not be required. For example
for a window of a day, +- one second may be appropriate, so a depth of
30 can be specified. This is much faster to execute on the database
side.
parameter previously available has been deprecated. The only valid value
for depth is now 0.

"""
materialized = []
Expand Down Expand Up @@ -1118,7 +1109,8 @@ def windows(self, width, depth):
The number of nanoseconds to use for each window size.
depth : int
The requested accuracy of the data up to 2^depth nanoseconds. A
depth of 0 is accurate to the nanosecond.
depth of 0 is accurate to the nanosecond. This is now the only
valid value for depth.

Returns
-------
Expand All @@ -1136,13 +1128,8 @@ def windows(self, width, depth):
less than the end timestamp. If (end - start) is not a multiple of
width, then end will be decreased to the greatest value less than end
such that (end - start) is a multiple of width (i.e., we set end = start
+ width * floordiv(end - start, width). The depth parameter is an
optimization that can be used to speed up queries on fast queries. Each
window will be accurate to 2^depth nanoseconds. If depth is zero, the
results are accurate to the nanosecond. On a dense stream for large
windows, this accuracy may not be required. For example for a window of
a day, +- one second may be appropriate, so a depth of 30 can be
specified. This is much faster to execute on the database side.
+ width * floordiv(end - start, width). The `depth` parameter previously
available has been deprecated. The only valid value for depth is now 0.

"""
if not self.allow_window:
Expand Down