|
49 | 49 | if TYPE_CHECKING: |
50 | 50 | from ansys.dpf import core as dpf |
51 | 51 | from ansys.dpf.core import server_types |
| 52 | + from ansys.grpc.dpf import data_sources_pb2 as DataSourcesPB2 |
52 | 53 |
|
53 | 54 |
|
54 | 55 | class DataSources: |
55 | | - """Manages paths to their files. |
| 56 | + """Manages paths to files as sources of data. |
56 | 57 |
|
57 | 58 | Use this object to declare data inputs for DPF and define their locations. |
58 | 59 |
|
@@ -88,9 +89,9 @@ class DataSources: |
88 | 89 |
|
89 | 90 | def __init__( |
90 | 91 | 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, |
94 | 95 | ): |
95 | 96 | """Initialize a connection with the server.""" |
96 | 97 | # step 1: get server |
@@ -649,20 +650,20 @@ def register_namespace(self, result_key: str, namespace: str): |
649 | 650 |
|
650 | 651 | For example, if the results file comes from a MAPDL solver and has an '.rst' extension |
651 | 652 | 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``. |
653 | 654 |
|
654 | 655 | 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 |
656 | 657 | 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. |
658 | 659 |
|
659 | 660 | Parameters |
660 | 661 | ---------- |
661 | 662 | result_key: |
662 | 663 | Extension of the file, which is used as a key for choosing the correct |
663 | 664 | plugin when a result is requested by an operator. |
664 | 665 | namespace: |
665 | | - Name of the correspondent solver |
| 666 | + Namespace to associate the file extension to. |
666 | 667 |
|
667 | 668 | Notes |
668 | 669 | ----- |
|
0 commit comments