Skip to content
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
15 changes: 15 additions & 0 deletions src/ansys/dpf/core/data_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,21 @@ def namespace(self, result_key: str) -> str:
"""
return self._api.data_sources_get_namespace(self, result_key)

@property
def streams_container(self) -> dpf.StreamsContainer:
"""Get the streams container representation of the data sources.

.. warning:: Only available with an InProcess server.

Returns
-------
streams_container:
StreamsContainer representation of the data sources.
"""
from ansys.dpf.core.operators.metadata.streams_provider import streams_provider

return streams_provider(data_sources=self, server=self._server).outputs.streams_container()

def __str__(self):
"""Describe the entity.

Expand Down
7 changes: 7 additions & 0 deletions tests/test_datasources.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,10 @@ def test_namespace(allkindofcomplexity, server_type):
data_sources = dpf.core.DataSources(server=server_type)
data_sources.set_result_file_path(cas_h5_file)
assert data_sources.namespace(data_sources.result_key) == "cff"


def test_as_stream(allkindofcomplexity, server_in_process):
ds = dpf.core.DataSources(allkindofcomplexity, server=server_in_process)
stream = ds.streams_container
assert isinstance(stream, dpf.core.StreamsContainer)
assert stream.datasources.result_files == ds.result_files
Loading