InProcessServer#
- class ansys.dpf.core.server_types.InProcessServer(ansys_path: str | None = None, as_global: bool = True, load_operators: bool = True, timeout: None = None, context: ansys.dpf.core.server_context.AvailableServerContexts = server_context.SERVER_CONTEXT)#
Bases:
CServerServer using the InProcess communication protocol.
Overview#
Must be implemented by subclasses. |
|
Return api for type. |
|
Set the current server as global if necessary. |
|
Check if server has a connected client. |
|
Clear the available Operators and Releases licenses when necessary. |
|
Define the settings that will be used to load DPF’s plugins. |
|
Check if the server version matches with a required version. |
|
Check if the server version matches with a required version. |
Get the version of the InProcess server. |
|
Get the operating system of the InProcess server. |
|
Get the client for the InProcess server. |
|
Get whether the InProcess server is running locally. |
|
Get the server configuration for the InProcess server. |
|
Return available api type, always c_api. |
|
Return the list of plugins loaded on the server. |
|
Server information. |
|
Plan event callbacks from the server, such as progress bars during workflow execution and logging. |
|
Whether the DPF server should be started in a Docker Container by default. |
|
Return the docker config associated with the server. |
|
Returns the settings used to load DPF’s plugins. |
Import detail#
from ansys.dpf.core.server_types import InProcessServer
Property detail#
- property InProcessServer.version#
Get the version of the InProcess server.
- Returns:
version – The version of the InProcess server in the format “major.minor.micro[modifier]” for servers using calendar versioning (major >= 2027), or “major.minor” for older servers.
- Return type:
str
- property InProcessServer.os#
Get the operating system of the InProcess server.
- Returns:
os – The operating system name. For InProcess servers, it typically returns the current OS, e.g., “posix” or “nt”.
- Return type:
str
- property InProcessServer.client#
Get the client for the InProcess server.
- Returns:
client – InProcess servers do not have a client, so this property returns None.
- Return type:
None
- property InProcessServer.local_server#
Get whether the InProcess server is running locally.
- Returns:
local_server – True, as the InProcess server is always local.
- Return type:
bool
- property InProcessServer.config#
Get the server configuration for the InProcess server.
- Returns:
config – The server configuration for the InProcess server from the AvailableServerConfigs.
- Return type:
- property InProcessServer.available_api_types#
Return available api type, always c_api.
- property InProcessServer.plugins: dict#
Return the list of plugins loaded on the server.
- property InProcessServer.info#
Server information.
- Returns:
info – Dictionary with server information, including
"server_ip","server_port","server_process_id","server_version","os"and"path"keys.- Return type:
dictionary
- property InProcessServer.session#
Plan event callbacks from the server, such as progress bars during workflow execution and logging.
- Return type:
- property InProcessServer.on_docker#
Whether the DPF server should be started in a Docker Container by default.
- property InProcessServer.docker_config#
Return the docker config associated with the server.
- property InProcessServer.context#
Returns the settings used to load DPF’s plugins.
To update the context server side, use
ansys.dpf.core.BaseServer.server_types.apply_context()- Return type:
Attribute detail#
- InProcessServer.__hash__ = None#
- InProcessServer.ansys_path = None#
- InProcessServer.__slots__ = ()#
Method detail#
- InProcessServer.shutdown()#
Must be implemented by subclasses.
- InProcessServer.__eq__(other_server)#
Return true, if the ip and the port are equals.
- InProcessServer.get_api_for_type(capi, grpcapi)#
Return api for type.
- InProcessServer.__del__()#
Clean up resources associated with the instance.
- Raises:
Warning – If an exception occurs while attempting to delete resources.
- InProcessServer.set_as_global(as_global=True)#
Set the current server as global if necessary.
- Parameters:
as_global (bool, optional) – Global variable that stores the IP address and port for the DPF module. All DPF objects created in this Python session will use this IP and port. The default is
True.
- InProcessServer.has_client()#
Check if server has a connected client.
- InProcessServer.release()#
Clear the available Operators and Releases licenses when necessary.
Notes
Available with server’s version starting at 6.0 (Ansys 2023R2).
- InProcessServer.apply_context(context)#
Define the settings that will be used to load DPF’s plugins.
A DPF xml file can be used to list the plugins and set up variables.
- Parameters:
context (ServerContext) – The context allows to choose which capabilities are available server side.
Notes
Available with server’s version starting at 6.0 (Ansys 2023R2).
- InProcessServer.check_version(required_version, msg=None)#
Check if the server version matches with a required version.
- Parameters:
required_version (str) – Required version to compare with the server version.
msg (str, optional) – Message for the raised exception if version requirements do not match.
:raises dpf_errors : errors: errors.DpfVersionNotSupported is raised if failure.
- Returns:
Trueif the server version meets the requirement.- Return type:
bool
- InProcessServer.meet_version(required_version)#
Check if the server version matches with a required version.
- Parameters:
required_version (str) – Required version to compare with the server version.
- Returns:
Trueif the server version meets the requirement.- Return type:
bool
- InProcessServer.__str__()#
Return string representation of the instance.
- InProcessServer.__ne__(other_server)#
Return true, if the servers are not equal.