A python wrapper for ansys dpf composites
Project description
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.
Clone the repository:
git clone https://github.com/pyansys/pydpf-composites cd pydpf-composites
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
Create a virtual environment and install the package with development dependencies. PyDPF Composites uses Poetry to manage the development environment.
poetry install --all-extras
Activate the virtual environment:
poetry shell
Test
Set the environment variable ANSYSLMD_LICENSE_FILE to configure the licensing or pass it as argument (–license-server=1055@mylicenseserver) to the pytest call.
There are three ways to run the PyDPF Composites tests, depending on how the DPF server is started.
Run tests with a Docker container.
docker pull ghcr.io/pyansys/pydpf-composites:latest pytest .
Run tests with a DPF server started from the Ansys installer. The Ansys version must be 2023 R2 or later.
pytest . --ansys-path "C:\Program Files\Ansys Inc\v232"
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:latest
docker run -d -p 21002:50052 -e ANSYSLMD_LICENSE_FILE=10555@mylicserver -e ANSYS_DPF_ACCEPT_LA=Y ghcr.io/pyansys/pydpf-composites:latest
tox -e doc-windows
On Linux, build documentation with this code:
docker pull ghcr.io/pyansys/pydpf-composites:latest
docker run -d -p 21002:50052 -e ANSYSLMD_LICENSE_FILE=10555@mylicserver -e ANSYS_DPF_ACCEPT_LA=Y ghcr.io/pyansys/pydpf-composites:latest
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ansys_dpf_composites-0.2b2.tar.gz
.
File metadata
- Download URL: ansys_dpf_composites-0.2b2.tar.gz
- Upload date:
- Size: 49.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a16c97ca7e8eded1f1d981644acc7d98fabad3293a2171f2cb4880cc379a5b7 |
|
MD5 | e72cc6587d50806f81115b38dff07a70 |
|
BLAKE2b-256 | e0a0347b2d7c3a2bb72dc8cff429548cbccc833045a72c87ce89c89129084670 |
File details
Details for the file ansys_dpf_composites-0.2b2-py3-none-any.whl
.
File metadata
- Download URL: ansys_dpf_composites-0.2b2-py3-none-any.whl
- Upload date:
- Size: 63.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03256e62690489ca1d5e5c9a8f592944318243df3b6d08d05885769b9e11ea37 |
|
MD5 | a4e12c77ba634d2c45005dd5e3dce840 |
|
BLAKE2b-256 | fab71e375a4ca774a5583b1b59d215804648b150fba4a8dcd196a0e7cb4be827 |