Giter VIP home page Giter VIP logo

pyansys's Introduction

PyAnsys metapackage

PyAnsys Python PyPI PyPI Downloads GH-CI MIT Black pre-commit.ci status

Welcome to the PyAnsys metapackage repository. The pyansys metapackage provides a single package of collected PyAnsys packages that ensures compatibility of these packages amongst themselves and the Ansys product release that they are linked to.

PyAnsys

The pyansys metapackage ensures compatibility between these PyAnsys packages:

  • PyACP: Pythonic interface to Ansys Composite PrepPost (ACP).
  • PyAdditive: Pythonic interface to the Ansys Additive service.
  • PyAEDT: Pythonic interface to Ansys Electronics Desktop (AEDT).
  • PyAnsys Geometry: Pythonic interface to the Ansys Geometry service.
  • PyAnsys Math: Pythonic interface to PyAnsys Math libraries.
  • PyDPF - Core: Pythonic interface to the Data Processing Framework (DPF) for building advanced and customized workflows.
  • PyDPF - Post: Pythonic interface to access and post process Ansys solver result files.
  • PyDPF - Composites: Pythonic interface to postprocess layered and short-fiber composite models.
  • PyDyna: Pythonic interface to build the Ansys DYNA input deck, submit it to the Ansys LS-DYNA solver, and postprocess its results.
  • PyDynamicReporting: Pythonic interface to Ansys Dynamic Reporting for service and control of its database and reports.
  • PyEDB: Pythonic interface to the Ansys Electronics Database (EDB) client library.
  • PyEDB - Core: Pythonic interface to Ansys Electronics Database (EDB).
  • PyEnSight: Pythonic interface to EnSight, the Ansys simulation postprocessor.
  • PyFluent: Pythonic interface to Ansys Fluent.
  • PyFluent - Parametric: Pythonic interface to Ansys Fluent parametric workflows.
  • PyFluent - Visualization: Pythonic interface to visualize Ansys Fluent simulations.
  • PyGranta: Pythonic interface to Ansys Granta MI services.
  • PyHPS: A Python client for Ansys HPC Platform Services (HPS).
  • PyMAPDL: Pythonic interface to Ansys MAPDL (Mechanical APDL).
  • PyMAPDL Reader: Pythonic interface to read legacy MAPDL result files (MAPDL 14.5 and later).
  • PyMechanical: Pythonic interface to Ansys Mechanical.
  • PyModelCenter: Pythonic interface for Ansys ModelCenter
  • PyMotorCAD: Pythonic interface to Ansys Motor-CAD.
  • PyOptislang: Pythonic interface to Ansys optislang.
  • PyPIM: Pythonic interface to communicate with the Ansys PIM (Product Instance Management) API.
  • PyPrimeMesh: Python library to acquire geometries and prepare surface and volume meshes for multiple solvers.
  • PyRocky: Python library to communicate with Ansys Rocky using Rocky PrePost API.
  • PySeascape: Pythonic interface to communicate with Ansys RedHawkSC and TotemSC.
  • PySherlock: Pythonic interface to communicate with Ansys Sherlock.
  • PySimAI: Pythonic interface to use SimAI.
  • PySystemCoupling: Pythonic interface to communicate with Ansys System Coupling.
  • PyTurboGrid: Pythonic interface to Ansys TurboGrid, a high-quality turbomachinery meshing software app.
  • PyTwin: Pythonic interface to communicate with consumption workflows for Ansys digital twins.
  • Shared Components: Shared Ansys software components to enable package interoperability and minimize maintenance.

Other tools delivered as part of the metapackage are:

Much effort is underway to continue expanding and developing packages in the PyAnsys GitHub account. On the Issues page for each package, you can post issues and request new features. You can also feel free to post a question on the Ansys Developer Forums.

By default, the PyAnsys metapackage installs these core modules:

Additionally, the pyansys metapackage contains certain extra targets that can be installed upon request:

Package installation

Two installation modes are provided: user and offline.

User mode installation

Before installing the pyansys metapackage in user mode, ensure that you have the latest version of pip with this command:

python -m pip install -U pip

Then, install the pyansys metapackage with this command:

python -m pip install pyansys

If you are interested in installing an extra target such as fluent-all, you use a command like this:

python -m pip install pyansys[fluent-all]

If you are interested in installing a specific version such as 2023.1.0, you use a command like this:

