Skip to main content

A python wrapper for ansys dpf composites

Project description

PyAnsys Python PyPI GH-CI Codecov MIT Black

PyDPF Composites is a Python wrapper for Ansys DPF composites. It implements classes on top of DPF Composites operators and data accessors for short fiber and layered composites (layered shell and solid elements). This module can be used to postprocess fiber reinforced plastics and layered composites and to implement custom failure criteria and computation. For examples demonstrating the behavior and usage of PyDPF Composites, see PyDPF Composites - Examples.

Contribute

Install in development mode

Installing PyDPF Composites in development mode allows you to modify the source and enhance it.

Before attempting to contribute to PyDPF Composites, ensure that you are thoroughly familiar with the PyAnsys Developer’s Guide.

  1. Clone the repository:

    git clone https://github.com/pyansys/pydpf-composites
    cd pydpf-composites
  2. Install dependencies:

    python -m pip install pipx
    pipx ensurepath
    # Minimum required poetry version is 1.2.0
    pipx install poetry
    pipx install pip
    pipx install tox
  3. Create a virtual environment and install the package with development dependencies. PyDPF Composites uses Poetry to manage the development environment.

    poetry install --all-extras
  4. Activate the virtual environment:

    poetry shell

Test

There are three ways to run the PyDPF Composites tests, depending on how the DPF server is started.

  1. Run tests with a Docker container.

    docker pull ghcr.io/pyansys/pydpf-composites:231
    pytest .
  2. Run tests with a DPF server started from the Ansys installer. The Ansys version must be 2023 R1 or later.

    pytest . --ansys-path "C:\Program Files\Ansys Inc\v231"
  3. Run tests with a local gRPC server executable:

    pytest . --server-bin dpf_composites/bin/lib/deps/Ans.Dpf.Grpc.exe

    This currently works only on Windows and with the directory structure of the Ansys internal dpf_composites package. The runtime dependencies of the Ans.Dpf.Grpc.exe file must be in its folder and the parent folder.

Build documentation

On Windows, build documentation with this code:

docker pull ghcr.io/pyansys/pydpf-composites:231
docker run -d -p 21002:50052  ghcr.io/pyansys/pydpf-composites:231
tox -e doc-windows

On Linux, build documentation with this code:

docker pull ghcr.io/pyansys/pydpf-composites:231
docker run -d -p 21002:50052  ghcr.io/pyansys/pydpf-composites:231
tox -e doc-linux

Run style checks

The style checks use pre-commit and can be run through tox:

tox -e style

The style checks can also be configured to run automatically before each git commit:

pre-commit install

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_dpf_composites-0.1.0.tar.gz (47.7 kB view details)

Uploaded Source

Built Distribution

ansys_dpf_composites-0.1.0-py3-none-any.whl (61.2 kB view details)

Uploaded Python 3

File details

Details for the file ansys_dpf_composites-0.1.0.tar.gz.

File metadata

  • Download URL: ansys_dpf_composites-0.1.0.tar.gz
  • Upload date:
  • Size: 47.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for ansys_dpf_composites-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fc67fc74cff3958bfac02fbb3a35031a9e1799f90215a6a062898fc78320084f
MD5 b4209b40a0a632a7a0e9f81d87e2f8d4
BLAKE2b-256 1e5d351e6f319d583369c031cf8523858477fde7f4caeb55ecd1797667efd655

See more details on using hashes here.

File details

Details for the file ansys_dpf_composites-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ansys_dpf_composites-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 43314dc0103327cd92133c7ef727281a75a677264d9e82219083e6ad98ee55dd
MD5 6a1c1a96deb86c69875d6a5c258ac233
BLAKE2b-256 5afcd605383a2fca76ab22190bf9e96fc5800bcccd0695cd7c67bb462f6cc95c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page