Package: ansys-motorcad-core
OverviewAnsys 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 issuesDocumentation for the latest stable release of PyMotorCAD is hosted atPyMotorCAD 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 alsoviewordownloadthe
PyMotorCAD cheat sheet. This one-page reference provides syntax rules and commands
for using PyMotorCAD.On thePyMotorCAD Issuespage, you can create
issues to report bugs and request new features. On theDiscussionspage on the Ansys Developer portal, you can post questions, share ideas, and get community feedback.To reach the project support team, emailpyansys.core@ansys.com.InstallationPyMotorCAD has two installation modes: user and developer.Install in user modeBefore installing PyMotorCAD in user mode, run this command to ensure
that you have the latest version ofpip:python-mpipinstall-UpipThen, run this command to install PyMotorCAD:python-mpipinstallansys-motorcad-coreInstall in developer modeInstalling 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 thePyAnsys Developer’s Guide.To install in developer mode, complete these steps:Clone thepymotorcadrepository with this command:gitclonehttps://github.com/ansys/pymotorcadCreate a fresh-clean Python environment and then activate it with these
commands:# Create a virtual environmentpython-mvenv.venv# Activate it in a POSIX systemsource.venv/bin/activate# Activate it in Windows CMD environment.venv\Scripts\activate.bat# Activate it in Windows Powershell.venv\Scripts\Activate.ps1Ensure that you have the latest required build system and
documentation, testing, and CI tools with this command:python-mpipinstall-UpiptoxInstall the project in editable mode with this command:python-mpipinstall--editableansys-motorcad-coreVerify your development installation with this command:toxTestingThis project takes advantage oftox. This tool allows you to automate common
development tasks (similar to Makefile), but it is oriented towards Python
development.While Makefile has rules,toxhas environments. In fact,toxcreates
its own virtual environment to guarantee the project’s integrity by isolating
anything being tested.toxcommandsHere are commands for running various checks in thetoxenvironment: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 testingIf required, you can call style commands, such asblack,isort,
andflake8, 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 liketoxexist.Style checksThe style checks take advantage ofpre-commit. Developers are not forced but
encouraged to install this tool by running this command:python-mpipinstallpre-commit&&pre-commitinstallDocumentation buildsTo build documentation, you can run the usual rules provided in theSphinxMakefile with a command like this:make-Cdoc/html&&your_browser_namedoc/html/index.htmlHowever, the recommended way of checking documentation integrity is to use
atoxcommand like this:tox-edoc&&your_browser_name.tox/doc_out/index.htmlDistributionIf 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-mpipinstall-Upippython-mbuildpython-mtwinecheckdist/*License and acknowledgementsPyMotorCAD is licensed under the MIT license. For more information, see theLICENSEfile.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 theAnsys Motor-CADpage on the Ansys website.