-
Notifications
You must be signed in to change notification settings - Fork 14
updates to release/0.8 #1188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
updates to release/0.8 #1188
Changes from all commits
f61655a
739fbd1
413bddc
43777c7
6abaab4
7608d4c
4ce4981
2a70d85
6c40a2f
bc44c89
6e77d3a
36c5266
4a9fd54
3d5cf9a
8fb00e5
558841a
6bbc2ca
c40d694
0979d80
c2717b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| updates to release/0.8 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ automesh | |
| Boolean | ||
| BRep | ||
| CAD | ||
| client_certs_dir | ||
| conformally | ||
| [Dd]efeature | ||
| defeaturing | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,7 +1,6 @@ | ||||||||||||||
| # Copyright (C) 2024 - 2025 ANSYS, Inc. and/or its affiliates. | ||||||||||||||
| # SPDX-License-Identifier: MIT | ||||||||||||||
| # | ||||||||||||||
| # | ||||||||||||||
| # Permission is hereby granted, free of charge, to any person obtaining a copy | ||||||||||||||
| # of this software and associated documentation files (the "Software"), to deal | ||||||||||||||
| # in the Software without restriction, including without limitation the rights | ||||||||||||||
|
|
@@ -24,6 +23,7 @@ | |||||||||||||
|
|
||||||||||||||
| import logging | ||||||||||||||
| import os | ||||||||||||||
| from typing import Optional | ||||||||||||||
|
|
||||||||||||||
| import ansys.meshing.prime.examples as examples | ||||||||||||||
| import ansys.meshing.prime.internals.config as config | ||||||||||||||
|
|
@@ -50,7 +50,8 @@ class Client(object): | |||||||||||||
| Maximum time to wait for connection. The default is ``defaults.connection_timeout()``. | ||||||||||||||
| credentials : Any, optional | ||||||||||||||
| Credentials to connect to the server. The default is ``None``. | ||||||||||||||
|
|
||||||||||||||
| client_certs_dir : Optional[str] | ||||||||||||||
| Directory containing client certificates for mutual TLS. | ||||||||||||||
| Raises | ||||||||||||||
| ------ | ||||||||||||||
| ValueError | ||||||||||||||
|
|
@@ -65,40 +66,88 @@ def __init__( | |||||||||||||
| port: int = defaults.port(), | ||||||||||||||
| timeout: float = defaults.connection_timeout(), | ||||||||||||||
| credentials=None, | ||||||||||||||
| connection_type: config.ConnectionType = config.ConnectionType.GRPC_SECURE, | ||||||||||||||
| uds_file: Optional[str] = None, | ||||||||||||||
| client_certs_dir: Optional[str] = None, | ||||||||||||||
| **kwargs, | ||||||||||||||
| ): | ||||||||||||||
| """Initialize the client.""" | ||||||||||||||
| self._default_model: Model = None | ||||||||||||||
| local = kwargs.get('local', False) | ||||||||||||||
| if local and server_process is not None: | ||||||||||||||
| raise ValueError('Local client cannot be instantiated with a server process') | ||||||||||||||
|
|
||||||||||||||
| if connection_type == config.ConnectionType.GRPC_INSECURE: | ||||||||||||||
| print("Warning (Client): Modification of these configurations is not recommended.") | ||||||||||||||
| print( | ||||||||||||||
| "Please see the documentation for your installed product for additional information" | ||||||||||||||
| ) | ||||||||||||||
|
|
||||||||||||||
| self._local = local | ||||||||||||||
| self._process = server_process | ||||||||||||||
| self._comm = None | ||||||||||||||
| if not local: | ||||||||||||||
| try: | ||||||||||||||
| from ansys.meshing.prime.internals.grpc_communicator import ( | ||||||||||||||
| GRPCCommunicator, | ||||||||||||||
| ) | ||||||||||||||
| if ( | ||||||||||||||
| connection_type == config.ConnectionType.GRPC_SECURE | ||||||||||||||
| or connection_type == config.ConnectionType.GRPC_INSECURE | ||||||||||||||
| ): | ||||||||||||||
| try: | ||||||||||||||
| from ansys.meshing.prime.internals.grpc_communicator import ( | ||||||||||||||
| GRPCCommunicator, | ||||||||||||||
| ) | ||||||||||||||
|
|
||||||||||||||
| channel = kwargs.get('channel', None) | ||||||||||||||
| if channel is not None: | ||||||||||||||
| self._comm = GRPCCommunicator(channel=channel, timeout=timeout) | ||||||||||||||
| else: | ||||||||||||||
| self._comm = GRPCCommunicator( | ||||||||||||||
| ip=ip, port=port, timeout=timeout, credentials=credentials | ||||||||||||||
| channel = kwargs.get('channel', None) | ||||||||||||||
|
|
||||||||||||||
| if channel is not None: | ||||||||||||||
| self._comm = GRPCCommunicator(channel=channel, timeout=timeout) | ||||||||||||||
| else: | ||||||||||||||
| if ( | ||||||||||||||
| os.name == 'nt' | ||||||||||||||
| or connection_type == config.ConnectionType.GRPC_INSECURE | ||||||||||||||
| ): | ||||||||||||||
| if ( | ||||||||||||||
| connection_type == config.ConnectionType.GRPC_INSECURE | ||||||||||||||
| and client_certs_dir is not None | ||||||||||||||
| ): | ||||||||||||||
| print( | ||||||||||||||
| "Warning: Ignoring client certificate \ | ||||||||||||||
| directory for insecure connections" | ||||||||||||||
|
Comment on lines
+113
to
+114
|
||||||||||||||
| "Warning: Ignoring client certificate \ | |
| directory for insecure connections" | |
| ( | |
| "Warning: Ignoring client certificate " | |
| "directory for insecure connections" | |
| ) |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -23,6 +23,7 @@ | |||||||||
| """Configuration utility for PyPrimeMesh.""" | ||||||||||
|
|
||||||||||
| from contextlib import contextmanager | ||||||||||
| from enum import Enum | ||||||||||
|
|
||||||||||
| __all__ = [ | ||||||||||
| 'enable_optimizing_numpy_arrays', | ||||||||||
|
|
@@ -45,6 +46,11 @@ | |||||||||
| from ansys.meshing.prime.internals.logger import PrimeLogger | ||||||||||
|
|
||||||||||
|
|
||||||||||
| class ConnectionType(Enum): | ||||||||||
| GRPC_SECURE = (1,) | ||||||||||
| GRPC_INSECURE = (2,) | ||||||||||
|
Comment on lines
+50
to
+51
|
||||||||||
| GRPC_SECURE = (1,) | |
| GRPC_INSECURE = (2,) | |
| GRPC_SECURE = 1 | |
| GRPC_INSECURE = 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grammatical error: 'path of input the files' should be 'path of the input files' or 'path to the input files'.