python -m pip install pyansys==2023.1.0

Offline mode installation

If you lack an internet connection on your installation machine, the recommended way of installing the pyansys metapackage is downloading the wheelhouse archive from the Releases Page for your corresponding machine architecture.

Each wheelhouse archive contains all the Python wheels necessary to install the pyansys metapackage from scratch on Windows, Linux, and MacOS from Python 3.9 to 3.11. You can install this on an isolated system with a fresh Python installation or on a virtual environment.

For example, on Linux with Python 3.9, unzip the wheelhouse archive and install it with the following commands:

unzip pyansys-v2024.2.dev0-wheelhouse-Linux-3.9-core.zip wheelhouse
pip install pyansys -f wheelhouse --no-index --upgrade --ignore-installed

If you're on Windows with Python 3.9, unzip to a wheelhouse directory and then install using the same pip command as in the previous example.

Consider installing using a virtual environment.

Versioning system

The pyansys metapackage follows a semantic-like versioning system, though it has been adapted to the Ansys product release mechanism. Thus, this kind of versioning system is followed:

XXXX.Y.ZZ

Where:

  • XXXX is the Ansys product release year (for example, 2022).
  • Y is the Ansys product release within the same year (for example, 1, which relates to R1).
  • ZZ is a patched version to the pyansys metapackage, if any.

Consequently, the first pyansys metapackage compatible with the 2024 R2 release would be:

2024.2.0

Any subsequent patched version of this package would be:

2024.2.1
2024.2.2
2024.2.3
...

You can request a specific version install when using pip to install your package:

python -m pip install pyansys==2024.2.0

License and acknowledgments

All PyAnsys libraries are licensed under the MIT license.

PyAnsys libraries make no commercial claim over Ansys whatsoever. These libraries extend the functionality of Ansys products by adding Python interfaces to legally obtained software products without changing the core behaviors or licenses of the original software.

For more information on Ansys products, visit the Ansys web site.

pyansys's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyansys's Issues

Consider using pyproject.toml

As noted by @greschd, we can incorporate the use of pyproject.toml and "pin" certain pyansys packages that we know have been tested and are compatible to allow the user to install the the latest pyansys packages for a certain release. Potentially in the following manner (up for discussion):

pip install pyansys==2022R1

We could also install individual packages with:

pip install pyansys[mapdl]

or

pip install pyansys[pymapdl]

Adding PySeascape to the metapackage

As title says.

Now that PySeascape is public, they should be included in the metapackage. The same goes for the GitHub landing page and documentation.

Adding PyDynamicReporting

After public release, PyDynamicReporting has to be added. It also has to be included in the 2023.2.* metapackage

Pinging @margalva for visibility.

Python Install should be 64bit

๐Ÿ“ Description of the feature

The Python install should be a 64bit--> VTK package has no 32bit version for most of the python installs

๐Ÿ’ก Steps for implementing the feature

No response

๐Ÿ”— Useful links and references

No response

Add community examples gallery.

๐Ÿ“ Description of the feature

It would be nice to give support to community users that want to share their examples by having a place for the examples to be uploaded.

๐Ÿ’ก Steps for implementing the feature

  • Set up a way for PyAnsys user to upload examples.
  • Set up a review process to accept/decline examples.
  • Set up a webpage/GH pages/documentation section to present the examples.

๐Ÿ”— Useful links and references

No response

Mechanism for updating doc links on release based on package versions

On dev, our links point to version/stable whenever multi-version is enabled.

We should come up with a simple script that will update those links on release branches. It can be run locally, no big deal. The goal is that the script checks the current versions of the packages and changes the stable subfolder for the major.minor folder associated to its package version.

This might imply moving all links to a single file, so that it is easier to maintain.

Python script should be failry simple:

  1. Use importlib metadata to check the version of the different packages.
  2. Given the version, strip the major.minor value
  3. Parse the links file and whenever there is a link associated to this library (we might need a dictionary where the keys are the libraries and the values, the URL to the main CNAME) modify version/stable by version/major.minor

This will only be applicable to those sites that have multi version enabled

Create metapackage

  • Update our setup.py to become a metapackage. This package is guaranteed to work with a certain release of Ansys, (e.g. 2023R1).
"""Metapackage for pyansys packages."""
import sys
import os
from io import open as io_open

from setuptools import setup

