Skip to main content

Python interface to Ansys Dynamic Reporting

Project description

PyAnsys Python PyPI GH-CI Security Status MIT Black

Overview

The pydynamicreporting repository contains 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

For comprehensive information on PyDynamicReporting, see the latest release documentation.

On the PyDynamicReporting Issues page, you can create issues to submit questions, report bugs, and request new features. This is the best place to post questions and code.

Installation

The pydynamicreporting package supports Python 3.7 through 3.11 on Windows and Linux. It is currently available only on the Ansys private repository at PyAnsysPyPI.

Installing from this private repository requires a PAT (private access token). For information on obtaining a PAT, see Release and publishing in the PyAnsys Developer’s Guide.

To install the package from the Ansys private repository, run this code, where <PAT> is the obtained token:

pip install --pre ansys-dynamicreporting-core --index-url=https://<PAT>@pkgs.dev.azure.com/pyansys/_packaging/pyansys/pypi/simple/

Once the pydynamicreporting package is publicly available on GitHub, two modes of installation are available:

  • Developer installation

  • User installation

The code provided for both installation modes use a virtual environment.

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.

User installation

To build and create a production-like installation for use, run this code:

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

Pre-commit setup

pre-commit is a framework for managing and maintaining multi-language pre-commit hooks.

To install the pre-commit package into your Git hooks, run this command:

pre-commit install

pre-commit now runs on every commit.

Each time you clone a project, installing the pre-commit package should always be the first thing that you do.

If you want to manually run all pre-commit hooks on a repository, run this command:

pre-commit run --all-files

The preceding command runs a bunch of formatters on your source files.

To run an individual hook, obtain the hook ID from the project’s .pre-commit-config.yaml file and then run this code, where <hook_id> is the obtained ID:

pre-commit run <hook_id>

The first time pre-commit runs on a file, it automatically downloads, installs, and runs the hook.

Local GitHub Actions

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

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

act -j docs

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.

Dependencies

To use PyDynamicReporting, you must have a locally installed and licensed copy of Ansys 2023 R2 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 Reproting 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.4.0.tar.gz (7.1 MB 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.4.0-py3-none-any.whl (94.5 kB view details)

Uploaded Python 3

File details

Details for the file ansys-dynamicreporting-core-0.4.0.tar.gz.

File metadata

File hashes

Hashes for ansys-dynamicreporting-core-0.4.0.tar.gz
Algorithm Hash digest
SHA256 e58aad80fd425bc97b39cd54960db63ea99aed51f930b8d4b0b63d852920e47e
MD5 77034f84ae5090c4aed0f3d092897c77
BLAKE2b-256 365ffc360be8ce4f4a062790ecb9cf847020b39bfe88c3b5fae0fee6040432e6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ansys_dynamicreporting_core-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 78030831f6e91df28774378a087adad6a8e27016d94507bc01bf9557e71b729e
MD5 84a69914a1e0e5120183ba2465717a1c
BLAKE2b-256 7922280f26b572816706fcc4ff7c9c5bae59ce64da30be916fd4fa7fb5b9a9a5

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