ansys-acp-core


Nameansys-acp-core JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://acp.docs.pyansys.com
SummaryPython library for ACP - Ansys Composite PrepPost
upload_time2025-01-10 20:33:04
maintainerANSYS, Inc.
docs_urlNone
authorANSYS, Inc.
requires_python<3.13,>=3.10
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. image:: https://github.com/ansys/pyacp/blob/feat/pyacp_logo/doc/source/_static/pyacp.svg
    :width: 400
    :alt: PyACP Logo
    :align: center

|pyansys| |python| |pypi| |GH-CI| |codecov| |MIT| |black|

.. |pyansys| image:: https://img.shields.io/badge/Py-Ansys-ffc107.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAABDklEQVQ4jWNgoDfg5mD8vE7q/3bpVyskbW0sMRUwofHD7Dh5OBkZGBgW7/3W2tZpa2tLQEOyOzeEsfumlK2tbVpaGj4N6jIs1lpsDAwMJ278sveMY2BgCA0NFRISwqkhyQ1q/Nyd3zg4OBgYGNjZ2ePi4rB5loGBhZnhxTLJ/9ulv26Q4uVk1NXV/f///////69du4Zdg78lx//t0v+3S88rFISInD59GqIH2esIJ8G9O2/XVwhjzpw5EAam1xkkBJn/bJX+v1365hxxuCAfH9+3b9/+////48cPuNehNsS7cDEzMTAwMMzb+Q2u4dOnT2vWrMHu9ZtzxP9vl/69RVpCkBlZ3N7enoDXBwEAAA+YYitOilMVAAAAAElFTkSuQmCC
    :target: https://docs.pyansys.com/
    :alt: PyAnsys

.. |python| image:: https://img.shields.io/pypi/pyversions/ansys-acp-core?logo=pypi
    :target: https://pypi.org/project/ansys-acp-core
    :alt: Python

.. |pypi| image:: https://img.shields.io/pypi/v/ansys-acp-core.svg?logo=python&logoColor=white
    :target: https://pypi.org/project/ansys-acp-core
    :alt: PyPI

.. |codecov| image:: https://codecov.io/gh/ansys/pyacp/branch/main/graph/badge.svg
    :target: https://codecov.io/gh/ansys/pyacp
    :alt: Codecov

.. |GH-CI| image:: https://github.com/ansys/pyacp/actions/workflows/ci_cd.yml/badge.svg
    :target: https://github.com/ansys/pyacp/actions/workflows/ci_cd.yml
    :alt: GH-CI

.. |MIT| image:: https://img.shields.io/badge/License-MIT-yellow.svg
    :target: https://opensource.org/licenses/MIT
    :alt: MIT

.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg?style=flat
    :target: https://github.com/psf/black
    :alt: Black


A Python client for Ansys Composite PrepPost (ACP).

Installation
------------

Install PyACP with:

.. code-block::

    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.

.. _launching_server:

Getting Started
---------------

Launching ACP
^^^^^^^^^^^^^

The ACP server can be started with ``launch_acp``:

.. code-block:: python

    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:

.. code-block:: pycon

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

.. START_MARKER_FOR_SPHINX_DOCS

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:

    .. code-block:: bash

        git clone https://github.com/ansys/pyacp
        cd pyacp

2.  Make sure you have the latest version of poetry:

    .. code-block:: bash

        python -m pip install pipx
        pipx ensurepath
        pipx install poetry

    .. note::

        At this point, you may need to restart your shell or editor to ensure that the new ``poetry`` command is available.

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

    .. code-block:: bash

        poetry install --with dev,test --all-extras

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

5.  Activate your development virtual environment with:

    .. code-block:: bash

        poetry shell

Testing
^^^^^^^

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

.. code-block:: bash

    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

.. code-block:: bash

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


Additional options can be found in the `pytest-benchmark documentation <https://pytest-benchmark.readthedocs.io/en/latest/usage.html>`_.

**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

.. code-block:: bash

    pre-commit run --all-files

We also recommend installing pre-commit into your repository:

.. code-block:: bash

    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
^^^^^^^^^^^^^
Before generating the documentation, configure the PyACP server via the
``ansys-launcher``, see `Launching ACP <launching_server>`_ above.
If Ansys is installed the examples can directly built with `Sphinx`_.

On Linux & MacOS:

.. code-block:: sh

    make -C doc html

On Windows:

.. code-block:: batch

    cd doc; .\make.bat html

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