# Get version from version info: execute file from raw string
__version__ = None
this_file = os.path.dirname(__file__)
version_file = os.path.join(this_file, 'pyansys', '_version.py')
with io_open(version_file, mode='r') as fd:
    exec(fd.read())


setup(
    name='pyansys',
    packages=['pyansys'],
    author='Ansys',
    maintainer_email='[email protected]',
    version=__version__,
    description='Pythonic interfaces to Ansys products',
    long_description=open('README.rst').read(),
    long_description_content_type='text/x-rst',
    license='MIT',
    classifiers=[
        'Development Status :: 4 - Beta',
        'Intended Audience :: Science/Research',
        'Topic :: Scientific/Engineering :: Information Analysis',
        'License :: OSI Approved :: MIT License',
        'Operating System :: Microsoft :: Windows',
        'Operating System :: POSIX',
        'Operating System :: MacOS',
        'Programming Language :: Python :: 3.7',
        'Programming Language :: Python :: 3.8',
        'Programming Language :: Python :: 3.9',
        'Programming Language :: Python :: 3.10',
    ],
    url='https://github.com/pyansys',
    keywords='Ansys PyAnsys',
    install_requires=[
        'ansys-mapdl-core==0.62.4',
        'ansys-fluent-core==0.1.4',
        'ansys-dpf-core==0.1.4',
        'pyaedt==0.6.0',
    ],
    extras_require={
        'all': ['ansys-fluent-visualization==0.1.4', 'ansys-mapdl-reader==0.20.0'],
        'fluent': ['ansys-fluent-visualization==0.1.4'],
        'mapdl': ['ansys-mapdl-reader==0.20.0'],
    },
)
  • Setup CI/CD. Validate the packages can all be installed and imported. Test with the pip pyansys[all] case as well as just the pip install pyansys. Create the PR as release/2023R1, when merged, tag as v23.1.<PATCH>.
  • Add wheelhouse for Python 3.7 - Python 3.10 for Windows and Linux

Show licenses when building the wheelhouse

As discussed in the PyAnsys API meeting, we should check that the dependencies included in the PyAnsys projects do not include any copyleft or similar products. Those must be identified and removed as soon as possible.

@PProfizi mentioned that it is possible to have a bot causing the workflow to fail if any of them are present. We should consider implementing it.

ANSYS/PyAnsys version management

From Costas Vogiatzis at Honeywell (Phoenix):
As we are starting to use PyAnsys for Methods work we are trying to determine the best way to support multiple ANSYS versions. For context, most of PyAnsys Methods work so far involves only MAPDL. We are using PyAnsys to read RST/RTH results and to a lesser extent drive MAPDL. Python literacy among ANSYS users is low so we are wrapping PyAnsys functionality in MATLAB code so users can perform these operations from within MATLAB without using Python/PyAnsys directly. These utilities are distributed as part of a larger, general purpose MATLAB library that I maintain.

We typically have users using releases going back up to 3-4 years and we also have archived data that go back even more. Depending on ANSYS version, users would need different PyAnsys module versions and possibly different Python versions. Often times the same user would need to work with multiple ANSYS versions depending on project. Managing dependencies for different ANSYS versions can be done with virtual environments and tools like pyenv for multiple Python versions. However that becomes too complex for a casual ANSYS user: users would need to be guided through Python and module installation and virtual environment use. Also, managing the environments is somewhat fragile because of version conflicts depending on what else the user has installed on that box.

This will be an issue with deployment of PyAnsys based utilities. The concern is that it will be complex for end users to manage and they will not work reliably. We would like to understand how ANSYS envisions multiple versions of ANSYS+PyAnsys would be managed on a single computer in a robust way. Ideally we would like everything relating to PyAnsys to be included in the MAPDL installation so users would not need to manage that.

A related issue is that per the docs the legacy RST reader will be phased out. However DPF does not seem to support older ANSYS versions. That will be an issue if we transition tools to PyAnsys and then find that we cannot use them with some earlier ANSYS result. We would like to understand what tool version can read what MAPDL result file version.

Regards,

Costas Vogiatzis
Aero & Mechanical Sciences
Honeywell Aerospace

pip install pyansys does not work

Description of the modifications

This page mentions that all pyansys packages can be installed thanks to pip install pyansys, but this command does not work:
image
Also the error messages does not return instructions for installation of all pyansys packages (pydpf core and post, pyprime mesh, etc), I don't know if this is wanted.

Useful links and references

No response

