Skip to main content

Python interface to Ansys Dynamic Reporting

Project description

PyAnsys Python PyPI GH-CI codecov MIT Black

Overview

PyDynamicReporting is the Python client library for Ansys Dynamic Reporting, previously documented as Nexus. Ansys Dynamic Reporting is a service for pushing items of many types, including images, text, 3D scenes, and tables, into a database, where you can keep them organized and create dynamic reports from them. When you use PyDynamicReporting to connect to an instance of Ansys Dynamic Reporting, you have a Pythonic way of accessing all capabilities of Ansys Dynamic Reporting.

Documentation and issues

Documentation for the latest stable release of PyDynamicReporting is hosted at PyDynamicReporting documentation.

In the upper right corner of the documentation’s title bar, there is an option for switching from viewing the documentation for the latest stable release to viewing the documentation for the development version or previously released versions.

You can also view or download the PyDynamicReporting cheat sheet. This one-page reference provides syntax rules and commands for using PyDynamicReporting.

On the PyDynamicReporting Issues page, you can create issues to report bugs and request new features. On the Discussions page on the Ansys Developer portal, you can post questions, share ideas, and get community feedback.

To reach the project support team, email pyansys.core@ansys.com.

Installation

The pydynamicreporting package supports Python 3.10 through 3.12 on Windows and Linux. It is currently available on the PyPi repository.

To install the package, simply run

pip install ansys-dynamicreporting-core

Developer installation

To clone and install the pydynamicreporting package in development mode, run this code:

git clone https://github.com/ansys/pydynamicreporting
cd pydynamicreporting
pip install virtualenv
virtualenv venv  # create virtual environment
source venv/bin/activate  # (.\venv\Scripts\activate for Windows shell)
make install-dev  # install pydynamicreporting in editable mode

The preceding code creates an “editable” installation that lets you develop and test PyDynamicReporting at the same time.

To build and create a production-like installation on Windows (not required on other OSes), first install chocolatey. Then:

choco install make  # install make on Windows
make clean  # clean
make build   # build
# this replaces the editable installation done previously. If you don't want to replace,
# switch your virtual environments to test the new install separately.
make install
# you can skip the steps above and just do 'make all'
make smoketest  # test import

Local GitHub Actions

To run GitHub Actions on your local desktop (recommended), install the act package.

choco install act-cli

To run a job, such as the style job from the ci_cd.yml file, use this command, where style is the job name:

act -W '.github/workflows/ci_cd.yml' -j style --bind

Deploy and upload steps must always be ignored. If they are not ignored, before running GitHub Actions locally, add if: ${{ !env.ACT }} to the workflow step and commit this change if required.

Local tests

To run tests on your local desktop (recommended), use the make target test-dev. This target runs the tests in the same way as GitHub Actions but using a local Ansys installation instead of Docker. You must specify the path to your Ansys installation and the test file you are trying to run.

make test-dev TEST_FILE="tests/test_service.py" INSTALL_PATH="C:\Program Files\ANSYS Inc\v252"

Note that any tests that require Docker will obviously fail.

Creating a Release

  • Before creating a new branch, make sure your local repository is up to date:

    git pull

    This ensures you have the latest changes from the default branch (usually main or develop).

  • Create a new branch for the release:

    git checkout -b release/0.10

    Important: The release branch must only include the major and minor version numbers. Do not include the patch version. For example, use release/0.10, not release/0.10.0.

  • If creating a patch release, do not create a new branch. Instead, reuse the existing release/0.10 branch.

  • Update the version number in pyproject.toml:

    If the current version is:

    version = "0.10.0.dev0"

    bump it to:

    version = "0.10.0"
  • Important: Every time you create a development (dev) release, you should first release the corresponding stable version on PyPI before bumping the development version.

    For example:

    • If you are at 0.10.0.dev0, first release 0.10.0 on PyPI.

    • Then, after the release, bump the version to 0.10.1.dev0.

    Otherwise, it may feel confusing to have a dev version without a corresponding stable release.

  • Create a commit for the version bump:

    git commit -am "MAINT: Bump version to v0.10.0"
  • Then push the branch:

    git push --set-upstream origin release/0.10
  • Create a tag for the release:

    git tag v0.10.0
    git push origin v0.10.0

    Important: The release tag must always include the full major.minor.patch version number. Always include the v prefix. For example, use v0.10.0, not v0.10. Creating and pushing the tag automatically triggers the release workflow in GitHub Actions.

Dependencies

To use PyDynamicReporting, you must have a locally installed and licensed copy of Ansys 2023 R2 or later.

To use PyDynamicReporting Serverless (ansys.dynamicreporting.core.serverless), you must have a locally installed and licensed copy of Ansys 2025 R1 or later.

Basic usage

This code shows how to start the simplest PyDynamicReporting session:

>>> import ansys.dynamicreporting.core as adr
>>> adr_service = adr.Service(ansys_installation=r"C:\Program Files\ANSYS Inc\v232")
>>> ret = adr_service.connect()
>>> my_img = adr_service.create_item()
>>> my_img.item_image = "image.png"
>>> adr_service.visualize_report()

License and acknowledgements

PyDynamicReporting is licensed under the MIT license.

PyDynamicReporting makes no commercial claim over Ansys whatsoever. This library extends the functionality of Ansys Dynamic Reporting by adding a Python interface to Ansys Dynamic Reporting without changing the core behavior or license of the original software. The use of PyDynamicReporting requires a legally licensed copy of an Ansys product that supports Ansys Dynamic Reporting.

To get a copy of Ansys, visit the Ansys website.

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_dynamicreporting_core-0.10.3.tar.gz (163.5 kB view details)

Uploaded Source

Built Distribution

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

ansys_dynamicreporting_core-0.10.3-py3-none-any.whl (156.4 kB view details)

Uploaded Python 3

File details

Details for the file ansys_dynamicreporting_core-0.10.3.tar.gz.

File metadata

File hashes

Hashes for ansys_dynamicreporting_core-0.10.3.tar.gz
Algorithm Hash digest
SHA256 be0977b3daeee064392015a5a0578697ffa2198200bead41eb0bbb07c07938d8
MD5 f72052bd2509b1e1de01d385c4238e1d
BLAKE2b-256 1cb7ad57e7322a198de6097bebcf5a45cdb340fe0189250e3708108a2e82054d

See more details on using hashes here.

Provenance

The following attestation bundles were made for ansys_dynamicreporting_core-0.10.3.tar.gz:

Publisher: ci_cd.yml on ansys/pydynamicreporting

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ansys_dynamicreporting_core-0.10.3-py3-none-any.whl.

File metadata

File hashes

Hashes for ansys_dynamicreporting_core-0.10.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f019c0d353147f2caadafcfdf770d42d0880082aee8661ffd30a0369366cbfb5
MD5 2eab304af92fb78128cfbf96b07ab4aa
BLAKE2b-256 c44c182ee77b799f814dd1202f10c2cf25794aab28db3429c0a756d2b357361b

See more details on using hashes here.

Provenance

The following attestation bundles were made for ansys_dynamicreporting_core-0.10.3-py3-none-any.whl:

Publisher: ci_cd.yml on ansys/pydynamicreporting

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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