Alternatively you can build the documentation by starting a mapdl and pydpf-composites docker
container. First ensure that you have accepted the DPF Preview License Agreement by setting the
ANSYS_DPF_ACCEPT_LA environment variable to Y
(see `DPF Preview License Agreement <https://dpf.docs.pyansys.com/version/stable/user_guide/getting_started_with_dpf_server.html#dpf-preview-license-agreement>`_
). In addition the  ANSYSLMD_LICENSE_FILE environment variable needs be set to a
valid license server (e.g ``1055@mylicenseserver.com``). Then start the docker containers with:

.. code-block:: bash

    docker compose -f docker-compose/docker-compose-extras.yaml up -d

Then build the documentation with the `Sphinx`_ commands mentioned above.

On Windows, you can use the shipped shell script:

.. code-block:: batch

    .\doc\create_doc_windows.ps1

Distribution
^^^^^^^^^^^^

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

.. code-block:: bash

    poetry build
    twine check dist/*

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

.. code-block:: bash

    pip install build
    python -m build --wheel

.. END_MARKER_FOR_SPHINX_DOCS

License
-------

``PyACP`` is licensed under the MIT license. Please see the `LICENSE <https://github.com/ansys/pyacp/raw/main/LICENSE>`_ for more details.

.. _black: https://github.com/psf/black
.. _flake8: https://flake8.pycqa.org/en/latest/
.. _isort: https://github.com/PyCQA/isort
.. _PyAnsys Developer's guide: https://dev.docs.pyansys.com/
.. _pre-commit: https://pre-commit.com/
.. _pytest: https://docs.pytest.org/en/stable/
.. _Sphinx: https://www.sphinx-doc.org/en/master/


            

Raw data

            {
    "_id": null,
    "home_page": "https://acp.docs.pyansys.com",
    "name": "ansys-acp-core",
    "maintainer": "ANSYS, Inc.",
    "docs_url": null,
    "requires_python": "<3.13,>=3.10",
    "maintainer_email": "pyansys.core@ansys.com",
    "keywords": null,
    "author": "ANSYS, Inc.",
    "author_email": "pyansys.core@ansys.com",
    "download_url": "https://files.pythonhosted.org/packages/10/16/30e8f9b077cc89d9a42f92e2d0340e1777ab5e45d7aeb535ab517a0157b7/ansys_acp_core-0.1.0.tar.gz",
    "platform": null,
    "description": ".. image:: https://github.com/ansys/pyacp/blob/feat/pyacp_logo/doc/source/_static/pyacp.svg\n    :width: 400\n    :alt: PyACP Logo\n    :align: center\n\n|pyansys| |python| |pypi| |GH-CI| |codecov| |MIT| |black|\n\n.. |pyansys| image:: https://img.shields.io/badge/Py-Ansys-ffc107.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAABDklEQVQ4jWNgoDfg5mD8vE7q/3bpVyskbW0sMRUwofHD7Dh5OBkZGBgW7/3W2tZpa2tLQEOyOzeEsfumlK2tbVpaGj4N6jIs1lpsDAwMJ278sveMY2BgCA0NFRISwqkhyQ1q/Nyd3zg4OBgYGNjZ2ePi4rB5loGBhZnhxTLJ/9ulv26Q4uVk1NXV/f///////69du4Zdg78lx//t0v+3S88rFISInD59GqIH2esIJ8G9O2/XVwhjzpw5EAam1xkkBJn/bJX+v1365hxxuCAfH9+3b9/+////48cPuNehNsS7cDEzMTAwMMzb+Q2u4dOnT2vWrMHu9ZtzxP9vl/69RVpCkBlZ3N7enoDXBwEAAA+YYitOilMVAAAAAElFTkSuQmCC\n    :target: https://docs.pyansys.com/\n    :alt: PyAnsys\n\n.. |python| image:: https://img.shields.io/pypi/pyversions/ansys-acp-core?logo=pypi\n    :target: https://pypi.org/project/ansys-acp-core\n    :alt: Python\n\n.. |pypi| image:: https://img.shields.io/pypi/v/ansys-acp-core.svg?logo=python&logoColor=white\n    :target: https://pypi.org/project/ansys-acp-core\n    :alt: PyPI\n\n.. |codecov| image:: https://codecov.io/gh/ansys/pyacp/branch/main/graph/badge.svg\n    :target: https://codecov.io/gh/ansys/pyacp\n    :alt: Codecov\n\n.. |GH-CI| image:: https://github.com/ansys/pyacp/actions/workflows/ci_cd.yml/badge.svg\n    :target: https://github.com/ansys/pyacp/actions/workflows/ci_cd.yml\n    :alt: GH-CI\n\n.. |MIT| image:: https://img.shields.io/badge/License-MIT-yellow.svg\n    :target: https://opensource.org/licenses/MIT\n    :alt: MIT\n\n.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg?style=flat\n    :target: https://github.com/psf/black\n    :alt: Black\n\n\nA Python client for Ansys Composite PrepPost (ACP).\n\nInstallation\n------------\n\nInstall PyACP with:\n\n.. code-block::\n\n    pip install ansys-acp-core[all]\n\n\nFor installing PyACP in development mode, see the `Development Setup`_ instructions below.\n\nDocumentation\n-------------\n\nThe PyACP documentation can be viewed online at https://acp.docs.pyansys.com.\n\n.. _launching_server:\n\nGetting Started\n---------------\n\nLaunching ACP\n^^^^^^^^^^^^^\n\nThe ACP server can be started with ``launch_acp``:\n\n.. code-block:: python\n\n    import ansys.acp.core as pyacp\n\n    acp = pyacp.launch_acp()\n\n\nBasic Usage\n^^^^^^^^^^^\n\nOnce the server is running, we can start working with PyACP. For example, to load an ACP\nModel from an existing file:\n\n.. code-block:: pycon\n\n    >>> remote_path = acp.upload_file(local_path=\"<MODEL_PATH>\")\n    >>> model = acp.import_model(path=remote_path)\n    >>> model.name\n    'ACP Model'\n\n.. START_MARKER_FOR_SPHINX_DOCS\n\nDevelopment Setup\n-----------------\n\nInstallation\n^^^^^^^^^^^^\n\nInstalling PyACP in developer mode allows you to modify the source and enhance it. Before contributing to the project,\nplease refer to the `PyAnsys Developer's guide`_.\n\nYou will need to follow these steps:\n\n1.  Start by cloning this repository, and entering the newly created directory:\n\n    .. code-block:: bash\n\n        git clone https://github.com/ansys/pyacp\n        cd pyacp\n\n2.  Make sure you have the latest version of poetry:\n\n    .. code-block:: bash\n\n        python -m pip install pipx\n        pipx ensurepath\n        pipx install poetry\n\n    .. note::\n\n        At this point, you may need to restart your shell or editor to ensure that the new ``poetry`` command is available.\n\n4.  Install the project and all its development dependencies using poetry. This also takes care of\n    creating a new virtual environment:\n\n    .. code-block:: bash\n\n        poetry install --with dev,test --all-extras\n\n    This step installs PyACP in an editable mode (no build step is needed, no re-install when changing the code).\n\n5.  Activate your development virtual environment with:\n\n    .. code-block:: bash\n\n        poetry shell\n\nTesting\n^^^^^^^\n\nThe PyACP test suite uses `pytest`_. You can run it with\n\n.. code-block:: bash\n\n    pytest --license-server=<YOUR_LICENSE_SERVER> tests/unittests\n\nBenchmarking\n^^^^^^^^^^^^\n\nAs part of the test suite, we run some performance benchmarks. These can be run with\n\n.. code-block:: bash\n\n    pytest --license-server=<YOUR_LICENSE_SERVER> tests/benchmarks\n\n\nAdditional options can be found in the `pytest-benchmark documentation <https://pytest-benchmark.readthedocs.io/en/latest/usage.html>`_.\n\n**NOTE:** The benchmarks use the ``tc-netem`` Linux kernel module to simulate a slow network\nconnection within a Docker container. This is available only on Linux, not on Docker for MacOS\nor Windows.\n\nThe benchmark results from the ``main`` branch are uploaded to https://acp.docs.pyansys.com/benchmarks.\n\nPre-commit hooks\n^^^^^^^^^^^^^^^^\n\nStyle and linter checks are run through the `pre-commit`_ tool. You can run these checks with\n\n.. code-block:: bash\n\n    pre-commit run --all-files\n\nWe also recommend installing pre-commit into your repository:\n\n.. code-block:: bash\n\n    pre-commit install\n\nThis will run the pre-commit hooks on the changed files before every ``git commit``. If you ever\nneed to create a commit without running the hooks, you can skip them with ``git commit -n``.\n\nDocumentation\n^^^^^^^^^^^^^\nBefore generating the documentation, configure the PyACP server via the\n``ansys-launcher``, see `Launching ACP <launching_server>`_ above.\nIf Ansys is installed the examples can directly built with `Sphinx`_.\n\nOn Linux & MacOS:\n\n.. code-block:: sh\n\n    make -C doc html\n\nOn Windows:\n\n.. code-block:: batch\n\n    cd doc; .\\make.bat html\n\nThe generated HTML files can be viewed with the browser of your choice.\n\nAlternatively you can build the documentation by starting a mapdl and pydpf-composites docker\ncontainer. First ensure that you have accepted the DPF Preview License Agreement by setting the\nANSYS_DPF_ACCEPT_LA environment variable to Y\n(see `DPF Preview License Agreement <https://dpf.docs.pyansys.com/version/stable/user_guide/getting_started_with_dpf_server.html#dpf-preview-license-agreement>`_\n). In addition the  ANSYSLMD_LICENSE_FILE environment variable needs be set to a\nvalid license server (e.g ``1055@mylicenseserver.com``). Then start the docker containers with:\n\n.. code-block:: bash\n\n    docker compose -f docker-compose/docker-compose-extras.yaml up -d\n\nThen build the documentation with the `Sphinx`_ commands mentioned above.\n\nOn Windows, you can use the shipped shell script:\n\n.. code-block:: batch\n\n    .\\doc\\create_doc_windows.ps1\n\nDistribution\n^^^^^^^^^^^^\n\nThe following commands can be used to build and check the PyACP package:\n\n.. code-block:: bash\n\n    poetry build\n    twine check dist/*\n\nThis creates both a source distribution, and a wheel file. An alternative is\n\n.. code-block:: bash\n\n    pip install build\n    python -m build --wheel\n\n.. END_MARKER_FOR_SPHINX_DOCS\n\nLicense\n-------\n\n``PyACP`` is licensed under the MIT license. Please see the `LICENSE <https://github.com/ansys/pyacp/raw/main/LICENSE>`_ for more details.\n\n.. _black: https://github.com/psf/black\n.. _flake8: https://flake8.pycqa.org/en/latest/\n.. _isort: https://github.com/PyCQA/isort\n.. _PyAnsys Developer's guide: https://dev.docs.pyansys.com/\n.. _pre-commit: https://pre-commit.com/\n.. _pytest: https://docs.pytest.org/en/stable/\n.. _Sphinx: https://www.sphinx-doc.org/en/master/\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python library for ACP - Ansys Composite PrepPost",
    "version": "0.1.0",
    "project_urls": {
        "Documentation": "https://acp.docs.pyansys.com",
        "Homepage": "https://acp.docs.pyansys.com",
        "Issues": "https://github.com/ansys/pyacp/issues",
        "Releases": "https://github.com/ansys/pyacp/releases",
        "Repository": "https://github.com/ansys/pyacp/"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1846013b0614c9726eeab0cd4022916141c7f4bd859093930e12398cf4c97745",
                "md5": "56bd33cd0ca5b58ed70a7a21eb15b665",
                "sha256": "7a2c64b1b957f901a4c78968e184b9f8318ec2d25efd04014a28e4963ed9034f"
            },
            "downloads": -1,
            "filename": "ansys_acp_core-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "56bd33cd0ca5b58ed70a7a21eb15b665",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.13,>=3.10",
            "size": 257661,
            "upload_time": "2025-01-10T20:33:01",
            "upload_time_iso_8601": "2025-01-10T20:33:01.343462Z",
            "url": "https://files.pythonhosted.org/packages/18/46/013b0614c9726eeab0cd4022916141c7f4bd859093930e12398cf4c97745/ansys_acp_core-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "101630e8f9b077cc89d9a42f92e2d0340e1777ab5e45d7aeb535ab517a0157b7",
                "md5": "2d6a11859262d077c733728c170fafb3",
                "sha256": "ba2aa699ef282146003a8ea0bb3f57b963cdb8dda270de03eb1c7b7092ded0f7"
            },
            "downloads": -1,
            "filename": "ansys_acp_core-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "2d6a11859262d077c733728c170fafb3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.13,>=3.10",
            "size": 119354,
            "upload_time": "2025-01-10T20:33:04",
            "upload_time_iso_8601": "2025-01-10T20:33:04.732599Z",
            "url": "https://files.pythonhosted.org/packages/10/16/30e8f9b077cc89d9a42f92e2d0340e1777ab5e45d7aeb535ab517a0157b7/ansys_acp_core-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-10 20:33:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ansys",
    "github_project": "pyacp",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "ansys-acp-core"
}
        
Elapsed time: 0.79903s