ansys-systemcoupling-core 0.5.0__py3-none-any.whl → 0.7.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ansys-systemcoupling-core might be problematic. Click here for more details.
- ansys/systemcoupling/core/__init__.py +11 -5
- ansys/systemcoupling/core/adaptor/api_23_1/add_interface.py +2 -2
- ansys/systemcoupling/core/adaptor/api_23_1/add_interface_by_display_names.py +2 -2
- ansys/systemcoupling/core/adaptor/api_23_1/add_transformation.py +1 -1
- ansys/systemcoupling/core/adaptor/api_23_1/partition_participants.py +3 -3
- ansys/systemcoupling/core/adaptor/api_23_1/show_plot.py +75 -0
- ansys/systemcoupling/core/adaptor/api_23_1/solution_root.py +7 -1
- ansys/systemcoupling/core/adaptor/api_23_1/start_participants.py +1 -1
- ansys/systemcoupling/core/adaptor/api_23_2/add_interface.py +2 -2
- ansys/systemcoupling/core/adaptor/api_23_2/add_interface_by_display_names.py +2 -2
- ansys/systemcoupling/core/adaptor/api_23_2/add_transformation.py +1 -1
- ansys/systemcoupling/core/adaptor/api_23_2/partition_participants.py +3 -3
- ansys/systemcoupling/core/adaptor/api_23_2/show_plot.py +75 -0
- ansys/systemcoupling/core/adaptor/api_23_2/solution_root.py +7 -1
- ansys/systemcoupling/core/adaptor/api_23_2/start_participants.py +1 -1
- ansys/systemcoupling/core/adaptor/api_24_1/add_aerodamping_data_transfers.py +1 -1
- ansys/systemcoupling/core/adaptor/api_24_1/add_interface.py +2 -2
- ansys/systemcoupling/core/adaptor/api_24_1/add_interface_by_display_names.py +2 -2
- ansys/systemcoupling/core/adaptor/api_24_1/add_transformation.py +1 -1
- ansys/systemcoupling/core/adaptor/api_24_1/partition_participants.py +3 -3
- ansys/systemcoupling/core/adaptor/api_24_1/show_plot.py +75 -0
- ansys/systemcoupling/core/adaptor/api_24_1/solution_root.py +7 -1
- ansys/systemcoupling/core/adaptor/api_24_1/start_participants.py +1 -1
- ansys/systemcoupling/core/adaptor/api_24_2/add_aerodamping_data_transfers.py +1 -1
- ansys/systemcoupling/core/adaptor/api_24_2/add_interface.py +2 -2
- ansys/systemcoupling/core/adaptor/api_24_2/add_interface_by_display_names.py +2 -2
- ansys/systemcoupling/core/adaptor/api_24_2/add_participant.py +4 -4
- ansys/systemcoupling/core/adaptor/api_24_2/add_transformation.py +1 -1
- ansys/systemcoupling/core/adaptor/api_24_2/partition_participants.py +3 -3
- ansys/systemcoupling/core/adaptor/api_24_2/setup_root.py +1 -1
- ansys/systemcoupling/core/adaptor/api_24_2/show_plot.py +75 -0
- ansys/systemcoupling/core/adaptor/api_24_2/solution_root.py +7 -1
- ansys/systemcoupling/core/adaptor/api_24_2/start_participants.py +1 -1
- ansys/systemcoupling/core/adaptor/api_25_1/_add_participant.py +80 -0
- ansys/systemcoupling/core/adaptor/api_25_1/_clear_state.py +13 -0
- ansys/systemcoupling/core/adaptor/api_25_1/_solve.py +13 -0
- ansys/systemcoupling/core/adaptor/api_25_1/abort.py +39 -0
- ansys/systemcoupling/core/adaptor/api_25_1/activate_hidden.py +46 -0
- ansys/systemcoupling/core/adaptor/api_25_1/add_aerodamping_data_transfers.py +43 -0
- ansys/systemcoupling/core/adaptor/api_25_1/add_data_transfer.py +190 -0
- ansys/systemcoupling/core/adaptor/api_25_1/add_data_transfer_by_display_names.py +191 -0
- ansys/systemcoupling/core/adaptor/api_25_1/add_expression_function.py +61 -0
- ansys/systemcoupling/core/adaptor/api_25_1/add_flow_boundary_data_transfers.py +32 -0
- ansys/systemcoupling/core/adaptor/api_25_1/add_fsi_data_transfers.py +43 -0
- ansys/systemcoupling/core/adaptor/api_25_1/add_interface.py +77 -0
- ansys/systemcoupling/core/adaptor/api_25_1/add_interface_by_display_names.py +78 -0
- ansys/systemcoupling/core/adaptor/api_25_1/add_named_expression.py +42 -0
- ansys/systemcoupling/core/adaptor/api_25_1/add_ordered_data_transfers.py +32 -0
- ansys/systemcoupling/core/adaptor/api_25_1/add_participant.py +162 -0
- ansys/systemcoupling/core/adaptor/api_25_1/add_reference_frame.py +40 -0
- ansys/systemcoupling/core/adaptor/api_25_1/add_thermal_data_transfers.py +43 -0
- ansys/systemcoupling/core/adaptor/api_25_1/add_transformation.py +102 -0
- ansys/systemcoupling/core/adaptor/api_25_1/analysis_control.py +293 -0
- ansys/systemcoupling/core/adaptor/api_25_1/apip.py +33 -0
- ansys/systemcoupling/core/adaptor/api_25_1/ascii_output.py +44 -0
- ansys/systemcoupling/core/adaptor/api_25_1/attribute.py +20 -0
- ansys/systemcoupling/core/adaptor/api_25_1/attribute_child.py +64 -0
- ansys/systemcoupling/core/adaptor/api_25_1/automatic_alignment_options.py +46 -0
- ansys/systemcoupling/core/adaptor/api_25_1/available_ports.py +40 -0
- ansys/systemcoupling/core/adaptor/api_25_1/avoid_data_reconstruction.py +46 -0
- ansys/systemcoupling/core/adaptor/api_25_1/case_root.py +62 -0
- ansys/systemcoupling/core/adaptor/api_25_1/clear_state.py +18 -0
- ansys/systemcoupling/core/adaptor/api_25_1/connect_ensight_dvs.py +41 -0
- ansys/systemcoupling/core/adaptor/api_25_1/coupling_interface.py +20 -0
- ansys/systemcoupling/core/adaptor/api_25_1/coupling_interface_child.py +42 -0
- ansys/systemcoupling/core/adaptor/api_25_1/coupling_participant.py +23 -0
- ansys/systemcoupling/core/adaptor/api_25_1/coupling_participant_child.py +271 -0
- ansys/systemcoupling/core/adaptor/api_25_1/create_restart_point.py +29 -0
- ansys/systemcoupling/core/adaptor/api_25_1/data_transfer.py +20 -0
- ansys/systemcoupling/core/adaptor/api_25_1/data_transfer_child.py +187 -0
- ansys/systemcoupling/core/adaptor/api_25_1/delete_snapshot.py +28 -0
- ansys/systemcoupling/core/adaptor/api_25_1/delete_transformation.py +42 -0
- ansys/systemcoupling/core/adaptor/api_25_1/dimensionality.py +96 -0
- ansys/systemcoupling/core/adaptor/api_25_1/execution_control.py +246 -0
- ansys/systemcoupling/core/adaptor/api_25_1/execution_control_1.py +24 -0
- ansys/systemcoupling/core/adaptor/api_25_1/expression.py +20 -0
- ansys/systemcoupling/core/adaptor/api_25_1/expression_child.py +36 -0
- ansys/systemcoupling/core/adaptor/api_25_1/expression_function.py +20 -0
- ansys/systemcoupling/core/adaptor/api_25_1/expression_function_child.py +46 -0
- ansys/systemcoupling/core/adaptor/api_25_1/external_data_file.py +24 -0
- ansys/systemcoupling/core/adaptor/api_25_1/fluent_input.py +77 -0
- ansys/systemcoupling/core/adaptor/api_25_1/fmu_parameter.py +20 -0
- ansys/systemcoupling/core/adaptor/api_25_1/fmu_parameter_child.py +164 -0
- ansys/systemcoupling/core/adaptor/api_25_1/generate_input_file.py +41 -0
- ansys/systemcoupling/core/adaptor/api_25_1/get_add_data_transfer_group_commands.py +29 -0
- ansys/systemcoupling/core/adaptor/api_25_1/get_execution_command.py +30 -0
- ansys/systemcoupling/core/adaptor/api_25_1/get_machines.py +13 -0
- ansys/systemcoupling/core/adaptor/api_25_1/get_mode_shape_variables.py +29 -0
- ansys/systemcoupling/core/adaptor/api_25_1/get_region_names_for_participant.py +31 -0
- ansys/systemcoupling/core/adaptor/api_25_1/get_setup_summary.py +25 -0
- ansys/systemcoupling/core/adaptor/api_25_1/get_status_messages.py +52 -0
- ansys/systemcoupling/core/adaptor/api_25_1/get_supported_participant_types.py +13 -0
- ansys/systemcoupling/core/adaptor/api_25_1/get_thermal_data_transfer_options.py +32 -0
- ansys/systemcoupling/core/adaptor/api_25_1/get_transformation.py +43 -0
- ansys/systemcoupling/core/adaptor/api_25_1/global_stabilization.py +155 -0
- ansys/systemcoupling/core/adaptor/api_25_1/has_input_file_changed.py +36 -0
- ansys/systemcoupling/core/adaptor/api_25_1/import_system_coupling_input_file.py +36 -0
- ansys/systemcoupling/core/adaptor/api_25_1/initialize.py +27 -0
- ansys/systemcoupling/core/adaptor/api_25_1/instancing.py +23 -0
- ansys/systemcoupling/core/adaptor/api_25_1/instancing_child.py +62 -0
- ansys/systemcoupling/core/adaptor/api_25_1/interrupt.py +39 -0
- ansys/systemcoupling/core/adaptor/api_25_1/library.py +37 -0
- ansys/systemcoupling/core/adaptor/api_25_1/live_visualization.py +20 -0
- ansys/systemcoupling/core/adaptor/api_25_1/live_visualization_child.py +100 -0
- ansys/systemcoupling/core/adaptor/api_25_1/mapping_control.py +239 -0
- ansys/systemcoupling/core/adaptor/api_25_1/open.py +102 -0
- ansys/systemcoupling/core/adaptor/api_25_1/open_results_in_ensight.py +56 -0
- ansys/systemcoupling/core/adaptor/api_25_1/open_snapshot.py +37 -0
- ansys/systemcoupling/core/adaptor/api_25_1/output_control.py +134 -0
- ansys/systemcoupling/core/adaptor/api_25_1/parameter.py +20 -0
- ansys/systemcoupling/core/adaptor/api_25_1/parameter_child.py +60 -0
- ansys/systemcoupling/core/adaptor/api_25_1/partition_participants.py +138 -0
- ansys/systemcoupling/core/adaptor/api_25_1/properties.py +36 -0
- ansys/systemcoupling/core/adaptor/api_25_1/record_interactions.py +46 -0
- ansys/systemcoupling/core/adaptor/api_25_1/reference_frame.py +20 -0
- ansys/systemcoupling/core/adaptor/api_25_1/reference_frame_child.py +71 -0
- ansys/systemcoupling/core/adaptor/api_25_1/region.py +20 -0
- ansys/systemcoupling/core/adaptor/api_25_1/region_child.py +71 -0
- ansys/systemcoupling/core/adaptor/api_25_1/reload_expression_function_modules.py +14 -0
- ansys/systemcoupling/core/adaptor/api_25_1/results.py +89 -0
- ansys/systemcoupling/core/adaptor/api_25_1/save.py +51 -0
- ansys/systemcoupling/core/adaptor/api_25_1/save_snapshot.py +54 -0
- ansys/systemcoupling/core/adaptor/api_25_1/setup_root.py +259 -0
- ansys/systemcoupling/core/adaptor/api_25_1/show_plot.py +75 -0
- ansys/systemcoupling/core/adaptor/api_25_1/shutdown.py +25 -0
- ansys/systemcoupling/core/adaptor/api_25_1/side.py +20 -0
- ansys/systemcoupling/core/adaptor/api_25_1/side_child.py +56 -0
- ansys/systemcoupling/core/adaptor/api_25_1/solution_control.py +115 -0
- ansys/systemcoupling/core/adaptor/api_25_1/solution_root.py +122 -0
- ansys/systemcoupling/core/adaptor/api_25_1/solve.py +30 -0
- ansys/systemcoupling/core/adaptor/api_25_1/stabilization.py +157 -0
- ansys/systemcoupling/core/adaptor/api_25_1/start_participants.py +47 -0
- ansys/systemcoupling/core/adaptor/api_25_1/step.py +57 -0
- ansys/systemcoupling/core/adaptor/api_25_1/transformation.py +21 -0
- ansys/systemcoupling/core/adaptor/api_25_1/transformation_child.py +62 -0
- ansys/systemcoupling/core/adaptor/api_25_1/type.py +39 -0
- ansys/systemcoupling/core/adaptor/api_25_1/unmapped_value_options.py +158 -0
- ansys/systemcoupling/core/adaptor/api_25_1/update_control.py +43 -0
- ansys/systemcoupling/core/adaptor/api_25_1/update_participant.py +61 -0
- ansys/systemcoupling/core/adaptor/api_25_1/variable.py +20 -0
- ansys/systemcoupling/core/adaptor/api_25_1/variable_child.py +231 -0
- ansys/systemcoupling/core/adaptor/api_25_1/write_csv_chart_files.py +21 -0
- ansys/systemcoupling/core/adaptor/api_25_1/write_ensight.py +46 -0
- ansys/systemcoupling/core/adaptor/impl/injected_commands.py +217 -32
- ansys/systemcoupling/core/adaptor/impl/static_info.py +17 -0
- ansys/systemcoupling/core/adaptor/impl/syc_proxy.py +3 -0
- ansys/systemcoupling/core/adaptor/impl/syc_proxy_interface.py +4 -0
- ansys/systemcoupling/core/adaptor/impl/types.py +1 -1
- ansys/systemcoupling/core/charts/chart_datatypes.py +169 -0
- ansys/systemcoupling/core/charts/csv_chartdata.py +299 -0
- ansys/systemcoupling/core/charts/live_csv_datasource.py +87 -0
- ansys/systemcoupling/core/charts/message_dispatcher.py +84 -0
- ansys/systemcoupling/core/charts/plot_functions.py +92 -0
- ansys/systemcoupling/core/charts/plotdefinition_manager.py +303 -0
- ansys/systemcoupling/core/charts/plotter.py +343 -0
- ansys/systemcoupling/core/client/grpc_client.py +6 -1
- ansys/systemcoupling/core/client/syc_container.py +12 -0
- ansys/systemcoupling/core/examples/downloads.py +17 -26
- ansys/systemcoupling/core/participant/manager.py +25 -9
- ansys/systemcoupling/core/participant/protocol.py +1 -0
- ansys/systemcoupling/core/session.py +23 -9
- ansys/systemcoupling/core/syc_version.py +1 -1
- ansys/systemcoupling/core/util/file_transfer.py +14 -0
- {ansys_systemcoupling_core-0.5.0.dist-info → ansys_systemcoupling_core-0.7.0.dist-info}/METADATA +20 -20
- {ansys_systemcoupling_core-0.5.0.dist-info → ansys_systemcoupling_core-0.7.0.dist-info}/RECORD +167 -46
- {ansys_systemcoupling_core-0.5.0.dist-info → ansys_systemcoupling_core-0.7.0.dist-info}/LICENSE +0 -0
- {ansys_systemcoupling_core-0.5.0.dist-info → ansys_systemcoupling_core-0.7.0.dist-info}/WHEEL +0 -0
|
@@ -32,6 +32,7 @@ Examples
|
|
|
32
32
|
"""
|
|
33
33
|
|
|
34
34
|
import os
|
|
35
|
+
import pathlib
|
|
35
36
|
import shutil
|
|
36
37
|
from typing import Optional
|
|
37
38
|
import urllib.request
|
|
@@ -67,12 +68,19 @@ def _get_file_url(filename: str, directory: Optional[str] = None) -> str:
|
|
|
67
68
|
return f"{root_url}/{filename}"
|
|
68
69
|
|
|
69
70
|
|
|
70
|
-
def _retrieve_file(url: str, filename: str):
|
|
71
|
+
def _retrieve_file(url: str, filename: str, download_to_cwd: bool = False):
|
|
72
|
+
|
|
73
|
+
name_to_return = lambda local_path: (
|
|
74
|
+
local_path if not download_to_cwd else pathlib.Path(local_path).name
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
download_target_dir = "." if download_to_cwd else pysyc.EXAMPLES_PATH
|
|
78
|
+
|
|
71
79
|
# First check if file has already been downloaded
|
|
72
|
-
local_path = os.path.join(
|
|
80
|
+
local_path = os.path.join(download_target_dir, os.path.basename(filename))
|
|
73
81
|
local_path_no_zip = local_path.replace(".zip", "")
|
|
74
82
|
if os.path.isfile(local_path_no_zip) or os.path.isdir(local_path_no_zip):
|
|
75
|
-
return local_path_no_zip, None
|
|
83
|
+
return name_to_return(local_path_no_zip), None
|
|
76
84
|
|
|
77
85
|
# grab the correct url retriever
|
|
78
86
|
urlretrieve = urllib.request.urlretrieve
|
|
@@ -83,30 +91,13 @@ def _retrieve_file(url: str, filename: str):
|
|
|
83
91
|
if get_ext(local_path) in [".zip"]:
|
|
84
92
|
_decompress(local_path)
|
|
85
93
|
local_path = local_path[:-4]
|
|
86
|
-
return local_path, resp
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
def _temp_get_file(filename: str, directory: Optional[str] = None):
|
|
90
|
-
example_dir = os.environ.get("PYSYC_EXAMPLE_DIR")
|
|
91
|
-
if example_dir is None:
|
|
92
|
-
raise Exception(
|
|
93
|
-
"PYSYC_EXAMPLE_DIR is not set. "
|
|
94
|
-
"(This is a temporary requirement during development.)"
|
|
95
|
-
)
|
|
96
|
-
local_path = os.path.join(pysyc.EXAMPLES_PATH, os.path.basename(filename))
|
|
97
|
-
local_path_no_zip = local_path.replace(".zip", "")
|
|
98
|
-
if os.path.isfile(local_path_no_zip) or os.path.isdir(local_path_no_zip):
|
|
99
|
-
return local_path_no_zip
|
|
100
|
-
|
|
101
|
-
file_path = os.path.join(example_dir, directory, filename)
|
|
102
|
-
shutil.copy(file_path, local_path)
|
|
103
|
-
if get_ext(local_path) in [".zip"]:
|
|
104
|
-
_decompress(local_path)
|
|
105
|
-
local_path = local_path[:-4]
|
|
106
|
-
return local_path
|
|
94
|
+
return name_to_return(local_path), resp
|
|
107
95
|
|
|
108
96
|
|
|
109
97
|
def download_file(filename: str, directory: Optional[str] = None):
|
|
110
98
|
url = _get_file_url(filename, directory)
|
|
111
|
-
|
|
112
|
-
|
|
99
|
+
download_to_cwd = (
|
|
100
|
+
os.getenv("PYSYC_BUILD_SPHINX_GALLERY") == "1"
|
|
101
|
+
and os.getenv("SYC_LAUNCH_CONTAINER") == "1"
|
|
102
|
+
)
|
|
103
|
+
return _retrieve_file(url, filename, download_to_cwd)[0]
|
|
@@ -24,6 +24,7 @@ import threading
|
|
|
24
24
|
from typing import Dict, List, Tuple
|
|
25
25
|
|
|
26
26
|
from ansys.systemcoupling.core.participant.protocol import ParticipantProtocol
|
|
27
|
+
from ansys.systemcoupling.core.syc_version import compare_versions
|
|
27
28
|
from ansys.systemcoupling.core.util.logging import LOG
|
|
28
29
|
|
|
29
30
|
|
|
@@ -54,10 +55,11 @@ class ParticipantManager:
|
|
|
54
55
|
until more participant types support the protocol.
|
|
55
56
|
"""
|
|
56
57
|
|
|
57
|
-
def __init__(self, syc_session):
|
|
58
|
+
def __init__(self, syc_session, server_version: str):
|
|
58
59
|
self.__participants: Dict[str, ParticipantProtocol] = {}
|
|
59
60
|
self.__syc_session = syc_session
|
|
60
61
|
self.__connection_lock = threading.Lock()
|
|
62
|
+
self.__server_version = server_version
|
|
61
63
|
self.clear()
|
|
62
64
|
|
|
63
65
|
def clear(self):
|
|
@@ -66,6 +68,11 @@ class ParticipantManager:
|
|
|
66
68
|
self.__solve_exception = None
|
|
67
69
|
|
|
68
70
|
def add_participant(self, participant_session: ParticipantProtocol) -> str:
|
|
71
|
+
if compare_versions(self.__server_version, "24.1") < 0:
|
|
72
|
+
raise RuntimeError(
|
|
73
|
+
f"System Coupling server version '{self.__server_version}' is too low to"
|
|
74
|
+
"support this form of 'add_participant'. Minimum version is '24.1'."
|
|
75
|
+
)
|
|
69
76
|
participant_name = (
|
|
70
77
|
f"{participant_session.participant_type}-{len(self.__participants) + 1}"
|
|
71
78
|
)
|
|
@@ -96,14 +103,23 @@ class ParticipantManager:
|
|
|
96
103
|
)
|
|
97
104
|
|
|
98
105
|
for region in participant_session.get_regions():
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
106
|
+
region_state = {
|
|
107
|
+
"topology": region.topology,
|
|
108
|
+
"input_variables": region.input_variables,
|
|
109
|
+
"output_variables": region.output_variables,
|
|
110
|
+
"display_name": region.display_name,
|
|
111
|
+
}
|
|
112
|
+
if compare_versions(self.__server_version, "24.2") >= 0:
|
|
113
|
+
region_state.update(
|
|
114
|
+
{
|
|
115
|
+
"region_discretization_type": (
|
|
116
|
+
region.region_discretization_type
|
|
117
|
+
if hasattr(region, "region_discretization_type")
|
|
118
|
+
else "Mesh Region"
|
|
119
|
+
)
|
|
120
|
+
}
|
|
121
|
+
)
|
|
122
|
+
part_state.region.create(region.name).set_state(region_state)
|
|
107
123
|
|
|
108
124
|
self.__participants[participant_name] = participant_session
|
|
109
125
|
return participant_name
|
|
@@ -83,7 +83,7 @@ class Session:
|
|
|
83
83
|
self.__rpc = rpc
|
|
84
84
|
self.__native_api = None
|
|
85
85
|
self.__syc_version = None
|
|
86
|
-
self.__part_mgr =
|
|
86
|
+
self.__part_mgr = None
|
|
87
87
|
|
|
88
88
|
def exit(self) -> None:
|
|
89
89
|
"""Close the System Coupling server instance.
|
|
@@ -138,13 +138,23 @@ class Session:
|
|
|
138
138
|
self.__rpc.start_output(handle_output)
|
|
139
139
|
|
|
140
140
|
def end_output(self) -> None:
|
|
141
|
-
"""
|
|
141
|
+
"""Cancel output streaming previously started by the ``start_output`` method."""
|
|
142
142
|
self.__rpc.end_output()
|
|
143
143
|
|
|
144
144
|
def ping(self) -> bool:
|
|
145
145
|
"""Simple test that the server is alive and responding."""
|
|
146
146
|
return self.__rpc.ping()
|
|
147
147
|
|
|
148
|
+
@property
|
|
149
|
+
def version(self) -> str:
|
|
150
|
+
"""Return the server version as a string.
|
|
151
|
+
|
|
152
|
+
The version string is in the form of dot-separated major and minor
|
|
153
|
+
version numbers. For example, "24.2".
|
|
154
|
+
"""
|
|
155
|
+
# Internal version string is in '_'-separated form as that is what is used elsewhere.
|
|
156
|
+
return self._get_version().replace("_", ".")
|
|
157
|
+
|
|
148
158
|
@property
|
|
149
159
|
def case(self) -> case_root:
|
|
150
160
|
"""Pythonic client-side form of the System Coupling case persistence API."""
|
|
@@ -168,18 +178,22 @@ class Session:
|
|
|
168
178
|
)
|
|
169
179
|
return self.__solution_root
|
|
170
180
|
|
|
181
|
+
def _get_version(self):
|
|
182
|
+
if self.__syc_version is None:
|
|
183
|
+
proxy = SycProxy(self.__rpc)
|
|
184
|
+
version = proxy.get_version()
|
|
185
|
+
self.__syc_version = version.replace(".", "_")
|
|
186
|
+
return self.__syc_version
|
|
187
|
+
|
|
171
188
|
def _get_api_root(self, category):
|
|
172
189
|
if isinstance(self.__rpc, _DefunctRpcImpl):
|
|
173
190
|
self.__rpc.trigger_error
|
|
174
191
|
sycproxy = SycProxy(self.__rpc)
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
self.
|
|
178
|
-
root = get_root(sycproxy, category=category, version=self.__syc_version)
|
|
192
|
+
root = get_root(sycproxy, category=category, version=self._get_version())
|
|
193
|
+
if self.__part_mgr is None:
|
|
194
|
+
self.__part_mgr = ParticipantManager(self, self.__syc_version)
|
|
179
195
|
sycproxy.set_injected_commands(
|
|
180
|
-
get_injected_cmd_map(
|
|
181
|
-
self.__syc_version, category, root, self.__part_mgr, self.__rpc
|
|
182
|
-
)
|
|
196
|
+
get_injected_cmd_map(category, self, self.__part_mgr, self.__rpc)
|
|
183
197
|
)
|
|
184
198
|
return (root, sycproxy)
|
|
185
199
|
|
|
@@ -25,7 +25,7 @@ from typing import Tuple
|
|
|
25
25
|
# Define constants relating to the default/current version of System Coupling
|
|
26
26
|
|
|
27
27
|
SYC_MAJOR_VERSION = 24
|
|
28
|
-
SYC_MINOR_VERSION =
|
|
28
|
+
SYC_MINOR_VERSION = 2
|
|
29
29
|
|
|
30
30
|
SYC_VERSION_CONCAT = f"{SYC_MAJOR_VERSION}{SYC_MINOR_VERSION}"
|
|
31
31
|
SYC_VERSION_DOT = f"{SYC_MAJOR_VERSION}.{SYC_MINOR_VERSION}"
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
# SOFTWARE.
|
|
22
22
|
|
|
23
23
|
import os
|
|
24
|
+
import shutil
|
|
24
25
|
from typing import Any, Optional, Protocol
|
|
25
26
|
|
|
26
27
|
|
|
@@ -88,9 +89,22 @@ class PimFileTransferService: # pragma: no cover
|
|
|
88
89
|
"""
|
|
89
90
|
if os.path.isfile(file_name):
|
|
90
91
|
remote_file_name = remote_file_name or os.path.basename(file_name)
|
|
92
|
+
delete_copy = False
|
|
93
|
+
if os.path.dirname(file_name):
|
|
94
|
+
base_filename = os.path.basename(file_name)
|
|
95
|
+
dst_file = base_filename
|
|
96
|
+
dst_file_footer = 0
|
|
97
|
+
while os.path.exists(dst_file):
|
|
98
|
+
dst_file_footer += 1
|
|
99
|
+
dst_file = f"{base_filename}_{dst_file_footer}"
|
|
100
|
+
shutil.copy2(file_name, dst_file)
|
|
101
|
+
delete_copy = True
|
|
102
|
+
file_name = dst_file
|
|
91
103
|
if not overwrite and self.file_service.file_exist(remote_file_name):
|
|
92
104
|
raise FileExistsError(f"{remote_file_name} already exists remotely.")
|
|
93
105
|
self.file_service.upload_file(file_name, remote_file_name)
|
|
106
|
+
if delete_copy:
|
|
107
|
+
os.remove(file_name)
|
|
94
108
|
else:
|
|
95
109
|
raise FileNotFoundError(f"Local file {file_name} does not exist.")
|
|
96
110
|
|
{ansys_systemcoupling_core-0.5.0.dist-info → ansys_systemcoupling_core-0.7.0.dist-info}/METADATA
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ansys-systemcoupling-core
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7.0
|
|
4
4
|
Summary: A Python wrapper for Ansys System Coupling.
|
|
5
5
|
Author-email: "ANSYS, Inc." <pyansys.support@ansys.com>
|
|
6
6
|
Maintainer-email: PyAnsys developers <pyansys.maintainers@ansys.com>
|
|
7
|
-
Requires-Python: >=3.
|
|
7
|
+
Requires-Python: >=3.10,<3.13
|
|
8
8
|
Description-Content-Type: text/x-rst
|
|
9
9
|
Classifier: Development Status :: 4 - Beta
|
|
10
10
|
Classifier: Intended Audience :: Science/Research
|
|
@@ -13,41 +13,41 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
13
13
|
Classifier: Operating System :: Microsoft :: Windows
|
|
14
14
|
Classifier: Operating System :: POSIX
|
|
15
15
|
Classifier: Operating System :: MacOS
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
17
16
|
Classifier: Programming Language :: Python :: 3.10
|
|
18
17
|
Classifier: Programming Language :: Python :: 3.11
|
|
19
18
|
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
-
Requires-Dist: ansys-api-systemcoupling==0.
|
|
19
|
+
Requires-Dist: ansys-api-systemcoupling==0.2.0
|
|
21
20
|
Requires-Dist: ansys-platform-instancemanagement~=1.0
|
|
22
21
|
Requires-Dist: grpcio>=1.30.0
|
|
23
|
-
Requires-Dist: grpcio-status>=1.30.0,<1.
|
|
22
|
+
Requires-Dist: grpcio-status>=1.30.0,<1.66.2
|
|
24
23
|
Requires-Dist: googleapis-common-protos>=1.50.0
|
|
25
|
-
Requires-Dist: protobuf>=3.20.1,<4.0.0
|
|
26
24
|
Requires-Dist: psutil>=5.7.0
|
|
27
25
|
Requires-Dist: pyyaml
|
|
28
26
|
Requires-Dist: appdirs>=1.4.0
|
|
29
27
|
Requires-Dist: importlib-metadata>=4.0
|
|
28
|
+
Requires-Dist: matplotlib>=3.8.2
|
|
30
29
|
Requires-Dist: build ; extra == "build"
|
|
31
|
-
Requires-Dist: black==24.
|
|
30
|
+
Requires-Dist: black==24.8.0 ; extra == "classesgen"
|
|
32
31
|
Requires-Dist: isort==5.13.2 ; extra == "classesgen"
|
|
33
|
-
Requires-Dist: ansys-sphinx-theme==0.
|
|
32
|
+
Requires-Dist: ansys-sphinx-theme==1.0.7 ; extra == "doc"
|
|
34
33
|
Requires-Dist: jupyter_sphinx==0.5.3 ; extra == "doc"
|
|
35
34
|
Requires-Dist: matplotlib ; extra == "doc"
|
|
36
|
-
Requires-Dist: numpydoc==1.
|
|
35
|
+
Requires-Dist: numpydoc==1.8.0 ; extra == "doc"
|
|
37
36
|
Requires-Dist: pypandoc==1.13 ; extra == "doc"
|
|
38
37
|
Requires-Dist: pytest-sphinx==0.6.3 ; extra == "doc"
|
|
39
|
-
Requires-Dist: Sphinx==
|
|
38
|
+
Requires-Dist: Sphinx==8.0.2 ; extra == "doc"
|
|
40
39
|
Requires-Dist: sphinx-autobuild==2024.4.16 ; extra == "doc"
|
|
41
|
-
Requires-Dist: sphinx-autodoc-typehints==2.0
|
|
40
|
+
Requires-Dist: sphinx-autodoc-typehints==2.3.0 ; extra == "doc"
|
|
42
41
|
Requires-Dist: sphinx-copybutton==0.5.2 ; extra == "doc"
|
|
43
|
-
Requires-Dist: sphinx-gallery==0.
|
|
44
|
-
Requires-Dist: sphinx-notfound-page==1.0.
|
|
45
|
-
Requires-Dist: sphinxcontrib-websupport==
|
|
42
|
+
Requires-Dist: sphinx-gallery==0.17.1 ; extra == "doc"
|
|
43
|
+
Requires-Dist: sphinx-notfound-page==1.0.4 ; extra == "doc"
|
|
44
|
+
Requires-Dist: sphinxcontrib-websupport==2.0.0 ; extra == "doc"
|
|
46
45
|
Requires-Dist: sphinxemoji==0.3.1 ; extra == "doc"
|
|
47
|
-
Requires-Dist: ansys-fluent-core ; extra == "doc"
|
|
48
|
-
Requires-Dist: ansys-dpf-core ; extra == "doc"
|
|
49
|
-
Requires-Dist:
|
|
50
|
-
Requires-Dist:
|
|
46
|
+
Requires-Dist: ansys-fluent-core==0.24.2 ; extra == "doc"
|
|
47
|
+
Requires-Dist: ansys-dpf-core==0.13.0 ; extra == "doc"
|
|
48
|
+
Requires-Dist: ansys-mapdl-core==0.68.4 ; extra == "doc"
|
|
49
|
+
Requires-Dist: codespell==2.3.0 ; extra == "style"
|
|
50
|
+
Requires-Dist: flake8==7.1.1 ; extra == "style"
|
|
51
51
|
Requires-Dist: pytest ; extra == "tests"
|
|
52
52
|
Requires-Dist: pytest-cov ; extra == "tests"
|
|
53
53
|
Requires-Dist: psutil>=5.7.0 ; extra == "tests"
|
|
@@ -136,12 +136,12 @@ in this order:
|
|
|
136
136
|
|
|
137
137
|
* ``SYSC_ROOT``
|
|
138
138
|
* ``AWP_ROOT``
|
|
139
|
-
* ``
|
|
139
|
+
* ``AWP_ROOT242``
|
|
140
140
|
|
|
141
141
|
If a variable is set but does not refer to a valid installation, PySystemCoupling
|
|
142
142
|
fails at that point, rather than attempting to use the next variable.
|
|
143
143
|
|
|
144
|
-
In a standard user installation, the expectation is that only ``
|
|
144
|
+
In a standard user installation, the expectation is that only ``AWP_ROOT242`` is set.
|
|
145
145
|
|
|
146
146
|
(It is also possible to provide a different version number as an argument to the ``launch()``
|
|
147
147
|
function. This will affect which ``AWP_ROOT<version>`` environment variable is examined.)
|