Getting started#
Software requirements#
To use PyGranta JobQueue, you must have access to a Granta MI 2024 R2 deployment.
The ansys.grantami.jobqueue
package currently supports Python version 3.9 through 3.12.
Installation#
To install the latest PyGranta JobQueue release from PyPI, run this command:
pip install ansys-grantami-jobqueue
To install a release compatible with a specific version of Granta MI, install the PyGranta metapackage with a requirement specifier:
pip install pygranta==2024.2.0
To see which individual PyGranta package versions are installed with each version of the PyGranta metapackage, consult the Package versions section of the PyGranta documentation.
Alternatively, to install the latest development version from the PyGranta JobQueue repository, run this command:
pip install git+https://github.com/ansys/grantami-jobqueue.git
To install a local development version with Git and Poetry, run these commands:
git clone https://github.com/ansys/grantami-jobqueue
cd grantami-jobqueue
poetry install
The preceding commands install the package in development mode so that you can modify it locally. Your changes are reflected in your Python setup after restarting the Python kernel.
Verify your installation#
To verify that you can start the PyGranta JobQueue client from Python, run this code:
>>> from ansys.grantami.jobqueue import Connection
>>> client = Connection("http://my.server.name/mi_servicelayer").with_autologon().connect()
>>> print(client)
<JobQueueApiClient url: http://my.server.name/mi_servicelayer>
This example uses Windows-based autologon authentication. For all supported authentication schemes, see the OpenAPI-Common documentation.
If you see a response from the server, you have successfully installed PyGranta JobQueue and can start using the JobQueue client. For more examples, see Examples. For comprehensive information on the API, see API reference.
If you are migrating from the Granta MI Scripting Toolkit AsyncJobs submodule, see User guide.