Skip to content
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

Renamed from_indexed_dicts to from_struct #419

Merged
merged 1 commit into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion docs/public_api_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"to_tensorflow_dataset",
"from_tensorflow_record",
"to_tensorflow_record",
"from_indexed_dicts",
"from_struct",
# DTYPES
"float64",
"float32",
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion temporian/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

# EventSets
from temporian.implementation.numpy.data.event_set import EventSet, IndexData
from temporian.implementation.numpy.data.io import event_set, from_indexed_dicts
from temporian.implementation.numpy.data.io import event_set, from_struct

# Serialization
from temporian.core.serialization import save
Expand Down
6 changes: 3 additions & 3 deletions temporian/implementation/numpy/data/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,21 +208,21 @@ def event_set(


@typecheck
def from_indexed_dicts(
def from_struct(
data: List[Tuple[Dict[str, Any], Dict[str, DataArray]]],
timestamps: str = "timestamp",
is_unix_timestamp: bool = False,
) -> EventSet:
"""Creates an [`EventSet`][temporian.EventSet] from indexed data.

Unlike `event_set`, `from_indexed_dicts` expects for the data to be already
Unlike `event_set`, `from_struct` expects for the data to be already
split by index value. Supported values for timestamps, indexes, and
features as similar to `event_set`.

Usage examples:

```python
>>> evset = tp.from_indexed_dicts(
>>> evset = tp.from_struct(
... [
... (
... {"i1": 1, "i2": "A"},
Expand Down
6 changes: 3 additions & 3 deletions temporian/implementation/numpy/data/test/io_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from numpy.testing import assert_array_equal
from datetime import datetime

from temporian.implementation.numpy.data.io import event_set, from_indexed_dicts
from temporian.implementation.numpy.data.io import event_set, from_struct
from temporian.implementation.numpy.data.event_set import IndexData, EventSet
from temporian.core.data.schema import Schema
from temporian.core.data.dtype import DType
Expand Down Expand Up @@ -199,8 +199,8 @@ def test_feature_wrong_type(self):
},
)

def test_from_indexed_dicts(self):
evset = from_indexed_dicts(
def test_from_struct(self):
evset = from_struct(
[
(
{"i1": 1, "i2": "A"},
Expand Down
Loading