Skip to main content

A Python wrapper for Ansys platform instancemanagement

Project description

PyPIM exposes a pythonic interface to communicate with the Product Instance Management API.

What is the Product Instance Management API?

The Product Instance Management API is a gRPC API enabling library and application developers to start a product in a remote environment and communicate with its API.

It is intended to be as simple as possible to be adaptable in a variety of network and software infrastructure. Using this API does not require any knowledge on this infrastructure, we want users to only know which product to start, and which API the product exposes. The API itself exposes very little feature and assumes that all the configuration is set on a server.

It is not intended to manage stateless services, to be a job management system, or a fully featured service orchestration API, but rather to to expose a minimum feature set of such API for service oriented applications.

Getting Started

To use PyPIM, you need to have access to an exposition of the “Product Instance Management” 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.

Starting MAPDL and communicating with it:

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")
    instance.wait_for_ready()
    channel = instance.build_grpc_channel(options=[("grpc.max_receive_message_length", 8*1024**2)])
    mapdl = Mapdl(channel=channel)
    mapdl.prep7()
    ...
    instance.delete()

Developer Guide

The general guidance appears in the Contributing topic in the PyAnsys Developer’s Guide.

Cloning the PyPIM Repository

git clone https://github.com/pyansys/pypim.git
cd pypim/

Running the tests

The test automation relies on tox.

They are entirely based on mocks and do not require any external software. Run the tests with:

tox -e py38

Where py38 matches your python version.

Building the documentation

tox -e doc

Building the package

The package is built using flit.

You can build the PyPIM package with:

flit build

You can also directly install PyPIM in your current environment with:

flit install

Release Process

Releasing a new version is driven by git tags, created from the Github release page.

  1. Create the release branch, named release/v<version>, where version does not include the patch part. Eg. release/v0.5, release/v1.2

  2. In the release/v<version> branch, remove the .dev0 suffix in pyproject.toml and tests/test_metadata.py

  3. Create a new release with a new tag named v<full_version>, including the patch part, based on the latest commit of the release/v<version> branch. Eg. v0.5.0, v1.2.0.

  4. In the main branch, increase the version, keeping the .dev0 suffix.

Patch versions are created from their release branch, by cherry-picking commits.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ansys-platform-instancemanagement-0.1.0.tar.gz (23.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file ansys-platform-instancemanagement-0.1.0.tar.gz.

File metadata

File hashes

Hashes for ansys-platform-instancemanagement-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5c0d1ba73e468d61d05f807f1c3aab8360327a879aa0c795cf265fd3d3f52d9f
MD5 d0287d3c514e00692fa531628c5ae58d
BLAKE2b-256 43add3e49bda5a3bd5b9596e361aa5d153054e3c79247292e86a4266a99ea3a8

See more details on using hashes here.

File details

Details for the file ansys_platform_instancemanagement-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ansys_platform_instancemanagement-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 73cd5535d79867bf8325bb3edaddb2a386373224bdca5f1b354c8fb1c1e8ab2a
MD5 1f879c41a11f30e871fb7903ec4986af
BLAKE2b-256 9f195ccc5688fe76d1f5968a664f2a3bc8abe79d565c0e93ac3add59f41d53b2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page