A Python wrapper for Ansys platform instancemanagement
Project description
PyPIM exposes a Pythonic interface to communicate with the Product Instance Management (PIM) API.
What is the PIM API?
The PIM API is a gRPC API enabling library and application developers to start a product in a remote environment and communicate with its API.
The PIM API is intended to be as simple as possible to be adaptable in a variety of network and software infrastructures. Using this API does not require any knowledge of its infrastructure. You need only know which product to start and which API the product exposes. The PIM API itself exposes very few features and assumes that all the configuration is set on a server.
The PIM API is not intended to manage stateless services, to be a job management system, or a fully featured service orchestration API. Its purpose is to expose a minimum feature set for managing service-oriented applications.
Getting Started
To use PyPIM, you must have access to the PIM API.
PyPIM itself is pure Python and relies on gRPC.
Installation
The ansys-platform-instancemanagement package is tested for Python 3.7 through Python 3.10 on Windows and Linux.
pip install ansys-platform-instancemanagement
Usage
PyPIM is a single module called ansys.platform.instancemanagement, shortened to pypim.
To start MAPDL and communicate with PyPIM:
import ansys.platform.instancemanagement as pypim
from ansys.mapdl.core import Mapdl
if pypim.is_configured():
with pypim.connect() as pim:
with pim.create_instance(product_name="mapdl", product_version="221") as instance:
instance.wait_for_ready()
channel = instance.build_grpc_channel(options=[("grpc.max_receive_message_length", 8*1024**2)])
mapdl = Mapdl(channel=channel)
mapdl.prep7()
...
You can also use PyPIM without the with statement:
import ansys.platform.instancemanagement as pypim
from ansys.mapdl.core import Mapdl
if pypim.is_configured():
pim = pypim.connect()
instance = pim.create_instance(product_name="mapdl", product_version="221")
mapdl = Mapdl(channel=channel)
mapdl.prep7()
...
instance.delete()
pim.close()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for ansys-platform-instancemanagement-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | eaac1585549138f17d359494d492c857cf8f73ad4be9ff273c2e391e5ab3327d |
|
MD5 | 31b0a6d49ccf06a0ea15f7a928782424 |
|
BLAKE2b-256 | 9ec86f728b5b7ee16714bb5154112741562973b797bd25adfdf537273ccedf2d |
Hashes for ansys_platform_instancemanagement-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad9cd61bac923b81bdc04fc25469a696ec70ea0f01e1ebc452289ee771cd9054 |
|
MD5 | 614e078173a0f1548457a3ad3721ff72 |
|
BLAKE2b-256 | a036edea21e6d7e9fafb2f059c676d7401e7dc0a901d42c59954dbea7d662a71 |