34
34
35
35
EXAMPLE_REPO = "https://github.com/ansys/example-data/raw/master/"
36
36
37
+ GITHUB_SOURCE_URL = (
38
+ "https://github.com/ansys/pydpf-core/raw/"
39
+ "master/doc/source/examples/07-python-operators/plugins/"
40
+ )
41
+
37
42
38
43
def delete_downloads (verbose = True ):
39
44
"""Delete all downloaded examples to free space or update the files"""
@@ -2066,7 +2071,7 @@ def download_gltf_plugin(
2066
2071
--------
2067
2072
2068
2073
>>> from ansys.dpf.core import examples
2069
- >>> path = examples.download_average_filter_plugin ()
2074
+ >>> path = examples.download_gltf_plugin ()
2070
2075
2071
2076
"""
2072
2077
file_list = [
@@ -2086,13 +2091,46 @@ def download_gltf_plugin(
2086
2091
)
2087
2092
2088
2093
2094
+ def download_easy_statistics (
2095
+ should_upload : bool = True , server = None , return_local_path = False
2096
+ ) -> Union [str , None ]:
2097
+ """Make the plugin available server side, if the server is remote the plugin is uploaded
2098
+ server side. Returns the path of the plugin folder.
2099
+
2100
+ Parameters
2101
+ ----------
2102
+ should_upload:
2103
+ Whether the file should be uploaded server side when the server is remote.
2104
+ server:
2105
+ Server with channel connected to the remote or local instance. When
2106
+ ``None``, attempts to use the global server.
2107
+ return_local_path:
2108
+ If ``True``, the local path is returned as is, without uploading, nor searching
2109
+ for mounted volumes.
2110
+
2111
+ Returns
2112
+ -------
2113
+ str
2114
+ Path to the plugin folder.
2115
+
2116
+ Examples
2117
+ --------
2118
+
2119
+ >>> from ansys.dpf.core import examples
2120
+ >>> path = examples.download_easy_statistics()
2121
+
2122
+ """
2123
+ file_name = "easy_statistics.py"
2124
+ EXAMPLE_FILE = GITHUB_SOURCE_URL + file_name
2125
+ operator_file_path = _retrieve_file (
2126
+ EXAMPLE_FILE , filename = file_name , directory = "python_plugins"
2127
+ )
2128
+ return find_files (operator_file_path , should_upload , server , return_local_path )
2129
+
2130
+
2089
2131
def _retrieve_plugin (
2090
2132
file_list : list [str ], should_upload : bool = True , server = None , return_local_path = False
2091
2133
) -> Union [str , None ]:
2092
- GITHUB_SOURCE_URL = (
2093
- "https://github.com/ansys/pydpf-core/raw/"
2094
- "master/doc/source/examples/07-python-operators/plugins/"
2095
- )
2096
2134
path = None
2097
2135
for file in file_list :
2098
2136
EXAMPLE_FILE = GITHUB_SOURCE_URL + file
0 commit comments