diff --git a/docs/public_api_test.py b/docs/public_api_test.py index 6cdd5c1e..d1724a7d 100644 --- a/docs/public_api_test.py +++ b/docs/public_api_test.py @@ -48,7 +48,7 @@ "to_tensorflow_dataset", "from_tensorflow_record", "to_tensorflow_record", - "from_indexed_dicts", + "from_struct", # DTYPES "float64", "float32", diff --git a/docs/src/reference/temporian/io/from_struct.md b/docs/src/reference/temporian/io/from_struct.md new file mode 100644 index 00000000..e69de29b diff --git a/temporian/__init__.py b/temporian/__init__.py index a9627737..cbd5ad00 100644 --- a/temporian/__init__.py +++ b/temporian/__init__.py @@ -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 diff --git a/temporian/implementation/numpy/data/io.py b/temporian/implementation/numpy/data/io.py index f8ac6612..170036d2 100644 --- a/temporian/implementation/numpy/data/io.py +++ b/temporian/implementation/numpy/data/io.py @@ -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"}, diff --git a/temporian/implementation/numpy/data/test/io_test.py b/temporian/implementation/numpy/data/test/io_test.py index 52a477be..f7f8f417 100644 --- a/temporian/implementation/numpy/data/test/io_test.py +++ b/temporian/implementation/numpy/data/test/io_test.py @@ -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 @@ -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"},