Skip to content

Commit

Permalink
Renamed from_indexed_dicts to from_struct
Browse files Browse the repository at this point in the history
  • Loading branch information
javiber committed Apr 12, 2024
1 parent ce03dca commit f4555ea
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
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

0 comments on commit f4555ea

Please sign in to comment.