From d68ef46a050f922ac8ea3100c734fd043f6d0c65 Mon Sep 17 00:00:00 2001 From: dmiller Date: Mon, 10 Feb 2025 08:52:40 -0700 Subject: [PATCH 1/2] FEATURE: Add client side buffering support --- pyproject.toml | 2 +- src/ansys/edb/core/hierarchy/hierarchy_obj.py | 10 +- src/ansys/edb/core/inner/base.py | 28 +- src/ansys/edb/core/inner/interceptors.py | 84 +- src/ansys/edb/core/inner/rpc_info.py | 1358 +++++++++++++++++ src/ansys/edb/core/inner/rpc_info_utils.py | 37 + src/ansys/edb/core/inner/utils.py | 13 +- src/ansys/edb/core/primitive/primitive.py | 6 +- src/ansys/edb/core/session.py | 6 +- src/ansys/edb/core/utility/cache.py | 85 -- src/ansys/edb/core/utility/io_manager.py | 398 +++++ 11 files changed, 1898 insertions(+), 129 deletions(-) create mode 100644 src/ansys/edb/core/inner/rpc_info.py create mode 100644 src/ansys/edb/core/inner/rpc_info_utils.py delete mode 100644 src/ansys/edb/core/utility/cache.py create mode 100644 src/ansys/edb/core/utility/io_manager.py diff --git a/pyproject.toml b/pyproject.toml index bd1a4a2410..bbd2c2f376 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,7 @@ classifiers = [ dependencies = [ - "ansys-api-edb==1.0.11", + "ansys-api-edb==1.0.12", "protobuf>=3.19.3,<5", "grpcio>=1.44.0", "Django>=4.2.16" diff --git a/src/ansys/edb/core/hierarchy/hierarchy_obj.py b/src/ansys/edb/core/hierarchy/hierarchy_obj.py index cccd7d1038..3ba1477e4d 100644 --- a/src/ansys/edb/core/hierarchy/hierarchy_obj.py +++ b/src/ansys/edb/core/hierarchy/hierarchy_obj.py @@ -18,18 +18,12 @@ def transform(self): """:class:`.Transform`: \ Transformation information of the hierarchy object.""" transform_msg = self.__stub.GetTransform(self.msg) - return Transform.create( - transform_msg.scale, - transform_msg.angle, - transform_msg.mirror, - transform_msg.offset_x, - transform_msg.offset_y, - ) + return Transform(transform_msg) @transform.setter def transform(self, value): """Set transform.""" - self.__stub.SetTransform(messages.transform_property_message(self, value)) + self.__stub.SetTransform(messages.pointer_property_message(self, value)) @property def name(self): diff --git a/src/ansys/edb/core/inner/base.py b/src/ansys/edb/core/inner/base.py index 4cea4c1a16..7d8d4d9611 100644 --- a/src/ansys/edb/core/inner/base.py +++ b/src/ansys/edb/core/inner/base.py @@ -2,7 +2,7 @@ from ansys.api.edb.v1.edb_messages_pb2 import EDBObjMessage -from ansys.edb.core.utility.cache import get_cache +from ansys.edb.core.utility.io_manager import get_buffer, get_cache, get_io_manager class ObjBase: @@ -15,10 +15,7 @@ def __init__(self, msg): ---------- msg : EDBObjMessage """ - self._id = 0 if msg is None else msg.id - cache = get_cache() - if cache is not None: - cache.add_from_cache_msg(msg.cache) + self.msg = msg @property def is_null(self): @@ -44,12 +41,27 @@ def msg(self): This property can only be set to ``None``. """ - return EDBObjMessage(id=self.id) + msg = EDBObjMessage(id=self.id) + io_mgr = get_io_manager() + if io_mgr.is_enabled: + if self._is_future: + msg.is_future = True + get_io_manager().active_request_edb_obj_msg_mgr.add_active_request_edb_obj_msg(msg) + return msg @msg.setter - def msg(self, val): - if val is None: + def msg(self, msg): + if msg is None: self._id = 0 + return + self._id = msg.id + self._is_future = msg.is_future + if self._is_future: + if (buffer := get_buffer()) is not None: + buffer.add_future_ref(self) + else: + if (cache := get_cache()) is not None: + cache.add_from_cache_msg(msg) class TypeField(object): diff --git a/src/ansys/edb/core/inner/interceptors.py b/src/ansys/edb/core/inner/interceptors.py index 1f0c7f80ae..205b34f509 100644 --- a/src/ansys/edb/core/inner/interceptors.py +++ b/src/ansys/edb/core/inner/interceptors.py @@ -7,15 +7,22 @@ from grpc import ( ClientCallDetails, StatusCode, + StreamStreamClientInterceptor, UnaryStreamClientInterceptor, UnaryUnaryClientInterceptor, ) from ansys.edb.core.inner.exceptions import EDBSessionException, ErrorCode, InvalidArgumentException -from ansys.edb.core.utility.cache import get_cache +from ansys.edb.core.inner.rpc_info_utils import can_cache +from ansys.edb.core.utility.io_manager import ServerNotification, get_io_manager -class Interceptor(UnaryUnaryClientInterceptor, UnaryStreamClientInterceptor, metaclass=abc.ABCMeta): +class Interceptor( + UnaryUnaryClientInterceptor, + UnaryStreamClientInterceptor, + StreamStreamClientInterceptor, + metaclass=abc.ABCMeta, +): """Provides the base interceptor class.""" def __init__(self, logger): @@ -42,6 +49,10 @@ def intercept_unary_stream(self, continuation, client_call_details, request): """Intercept a gRPC streaming call.""" return continuation(client_call_details, request) + def intercept_stream_stream(self, continuation, client_call_details, request_iterator): + """Intercept a gRPC streaming call.""" + return continuation(client_call_details, request_iterator) + class LoggingInterceptor(Interceptor): """Logs EDB errors on each request.""" @@ -92,7 +103,7 @@ def _post_process(self, response): raise exception -class CachingInterceptor(Interceptor): +class IOInterceptor(Interceptor): """Returns cached values if a given request has already been made and caching is enabled.""" def __init__(self, logger, rpc_counter): @@ -104,6 +115,7 @@ def __init__(self, logger, rpc_counter): def _reset_cache_entry_data(self): self._current_rpc_method = "" self._current_cache_key_details = None + self._hijacked = False def _should_log_traffic(self): return self._rpc_counter is not None @@ -114,14 +126,23 @@ class _ClientCallDetails( ): pass + @staticmethod + def _add_caching_option_to_metadata(metadata, option, is_enabled): + metadata.append((option, "1" if is_enabled else "0")) + @classmethod def _get_client_call_details_with_caching_options(cls, client_call_details): - if get_cache() is None: + io_mgr = get_io_manager() + if not io_mgr.get_notifications_for_server(): return client_call_details metadata = [] if client_call_details.metadata is not None: metadata = list(client_call_details.metadata) - metadata.append(("enable-caching", "1")) + for notification in io_mgr.get_notifications_for_server(True): + if notification == ServerNotification.INVALIDATE_CACHE: + cls._add_caching_option_to_metadata(metadata, "invalidate-cache", True) + elif notification == ServerNotification.FLUSH_BUFFER: + cls._add_caching_option_to_metadata(metadata, "flush-buffer", True) return cls._ClientCallDetails( client_call_details.method, client_call_details.timeout, @@ -129,32 +150,47 @@ def _get_client_call_details_with_caching_options(cls, client_call_details): client_call_details.credentials, ) + @staticmethod + def _attempt_hijack(*args): + io_manager = get_io_manager() + hijacked_response = None + if (buffer := io_manager.buffer) is not None: + hijacked_response = buffer.hijack_request(*args) + if hijacked_response is None and (cache := io_manager.cache) is not None: + hijacked_response = cache.hijack_request(*args) + return hijacked_response + + def _hijack(self, service_name, rpc_name, request): + hijacked_result = self._attempt_hijack(service_name, rpc_name, request) + if hijacked_result is not None: + self._hijacked = True + return hijacked_result + def _continue_unary_unary(self, continuation, client_call_details, request): + io_manager = get_io_manager() + if io_manager.is_enabled and not io_manager.is_blocking: + with io_manager.manage_io(): + method_tokens = client_call_details.method.strip("/").split("/") + cache_key_details = method_tokens[0], method_tokens[1], request + if (hijacked_result := self._hijack(*cache_key_details)) is not None: + return hijacked_result + if io_manager.cache is not None and can_cache( + cache_key_details[0], cache_key_details[1] + ): + self._current_cache_key_details = cache_key_details if self._should_log_traffic(): self._current_rpc_method = client_call_details.method - cache = get_cache() - if cache is not None: - method_tokens = client_call_details.method.strip("/").split("/") - cache_key_details = method_tokens[0], method_tokens[1], request - cached_response = cache.get(*cache_key_details) - if cached_response is not None: - return cached_response - else: - self._current_cache_key_details = cache_key_details return super()._continue_unary_unary( continuation, self._get_client_call_details_with_caching_options(client_call_details), request, ) - def _cache_missed(self): - return self._current_cache_key_details is not None - def _post_process(self, response): - cache = get_cache() - if cache is not None and self._cache_missed(): + io_manager = get_io_manager() + if (cache := io_manager.cache) is not None and self._current_cache_key_details is not None: cache.add(*self._current_cache_key_details, response.result()) - if self._should_log_traffic() and (cache is None or self._cache_missed()): + if self._should_log_traffic() and not self._hijacked: self._rpc_counter[self._current_rpc_method] += 1 self._reset_cache_entry_data() @@ -165,3 +201,11 @@ def intercept_unary_stream(self, continuation, client_call_details, request): self._get_client_call_details_with_caching_options(client_call_details), request, ) + + def intercept_stream_stream(self, continuation, client_call_details, request_iterator): + """Intercept a gRPC streaming call.""" + return super().intercept_stream_stream( + continuation, + self._get_client_call_details_with_caching_options(client_call_details), + request_iterator, + ) diff --git a/src/ansys/edb/core/inner/rpc_info.py b/src/ansys/edb/core/inner/rpc_info.py new file mode 100644 index 0000000000..be237ff89c --- /dev/null +++ b/src/ansys/edb/core/inner/rpc_info.py @@ -0,0 +1,1358 @@ +"""Defines container which gives additional information for RPC methods.""" + + +class _RpcInfo: + def __init__( + self, + read_no_cache=False, + write_no_buffer=False, + cache=False, + buffer=False, + returns_future=False, + write_no_cache_invalidation=False, + ): + self._read_no_cache = read_no_cache + self._write_no_buffer = write_no_buffer + self._cache = cache + self._buffer = buffer + self._write_no_cache_invalidation = write_no_cache_invalidation + self._returns_future = returns_future + + @property + def is_read(self): + return self._cache or self._read_no_cache + + @property + def is_write(self): + return self._buffer or self._write_no_buffer + + @property + def can_cache(self): + return self._cache + + @property + def can_buffer(self): + return self._buffer + + @property + def returns_future(self): + return self._returns_future + + @property + def invalidates_cache(self): + return self.is_write and not self._write_no_cache_invalidation + + +rpc_information = { + "ansys.api.edb.v1.ArcDataService": { + "GetHeight": _RpcInfo(cache=True), + "GetCenter": _RpcInfo(cache=True), + "GetMidpoint": _RpcInfo(cache=True), + "GetRadius": _RpcInfo(cache=True), + "GetBoundingBox": _RpcInfo(cache=True), + "GetAngle": _RpcInfo(cache=True), + "ClosestPoints": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.BoardBendDefService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "GetBoundaryPrim": _RpcInfo(cache=True), + "GetBendMiddle": _RpcInfo(cache=True), + "SetBendMiddle": _RpcInfo(buffer=True), + "GetRadius": _RpcInfo(cache=True), + "SetRadius": _RpcInfo(buffer=True), + "GetAngle": _RpcInfo(cache=True), + "SetAngle": _RpcInfo(buffer=True), + "GetBentRegions": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.BondwireService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "GetMaterial": _RpcInfo(cache=True), + "SetMaterial": _RpcInfo(buffer=True), + "GetType": _RpcInfo(cache=True), + "SetType": _RpcInfo(buffer=True), + "GetCrossSectionType": _RpcInfo(cache=True), + "SetCrossSectionType": _RpcInfo(buffer=True), + "GetCrossSectionHeight": _RpcInfo(cache=True), + "SetCrossSectionHeight": _RpcInfo(buffer=True), + "GetDefinitionName": _RpcInfo(cache=True), + "SetDefinitionName": _RpcInfo(buffer=True), + "GetStartElevation": _RpcInfo(cache=True), + "SetStartElevation": _RpcInfo(buffer=True), + "GetEndElevation": _RpcInfo(cache=True), + "SetEndElevation": _RpcInfo(buffer=True), + "GetTraj": _RpcInfo(cache=True), + "SetTraj": _RpcInfo(buffer=True), + "GetWidthValue": _RpcInfo(cache=True), + "SetWidthValue": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.BondwireDefService": { + "Delete": _RpcInfo(buffer=True), + "GetName": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.ApdBondwireDefService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "FindByName": _RpcInfo(cache=True), + "GetParameters": _RpcInfo(cache=True), + "SetParameters": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.Jedec4BondwireDefService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "FindByName": _RpcInfo(cache=True), + "GetParameters": _RpcInfo(cache=True), + "SetParameters": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.Jedec5BondwireDefService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "FindByName": _RpcInfo(cache=True), + "GetParameters": _RpcInfo(cache=True), + "SetParameters": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.BundleTerminalService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "Ungroup": _RpcInfo(buffer=True), + "GetTerminals": _RpcInfo(read_no_cache=True), + "StreamTerminals": _RpcInfo(read_no_cache=True), + }, + "ansys.api.edb.v1.CellService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "GetLayout": _RpcInfo(cache=True), + "Find": _RpcInfo(cache=True), + "Delete": _RpcInfo(buffer=True), + "GetDatabase": _RpcInfo(cache=True), + "IsFootprint": _RpcInfo(cache=True), + "IsBlackBox": _RpcInfo(cache=True), + "SetBlackBox": _RpcInfo(buffer=True), + "GetSuppressPads": _RpcInfo(cache=True), + "SetSuppressPads": _RpcInfo(buffer=True), + "GetAntiPadsAlwaysOn": _RpcInfo(cache=True), + "SetAntiPadsAlwaysOn": _RpcInfo(buffer=True), + "GetAntiPadsOption": _RpcInfo(cache=True), + "SetAntiPadsOption": _RpcInfo(buffer=True), + "IsSymbolicFootprint": _RpcInfo(cache=True), + "GetName": _RpcInfo(cache=True), + "SetName": _RpcInfo(buffer=True), + "GetDesignMode": _RpcInfo(cache=True), + "SetDesignMode": _RpcInfo(buffer=True), + "GetHfssExtentInfo": _RpcInfo(cache=True), + "SetHfssExtentInfo": _RpcInfo(buffer=True), + "GetTemperatureSettings": _RpcInfo(cache=True), + "SetTemperatureSettings": _RpcInfo(buffer=True), + "GetProductPropertyIds": _RpcInfo(cache=True), + "GetProductProperty": _RpcInfo(cache=True), + "SetProductProperty": _RpcInfo(buffer=True), + "DeleteSimulationSetup": _RpcInfo(buffer=True), + "GetSimulationSetups": _RpcInfo(read_no_cache=True), + "StreamSimulationSetups": _RpcInfo(read_no_cache=True), + "GenerateAutoHFSSRegions": _RpcInfo(buffer=True), + "GenerateViaSmartBox": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.CellInstanceService": { + "Create": _RpcInfo(returns_future=True, buffer=True), + "CreateWithComponent": _RpcInfo(returns_future=True, buffer=True), + "FindByName": _RpcInfo(cache=True), + "GetReferenceLayout": _RpcInfo(cache=True), + "GetIs3DPlacement": _RpcInfo(cache=True), + "Set3DPlacement": _RpcInfo(buffer=True), + "Get3DTransform": _RpcInfo(cache=True), + "Set3DTransform": _RpcInfo(buffer=True), + "GetParameterOverride": _RpcInfo(cache=True), + "SetParameterOverride": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.CircleService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "Render": _RpcInfo(cache=True), + "GetParameters": _RpcInfo(cache=True), + "SetParameters": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.ComponentDefService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "FindByName": _RpcInfo(cache=True), + "SetName": _RpcInfo(buffer=True), + "GetName": _RpcInfo(cache=True), + "SetFootprintCell": _RpcInfo(buffer=True), + "GetFootprintCell": _RpcInfo(cache=True), + "GetComponentModels": _RpcInfo(read_no_cache=True), + "StreamComponentModels": _RpcInfo(read_no_cache=True), + "GetComponentPins": _RpcInfo(read_no_cache=True), + "StreamComponentPins": _RpcInfo(read_no_cache=True), + "AddComponentModel": _RpcInfo(buffer=True), + "RemoveComponentModel": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.ComponentGroupService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "GetNumberOfPins": _RpcInfo(cache=True), + "GetComponentProperty": _RpcInfo(cache=True), + "SetComponentProperty": _RpcInfo(buffer=True), + "GetComponentType": _RpcInfo(cache=True), + "SetComponentType": _RpcInfo(buffer=True), + "FindByDef": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.ComponentModelService": { + "SetReferenceFile": _RpcInfo(buffer=True), + "GetReferenceFile": _RpcInfo(cache=True), + "FindByName": _RpcInfo(cache=True), + "FindById": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.NPortComponentModelService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True) + }, + "ansys.api.edb.v1.DynamicLinkComponentModelService": { + "Create": _RpcInfo(returns_future=True, buffer=True), + "SetDesignName": _RpcInfo(buffer=True), + "GetDesignName": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.ComponentPinService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "FindByName": _RpcInfo(cache=True), + "SetName": _RpcInfo(buffer=True), + "GetName": _RpcInfo(cache=True), + "GetNumber": _RpcInfo(cache=True), + "GetComponentDef": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.ComponentPropertyService": { + "Clone": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "GetPackageMountingOffset": _RpcInfo(cache=True), + "SetPackageMountingOffset": _RpcInfo(buffer=True), + "GetPackageDef": _RpcInfo(cache=True), + "SetPackageDef": _RpcInfo(buffer=True), + "GetModel": _RpcInfo(cache=True), + "SetModel": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.ConnectableService": { + "GetObjType": _RpcInfo(cache=True), + "FindByIdAndType": _RpcInfo(cache=True), + "GetId": _RpcInfo(cache=True), + "GetComponent": _RpcInfo(cache=True), + "GetGroup": _RpcInfo(cache=True), + "SetGroup": _RpcInfo(buffer=True), + "GetNet": _RpcInfo(cache=True), + "SetNet": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.DatabaseService": { + "IsReadOnly": _RpcInfo(cache=True), + "GetTopCircuits": _RpcInfo(cache=True), + "GetId": _RpcInfo(cache=True), + "FindById": _RpcInfo(cache=True), + "GetVersionByRelease": _RpcInfo(cache=True), + "GetDirectory": _RpcInfo(cache=True), + "GetProductProperty": _RpcInfo(cache=True), + "SetProductProperty": _RpcInfo(buffer=True), + "GetProductPropertyIds": _RpcInfo(cache=True), + "GetVersion": _RpcInfo(cache=True), + "Scale": _RpcInfo(buffer=True), + "GetSource": _RpcInfo(cache=True), + "SetSource": _RpcInfo(buffer=True), + "GetSourceVersion": _RpcInfo(cache=True), + "SetSourceVersion": _RpcInfo(buffer=True), + "GetDefinitionObjs": _RpcInfo(cache=True), + "TopCircuitCells": _RpcInfo(cache=True), + "GetCircuits": _RpcInfo(cache=True), + "GetFootprints": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.DatasetDefService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "FindByName": _RpcInfo(cache=True), + "GetName": _RpcInfo(cache=True), + "SetName": _RpcInfo(buffer=True), + "GetData": _RpcInfo(cache=True), + "SetData": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.DebyeModelService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "GetFrequencyRange": _RpcInfo(cache=True), + "SetFrequencyRange": _RpcInfo(buffer=True), + "GetRelativePermitivityAtHighLowFrequency": _RpcInfo(cache=True), + "SetRelativePermitivityAtHighLowFrequency": _RpcInfo(buffer=True), + "IsRelativePermitivityEnabledAtOpticalFrequency": _RpcInfo(cache=True), + "SetRelativePermitivityEnabledAtOpticalFrequency": _RpcInfo(buffer=True), + "GetRelativePermitivityAtOpticalFrequency": _RpcInfo(cache=True), + "SetRelativePermitivityAtOpticalFrequency": _RpcInfo(buffer=True), + "UseDCConductivity": _RpcInfo(cache=True), + "SetUseDCConductivity": _RpcInfo(buffer=True), + "GetDCConductivity": _RpcInfo(cache=True), + "SetDCConductivity": _RpcInfo(buffer=True), + "GetLossTangentAtHighLowFrequency": _RpcInfo(cache=True), + "SetLossTangentAtHighLowFrequency": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.DielectricMaterialModelService": {"GetType": _RpcInfo(cache=True)}, + "ansys.api.edb.v1.DiePropertyService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "Clone": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "GetDieType": _RpcInfo(cache=True), + "SetDieType": _RpcInfo(buffer=True), + "GetHeight": _RpcInfo(cache=True), + "SetHeight": _RpcInfo(buffer=True), + "GetOrientation": _RpcInfo(cache=True), + "SetOrientation": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.DifferentialPairService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "FindByName": _RpcInfo(cache=True), + "GetDifferentialPair": _RpcInfo(cache=True), + "SetDifferentialPair": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.DjordjecvicSarkarModelService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "GetFrequency": _RpcInfo(cache=True), + "SetFrequency": _RpcInfo(buffer=True), + "GetRelativePermitivityAtFrequency": _RpcInfo(cache=True), + "SetRelativePermitivityAtFrequency": _RpcInfo(buffer=True), + "GetLossTangentAtFrequency": _RpcInfo(cache=True), + "SetLossTangentAtFrequency": _RpcInfo(buffer=True), + "UseDCRelativePermitivity": _RpcInfo(cache=True), + "SetUseDCRelativePermitivity": _RpcInfo(buffer=True), + "GetDCRelativePermitivity": _RpcInfo(cache=True), + "SetDCRelativePermitivity": _RpcInfo(buffer=True), + "GetDCConductivity": _RpcInfo(cache=True), + "SetDCConductivity": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.EdgeService": { + "GetEdgeType": _RpcInfo(cache=True), + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "GetParameters": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.EdgeTerminalService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "GetEdges": _RpcInfo(read_no_cache=True), + "StreamEdges": _RpcInfo(read_no_cache=True), + "SetEdges": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.ExtendedNetService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "FindByName": _RpcInfo(cache=True), + "RemoveNet": _RpcInfo(buffer=True), + "AddNet": _RpcInfo(buffer=True), + "RemoveAllNets": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.GroupService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "FindByName": _RpcInfo(cache=True), + "AddMember": _RpcInfo(buffer=True), + "RemoveMember": _RpcInfo(buffer=True), + "Ungroup": _RpcInfo(buffer=True), + "GetMembers": _RpcInfo(read_no_cache=True), + "StreamMembers": _RpcInfo(read_no_cache=True), + "GetGroupType": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.HFSSGeneralSettingsService": { + "GetSingleFrequencyAdaptiveSolution": _RpcInfo(cache=True), + "SetSingleFrequencyAdaptiveSolution": _RpcInfo(buffer=True), + "GetMultiFrequencyAdaptiveSolution": _RpcInfo(cache=True), + "SetMultiFrequencyAdaptiveSolution": _RpcInfo(buffer=True), + "GetBroadbandFrequencyAdaptiveSolution": _RpcInfo(cache=True), + "SetBroadbandFrequencyAdaptiveSolution": _RpcInfo(buffer=True), + "GetSaveFieldsFlag": _RpcInfo(cache=True), + "SetSaveFieldsFlag": _RpcInfo(buffer=True), + "GetUseMeshRegion": _RpcInfo(cache=True), + "SetUseMeshRegion": _RpcInfo(buffer=True), + "GetMeshRegionName": _RpcInfo(cache=True), + "SetMeshRegionName": _RpcInfo(buffer=True), + "GetUseParallelRefinement": _RpcInfo(cache=True), + "SetUseParallelRefinement": _RpcInfo(buffer=True), + "GetAdaptType": _RpcInfo(cache=True), + "SetAdaptType": _RpcInfo(buffer=True), + "GetSaveRadFieldsOnlyFlag": _RpcInfo(cache=True), + "SetSaveRadFieldsOnlyFlag": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.HFSSOptionsSettingsService": { + "GetMaxRefinementPerPass": _RpcInfo(cache=True), + "SetMaxRefinementPerPass": _RpcInfo(buffer=True), + "GetMinPasses": _RpcInfo(cache=True), + "SetMinPasses": _RpcInfo(buffer=True), + "GetMinConvergedPasses": _RpcInfo(cache=True), + "SetMinConvergedPasses": _RpcInfo(buffer=True), + "GetUseMaxRefinement": _RpcInfo(cache=True), + "SetUseMaxRefinement": _RpcInfo(buffer=True), + "GetBasisFunctionOrder": _RpcInfo(cache=True), + "SetBasisFunctionOrder": _RpcInfo(buffer=True), + "GetSolverTypeOrder": _RpcInfo(cache=True), + "SetSolverTypeOrder": _RpcInfo(buffer=True), + "GetRelativeResidual": _RpcInfo(cache=True), + "SetRelativeResidual": _RpcInfo(buffer=True), + "GetUseShellElements": _RpcInfo(cache=True), + "SetUseShellElements": _RpcInfo(buffer=True), + "GetEnhancedLowFrequencyAccuracy": _RpcInfo(cache=True), + "SetEnhancedLowFrequencyAccuracy": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.HFSSAdvancedSettingsService": { + "GetICModeAutoResolution": _RpcInfo(cache=True), + "SetICModeAutoResolution": _RpcInfo(buffer=True), + "GetICModeLength": _RpcInfo(cache=True), + "SetICModeLength": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.HFSSAdvancedMeshingSettingsService": { + "GetLayerAlignment": _RpcInfo(cache=True), + "SetLayerAlignment": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.HFSSSolverSettingsService": { + "GetMaxDeltaZ0": _RpcInfo(cache=True), + "SetMaxDeltaZ0": _RpcInfo(buffer=True), + "GetSetTrianglesForWaveport": _RpcInfo(cache=True), + "SetSetTrianglesForWaveport": _RpcInfo(buffer=True), + "GetMinTrianglesForWavePort": _RpcInfo(cache=True), + "SetMinTrianglesForWavePort": _RpcInfo(buffer=True), + "GetMaxTrianglesForWavePort": _RpcInfo(cache=True), + "SetMaxTrianglesForWavePort": _RpcInfo(buffer=True), + "GetIntraPlaneCouplingEnabled": _RpcInfo(cache=True), + "SetIntraPlaneCouplingEnabled": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.DCRSettingsService": { + "GetMaxPasses": _RpcInfo(cache=True), + "SetMaxPasses": _RpcInfo(buffer=True), + "GetMinPasses": _RpcInfo(cache=True), + "SetMinPasses": _RpcInfo(buffer=True), + "GetMinConvergedPasses": _RpcInfo(cache=True), + "SetMinConvergedPasses": _RpcInfo(buffer=True), + "GetPercentError": _RpcInfo(cache=True), + "SetPercentError": _RpcInfo(buffer=True), + "GetPercentRefinementPerPass": _RpcInfo(cache=True), + "SetPercentRefinementPerPass": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.HfssSimulationSetupService": { + "GetMeshOperations": _RpcInfo(cache=True), + "SetMeshOperations": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.HierarchyObjectService": { + "GetTransform": _RpcInfo(cache=True), + "SetTransform": _RpcInfo(buffer=True), + "GetName": _RpcInfo(cache=True), + "SetName": _RpcInfo(buffer=True), + "GetComponent": _RpcInfo(cache=True), + "GetPlacementLayer": _RpcInfo(cache=True), + "SetPlacementLayer": _RpcInfo(buffer=True), + "GetLocation": _RpcInfo(cache=True), + "SetLocation": _RpcInfo(buffer=True), + "GetSolveIndependentPreference": _RpcInfo(cache=True), + "SetSolveIndependentPreference": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.ICComponentPropertyService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "SetSolderBallProperty": _RpcInfo(buffer=True), + "GetSolderBallProperty": _RpcInfo(cache=True), + "SetDieProperty": _RpcInfo(buffer=True), + "GetDieProperty": _RpcInfo(cache=True), + "SetPortProperty": _RpcInfo(buffer=True), + "GetPortProperty": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.InstArrayService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "FindByName": _RpcInfo(cache=True), + "GetXAxis": _RpcInfo(cache=True), + "SetXAxis": _RpcInfo(buffer=True), + "GetYAxis": _RpcInfo(cache=True), + "SetYAxis": _RpcInfo(buffer=True), + "GetXCount": _RpcInfo(cache=True), + "SetXCount": _RpcInfo(buffer=True), + "GetYCount": _RpcInfo(cache=True), + "SetYCount": _RpcInfo(buffer=True), + "Decompose": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.IOComponentPropertyService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "SetSolderBallProperty": _RpcInfo(buffer=True), + "GetSolderBallProperty": _RpcInfo(cache=True), + "SetPortProperty": _RpcInfo(buffer=True), + "GetPortProperty": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.LayerService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "GetLayerType": _RpcInfo(cache=True), + "SetLayerType": _RpcInfo(buffer=True), + "IsViaLayer": _RpcInfo(cache=True), + "GetName": _RpcInfo(cache=True), + "SetName": _RpcInfo(buffer=True), + "Clone": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "GetLayerId": _RpcInfo(cache=True), + "GetTopBottomAssociation": _RpcInfo(cache=True), + "SetTopBottomAssociation": _RpcInfo(buffer=True), + "GetColor": _RpcInfo(cache=True), + "SetColor": _RpcInfo(buffer=True), + "GetVisibilityMask": _RpcInfo(cache=True), + "SetVisibilityMask": _RpcInfo(buffer=True), + "GetLocked": _RpcInfo(cache=True), + "SetLocked": _RpcInfo(buffer=True), + "GetTransparency": _RpcInfo(cache=True), + "SetTransparency": _RpcInfo(buffer=True), + "GetDrawOverride": _RpcInfo(cache=True), + "SetDrawOverride": _RpcInfo(buffer=True), + "GetProductProperty": _RpcInfo(cache=True), + "SetProductProperty": _RpcInfo(buffer=True), + "GetProductPropertyIds": _RpcInfo(cache=True), + "IsInZone": _RpcInfo(cache=True), + "SetIsInZone": _RpcInfo(buffer=True), + "GetZones": _RpcInfo(cache=True), + "GetZone": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.LayerCollectionService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "Clone": _RpcInfo(returns_future=True, buffer=True), + "GetMode": _RpcInfo(cache=True, write_no_cache_invalidation=True), + "SetMode": _RpcInfo(buffer=True), + "AddLayers": _RpcInfo(buffer=True), + "AddLayer": _RpcInfo(returns_future=True, buffer=True), + "IsValid": _RpcInfo(cache=True), + "FindByName": _RpcInfo(cache=True), + "GetTopBottomStackupLayers": _RpcInfo(cache=True), + "GetLayers": _RpcInfo(read_no_cache=True), + "StreamLayers": _RpcInfo(read_no_cache=True), + "GetProductProperty": _RpcInfo(cache=True), + "SetProductProperty": _RpcInfo(buffer=True), + "GetProductPropertyIds": _RpcInfo(cache=True), + "MergeDielectrics": _RpcInfo(returns_future=True, buffer=True), + "GetZoneIds": _RpcInfo(cache=True), + "GetZoneName": _RpcInfo(cache=True), + "SetZoneName": _RpcInfo(buffer=True), + "RemoveZone": _RpcInfo(buffer=True), + "AddZoneToLayer": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.LayerMapService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "Clear": _RpcInfo(buffer=True), + "SetMapping": _RpcInfo(buffer=True), + "GetMappingForward": _RpcInfo(cache=True), + "GetMappingBackward": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.LayoutService": { + "GetCell": _RpcInfo(cache=True), + "GetLayerCollection": _RpcInfo(cache=True), + "SetLayerCollection": _RpcInfo(buffer=True), + "GetItems": _RpcInfo(read_no_cache=True), + "StreamItems": _RpcInfo(read_no_cache=True), + "GetExpandedExtentFromNets": _RpcInfo(cache=True), + "ConvertPrimitivesToVias": _RpcInfo(buffer=True), + "ArePortReferenceTerminalsConnected": _RpcInfo(cache=True), + "GetZonePrimitives": _RpcInfo(read_no_cache=True), + "StreamZonePrimitives": _RpcInfo(read_no_cache=True), + "SetFixedZonePrimitives": _RpcInfo(buffer=True), + "GetFixedZonePrimitive": _RpcInfo(cache=True), + "GetBoardBendDefs": _RpcInfo(read_no_cache=True), + "StreamBoardBendDefs": _RpcInfo(read_no_cache=True), + "GetLayoutInstance": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.LayoutComponentService": { + "ExportLayoutComponent": _RpcInfo(write_no_cache_invalidation=True), + "ImportLayoutComponent": _RpcInfo(write_no_cache_invalidation=True), + "GetCellInstance": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.LayoutInstanceService": { + "QueryLayoutObjInstances": _RpcInfo(cache=True), + "GetLayoutObjInstanceInContext": _RpcInfo(cache=True), + "GetConnectedObjects": _RpcInfo(read_no_cache=True), + "StreamConnectedObjects": _RpcInfo(read_no_cache=True), + }, + "ansys.api.edb.v1.LayoutInstanceContextService": { + "GetLayout": _RpcInfo(cache=True), + "GetBBox": _RpcInfo(cache=True), + "IsTopOrBlackBox": _RpcInfo(cache=True), + "GetTopOrBlackBox": _RpcInfo(cache=True), + "GetPlacementElevation": _RpcInfo(cache=True), + "Is3DPlacement": _RpcInfo(cache=True), + "GetTransformation": _RpcInfo(cache=True), + "GetTransformationBetweenContexts": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.LayoutObjService": { + "GetLayout": _RpcInfo(cache=True), + "Delete": _RpcInfo(buffer=True), + "GetProductProperty": _RpcInfo(cache=True), + "SetProductProperty": _RpcInfo(buffer=True), + "GetProductPropertyIds": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.LayoutObjInstanceService": { + "GetLayers": _RpcInfo(cache=True), + "GetGeometries": _RpcInfo(cache=True), + "GetContext": _RpcInfo(cache=True), + "GetLayoutInstanceContext": _RpcInfo(cache=True), + "GetLayoutObj": _RpcInfo(cache=True), + "GetBBox": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.LayoutObjInstance2DGeometryService": { + "IsNegative": _RpcInfo(cache=True), + "GetPolygonData": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.LayoutObjInstance3DGeometryService": { + "GetTesselationData": _RpcInfo(cache=True) + }, + "ansys.api.edb.v1.LayoutObjInstanceGeometryService": { + "GetMaterial": _RpcInfo(cache=True), + "GetColor": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.MaterialDefService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "SetProperty": _RpcInfo(buffer=True), + "FindByName": _RpcInfo(cache=True), + "Delete": _RpcInfo(buffer=True), + "GetProperty": _RpcInfo(cache=True), + "GetAllProperties": _RpcInfo(cache=True), + "RemoveProperty": _RpcInfo(buffer=True), + "GetName": _RpcInfo(cache=True), + "GetDielectricMaterialModel": _RpcInfo(cache=True), + "SetDielectricMaterialModel": _RpcInfo(buffer=True), + "GetDimensions": _RpcInfo(cache=True), + "SetThermalModifier": _RpcInfo(buffer=True), + "SetAnisotropicThermalModifier": _RpcInfo(buffer=True), + "GetThermalModifier": _RpcInfo(cache=True), + "GetAnisotropicThermalModifier": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.MaterialPropertyThermalModifierService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "GetQuadraticModelParams": _RpcInfo(cache=True), + "GetThermalModifierExpression": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.McadModelService": { + "CreateStride": _RpcInfo(returns_future=True, buffer=True), + "CreateHfss": _RpcInfo(returns_future=True, buffer=True), + "Create3dComp": _RpcInfo(returns_future=True, buffer=True), + "IsMcad": _RpcInfo(cache=True), + "IsMcadStride": _RpcInfo(cache=True), + "IsMcadHfss": _RpcInfo(cache=True), + "IsMcad3dComp": _RpcInfo(cache=True), + "GetOrigin": _RpcInfo(cache=True), + "SetOrigin": _RpcInfo(buffer=True), + "GetRotation": _RpcInfo(cache=True), + "SetRotation": _RpcInfo(buffer=True), + "GetScale": _RpcInfo(cache=True), + "SetScale": _RpcInfo(buffer=True), + "GetMaterial": _RpcInfo(cache=True), + "SetMaterial": _RpcInfo(buffer=True), + "GetVisible": _RpcInfo(cache=True), + "SetVisible": _RpcInfo(buffer=True), + "GetModeled": _RpcInfo(cache=True), + "SetModeled": _RpcInfo(buffer=True), + "GetCellInst": _RpcInfo(cache=True), + "GetPartCount": _RpcInfo(cache=True), + "GetPartName": _RpcInfo(cache=True), + "GetPartIndex": _RpcInfo(cache=True), + "GetModelName": _RpcInfo(cache=True), + "GetDesignName": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.ModelService": { + "Clone": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True) + }, + "ansys.api.edb.v1.MultipoleDebyeModelService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "GetParameters": _RpcInfo(cache=True), + "SetParameters": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.NetService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "FindByName": _RpcInfo(cache=True), + "GetName": _RpcInfo(cache=True), + "SetName": _RpcInfo(buffer=True), + "GetIsPowerGround": _RpcInfo(cache=True), + "SetIsPowerGround": _RpcInfo(buffer=True), + "GetLayoutObjects": _RpcInfo(read_no_cache=True), + "StreamLayoutObjects": _RpcInfo(read_no_cache=True), + }, + "ansys.api.edb.v1.NetClassService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "FindByName": _RpcInfo(cache=True), + "GetName": _RpcInfo(cache=True), + "SetName": _RpcInfo(buffer=True), + "GetDescription": _RpcInfo(cache=True), + "SetDescription": _RpcInfo(buffer=True), + "IsPowerGround": _RpcInfo(cache=True), + "AddNet": _RpcInfo(buffer=True), + "RemoveNet": _RpcInfo(buffer=True), + "ContainsNet": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.NetlistModelService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "GetNetlist": _RpcInfo(cache=True), + "SetNetlist": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.PackageDefService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "Delete": _RpcInfo(buffer=True), + "FindByName": _RpcInfo(cache=True), + "FindByEDBUId": _RpcInfo(cache=True), + "GetName": _RpcInfo(cache=True), + "SetName": _RpcInfo(buffer=True), + "GetExteriorBoundary": _RpcInfo(cache=True), + "SetExteriorBoundary": _RpcInfo(buffer=True), + "GetHeight": _RpcInfo(cache=True), + "SetHeight": _RpcInfo(buffer=True), + "GetOperatingPower": _RpcInfo(cache=True), + "SetOperatingPower": _RpcInfo(buffer=True), + "GetMaximumPower": _RpcInfo(cache=True), + "SetMaximumPower": _RpcInfo(buffer=True), + "GetTherm_Cond": _RpcInfo(cache=True), + "SetTherm_Cond": _RpcInfo(buffer=True), + "GetTheta_JB": _RpcInfo(cache=True), + "SetTheta_JB": _RpcInfo(buffer=True), + "GetTheta_JC": _RpcInfo(cache=True), + "SetTheta_JC": _RpcInfo(buffer=True), + "GetHeatSink": _RpcInfo(cache=True), + "SetHeatSink": _RpcInfo(buffer=True), + "GetProductProperty": _RpcInfo(cache=True), + "SetProductProperty": _RpcInfo(buffer=True), + "GetProductPropertyIds": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.PadstackDefService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "Delete": _RpcInfo(buffer=True), + "FindByName": _RpcInfo(cache=True), + "GetName": _RpcInfo(cache=True), + "GetData": _RpcInfo(cache=True), + "SetData": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.PadstackDefDataService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "GetMaterial": _RpcInfo(cache=True), + "SetMaterial": _RpcInfo(buffer=True), + "GetLayerNames": _RpcInfo(cache=True), + "GetLayerIds": _RpcInfo(cache=True), + "AddLayers": _RpcInfo(buffer=True), + "GetPadParameters": _RpcInfo(cache=True), + "SetPadParameters": _RpcInfo(buffer=True), + "GetHoleRange": _RpcInfo(cache=True), + "SetHoleRange": _RpcInfo(buffer=True), + "GetPlatingPercentage": _RpcInfo(cache=True), + "SetPlatingPercentage": _RpcInfo(buffer=True), + "GetSolderBallShape": _RpcInfo(cache=True), + "SetSolderBallShape": _RpcInfo(buffer=True), + "GetSolderBallPlacement": _RpcInfo(cache=True), + "SetSolderBallPlacement": _RpcInfo(buffer=True), + "GetSolderBallParam": _RpcInfo(cache=True), + "SetSolderBallParam": _RpcInfo(buffer=True), + "GetSolderBallMaterial": _RpcInfo(cache=True), + "SetSolderBallMaterial": _RpcInfo(buffer=True), + "GetConnectionPt": _RpcInfo(cache=True), + "SetConnectionPt": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.PadstackInstanceService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "GetPadstackDef": _RpcInfo(cache=True), + "GetName": _RpcInfo(cache=True), + "SetName": _RpcInfo(buffer=True), + "GetPositionAndRotation": _RpcInfo(cache=True), + "SetPositionAndRotation": _RpcInfo(buffer=True), + "GetLayerRange": _RpcInfo(cache=True), + "SetLayerRange": _RpcInfo(buffer=True), + "GetSolderBallLayer": _RpcInfo(cache=True), + "SetSolderBallLayer": _RpcInfo(buffer=True), + "GetLayerMap": _RpcInfo(cache=True), + "SetLayerMap": _RpcInfo(buffer=True), + "GetHoleOverrides": _RpcInfo(cache=True), + "SetHoleOverrides": _RpcInfo(buffer=True), + "GetIsLayoutPin": _RpcInfo(cache=True), + "SetIsLayoutPin": _RpcInfo(buffer=True), + "GetBackDrillType": _RpcInfo(cache=True), + "GetBackDrillByLayer": _RpcInfo(cache=True), + "GetBackDrillByDepth": _RpcInfo(cache=True), + "SetBackDrillByLayer": _RpcInfo(buffer=True), + "SetBackDrillByDepth": _RpcInfo(buffer=True), + "GetPadstackInstanceTerminal": _RpcInfo(cache=True), + "IsInPinGroup": _RpcInfo(cache=True), + "GetPinGroups": _RpcInfo(read_no_cache=True), + "StreamPinGroups": _RpcInfo(read_no_cache=True), + }, + "ansys.api.edb.v1.PadstackInstanceTerminalService": { + "Create": _RpcInfo(returns_future=True, buffer=True), + "GetParameters": _RpcInfo(cache=True), + "SetParameters": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.PathService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "Render": _RpcInfo(cache=True), + "GetPolygonData": _RpcInfo(cache=True), + "GetCenterLine": _RpcInfo(cache=True), + "SetCenterLine": _RpcInfo(buffer=True), + "GetEndCapStyle": _RpcInfo(cache=True), + "SetEndCapStyle": _RpcInfo(buffer=True), + "GetClipInfo": _RpcInfo(cache=True), + "SetClipInfo": _RpcInfo(buffer=True), + "GetCornerStyle": _RpcInfo(cache=True), + "SetCornerStyle": _RpcInfo(buffer=True), + "GetWidth": _RpcInfo(cache=True), + "SetWidth": _RpcInfo(buffer=True), + "GetMiterRatio": _RpcInfo(cache=True), + "SetMiterRatio": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.PinGroupService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "FindByName": _RpcInfo(cache=True), + "GetName": _RpcInfo(cache=True), + "AddPins": _RpcInfo(buffer=True), + "RemovePins": _RpcInfo(buffer=True), + "GetPinGroupTerminal": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.PinGroupTerminalService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "GetPinGroup": _RpcInfo(cache=True), + "SetPinGroup": _RpcInfo(buffer=True), + "GetLayer": _RpcInfo(cache=True), + "SetLayer": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.PinPairModelService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "GetRlc": _RpcInfo(cache=True), + "SetRlc": _RpcInfo(buffer=True), + "DeleteRlc": _RpcInfo(buffer=True), + "GetPinPairs": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.PointDataService": { + "Rotate": _RpcInfo(cache=True), + "ClosestPoint": _RpcInfo(cache=True), + "Distance": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.PointTerminalService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "GetParameters": _RpcInfo(cache=True), + "SetParameters": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.PolygonService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "GetPolygonData": _RpcInfo(cache=True), + "SetPolygonData": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.PolygonDataService": { + "GetNormalizedPoints": _RpcInfo(cache=True), + "IsCircle": _RpcInfo(cache=True), + "IsBox": _RpcInfo(cache=True), + "HasSelfIntersections": _RpcInfo(cache=True), + "RemoveSelfIntersections": _RpcInfo(cache=True), + "IsConvex": _RpcInfo(cache=True), + "GetArea": _RpcInfo(cache=True), + "Transform": _RpcInfo(cache=True), + "GetBBox": _RpcInfo(cache=True), + "GetConvexHull": _RpcInfo(cache=True), + "RemoveArcs": _RpcInfo(cache=True), + "Defeature": _RpcInfo(cache=True), + "GetBoundingCircle": _RpcInfo(cache=True), + "IsInside": _RpcInfo(cache=True), + "CircleIntersectsPolygon": _RpcInfo(cache=True), + "GetIntersectionType": _RpcInfo(cache=True), + "GetClosestPoints": _RpcInfo(cache=True), + "GetUnion": _RpcInfo(cache=True), + "GetIntersection": _RpcInfo(cache=True), + "Subtract": _RpcInfo(cache=True), + "Xor": _RpcInfo(cache=True), + "Expand": _RpcInfo(cache=True), + "Get2DAlphaShape": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.PortPropertyService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "Clone": _RpcInfo(returns_future=True, buffer=True), + "GetReferenceHeight": _RpcInfo(cache=True), + "SetReferenceHeight": _RpcInfo(buffer=True), + "GetReferenceSizeAuto": _RpcInfo(cache=True), + "SetReferenceSizeAuto": _RpcInfo(buffer=True), + "GetReferenceSize": _RpcInfo(cache=True), + "SetReferenceSize": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.PrimitiveService": { + "GetPrimitiveType": _RpcInfo(cache=True), + "AddVoid": _RpcInfo(buffer=True), + "SetHfssProp": _RpcInfo(buffer=True), + "GetLayer": _RpcInfo(cache=True), + "SetLayer": _RpcInfo(buffer=True), + "GetIsNegative": _RpcInfo(cache=True), + "SetIsNegative": _RpcInfo(buffer=True), + "IsVoid": _RpcInfo(cache=True), + "HasVoids": _RpcInfo(cache=True), + "Voids": _RpcInfo(read_no_cache=True), + "StreamVoids": _RpcInfo(read_no_cache=True), + "GetOwner": _RpcInfo(cache=True), + "IsParameterized": _RpcInfo(cache=True), + "GetHfssProp": _RpcInfo(cache=True), + "RemoveHfssProp": _RpcInfo(buffer=True), + "IsZonePrimitive": _RpcInfo(cache=True), + "MakeZonePrimitive": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.RaptorXGeneralSettingsService": { + "GetUseGoldEMSolver": _RpcInfo(cache=True), + "SetUseGoldEMSolver": _RpcInfo(buffer=True), + "GetMaxFrequency": _RpcInfo(cache=True), + "SetMaxFrequency": _RpcInfo(buffer=True), + "GetGlobalTemperature": _RpcInfo(cache=True), + "SetGlobalTemperature": _RpcInfo(buffer=True), + "GetSaveNetlist": _RpcInfo(cache=True), + "SetSaveNetlist": _RpcInfo(buffer=True), + "GetNetlistExportSpectre": _RpcInfo(cache=True), + "SetNetlistExportSpectre": _RpcInfo(buffer=True), + "GetSaveRFM": _RpcInfo(cache=True), + "SetSaveRFM": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.RaptorXAdvancedSettingsService": { + "GetUseMeshFrequency": _RpcInfo(cache=True), + "SetUseMeshFrequency": _RpcInfo(buffer=True), + "GetMeshFrequency": _RpcInfo(cache=True), + "SetMeshFrequency": _RpcInfo(buffer=True), + "GetUseEdgeMesh": _RpcInfo(cache=True), + "SetUseEdgeMesh": _RpcInfo(buffer=True), + "GetEdgeMesh": _RpcInfo(cache=True), + "SetEdgeMesh": _RpcInfo(buffer=True), + "GetUseCellsPerWavelength": _RpcInfo(cache=True), + "SetUseCellsPerWavelength": _RpcInfo(buffer=True), + "GetCellsPerWavelength": _RpcInfo(cache=True), + "SetCellsPerWavelength": _RpcInfo(buffer=True), + "GetUsePlaneProjectionFactor": _RpcInfo(cache=True), + "SetUsePlaneProjectionFactor": _RpcInfo(buffer=True), + "GetPlaneProjectionFactor": _RpcInfo(cache=True), + "SetPlaneProjectionFactor": _RpcInfo(buffer=True), + "GetUseRelaxedZAxis": _RpcInfo(cache=True), + "SetUseRelaxedZAxis": _RpcInfo(buffer=True), + "GetUseEliminateSlitPerHoles": _RpcInfo(cache=True), + "SetUseEliminateSlitPerHoles": _RpcInfo(buffer=True), + "GetEliminateSlitPerHoles": _RpcInfo(cache=True), + "SetEliminateSlitPerHoles": _RpcInfo(buffer=True), + "GetUseAutoRemovalSliverPoly": _RpcInfo(cache=True), + "SetUseAutoRemovalSliverPoly": _RpcInfo(buffer=True), + "GetAutoRemovalSliverPoly": _RpcInfo(cache=True), + "SetAutoRemovalSliverPoly": _RpcInfo(buffer=True), + "GetUseAccelerateViaExtraction": _RpcInfo(cache=True), + "SetUseAccelerateViaExtraction": _RpcInfo(buffer=True), + "GetUseEnableSubstrateNetworkExtraction": _RpcInfo(cache=True), + "SetUseEnableSubstrateNetworkExtraction": _RpcInfo(buffer=True), + "GetUseLDE": _RpcInfo(cache=True), + "SetUseLDE": _RpcInfo(buffer=True), + "GetUseExtractFloatingMetalsDummy": _RpcInfo(cache=True), + "SetUseExtractFloatingMetalsDummy": _RpcInfo(buffer=True), + "GetUseExtractFloatingMetalsFloating": _RpcInfo(cache=True), + "SetUseExtractFloatingMetalsFloating": _RpcInfo(buffer=True), + "GetUseEnableEtchTransform": _RpcInfo(cache=True), + "SetUseEnableEtchTransform": _RpcInfo(buffer=True), + "GetUseEnableHybridExtraction": _RpcInfo(cache=True), + "SetUseEnableHybridExtraction": _RpcInfo(buffer=True), + "GetUseEnableAdvancedCapEffects": _RpcInfo(cache=True), + "SetUseEnableAdvancedCapEffects": _RpcInfo(buffer=True), + "GetUseOverrideShrinkFac": _RpcInfo(cache=True), + "SetUseOverrideShrinkFac": _RpcInfo(buffer=True), + "GetOverrideShrinkFac": _RpcInfo(cache=True), + "SetOverrideShrinkFac": _RpcInfo(buffer=True), + "GetAdvancedOptions": _RpcInfo(cache=True), + "SetAdvancedOptions": _RpcInfo(buffer=True), + "GetNetSettingsOptions": _RpcInfo(cache=True), + "SetNetSettingsOptions": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.RectangleService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "GetParameters": _RpcInfo(cache=True), + "SetParameters": _RpcInfo(buffer=True), + "Render": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.RLCComponentPropertyService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "GetEnabled": _RpcInfo(cache=True), + "SetEnabled": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.RTreeService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "GetExtent": _RpcInfo(cache=True), + "InsertIntObject": _RpcInfo(buffer=True), + "DeleteIntObject": _RpcInfo(buffer=True), + "Empty": _RpcInfo(cache=True), + "Search": _RpcInfo(cache=True), + "NearestNeighbor": _RpcInfo(cache=True), + "TouchingGeometry": _RpcInfo(cache=True), + "ConnectedGeometry": _RpcInfo(cache=True), + "GetConnectedGeometrySets": _RpcInfo(cache=True), + "IncrementVisit": _RpcInfo(buffer=True), + "IsVisited": _RpcInfo(cache=True), + "Visit": _RpcInfo(buffer=True), + "GetVisit": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.SimulationSettingsService": { + "GetEnabled": _RpcInfo(cache=True), + "SetEnabled": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.SettingsOptionsService": { + "GetDoLamdaRefineFlag": _RpcInfo(cache=True), + "SetDoLamdaRefineFlag": _RpcInfo(buffer=True), + "GetLamdaTarget": _RpcInfo(cache=True), + "SetLamdaTarget": _RpcInfo(buffer=True), + "GetMeshSizefactor": _RpcInfo(cache=True), + "SetMeshSizefactor": _RpcInfo(buffer=True), + "GetUseDefaultLamda": _RpcInfo(cache=True), + "SetUseDefaultLamda": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.AdvancedSettingsService": { + "GetUnionPolygons": _RpcInfo(cache=True), + "SetUnionPolygons": _RpcInfo(buffer=True), + "GetRemoveFloatingGeometry": _RpcInfo(cache=True), + "SetRemoveFloatingGeometry": _RpcInfo(buffer=True), + "GetHealingOption": _RpcInfo(cache=True), + "SetHealingOption": _RpcInfo(buffer=True), + "GetSmallVoidArea": _RpcInfo(cache=True), + "SetSmallVoidArea": _RpcInfo(buffer=True), + "GetUseDefeature": _RpcInfo(cache=True), + "SetUseDefeature": _RpcInfo(buffer=True), + "GetUseDefeatureAbsoluteLength": _RpcInfo(cache=True), + "SetUseDefeatureAbsoluteLength": _RpcInfo(buffer=True), + "GetDefeatureAbsoluteLength": _RpcInfo(cache=True), + "SetDefeatureAbsoluteLength": _RpcInfo(buffer=True), + "GetDefeatureRatio": _RpcInfo(cache=True), + "SetDefeatureRatio": _RpcInfo(buffer=True), + "GetViaModelType": _RpcInfo(cache=True), + "SetViaModelType": _RpcInfo(buffer=True), + "GetNumViaSides": _RpcInfo(cache=True), + "SetNumViaSides": _RpcInfo(buffer=True), + "GetViaDensity": _RpcInfo(cache=True), + "SetViaDensity": _RpcInfo(buffer=True), + "GetViaMaterial": _RpcInfo(cache=True), + "SetViaMaterial": _RpcInfo(buffer=True), + "GetMeshForViaPlating": _RpcInfo(cache=True), + "SetMeshForViaPlating": _RpcInfo(buffer=True), + "GetModelType": _RpcInfo(cache=True), + "SetModelType": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.AdvancedMeshingSettingsService": { + "GetArcStepSize": _RpcInfo(cache=True), + "SetArcStepSize": _RpcInfo(buffer=True), + "GetCircleStartAzimuth": _RpcInfo(cache=True), + "SetCircleStartAzimuth": _RpcInfo(buffer=True), + "GetMaxNumArcPoints": _RpcInfo(cache=True), + "SetMaxNumArcPoints": _RpcInfo(buffer=True), + "GetUseArcChordErrorApprox": _RpcInfo(cache=True), + "SetUseArcChordErrorApprox": _RpcInfo(buffer=True), + "GetArcChordErrorApprox": _RpcInfo(cache=True), + "SetArcChordErrorApprox": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.SolverSettingsService": { + "GetThinSignalLayerThreshold": _RpcInfo(cache=True), + "SetThinSignalLayerThreshold": _RpcInfo(buffer=True), + "GetThinDielectricLayerThreshold": _RpcInfo(cache=True), + "SetThinDielectricLayerThreshold": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.SimulationSetupService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "GetName": _RpcInfo(cache=True), + "SetName": _RpcInfo(buffer=True), + "GetPosition": _RpcInfo(cache=True), + "SetPosition": _RpcInfo(buffer=True), + "GetSweepData": _RpcInfo(cache=True), + "SetSweepData": _RpcInfo(buffer=True), + "GetType": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.SIWaveDCIRSimulationSettingsService": { + "GetIcepakTempFile": _RpcInfo(cache=True), + "SetIcepakTempFile": _RpcInfo(buffer=True), + "GetSourceTermsToGround": _RpcInfo(cache=True), + "SetSourceTermsToGround": _RpcInfo(buffer=True), + "GetExportDCThermalData": _RpcInfo(cache=True), + "SetExportDCThermalData": _RpcInfo(buffer=True), + "GetImportThermalData": _RpcInfo(cache=True), + "SetImportThermalData": _RpcInfo(buffer=True), + "GetFullDCReportPath": _RpcInfo(cache=True), + "SetFullDCReportPath": _RpcInfo(buffer=True), + "GetViaReportPath": _RpcInfo(cache=True), + "SetViaReportPath": _RpcInfo(buffer=True), + "GetPerPinResPath": _RpcInfo(cache=True), + "SetPerPinResPath": _RpcInfo(buffer=True), + "GetDCReportConfigFile": _RpcInfo(cache=True), + "SetDCReportConfigFile": _RpcInfo(buffer=True), + "GetDCReportShowActiveDevices": _RpcInfo(cache=True), + "SetDCReportShowActiveDevices": _RpcInfo(buffer=True), + "GetPerPinUsePinFormat": _RpcInfo(cache=True), + "SetPerPinUsePinFormat": _RpcInfo(buffer=True), + "GetUseLoopResForPerPin": _RpcInfo(cache=True), + "SetUseLoopResForPerPin": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.SIWaveGeneralSettingsService": { + "GetUseSISettings": _RpcInfo(cache=True), + "SetUseSISettings": _RpcInfo(buffer=True), + "GetUseCustomSettings": _RpcInfo(cache=True), + "SetUseCustomSettings": _RpcInfo(buffer=True), + "GetSISliderPos": _RpcInfo(cache=True), + "SetSISliderPos": _RpcInfo(buffer=True), + "GetPISliderPos": _RpcInfo(cache=True), + "SetPISliderPos": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.SIWaveAdvancedSettingsService": { + "GetIncludeCoPlaneCoupling": _RpcInfo(cache=True), + "SetIncludeCoPlaneCoupling": _RpcInfo(buffer=True), + "GetIncludeInterPlaneCoupling": _RpcInfo(cache=True), + "SetIncludeInterPlaneCoupling": _RpcInfo(buffer=True), + "GetIncludeSplitPlaneCoupling": _RpcInfo(cache=True), + "SetIncludeSplitPlaneCoupling": _RpcInfo(buffer=True), + "GetIncludeFringePlaneCoupling": _RpcInfo(cache=True), + "SetIncludeFringePlaneCoupling": _RpcInfo(buffer=True), + "GetIncludeTracePlaneCoupling": _RpcInfo(cache=True), + "SetIncludeTracePlaneCoupling": _RpcInfo(buffer=True), + "GetCrossTalkThreshold": _RpcInfo(cache=True), + "SetCrossTalkThreshold": _RpcInfo(buffer=True), + "GetMaxCoupledLines": _RpcInfo(cache=True), + "SetMaxCoupledLines": _RpcInfo(buffer=True), + "GetMinVoidArea": _RpcInfo(cache=True), + "SetMinVoidArea": _RpcInfo(buffer=True), + "GetMinPadAreaToMesh": _RpcInfo(cache=True), + "SetMinPadAreaToMesh": _RpcInfo(buffer=True), + "GetMinPlaneAreaToMesh": _RpcInfo(cache=True), + "SetMinPlaneAreaToMesh": _RpcInfo(buffer=True), + "GetSnapLengthThreshold": _RpcInfo(cache=True), + "SetSnapLengthThreshold": _RpcInfo(buffer=True), + "GetMeshAutomatic": _RpcInfo(cache=True), + "SetMeshAutomatic": _RpcInfo(buffer=True), + "GetMeshFrequency": _RpcInfo(cache=True), + "SetMeshFrequency": _RpcInfo(buffer=True), + "GetAcDcMergeMode": _RpcInfo(cache=True), + "SetAcDcMergeMode": _RpcInfo(buffer=True), + "Get3DReturnCurrentDistribution": _RpcInfo(cache=True), + "Set3DReturnCurrentDistribution": _RpcInfo(buffer=True), + "GetIncludeVISources": _RpcInfo(cache=True), + "SetIncludeVISources": _RpcInfo(buffer=True), + "GetIncludeInfGnd": _RpcInfo(cache=True), + "SetIncludeInfGnd": _RpcInfo(buffer=True), + "GetInfGndLocation": _RpcInfo(cache=True), + "SetInfGndLocation": _RpcInfo(buffer=True), + "GetPerformERC": _RpcInfo(cache=True), + "SetPerformERC": _RpcInfo(buffer=True), + "GetIgnoreNonFunctionalPads": _RpcInfo(cache=True), + "SetIgnoreNonFunctionalPads": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.SIWaveDCSettingsService": { + "GetUseDCCustomSettings": _RpcInfo(cache=True), + "SetUseDCCustomSettings": _RpcInfo(buffer=True), + "GetComputeInductance": _RpcInfo(cache=True), + "SetComputeInductance": _RpcInfo(buffer=True), + "GetPlotJV": _RpcInfo(cache=True), + "SetPlotJV": _RpcInfo(buffer=True), + "GetContactRadius": _RpcInfo(cache=True), + "SetContactRadius": _RpcInfo(buffer=True), + "GetDCSliderPos": _RpcInfo(cache=True), + "SetDCSliderPos": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.SIWaveDCAdvancedSettingsService": { + "GetDCMinPlaneAreaToMesh": _RpcInfo(cache=True), + "SetDCMinPlaneAreaToMesh": _RpcInfo(buffer=True), + "GetDCMinVoidAreaToMesh": _RpcInfo(cache=True), + "SetDCMinVoidAreaToMesh": _RpcInfo(buffer=True), + "GetMaxInitMeshEdgeLength": _RpcInfo(cache=True), + "SetMaxInitMeshEdgeLength": _RpcInfo(buffer=True), + "GetPerformAdaptiveRefinement": _RpcInfo(cache=True), + "SetPerformAdaptiveRefinement": _RpcInfo(buffer=True), + "GetMaxNumPasses": _RpcInfo(cache=True), + "SetMaxNumPasses": _RpcInfo(buffer=True), + "GetMinNumPasses": _RpcInfo(cache=True), + "SetMinNumPasses": _RpcInfo(buffer=True), + "GetPercentLocalRefinement": _RpcInfo(cache=True), + "SetPercentLocalRefinement": _RpcInfo(buffer=True), + "GetEnergyError": _RpcInfo(cache=True), + "SetEnergyError": _RpcInfo(buffer=True), + "GetMeshBws": _RpcInfo(cache=True), + "SetMeshBws": _RpcInfo(buffer=True), + "GetRefineBws": _RpcInfo(cache=True), + "SetRefineBws": _RpcInfo(buffer=True), + "GetMeshVias": _RpcInfo(cache=True), + "SetMeshVias": _RpcInfo(buffer=True), + "GetRefineVias": _RpcInfo(cache=True), + "SetRefineVias": _RpcInfo(buffer=True), + "GetNumBwSides": _RpcInfo(cache=True), + "SetNumBwSides": _RpcInfo(buffer=True), + "GetNumViaSides": _RpcInfo(cache=True), + "SetNumViaSides": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.SIWaveSParameterSettingsService": { + "GetUseStateSpace": _RpcInfo(cache=True), + "SetUseStateSpace": _RpcInfo(buffer=True), + "GetInterpolation": _RpcInfo(cache=True), + "SetInterpolation": _RpcInfo(buffer=True), + "GetExtrapolation": _RpcInfo(cache=True), + "SetExtrapolation": _RpcInfo(buffer=True), + "GetDCBehavior": _RpcInfo(cache=True), + "SetDCBehavior": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.SolderBallPropertyService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "GetShape": _RpcInfo(cache=True), + "SetShape": _RpcInfo(buffer=True), + "GetPlacement": _RpcInfo(cache=True), + "SetPlacement": _RpcInfo(buffer=True), + "GetDiameter": _RpcInfo(cache=True), + "SetDiameter": _RpcInfo(buffer=True), + "GetHeight": _RpcInfo(cache=True), + "SetHeight": _RpcInfo(buffer=True), + "GetMaterialName": _RpcInfo(cache=True), + "SetMaterialName": _RpcInfo(buffer=True), + "UsesSolderball": _RpcInfo(cache=True), + "Clone": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + }, + "ansys.api.edb.v1.SParameterModelService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "GetProperties": _RpcInfo(cache=True), + "SetComponentModelName": _RpcInfo(buffer=True), + "SetReferenceNet": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.SpiceModelService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "GetProperties": _RpcInfo(cache=True), + "SetModelPath": _RpcInfo(buffer=True), + "SetModelName": _RpcInfo(buffer=True), + "SetSubCkt": _RpcInfo(buffer=True), + "AddTerminalPinPair": _RpcInfo(buffer=True), + "RemoveTerminalPinPair": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.StackupLayerService": { + "Create": _RpcInfo(returns_future=True, buffer=True), + "GetNegative": _RpcInfo(cache=True), + "SetNegative": _RpcInfo(buffer=True), + "GetThickness": _RpcInfo(cache=True), + "SetThickness": _RpcInfo(buffer=True), + "GetLowerElevation": _RpcInfo(cache=True), + "SetLowerElevation": _RpcInfo(buffer=True), + "GetUpperElevation": _RpcInfo(cache=True), + "GetMaterial": _RpcInfo(cache=True), + "SetMaterial": _RpcInfo(buffer=True), + "GetFillMaterial": _RpcInfo(cache=True), + "SetFillMaterial": _RpcInfo(buffer=True), + "SetRoughnessEnabled": _RpcInfo(buffer=True), + "IsRoughnessEnabled": _RpcInfo(cache=True), + "GetRoughnessModel": _RpcInfo(cache=True), + "SetRoughnessModel": _RpcInfo(buffer=True), + "IsEtchFactorEnabled": _RpcInfo(cache=True), + "SetEtchFactorEnabled": _RpcInfo(buffer=True), + "SetEtchFactor": _RpcInfo(buffer=True), + "GetEtchFactor": _RpcInfo(cache=True), + "GetUseSolverProperties": _RpcInfo(cache=True), + "SetUseSolverProperties": _RpcInfo(buffer=True), + "GetHFSSSolverProperties": _RpcInfo(cache=True), + "SetHFSSSolverProperties": _RpcInfo(buffer=True), + "GetReferencingViaLayerIds": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.Structure3DService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "GetMaterial": _RpcInfo(cache=True), + "SetMaterial": _RpcInfo(buffer=True), + "GetThickness": _RpcInfo(cache=True), + "SetThickness": _RpcInfo(buffer=True), + "GetMeshClosureProp": _RpcInfo(cache=True), + "SetMeshClosureProp": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.TerminalService": { + "FindByName": _RpcInfo(returns_future=True, buffer=True), + "GetParams": _RpcInfo(cache=True), + "SetParams": _RpcInfo(buffer=True), + "GetProductSolvers": _RpcInfo(cache=True), + "SetProductSolverOptions": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.TerminalInstanceService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "GetOwningCellInstance": _RpcInfo(cache=True), + "GetDefinitionTerminal": _RpcInfo(cache=True), + "GetDefinitionTerminalName": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.TerminalInstanceTerminalService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "GetTerminalInstance": _RpcInfo(cache=True), + "SetTerminalInstance": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.TextService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "GetTextData": _RpcInfo(cache=True), + "SetTextData": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.TransformService": { + "Rotate": _RpcInfo(cache=True), + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "GetScale": _RpcInfo(cache=True), + "SetScale": _RpcInfo(buffer=True), + "GetMirror": _RpcInfo(cache=True), + "SetMirror": _RpcInfo(buffer=True), + "GetRotation": _RpcInfo(cache=True), + "SetRotation": _RpcInfo(buffer=True), + "GetOffsetX": _RpcInfo(cache=True), + "SetOffsetX": _RpcInfo(buffer=True), + "GetOffsetY": _RpcInfo(cache=True), + "SetOffsetY": _RpcInfo(buffer=True), + "TransformPlus": _RpcInfo(returns_future=True, buffer=True), + "IsIdentity": _RpcInfo(cache=True), + "TransformPoint": _RpcInfo(cache=True), + "TransformPolygon": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.Transform3DService": { + "CreateIdentity": _RpcInfo( + returns_future=True, write_no_cache_invalidation=True, buffer=True + ), + "CreateCopy": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "CreateOffset": _RpcInfo( + returns_future=True, write_no_cache_invalidation=True, buffer=True + ), + "CreateCenterScale": _RpcInfo( + returns_future=True, write_no_cache_invalidation=True, buffer=True + ), + "CreateRotationFromAngle": _RpcInfo( + returns_future=True, write_no_cache_invalidation=True, buffer=True + ), + "CreateRotationFromAxis": _RpcInfo( + returns_future=True, write_no_cache_invalidation=True, buffer=True + ), + "CreateRotationFromAxisAndAngle": _RpcInfo( + returns_future=True, write_no_cache_invalidation=True, buffer=True + ), + "CreateRotationFromToAxis": _RpcInfo( + returns_future=True, write_no_cache_invalidation=True, buffer=True + ), + "CreateTransform2D": _RpcInfo( + returns_future=True, write_no_cache_invalidation=True, buffer=True + ), + "OperatorPlus": _RpcInfo( + returns_future=True, write_no_cache_invalidation=True, buffer=True + ), + "TransformPoint": _RpcInfo(cache=True), + "GetZYXRotation": _RpcInfo(cache=True), + "GetAxis": _RpcInfo(cache=True), + "Transpose": _RpcInfo(buffer=True), + "Invert": _RpcInfo(buffer=True), + "IsIdentity": _RpcInfo(cache=True), + "IsEqual": _RpcInfo(cache=True), + "GetScaling": _RpcInfo(cache=True), + "GetShift": _RpcInfo(cache=True), + "SetMatrix": _RpcInfo(buffer=True), + "GetMatrix": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.ValueService": { + "GetDouble": _RpcInfo(cache=True), + "GetComplex": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.VariableServerService": { + "AddVariable": _RpcInfo(buffer=True), + "AddMenuVariable": _RpcInfo(buffer=True), + "DeleteVariable": _RpcInfo(buffer=True), + "SetVariableValue": _RpcInfo(buffer=True), + "GetVariableValue": _RpcInfo(cache=True), + "IsParameter": _RpcInfo(cache=True), + "GetAllVariableNames": _RpcInfo(cache=True), + "GetVariableDesc": _RpcInfo(cache=True), + "SetVariableDesc": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.ViaGroupService": { + "CreateWithOutline": _RpcInfo( + returns_future=True, write_no_cache_invalidation=True, buffer=True + ), + "FindByName": _RpcInfo(cache=True), + "GetOutline": _RpcInfo(cache=True), + "GetConductorPercentage": _RpcInfo(cache=True), + "IsPersistent": _RpcInfo(cache=True), + }, + "ansys.api.edb.v1.ViaLayerService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "GetRefLayerName": _RpcInfo(cache=True), + "SetRefLayer": _RpcInfo(buffer=True), + }, + "ansys.api.edb.v1.VoltageRegulatorService": { + "Create": _RpcInfo(returns_future=True, write_no_cache_invalidation=True, buffer=True), + "GetName": _RpcInfo(cache=True), + "SetName": _RpcInfo(buffer=True), + "IsActive": _RpcInfo(cache=True), + "SetIsActive": _RpcInfo(buffer=True), + "GetVoltage": _RpcInfo(cache=True), + "SetVoltage": _RpcInfo(buffer=True), + "GetLoadRegulationCurrent": _RpcInfo(cache=True), + "SetLoadRegulationCurrent": _RpcInfo(buffer=True), + "GetLoadRegulationPercent": _RpcInfo(cache=True), + "SetLoadRegulationPercent": _RpcInfo(buffer=True), + "GetPosRemoteSensePin": _RpcInfo(cache=True), + "SetPosRemoteSensePin": _RpcInfo(buffer=True), + "GetNegRemoteSensePin": _RpcInfo(cache=True), + "SetNegRemoteSensePin": _RpcInfo(buffer=True), + "GetNPowerModules": _RpcInfo(cache=True), + "GetNActivePowerModules": _RpcInfo(cache=True), + "GetPowerModule": _RpcInfo(cache=True), + "GetAllPowerModules": _RpcInfo(cache=True), + "AddPowerModule": _RpcInfo(buffer=True), + "RemovePowerModule": _RpcInfo(buffer=True), + "AddPowerModules": _RpcInfo(buffer=True), + "RemovePowerModules": _RpcInfo(buffer=True), + "RemoveAllPowerModules": _RpcInfo(buffer=True), + }, +} diff --git a/src/ansys/edb/core/inner/rpc_info_utils.py b/src/ansys/edb/core/inner/rpc_info_utils.py new file mode 100644 index 0000000000..330703ef1a --- /dev/null +++ b/src/ansys/edb/core/inner/rpc_info_utils.py @@ -0,0 +1,37 @@ +"""RPC Info Utils.""" + +from ansys.edb.core.inner.rpc_info import rpc_information + + +def get_rpc_info(service_name, rpc_name): + """Get the rpc info for the rpc corresponding to the provided service and rpc names.""" + buffered_service = rpc_information.get(service_name) + return buffered_service.get(rpc_name) if buffered_service is not None else None + + +def can_cache(service_name, rpc_name): + """Check if the response of the rpc corresponding to the provided service and rpc names can be cached.""" + if (rpc_info := get_rpc_info(service_name, rpc_name)) is not None: + return rpc_info.can_cache + return False + + +def can_buffer(service_name, rpc_name): + """Check if the request of the rpc corresponding to the provided service and rpc names can be buffered.""" + if (rpc_info := get_rpc_info(service_name, rpc_name)) is not None: + return rpc_info.can_buffer + return False + + +def is_read(service_name, rpc_name): + """Check if the rpc corresponding to the provided service and rpc names is a read operation.""" + if (rpc_info := get_rpc_info(service_name, rpc_name)) is not None: + return rpc_info.is_read + return False + + +def is_write(service_name, rpc_name): + """Check if the rpc corresponding to the provided service and rpc names is a write operation.""" + if (rpc_info := get_rpc_info(service_name, rpc_name)) is not None: + return rpc_info.is_write + return False diff --git a/src/ansys/edb/core/inner/utils.py b/src/ansys/edb/core/inner/utils.py index a558574bb8..43bcc8c2a3 100644 --- a/src/ansys/edb/core/inner/utils.py +++ b/src/ansys/edb/core/inner/utils.py @@ -2,7 +2,7 @@ from ansys.api.edb.v1.layout_obj_pb2 import LayoutObjTargetMessage from ansys.edb.core.inner.factory import create_lyt_obj -from ansys.edb.core.utility.cache import get_cache +from ansys.edb.core.utility.io_manager import get_cache def map_list(iterable_to_operate_on, operator=None): @@ -18,12 +18,19 @@ def map_list(iterable_to_operate_on, operator=None): ) -def query_lyt_object_collection(owner, obj_type, unary_rpc, unary_streaming_rpc): +def query_lyt_object_collection( + owner, obj_type, unary_rpc, unary_streaming_rpc, request_requires_type=True +): """For the provided request, retrieve a collection of objects using the unary_rpc or unary_streaming_rpc methods \ depending on whether caching is enabled.""" + request = ( + LayoutObjTargetMessage(target=owner.msg, type=obj_type.value) + if request_requires_type + else owner.msg + ) + items = [] cache = get_cache() - request = LayoutObjTargetMessage(target=owner.msg, type=obj_type.value) def add_msgs_to_items(edb_obj_collection_msg): nonlocal items diff --git a/src/ansys/edb/core/primitive/primitive.py b/src/ansys/edb/core/primitive/primitive.py index 69cc029e33..818ed8fb6d 100644 --- a/src/ansys/edb/core/primitive/primitive.py +++ b/src/ansys/edb/core/primitive/primitive.py @@ -25,7 +25,7 @@ from ansys.edb.core.definition.padstack_def import PadstackDef from ansys.edb.core.edb_defs import LayoutObjType -from ansys.edb.core.inner import conn_obj, messages, parser +from ansys.edb.core.inner import conn_obj, messages, parser, utils from ansys.edb.core.layer.layer import Layer from ansys.edb.core.session import StubAccessor, StubType from ansys.edb.core.utility.layer_map import LayerMap @@ -208,7 +208,9 @@ def voids(self): This property is read-only. """ - return [Primitive(msg).cast() for msg in self.__stub.Voids(self.msg).items] + return utils.query_lyt_object_collection( + self, LayoutObjType.PRIMITIVE, self.__stub.Voids, self.__stub.StreamVoids, False + ) @property def owner(self): diff --git a/src/ansys/edb/core/session.py b/src/ansys/edb/core/session.py index 52da303ecb..993294f333 100644 --- a/src/ansys/edb/core/session.py +++ b/src/ansys/edb/core/session.py @@ -57,6 +57,7 @@ from ansys.api.edb.v1.ic_component_property_pb2_grpc import ICComponentPropertyServiceStub from ansys.api.edb.v1.inst_array_pb2_grpc import InstArrayServiceStub from ansys.api.edb.v1.io_component_property_pb2_grpc import IOComponentPropertyServiceStub +from ansys.api.edb.v1.io_manager_pb2_grpc import IOManagerServiceStub from ansys.api.edb.v1.layer_collection_pb2_grpc import LayerCollectionServiceStub from ansys.api.edb.v1.layer_map_pb2_grpc import LayerMapServiceStub from ansys.api.edb.v1.layer_pb2_grpc import LayerServiceStub @@ -146,8 +147,8 @@ from ansys.edb.core.inner import LOGGER from ansys.edb.core.inner.exceptions import EDBSessionException, ErrorCode from ansys.edb.core.inner.interceptors import ( - CachingInterceptor, ExceptionInterceptor, + IOInterceptor, LoggingInterceptor, ) @@ -193,7 +194,7 @@ def __init__(self, ip_address, port_num, ansys_em_root, dump_traffic_log): self.rpc_counter = defaultdict(int) if dump_traffic_log else None self.interceptors = [ # on reversed order of interception - CachingInterceptor(LOGGER, self.rpc_counter), + IOInterceptor(LOGGER, self.rpc_counter), ExceptionInterceptor(LOGGER), LoggingInterceptor(LOGGER), ] @@ -446,6 +447,7 @@ class StubType(Enum): raptor_x_general_sim_settings = RaptorXGeneralSettingsServiceStub raptor_x_adv_sim_settings = RaptorXAdvancedSettingsServiceStub layout_component = LayoutComponentServiceStub + io_manager = IOManagerServiceStub def attach_session(ip_address=None, port_num=50051, dump_traffic_log=False): diff --git a/src/ansys/edb/core/utility/cache.py b/src/ansys/edb/core/utility/cache.py deleted file mode 100644 index 264cf403c8..0000000000 --- a/src/ansys/edb/core/utility/cache.py +++ /dev/null @@ -1,85 +0,0 @@ -"""Cache.""" - -from contextlib import contextmanager -from sys import modules - -from django.utils.module_loading import import_string - -# The cache module singleton -MOD = modules[__name__] -MOD.cache = None - - -class _Cache: - def __init__(self): - self._response_cache = {} - self._msg_type_cache = {} - - def _extract_msg_from_any_module_msg(self, any_module_msg): - msg_type_name = any_module_msg.any.TypeName() - msg_type = self._msg_type_cache.get(msg_type_name) - if msg_type is None: - insertion_idx = msg_type_name.rindex(".") - msg_class_path = ( - msg_type_name[: insertion_idx + 1] - + any_module_msg.module - + "_pb2" - + msg_type_name[insertion_idx:] - ) - msg_type = import_string(msg_class_path) - self._msg_type_cache[msg_type_name] = msg_type - msg = msg_type() - any_module_msg.any.Unpack(msg) - return msg - - @staticmethod - def _generate_cache_key(service_name, rpc_method_name, request): - """Generate a unique cache key based on the request.""" - return f"{service_name}-{rpc_method_name}-{str(request)}" - - class _CacheOutcome: - def __init__(self, result): - self._result = result - - def result(self): - return self._result - - def add(self, service_name, rpc_method_name, request_msg, response_msg): - key = self._generate_cache_key(service_name, rpc_method_name, request_msg) - self._response_cache[key] = self._CacheOutcome(response_msg) - - def add_from_cache_msg(self, cache_msg): - for cache_entry in cache_msg.cache: - request_msg = self._extract_msg_from_any_module_msg(cache_entry.request) - response_msg = self._extract_msg_from_any_module_msg(cache_entry.response) - self.add( - cache_entry.service_name, cache_entry.rpc_method_name, request_msg, response_msg - ) - if cache_msg.cache: - cache_msg.ClearField("cache") - - def get(self, service_name, rpc_method_name, request_msg): - return self._response_cache.get( - self._generate_cache_key(service_name, rpc_method_name, request_msg) - ) - - -@contextmanager -def enable_caching(): - """Enable caching of data from the server for code called within the context manager and improve performance of \ - read-only operations. - - .. note:: - This is intended for use with read-only operations. If modifications are made to the EDB in this code block, \ - the changes will not be reflected when querying the server until after the context manager is exited. - """ - try: - MOD.cache = _Cache() - yield - finally: - MOD.cache = None - - -def get_cache(): - """Get the active cache.""" - return MOD.cache diff --git a/src/ansys/edb/core/utility/io_manager.py b/src/ansys/edb/core/utility/io_manager.py new file mode 100644 index 0000000000..212b600168 --- /dev/null +++ b/src/ansys/edb/core/utility/io_manager.py @@ -0,0 +1,398 @@ +"""Cache.""" + +import abc +from contextlib import contextmanager +from enum import Enum, auto +from sys import modules + +from ansys.api.edb.v1.edb_messages_pb2 import EDBObjCollectionMessage, EDBObjMessage +from ansys.api.edb.v1.io_manager_pb2 import BufferEntryMessage, BufferMessage +from django.utils.module_loading import import_string +from google.protobuf.any_pb2 import Any +from google.protobuf.empty_pb2 import Empty + +from ansys.edb.core.inner.rpc_info_utils import get_rpc_info + +# The cache module singleton +MOD = modules[__name__] + +_future_id = 0 + + +def _get_next_future_id(): + global _future_id + _future_id += 1 + return _future_id + + +def _get_io_manager_stub(): + from ansys.edb.core.session import StubAccessor, StubType + + return StubAccessor(StubType.io_manager).__get__() + + +class _HijackedOutcome: + def __init__(self, result): + self._result = result + + def result(self): + return self._result + + +class _IOOptimizer(metaclass=abc.ABCMeta): + def __init__(self): + self._is_blocking = False + + @contextmanager + def block(self): + try: + self._is_blocking = True + yield + finally: + self._is_blocking = False + self._reset_after_block() + + def _reset_after_block(self): + pass + + @property + def is_blocking(self): + return self._is_blocking + + def hijack_request(self, service_name, rpc_name, request): + hijacked_response = self._hijack_request(service_name, rpc_name, request) + if hijacked_response is not None: + return _HijackedOutcome(hijacked_response) + return None + + @abc.abstractmethod + def _hijack_request(self, service_name, rpc_name, request): + pass + + +class _Cache(_IOOptimizer): + def __init__(self): + super().__init__() + self._response_cache = {} + self._msg_type_cache = {} + self._cached_edb_objs = {} + + def _extract_msg_from_any_module_msg(self, any_module_msg): + msg_type_name = any_module_msg.any.TypeName() + msg_type = self._msg_type_cache.get(msg_type_name) + if msg_type is None: + insertion_idx = msg_type_name.rindex(".") + msg_class_path = ( + msg_type_name[: insertion_idx + 1] + + any_module_msg.module + + "_pb2" + + msg_type_name[insertion_idx:] + ) + msg_type = import_string(msg_class_path) + self._msg_type_cache[msg_type_name] = msg_type + msg = msg_type() + any_module_msg.any.Unpack(msg) + return msg + + @staticmethod + def _generate_cache_key(service_name, rpc_method_name, request): + """Generate a unique cache key based on the request.""" + return f"{service_name}-{rpc_method_name}-{str(request)}" + + def add(self, service_name, rpc_method_name, request_msg, response_msg): + self._response_cache[ + self._generate_cache_key(service_name, rpc_method_name, request_msg) + ] = response_msg + + def add_from_cache_msg(self, edb_obj_msg): + cache_msg = edb_obj_msg.cache + for cache_entry in cache_msg.cache: + request_msg = self._extract_msg_from_any_module_msg(cache_entry.request) + response_msg = self._extract_msg_from_any_module_msg(cache_entry.response) + self.add( + cache_entry.service_name, cache_entry.rpc_method_name, request_msg, response_msg + ) + self._cached_edb_objs[edb_obj_msg.id] = True + if cache_msg.cache: + cache_msg.ClearField("cache") + + def _hijack_request(self, service_name, rpc_name, request): + if (rpc_info := get_rpc_info(service_name, rpc_name)) is None or rpc_info.invalidates_cache: + self.invalidate() + return + if not rpc_info.can_cache: + return + self.refresh_for_request() + return self._response_cache.get(self._generate_cache_key(service_name, rpc_name, request)) + + def invalidate(self): + if not self._response_cache: + return + self._response_cache.clear() + self._cached_edb_objs = self._cached_edb_objs.fromkeys(self._cached_edb_objs, False) + get_io_manager().add_notification_for_server(ServerNotification.INVALIDATE_CACHE) + + def refresh_for_request(self): + active_request_edb_obj_msgs = ( + get_io_manager().active_request_edb_obj_msg_mgr.active_request_edb_obj_msgs + ) + if not active_request_edb_obj_msgs: + return + edb_objs_to_refresh = [ + active_request_edb_obj_msg + for active_request_edb_obj_msg in active_request_edb_obj_msgs.values() + if not active_request_edb_obj_msg.is_future + and self._cached_edb_objs.get(active_request_edb_obj_msg.id) is False + ] + if not edb_objs_to_refresh: + return + with self.block(): + response = _get_io_manager_stub().RefreshCache( + EDBObjCollectionMessage(items=edb_objs_to_refresh) + ) + for msg in response.items: + self.add_from_cache_msg(msg) + + +class _Buffer(_IOOptimizer): + class _BufferEntry: + def __init__(self, service_name, rpc_name, request, future_id): + self._service_name = service_name + self._rpc_name = rpc_name + self._request = request + self._future_id = future_id + + def msg(self): + any_request = Any() + any_request.Pack(self._request) + msg = BufferEntryMessage( + service_name=self._service_name, + rpc_name=self._rpc_name, + request=any_request, + future_id=self._future_id, + ) + return msg + + def __init__(self): + super().__init__() + self._reset() + + def _reset(self): + self._buffer = [] + self._futures = {} + self._invalidate_cache = False + + def _hijack_request(self, service_name, rpc_name, request): + if (rpc_info := get_rpc_info(service_name, rpc_name)) is None or rpc_info.is_read: + self.flush() + return + if not rpc_info.can_buffer: + return + if rpc_info.invalidates_cache: + self._invalidate_cache = True + future_id = _get_next_future_id() if rpc_info.returns_future else None + self._buffer.append(self._BufferEntry(service_name, rpc_name, request, future_id)) + return Empty if future_id is None else EDBObjMessage(id=future_id, is_future=True) + + @staticmethod + def _buffer_request_iterator(buffer): + max_size = 32000 + msg = BufferMessage() + for buffer_entry in buffer: + buffer_entry_msg = buffer_entry.msg() + if msg.ByteSize() + buffer_entry_msg.ByteSize() > max_size: + yield msg + msg = BufferMessage() + msg.buffer.append(buffer_entry_msg) + yield msg + + def flush(self): + if not self._buffer: + return + with self.block(): + get_io_manager().add_notification_for_server(ServerNotification.FLUSH_BUFFER) + for response in _get_io_manager_stub().FlushBufferStream( + self._buffer_request_iterator(self._buffer) + ): + if (cache := get_cache()) is not None and self._invalidate_cache: + cache.invalidate() + for updated_edb_obj in response.resolved_futures: + if (future_edb_obj := self._futures.get(updated_edb_obj.future_id)) is not None: + future_edb_obj.msg = updated_edb_obj.edb_obj + get_io_manager().active_request_edb_obj_msg_mgr.resolve_future( + updated_edb_obj.future_id, updated_edb_obj.edb_obj.id + ) + + def add_future_ref(self, future): + self._futures[future.id] = future + + def _reset_after_block(self): + self._reset() + + +class ServerNotification(Enum): + """Provides an enum representing the types of server notifications.""" + + INVALIDATE_CACHE = auto() + FLUSH_BUFFER = auto() + + +class IOMangementType(Enum): + """Provides an enum representing the types of IO management modes.""" + + READ = auto() + WRITE = auto() + READ_AND_WRITE = auto() + + +class _ActiveRequestEdbObjMsgMgr: + def __init__(self): + self._active_request_edb_obj_msgs = {} + + @staticmethod + def _get_key(msg_id, is_future): + return f"{msg_id}-{is_future}" + + def add_active_request_edb_obj_msg(self, msg): + self._active_request_edb_obj_msgs[self._get_key(msg.id, msg.is_future)] = msg + + def resolve_future(self, future_id, resolved_id): + key = self._get_key(future_id, True) + if key in self._active_request_edb_obj_msgs: + msg = self._active_request_edb_obj_msgs.pop(key) + msg.id = resolved_id + msg.is_future = False + self.add_active_request_edb_obj_msg(msg) + + def reset(self): + self._active_request_edb_obj_msgs.clear() + + @property + def active_request_edb_obj_msgs(self): + return self._active_request_edb_obj_msgs + + +class _IOManager: + def __init__(self): + self._reset() + self._server_notifications = set() + + def _reset(self): + self._cache = None + self._buffer = None + self._active_request_edb_obj_msg_mgr = _ActiveRequestEdbObjMsgMgr() + + @staticmethod + def _enable_caching(enable): + from ansys.edb.core.inner.messages import bool_message + + _get_io_manager_stub().EnableCache(bool_message(enable)) + + def start_managing(self, mode): + if mode == IOMangementType.READ or mode == IOMangementType.READ_AND_WRITE: + self._cache = _Cache() + self._enable_caching(True) + if mode == IOMangementType.WRITE or mode == IOMangementType.READ_AND_WRITE: + self._buffer = _Buffer() + + def end_managing(self): + if self._cache is not None: + self._enable_caching(False) + if self._buffer is not None: + self._buffer.flush() + self._reset() + + @property + def cache(self): + """Get the active cache.""" + return self._cache + + @property + def buffer(self): + """Get the active buffer.""" + return self._buffer + + @property + def is_blocking(self): + """Check if the io manager is currently blocking caching and buffering operations.""" + return ( + self.cache is not None + and self.cache.is_blocking + or self.buffer is not None + and self.buffer.is_blocking + ) + + def add_notification_for_server(self, notification): + self._server_notifications.add(notification) + + def get_notifications_for_server(self, pop=False): + if not pop: + return self._server_notifications + server_notifications = self._server_notifications + self._server_notifications = set() + return server_notifications + + @property + def is_enabled(self): + return (self.buffer or self.cache) is not None + + @property + def active_request_edb_obj_msg_mgr(self): + return self._active_request_edb_obj_msg_mgr + + @contextmanager + def manage_io(self): + try: + yield + finally: + self.active_request_edb_obj_msg_mgr.reset() + + +MOD.io_manager = _IOManager() + + +@contextmanager +def enable_io_manager(io_type=IOMangementType.READ_AND_WRITE): + """Enable caching of data from the server for code called within the context manager and improve performance of \ + read-only operations. + + .. note:: + This is intended for use with read-only operations. If modifications are made to the EDB in this code block, \ + the changes will not be reflected when querying the server until after the context manager is exited. + """ + try: + MOD.io_manager.start_managing(io_type) + yield + finally: + MOD.io_manager.end_managing() + + +def get_io_manager(): + """Get the active IO manager.""" + return MOD.io_manager + + +def get_cache(): + """Get the active cache.""" + return MOD.io_manager.cache + + +def get_buffer(): + """Get the active buffer.""" + return MOD.io_manager.buffer + + +def start_managing(io_type): + """Begin managing IO operations of the specified type. + + Parameters + ---------- + io_type : IOMangementMode + + """ + MOD.io_manager.start_managing(io_type) + + +def end_managing(): + """End management of IO operations.""" + MOD.io_manager.end_managing() From 0b21e6c5429cf2b469c28a43ce2e2eeb976b543f Mon Sep 17 00:00:00 2001 From: dmiller Date: Tue, 11 Feb 2025 15:17:26 -0700 Subject: [PATCH 2/2] FEATURE: Fixed streaming API hijacking and added example scratch file --- src/ansys/edb/core/inner/interceptors.py | 19 ++-- tests/e2e/scratch/io_performance_scratch.py | 120 ++++++++++++++++++++ 2 files changed, 131 insertions(+), 8 deletions(-) create mode 100644 tests/e2e/scratch/io_performance_scratch.py diff --git a/src/ansys/edb/core/inner/interceptors.py b/src/ansys/edb/core/inner/interceptors.py index 205b34f509..b003717eca 100644 --- a/src/ansys/edb/core/inner/interceptors.py +++ b/src/ansys/edb/core/inner/interceptors.py @@ -160,19 +160,14 @@ def _attempt_hijack(*args): hijacked_response = cache.hijack_request(*args) return hijacked_response - def _hijack(self, service_name, rpc_name, request): - hijacked_result = self._attempt_hijack(service_name, rpc_name, request) - if hijacked_result is not None: - self._hijacked = True - return hijacked_result - - def _continue_unary_unary(self, continuation, client_call_details, request): + def _hijack(self, client_call_details, request): io_manager = get_io_manager() if io_manager.is_enabled and not io_manager.is_blocking: with io_manager.manage_io(): method_tokens = client_call_details.method.strip("/").split("/") cache_key_details = method_tokens[0], method_tokens[1], request - if (hijacked_result := self._hijack(*cache_key_details)) is not None: + if (hijacked_result := self._attempt_hijack(*cache_key_details)) is not None: + self._hijacked = True return hijacked_result if io_manager.cache is not None and can_cache( cache_key_details[0], cache_key_details[1] @@ -180,6 +175,10 @@ def _continue_unary_unary(self, continuation, client_call_details, request): self._current_cache_key_details = cache_key_details if self._should_log_traffic(): self._current_rpc_method = client_call_details.method + + def _continue_unary_unary(self, continuation, client_call_details, request): + if (hijacked_result := self._hijack(client_call_details, request)) is not None: + return hijacked_result return super()._continue_unary_unary( continuation, self._get_client_call_details_with_caching_options(client_call_details), @@ -196,6 +195,8 @@ def _post_process(self, response): def intercept_unary_stream(self, continuation, client_call_details, request): """Intercept a gRPC streaming call.""" + if (hijacked_result := self._hijack(client_call_details, request)) is not None: + return hijacked_result return super().intercept_unary_stream( continuation, self._get_client_call_details_with_caching_options(client_call_details), @@ -204,6 +205,8 @@ def intercept_unary_stream(self, continuation, client_call_details, request): def intercept_stream_stream(self, continuation, client_call_details, request_iterator): """Intercept a gRPC streaming call.""" + if (hijacked_result := self._hijack(client_call_details, request_iterator)) is not None: + return hijacked_result return super().intercept_stream_stream( continuation, self._get_client_call_details_with_caching_options(client_call_details), diff --git a/tests/e2e/scratch/io_performance_scratch.py b/tests/e2e/scratch/io_performance_scratch.py new file mode 100644 index 0000000000..7912a1c9cf --- /dev/null +++ b/tests/e2e/scratch/io_performance_scratch.py @@ -0,0 +1,120 @@ +from time import time + +import settings + +from ansys.edb.core.database import Database +from ansys.edb.core.layer.layer import LayerType +from ansys.edb.core.layer.stackup_layer import StackupLayer +from ansys.edb.core.layout.cell import Cell, CellType +from ansys.edb.core.net.net import Net +from ansys.edb.core.primitive.primitive import Rectangle, RectangleRepresentationType +from ansys.edb.core.session import session +from ansys.edb.core.utility.io_manager import IOMangementType, enable_io_manager + +db_name = "io_performance_test.aedb" +lyr_name = "signal_1" +net_name = "net_1" +db = None +lyt = None + + +def query_prims(): + prims = lyt.primitives + for prim in prims: + prim.get_hfss_prop + prim.polygon_data + prim.net + prim.layer + prim.is_void + prim.layout + return len(prims) + + +def create_prims(): + num_prims = 10000 + for i in range(num_prims): + rect = Rectangle.create( + lyt, + lyr_name, + net_name, + RectangleRepresentationType.CENTER_WIDTH_HEIGHT, + 0, + 0, + 1e-3, + 1e-3, + 0.0, + 0.0, + ) + rect.set_hfss_prop("copper", True) + return num_prims + + +def read_test(): + read_test_start = time() + with enable_io_manager(IOMangementType.READ): + num_read_test_queried_prims = query_prims() + read_test_end = time() + print( + f"read_test time: {read_test_end - read_test_start} seconds (queried {num_read_test_queried_prims} primitives)" + ) + return num_read_test_queried_prims + + +def write_test(): + write_test_start = time() + with enable_io_manager(IOMangementType.WRITE): + num_write_test_created_prims = create_prims() + write_test_end = time() + print( + f"write_test time: {write_test_end - write_test_start} seconds " + f"(created {num_write_test_created_prims} primitives)" + ) + return num_write_test_created_prims + + +def read_and_write_test(): + read_write_test_start = time() + with enable_io_manager(IOMangementType.READ_AND_WRITE): + num_read_write_test_created_prims = create_prims() + num_read_write_test_queried_prims = query_prims() + read_write_test_end = time() + print( + f"read_and_write_test time: {read_write_test_end - read_write_test_start} seconds " + f"(created {num_read_write_test_created_prims} primitives, queried {num_read_write_test_queried_prims} " + f"primitives)" + ) + return num_read_write_test_created_prims, num_read_write_test_queried_prims + + +def setup(): + global db, lyt + + db = Database.create(db_name) + cell = Cell.create(db, CellType.CIRCUIT_CELL, "EMDesign1") + lyt = cell.layout + lyt.layer_collection.add_layers( + [StackupLayer.create(lyr_name, LayerType.SIGNAL_LAYER, 1e-3, 0, "copper")] + ) + Net.create(lyt, net_name) + + +def teardown(): + db.close() + Database.delete(db_name) + + +if __name__ == "__main__": + with session(settings.server_exe_dir(), 50051): + setup() + start = time() + num_created_prims = write_test() + num_queried_prims = read_test() + prim_io_op_counts = read_and_write_test() + end = time() + total_created_prims = num_created_prims + prim_io_op_counts[0] + total_queried_prims = num_queried_prims + prim_io_op_counts[1] + print( + f"total time: {end - start} seconds (created {total_queried_prims} primitives, " + f"queried {total_created_prims} primitives)" + ) + teardown()