Skip to content

Commit

Permalink
pushing PR up for review
Browse files Browse the repository at this point in the history
  • Loading branch information
amandarichardsonn committed Oct 11, 2023
1 parent 0972ec4 commit 957e295
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/python/module/smartredis/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,15 @@ def get_tensor(self, name: str) -> np.ndarray:
"""
typecheck(name, "name", str)
return self._data.get_tensor(name)

@exception_handler
def get_name(self) -> str:
"""Get a tensor from the Dataset
:return: the name of the dataset in-memory
:rtype: str
"""
return self._data.get_name()

@exception_handler
def add_meta_scalar(self, name: str, data: t.Union[int, float]) -> None:
Expand Down
7 changes: 7 additions & 0 deletions tests/python/test_dataset_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ def test_add_get_strings(mock_data):
data = mock_data.create_metadata_strings(10)
add_get_strings(dataset, data)

def test_dataset_get_name():
"""Test getting a dataset name
"""
dataset = Dataset("test-dataset")
name = dataset.get_name()
assert name == "test-dataset"

def test_dataset_inspection(context):
d = Dataset(context)
data = np.uint8([[2, 4, 6, 8], [1, 3, 5, 7]])
Expand Down

0 comments on commit 957e295

Please sign in to comment.