Pythonic interface to Ansys Motor-CAD.
Project description
Overview
Ansys Motor-CAD is a dedicated design and analysis tool for electric motors. It enables rapid and accurate multiphysics design and analysis of electric machines across the full-operating spectrum.
PyMotorCAD uses a Python JSON-RPC (remote procedure call) interface for Motor-CAD to launch or connect with a Motor-CAD instance, either locally or from a remote machine via HTTP. With PyMotorCAD, you can programmatically create, interact with, and control a Motor-CAD model, with or without using the Motor-CAD GUI.
Documentation and issues
Documentation for the latest stable release of PyMotorCAD is hosted at PyMotorCAD documentation.
In the upper right corner of the documentation’s title bar, there is an option for switching from viewing the documentation for the latest stable release to viewing the documentation for the development version or previously released versions.
You can also view or download the PyMotorCAD cheat sheet. This one-page reference provides syntax rules and commands for using PyMotorCAD.
On the PyMotorCAD Issues page, you can create issues to report bugs and request new features. On the Discussions page on the Ansys Developer portal, you can post questions, share ideas, and get community feedback.
To reach the project support team, email pyansys.core@ansys.com.
Installation
PyMotorCAD has two installation modes: user and developer.
Install in user mode
Before installing PyMotorCAD in user mode, run this command to ensure 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.
Note: Before contributing to this project, ensure that you are familiar with all guidelines in the PyAnsys Developer’s Guide.
To install in developer mode, complete these steps:
Clone the pymotorcad repository with this command:
git clone https://github.com/ansys/pymotorcad
Create a fresh-clean Python environment and then 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
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
Install the project in editable mode with this command:
python -m pip install --editable ansys-motorcad-core
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, such as black, isort, and flake8, or unit testing commands, such as`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 builds
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 a tox command like this:
tox -e doc && your_browser_name .tox/doc_out/index.html
Distribution
If you would like to create either source or wheel files, run the following commands to install the building requirements and execute the build module:
python -m pip install -U pip
python -m build
python -m twine check dist/*
License and acknowledgements
PyMotorCAD is licensed under the MIT license. For more information, see the LICENSE file.
PyMotorCAD makes no commercial claim over Ansys whatsoever. This library extends the capability of Ansys Motor-CAD by adding a Python interface to Motor-CAD without changing the core behaviour or license of the original software. Using PyMotorCAD for interactive control of Motor-CAD requires a legally licensed copy of Motor-CAD.
For more information on Motor-CAD, see the Ansys Motor-CAD page on the Ansys website.
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_motorcad_core-0.4.3.tar.gz
.
File metadata
- Download URL: ansys_motorcad_core-0.4.3.tar.gz
- Upload date:
- Size: 47.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80b4fc38328f9db7aee27a636084e2c57328638da556d8d7b403dd83f149e53e |
|
MD5 | 6463090913b07221c6ddf64fb38f35df |
|
BLAKE2b-256 | ca87a4c56a745f41f6c2eeabc7d4b3b3160b53bc8e3eb690ce0a518db320cc5a |
File details
Details for the file ansys_motorcad_core-0.4.3-py3-none-any.whl
.
File metadata
- Download URL: ansys_motorcad_core-0.4.3-py3-none-any.whl
- Upload date:
- Size: 53.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 723a5f637c482bfb75c588967ba79141fd4ee59851c7edd6512129df9ae5d477 |
|
MD5 | db5a322636c8949a7e8b5eb92d4e1563 |
|
BLAKE2b-256 | b160bd00df8978e6dd3c610dba465e629fc2756d12f7a8265be01aa0c1d8a1d4 |