Skip to content

Commit

Permalink
Export time series interface from __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
twanvl committed Dec 13, 2024
1 parent addad95 commit 22669c7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/tsdf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@

from .tsdfmetadata import TSDFMetadata

from .time_series import (
ChannelMetadata,
ChannelGroup,
TimeSeriesMetadata,
TSDFTimeSeries,
read_multi_time_series_metadata,
read_time_series,
read_dataframe,
write_dataframe,
)

__all__ = [
"load_metadata_file",
"load_metadata_from_path",
Expand All @@ -37,5 +48,12 @@
"load_ndarray_from_binary",
"load_dataframe_from_binaries",
"TSDFMetadata",
"constants",
"ChannelMetadata",
"ChannelGroup",
"TimeSeriesMetadata",
"TSDFTimeSeries",
"read_multi_time_series_metadata",
"read_time_series",
"read_dataframe",
"write_dataframe",
]
3 changes: 3 additions & 0 deletions tests/test_time_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ def test_write_time_series_subset(shared_datadir):
assert get_metadata(df).to_dict() == get_metadata(df2).to_dict()

def test_write_time_series_add_channel(shared_datadir):
"""
Test adding a channel and then writing&reading a file
"""
file = shared_datadir / "ppp_format_meta.json"
file2 = shared_datadir / "test_write_time_series_add_channel.json"
df = read_dataframe(file, ["time"])
Expand Down

0 comments on commit 22669c7

Please sign in to comment.