Skip to main content

Pythonic interface to Ansys Motor-CAD.

Project description

PyAnsys Python PyPI GH-CI Codecov MIT Black

This Python package provides the core Python RPC-JSON interface for Motor-CAD.

Install the package

PyMotorCAD has two installation modes: user and developer.

Install in user mode

Before installing PyMotorCAD in user mode, run this command to esure that you have the latest version of pip:

python -m pip install -U pip

Then, run this command to install PyMotorCAD:

python -m pip install ansys-motorcad-core

Install in developer mode

Installing PyMotorCAD in developer mode allows you to modify the source and enhance it.

To install in developer mode, complete these steps:

  1. Clone the pymotorcad repository with this command:

    git clone https://github.com/pyansys/pymotorcad
  2. Create a fresh-clean Python environment and activate it with these commands:

    # Create a virtual environment
    python -m venv .venv
    
    # Activate it in a POSIX system
    source .venv/bin/activate
    
    # Activate it in Windows CMD environment
    .venv\Scripts\activate.bat
    
    # Activate it in Windows Powershell
    .venv\Scripts\Activate.ps1
  3. Ensure that you have the latest required build system and documentation, testing, and CI tools with this command:

    python -m pip install -U pip tox
  4. Install the project in editable mode with this command:

    python -m pip install --editable ansys-motorcad-core
  5. Verify your development installation with this command:

    tox

Testing

This project takes advantage of tox. This tool allows you to automate common development tasks (similar to Makefile), but it is oriented towards Python development.

While Makefile has rules, tox has environments. In fact, tox creates its own virtual environment to guarantee the project’s integrity by isolating anything being tested.

tox commands

Here are commands for running various checks in the tox environment:

  • tox -e style: Checks for coding style quality.

  • tox -e py: Checks for unit tests.

  • tox -e py-coverage: Checks for unit testing and code coverage.

  • tox -e doc: Checks for the documentation-building process.

Raw testing

If required, you can call style commands, including black, isort, and flake8 or unit testing commands like`pytest`_ from the command line. However, using these commands does not guarantee that your project is being tested in an isolated environment, which is why tools like tox exist.

Style checks

The style checks take advantage of pre-commit. Developers are not forced but encouraged to install this tool by running this command:

python -m pip install pre-commit && pre-commit install

Documentation

To build documentation, you can run the usual rules provided in the Sphinx Makefile with a command like this:

make -C doc/ html && your_browser_name doc/html/index.html

However, the recommended way of checking documentation integrity is to use this tox command:

tox -e doc && your_browser_name .tox/doc_out/index.html

For more information, see the Documentation page in the PyMotorCAD documentation.

Distribution

If you would like to create either source or wheel files, run the following code to install the building requirements and execute the build module:

python -m pip install -U pip
python -m build
python -m twine check dist/*

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-motorcad-core-0.1.0.tar.gz (29.2 kB view details)

Uploaded Source

Built Distribution

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

ansys_motorcad_core-0.1.0-py3-none-any.whl (34.7 kB view details)

Uploaded Python 3

File details

Details for the file ansys-motorcad-core-0.1.0.tar.gz.

File metadata

  • Download URL: ansys-motorcad-core-0.1.0.tar.gz
  • Upload date:
  • Size: 29.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for ansys-motorcad-core-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2fe10230d012129e8a90cceddfcd252090432d5d71b6b31b77428f9e57b9f7a6
MD5 f7e039191101e0c55f49ab4d3c8401fe
BLAKE2b-256 e75c43dab146169d5ee959ec34a7608e682edcb21e4fee2c63ef387e4f29641e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ansys_motorcad_core-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5f86d389e1b480fedf7b6b8ce6d595be4f71c31512fe5f39e2cbe755f9108cc6
MD5 1d649b7c6f030b50f3fef9c9e929a871
BLAKE2b-256 8a1116b0360194bf2ed25c9f236c9bce5424755762297a05ec53028133eb3c01

See more details on using hashes here.

Supported by

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