Skip to content

Commit 8a135de

Browse files
updates in the DataSources api reference
1 parent 5654bce commit 8a135de

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/ansys/dpf/core/data_sources.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,11 @@
4949
if TYPE_CHECKING:
5050
from ansys.dpf import core as dpf
5151
from ansys.dpf.core import server_types
52+
from ansys.grpc.dpf import data_sources_pb2 as DataSourcesPB2
5253

5354

5455
class DataSources:
55-
"""Manages paths to their files.
56+
"""Manages paths to files as sources of data.
5657
5758
Use this object to declare data inputs for DPF and define their locations.
5859
@@ -88,9 +89,9 @@ class DataSources:
8889

8990
def __init__(
9091
self,
91-
result_path: Optional[Union[str, os.PathLike]] = None,
92-
data_sources: Optional[dpf.DataSources] = None,
93-
server: Optional[server_types.DpfServer] = None,
92+
result_path: Optional[str, os.PathLike] = None,
93+
data_sources: Optional[dpf.DataSources, int, DataSourcesPB2.DataSources] = None,
94+
server: Optional[type[server_types.BaseServer]] = None,
9495
):
9596
"""Initialize a connection with the server."""
9697
# step 1: get server
@@ -649,20 +650,20 @@ def register_namespace(self, result_key: str, namespace: str):
649650
650651
For example, if the results file comes from a MAPDL solver and has an '.rst' extension
651652
and you want to get the displacement results in this file, DPF code will get the
652-
correspondence: ``mapdl::rst::displacement``.
653+
corresponding operator: ``mapdl::rst::displacement``.
653654
654655
So, if you have an extension that is not
655-
know by DPF you have to define its namespace. This function is mainly used when
656+
registered in DPF you have to define its namespace. This function is mainly used when
656657
creating your own operators and plugins, or when you have a file with an unknown
657-
namespace, but you know that it corresponds to certain solver.
658+
namespace, but you know that it corresponds to a given solver.
658659
659660
Parameters
660661
----------
661662
result_key:
662663
Extension of the file, which is used as a key for choosing the correct
663664
plugin when a result is requested by an operator.
664665
namespace:
665-
Name of the correspondent solver
666+
Namespace to associate the file extension to.
666667
667668
Notes
668669
-----

0 commit comments

Comments
 (0)