Implememt automatic milestone mechanism

๐Ÿ“ Description of the feature

We should be able to notify all the core dependencies (at the very least) that they should prepare to have a milestone ready before Ansys release (e.g. 23R1, 23R2...).

This should be done as a GH Actions workflow using the PyGithub package (allows to automatically interact with GitHub's API from Python)

๐Ÿ’ก Steps for implementing the feature

To be determined

๐Ÿ”— Useful links and references

No response

Better images in PyAnsys landing page

    > I'm also having a hard time understanding what to include in API Reference or Examples for this landing page... the PyAnsys metapackage is not expected to have an API or examples...

Reasonable, though we could probably provide a brief overview of other packages APIs in a smart way... or just do what you did and point out that you should really reference the rest of the pyansys documentation.

@RobPasMue, As a follow-up, let's put better pictures on the landing and reference pages.

Originally posted by @akaszynski in #118 (comment)

Provide support for Python 3.10

๐Ÿ“ Description of the feature

At the moment, CI/CD is only checking on Python 3.7 to 3.9. We should also include support for Python 3.10 but this also requires updating ansys-dpf-* mainly, since it is the most restrictive in terms of dependencies.

๐Ÿ’ก Steps for implementing the feature

Activating commented lines in CI/CD file and updating reqs on pyproject.toml file

๐Ÿ”— Useful links and references

No response

Change PyDPF-Core and PyDPF-Post thumbnail images

Description of the modifications

Create better illustrations for the ansys-dpf-core and ansys-dpf-post thumbnail images on the PyAnsys documentation landing page.

Change the pydpf-core picture here.
Add a pydpf-post picture and link it here.

Useful links and references

No response

Rework the main README so that it is aligned to the metapackage purpose

๐Ÿ“ Description of the feature

At this very moment, the main README just contains a bunch of information on how to install the different PyAnsys libraries on their own. This is no longer the purpose of this repository.

This README file should be reworked to contain information on: how to install the metapackage, how the versions work, what are the different available targets (all, fluent, mapdl...) and so on.

๐Ÿ’ก Steps for implementing the feature

๐Ÿ”— Useful links and references

Bug located while working with Jupyter Notebook to access PyAnsys specifically PyMotorCAD

๐Ÿ” Before submitting the issue

  • I have searched among the existing issues
  • I am using a Python virtual environment

๐Ÿž Description of the bug

I tried to run a sample code in the Jupyter Notebook as below.
import os
import matplotlib.pyplot as plt
import ansys.aedt.core as pyaedt
if "QT_API" in os.environ:
os.environ["QT_API"] = "pyqt"

I am seeing the below error.
ModuleNotFoundError Traceback (most recent call last)
Input In [16], in
1 import os
3 import matplotlib.pyplot as plt

----> 5 import ansys.aedt.core as pyaedt
7 if "QT_API" in os.environ:
8 os.environ["QT_API"] = "pyqt"

ModuleNotFoundError: No module named 'ansys'

error_PyAnsys

๐Ÿ“ Steps to reproduce

Copy paste the below code in the Jupyter notebook.
import os
import matplotlib.pyplot as plt
import ansys.aedt.core as pyaedt
if "QT_API" in os.environ:
os.environ["QT_API"] = "pyqt"

๐Ÿ’ป Which operating system are you using?

Windows

๐Ÿ“€ Which ANSYS version are you using?

Ver.2023R1.1

๐Ÿ Which Python version are you using?

3.7

๐Ÿ“ฆ Installed packages

ansys-api-fluent==0.3.12
ansys-api-mapdl==0.5.1
ansys-api-mechanical==0.1.0
ansys-api-meshing-prime==0.1.1
ansys-api-platform-instancemanagement==1.0.0b3
ansys-api-systemcoupling==0.1.0
ansys-corba==0.1.1
ansys-dpf-composites==0.2.0
ansys-dpf-core==0.8.1
ansys-dpf-gate==0.3.1
ansys-dpf-gatebin==0.3.1
ansys-dpf-post==0.4.0
ansys-fluent-core==0.14.0
ansys-grantami-bomanalytics==1.1.3
ansys-grantami-bomanalytics-openapi==1.0.0
ansys-grpc-dpf==0.7.1
ansys-mapdl-core==0.64.1
ansys-mapdl-reader==0.52.15
ansys-math-core==0.1.1
ansys-mechanical-core==0.8.0
ansys-meshing-prime==0.3.2
ansys-motorcad-core==0.1.3
ansys-openapi-common==1.2.1
ansys-optislang-core==0.2.1
ansys-platform-instancemanagement==1.1.1
ansys-pythonnet==3.1.0rc1
ansys-seascape==0.2.0
ansys-systemcoupling-core==0.1.3
appdirs==1.4.4
cachetools==5.3.1
certifi==2022.9.24
cffi==1.15.1
charset-normalizer==2.1.1
click==8.1.3
clr-loader==0.2.5
colorama==0.4.6
contourpy==1.1.0
cryptography==41.0.1
cycler==0.11.0
fonttools==4.40.0
google-api-core==2.11.1
google-api-python-client==2.89.0
google-auth==2.20.0
google-auth-httplib2==0.1.0
googleapis-common-protos==1.59.1
grpcio==1.54.2
grpcio-status==1.48.2
h5py==3.8.0
httplib2==0.22.0
idna==3.4
importlib-metadata==4.13.0
importlib-resources==5.12.0
kiwisolver==1.4.4
lxml==4.9.2
matplotlib==3.7.1
numpy==1.23.3
packaging==23.1
pandas==2.0.2
Pillow==9.5.0
platformdirs==3.5.3
plumbum==1.8.2
pooch==1.7.0
protobuf==3.20.3
protoc-gen-swagger==0.1.0
psutil==5.9.5
pyaedt==0.6.76
pyansys==2023.2.3
pyansys-tools-versioning==0.3.3
pyasn1==0.5.0
pyasn1-modules==0.3.0
pycparser==2.21
pyiges==0.3.0
pyparsing==3.0.9
pypiwin32==223
pyspnego==0.9.1
python-dateutil==2.8.2
pythonnet==3.0.1
pytwin==0.3.0
pytz==2023.3
pyvista==0.39.1
pywin32==304
PyYAML==6.0
requests==2.28.1
requests-negotiate-sspi==0.5.2
requests-ntlm==1.2.0
rpyc==5.3.1
rsa==4.9
scipy==1.9.1
scooby==0.7.2
six==1.16.0
tqdm==4.65.0
tzdata==2023.3
uritemplate==4.1.1
urllib3==1.26.12
vtk==9.2.6
zipp==3.15.0

PyPrimeMesh link in PyAnsys site needs updating

๐Ÿ” Before submitting the issue

  • I have searched among the existing issues
  • I am using a Python virtual environment

๐Ÿž Description of the bug

PyAnsys โ€” PyAnsys
link still pointing to 0.3.2 docs for PyPrimeMesh. Please can we update to 0.4.0.

๐Ÿ“ Steps to reproduce

Click on link to PyPrimeMesh in PyAnsys โ€” PyAnsys

๐Ÿ’ป Which operating system are you using?

Windows

๐Ÿ“€ Which ANSYS version are you using?

N/A

๐Ÿ Which Python version are you using?

3.7

๐Ÿ“ฆ Installed packages

N/A

Including ``ansys-fluent-visualization`` as a dependency

๐Ÿ“ Description of the feature

This consists on activating the commented line for all, fluent-all extra dependencies and the optional requirement for ansys-fluent-visualization once the issues with ansys-dpf-* have been solved.

๐Ÿ’ก Steps for implementing the feature

Activating commented lines in pyproject.toml file

๐Ÿ”— Useful links and references

No response

Need to add a pinned dependency for PyDPF

๐Ÿ” Before submitting the issue

  • I have searched among the existing issues
  • I am using a Python virtual environment

๐Ÿž Description of the bug

A pinned package should be added along with ansys-dpf-core and ansys-dpf-post.

The ansys-dpf-gate package is specific to ANSYS releases (see here).

This would need to be added to the pinned packages, otherwise once 232 is out with its equivalent ansys-dpf-gate, this will become the latest and people installing with pyansys package will gather the latest instead of the compatible one.

The question now is, ansys-dpf-gate==0.2.1 is the one compatible with ansys-dpf-core==0.6.0.
Otherwise, ansys-dpf-gate==0.2.3 is the latest, to be used with ansys-dpf-core==0.6.2.

๐Ÿ“ Steps to reproduce

None

๐Ÿ’ป Which operating system are you using?

Windows

๐Ÿ Which Python version are you using?

3.8

๐Ÿ“ฆ Installed packages

None

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.