Skip to content

Commit af5e84f

Browse files
committed
Catch up to master branch.
2 parents 3ea962c + 6f10939 commit af5e84f

File tree

4 files changed

+24
-9
lines changed

4 files changed

+24
-9
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ These are BTrDB Bindings for Python allowing you painless and productive access
44

55
## Sample Code
66

7-
Our goal is to make BTrDB as easy to use as possible, focusing on integration with other tools and the productivity of our users. In keeping with this we continue to add new features such as easy transformation to numpy arrays, pandas Series, etc. See the sample code below and then checkout our [documentation](https://btrdb.readthedocs.io/en/latest/) for more in depth instructions.
7+
Our goal is to make BTrDB as easy to use as possible, focusing on integration with other tools and the productivity of our users. In keeping with this we continue to add new features such as easy transformation to numpy arrays, pandas Series, etc. See the sample code below and then checkout our [documentation](https://btrdb-python.readthedocs.io/en/latest/) for more in depth instructions.
88

99
import btrdb
1010

@@ -67,7 +67,7 @@ You can also easily work with a group of streams for when you need to evaluate d
6767

6868
## Installation
6969

70-
See our documentation on [installing](https://btrdb.readthedocs.io/en/latest/installing.html) the bindings for more detailed instructions. However, to quickly get started using the latest available versions you can use `pip` to install from pypi with `conda` support coming in the near future.
70+
See our documentation on [installing](https://btrdb-python.readthedocs.io/en/latest/installing.html) the bindings for more detailed instructions. However, to quickly get started using the latest available versions you can use `pip` to install from pypi with `conda` support coming in the near future.
7171

7272
$ pip install btrdb
7373

@@ -99,7 +99,7 @@ The project documentation is written in reStructuredText and is built using Sphi
9999

100100
$ make html
101101

102-
This will build the HTML documentation locally in `docs/build`, which can be viewed using `open docs/build/index.html`. Other formats (PDF, epub, etc) can be built using `docs/Makefile`. The documentation is automatically built on every GitHub release and hosted on [Read The Docs](https://btrdb.readthedocs.io/en/latest/).
102+
This will build the HTML documentation locally in `docs/build`, which can be viewed using `open docs/build/index.html`. Other formats (PDF, epub, etc) can be built using `docs/Makefile`. The documentation is automatically built on every GitHub release and hosted on [Read The Docs](https://btrdb-python.readthedocs.io/en/latest/).
103103

104104
Note that the documentation also requires Sphix and other dependencies to successfully build: `pip install -r docs/requirements.txt`.
105105

btrdb/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
## Module Info
1616
##########################################################################
1717

18-
__version_info__ = {"major": 5, "minor": 30, "micro": 2, "releaselevel": "final"}
18+
__version_info__ = {"major": 5, "minor": 31, "micro": 0, "releaselevel": "final"}
1919

2020
##########################################################################
2121
## Helper Functions

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "btrdb"
3-
version = "5.30.2"
3+
version = "5.31.0"
44
authors = [
55
{name="PingThingsIO", email="support@pingthings.io"},
66
]

tests/btrdb_integration/test_streamset.py

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,17 @@ def test_streamset_arrow_windows_vs_windows(conn, tmp_collection, name_callable)
9696
.windows(width=btrdb.utils.timez.ns_delta(nanoseconds=10))
9797
)
9898
values_arrow = ss.arrow_to_dataframe(name_callable=name_callable)
99+
values_arrow.set_index("time", inplace=True)
100+
values_arrow.index = pd.DatetimeIndex(values_arrow.index)
99101
values_prev = ss.to_dataframe(name_callable=name_callable).convert_dtypes(
100102
dtype_backend="pyarrow"
101103
)
102-
values_prev.index = pd.DatetimeIndex(values_prev.index, tz="UTC")
104+
values_prev.index = pd.to_datetime(values_prev.index, utc=True)
105+
values_prev = values_prev.convert_dtypes(
106+
dtype_backend="pyarrow",
107+
)
103108
col_map = {old_col: old_col + "/mean" for old_col in values_prev.columns}
104109
values_prev = values_prev.rename(columns=col_map)
105-
(values_arrow)
106-
(values_prev)
107110
assert values_arrow.equals(values_prev)
108111

109112

@@ -125,6 +128,8 @@ def test_streamset_arrow_windows_vs_windows_agg_all(conn, tmp_collection):
125128
.windows(width=btrdb.utils.timez.ns_delta(nanoseconds=10))
126129
)
127130
values_arrow = ss.arrow_to_dataframe(name_callable=None, agg=["all"])
131+
values_arrow.set_index("time", inplace=True)
132+
values_arrow.index = pd.DatetimeIndex(values_arrow.index)
128133
values_prev = ss.to_dataframe(name_callable=None, agg="all")
129134
values_prev = values_prev.apply(lambda x: x.astype(str(x.dtype) + "[pyarrow]"))
130135
values_prev = values_prev.apply(
@@ -145,7 +150,12 @@ def test_streamset_arrow_windows_vs_windows_agg_all(conn, tmp_collection):
145150
agg=["all", "mean", "trash"], name_callable=lambda x: str(x.uuid)
146151
)
147152
assert (
148-
len(other_arrow_df.filter(regex="[min,mean,max,count,stddev]").columns) == 3 * 5
153+
len(
154+
other_arrow_df.filter(
155+
regex=".*\/[min,mean,max,count,stddev]", axis=1
156+
).columns
157+
)
158+
== 3 * 5
149159
)
150160

151161

@@ -174,6 +184,8 @@ def test_streamset_arrow_aligned_windows_vs_aligned_windows(
174184
.windows(width=btrdb.utils.general.pointwidth.from_nanoseconds(10))
175185
)
176186
values_arrow = ss.arrow_to_dataframe(name_callable=name_callable)
187+
values_arrow.set_index("time", inplace=True)
188+
values_arrow.index = pd.DatetimeIndex(values_arrow.index)
177189
values_prev = ss.to_dataframe(
178190
name_callable=name_callable
179191
) # .convert_dtypes(dtype_backend='pyarrow')
@@ -235,6 +247,7 @@ def test_arrow_streamset_to_dataframe(conn, tmp_collection):
235247
s2.insert(list(zip(t2, d2)))
236248
ss = btrdb.stream.StreamSet([s1, s2]).filter(start=100, end=121)
237249
values = ss.arrow_to_dataframe()
250+
values.set_index("time", inplace=True)
238251
expected_times = [100, 101, 105, 106, 110, 114, 115, 119, 120]
239252
expected_times = [
240253
pa.scalar(v, type=pa.timestamp("ns", tz="UTC")).as_py() for v in expected_times
@@ -385,6 +398,8 @@ def test_streamset_windows_aggregates_filter(conn, tmp_collection):
385398
.windows(width=btrdb.utils.timez.ns_delta(nanoseconds=10))
386399
)
387400
values_arrow_df = ss.arrow_to_dataframe(agg=["mean", "stddev"])
401+
values_arrow_df.set_index("time", inplace=True)
402+
values_arrow_df.index = pd.DatetimeIndex(values_arrow_df.index)
388403
values_non_arrow_df = ss.to_dataframe(agg="all")
389404
values_non_arrow_df.index = pd.DatetimeIndex(values_non_arrow_df.index, tz="UTC")
390405
values_non_arrow_df = values_non_arrow_df.apply(

0 commit comments

Comments
 (0)