Skip to main content
PyACP Logo

PyAnsys Python PyPI GH-CI Codecov MIT Black

A Python client for Ansys Composite PrepPost (ACP).

Installation

Install PyACP with:

pip install ansys-acp-core[all]

For installing PyACP in development mode, see the Development Setup instructions below.

Documentation

The PyACP documentation can be viewed online at https://acp.docs.pyansys.com.

Getting Started

Launching ACP

The ACP server can be started with launch_acp:

import ansys.acp.core as pyacp

acp = pyacp.launch_acp()

Basic Usage

Once the server is running, we can start working with PyACP. For example, to load an ACP Model from an existing file:

>>> remote_path = acp.upload_file(local_path="<MODEL_PATH>")
>>> model = acp.import_model(path=remote_path)
>>> model.name
'ACP Model'

Development Setup

Installation

Installing PyACP in developer mode allows you to modify the source and enhance it. Before contributing to the project, please refer to the PyAnsys Developer’s guide.

You will need to follow these steps:

  1. Start by cloning this repository, and entering the newly created directory:

    git clone https://github.com/ansys/pyacp
    cd pyacp
  2. Make sure you have the latest version of uv, using one of the methods described at https://docs.astral.sh/uv/getting-started/installation/.

    4. Install the project and all its development dependencies using uv. This also takes care of creating a new virtual environment:

    uv sync --all-groups --all-extras

    This step installs PyACP in an editable mode (no build step is needed, no re-install when changing the code).

  1. Activate your development virtual environment with:

    source .venv/bin/activate

    On Windows PowerShell:

    .venv\Scripts\Activate.ps1

Testing

The PyACP test suite uses pytest. You can run it with

pytest --license-server=<YOUR_LICENSE_SERVER> tests/unittests

Benchmarking

As part of the test suite, we run some performance benchmarks. These can be run with

pytest --license-server=<YOUR_LICENSE_SERVER> tests/benchmarks

Additional options can be found in the pytest-benchmark documentation.

NOTE: The benchmarks use the tc-netem Linux kernel module to simulate a slow network connection within a Docker container. This is available only on Linux, not on Docker for MacOS or Windows.

The benchmark results from the main branch are uploaded to https://acp.docs.pyansys.com/benchmarks.

Pre-commit hooks

Style and linter checks are run through the pre-commit tool. You can run these checks with

pre-commit run --all-files

We also recommend installing pre-commit into your repository:

pre-commit install

This will run the pre-commit hooks on the changed files before every git commit. If you ever need to create a commit without running the hooks, you can skip them with git commit -n.

Documentation

Basic documentation build

To build the documentation, run the following commands:

On Linux & MacOS:

make -C doc html

On Windows:

cd doc; .\make.bat html

The generated HTML files can be viewed with the browser of your choice.

This method of building the documentation will run the examples with the default or currently configured launch options for the ACP, MAPDL, and DPF servers. Make sure to have these installed and configured correctly, or alternatively follow the Docker-based instructions below.

Alternative: start services with docker

Alternatively, you can use the provided docker-compose file to start the MAPDL and DPF servers.

First, review the DPF preview license agreement, and if you agree, set the ANSYS_DPF_ACCEPT_LA environment variable to Y. See the PyDPF documentation for details.

On Windows, you can then use the shipped shell script:

.\doc\create_doc_windows.ps1

The following manual steps can be used on any platform:

  1. Set the following additional environment variables in your shell:

    • ANSYSLMD_LICENSE_FILE: To a valid license server (e.g 1055@mylicenseserver.com).

    • PYMAPDL_PORT: Choose any free port.

    • PYMAPDL_START_INSTANCE=FALSE

    • PYDPF_COMPOSITES_DOCKER_CONTAINER_PORT: Choose any free port.

  2. Start the docker containers with:

    docker compose -f docker-compose/docker-compose-extras.yaml up -d
  3. Build the documentation with the Sphinx commands mentioned above:

    On Linux & MacOS:

    make -C doc html

    On Windows:

    cd doc; .\make.bat html

Partial builds

Two environment variables can be used to run a quicker partial documentation build:

  • PYACP_DOC_SKIP_API=1: Skip the API reference build.

  • PYACP_DOC_SKIP_GALLERY=1: Skip running the examples.

Distribution

The following commands can be used to build and check the PyACP package:

uv build
twine check dist/*

This creates both a source distribution, and a wheel file. An alternative is

pip install build
python -m build --wheel

License

PyACP is licensed under the MIT license. Please see the LICENSE for more 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_acp_core-0.4.1.tar.gz (130.0 kB view details)

Uploaded Source

Built Distribution

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

ansys_acp_core-0.4.1-py3-none-any.whl (278.1 kB view details)

Uploaded Python 3

File details

Details for the file ansys_acp_core-0.4.1.tar.gz.

File metadata

  • Download URL: ansys_acp_core-0.4.1.tar.gz
  • Upload date:
  • Size: 130.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ansys_acp_core-0.4.1.tar.gz
Algorithm Hash digest
SHA256 8bbc783f7fab359b3f39e1ea2e262db6ef052183289bf4122fb442674b05512d
MD5 d83ef7da51a7b303d6a1bf7f70cc1c07
BLAKE2b-256 5ddc1bb751d0469da0b1a8d5743c05c4d1ceeaa0a3e87ae01e05e64f5473bd0a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ansys_acp_core-0.4.1.tar.gz:

Publisher: ci_cd.yml on ansys/pyacp

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_acp_core-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: ansys_acp_core-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 278.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ansys_acp_core-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bb3fa9d92f3a7fc1ae8fca3e2882307c69371e32ce71ac8e3f0e185758c4ba24
MD5 70e77e0620e4e41b53094d0eda50ebe1
BLAKE2b-256 ae7db05ce764a28dd706cc8374cb9df4810fb58b9c95e1a5a5909bc6cf19e4c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for ansys_acp_core-0.4.1-py3-none-any.whl:

Publisher: ci_cd.yml on ansys/pyacp

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

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 files

0.4.0

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page