PyEMMO
Python Electrical Machine Modelling in ONELAB
PyEMMO is a interface for modeling electrical machines in the open-source FEA software ONELAB. The goal of the project is to automate model creation and the simulation workflow for electrical machines with ONELAB.
Installation
Use the package manager pip to install PyEMMO.
pip install pyemmo
You will need versions of Gmsh and GetDP executables. While Gmsh can be directly installed from pip with the Gmsh Python-API, you will need to download GetDP individually.
[!WARNING] Models created with PyEMMO fail with current GetDP version 3.6.0 due to mesh import error! You can check your GetDP version with
getdp --version
Usage
The easiest way to start is by using the PYLEECAN project to create a electrical machine instance and feeding it into the PyEMMO-PYLEECAN interface.
- Have a look at the PYLEECAN tutorials on how to use PYLEECAN. Especially the tutorial on "How to define a machine".
- See the PYLEECAN API tutorial for detailed instructions on how to create a ONELAB model from a PYLEECAN machine object.
- See the PyEMMO documentation for details.
Here is a small example of the PYLEECAN API:
from os.path import join
from pyemmo.api.pyleecan import main as pyleecan_api
from pyleecan.definitions import DATA_DIR
from pyleecan.Functions.load import load
# load a pyleecan machine
IPMSM_A = load(join(DATA_DIR, "Machine", "Toyota_Prius.json"))
# Run the main function of the pyleecan api:
pyemmo_script = pyleecan_api.main(
pyleecan_machine=IPMSM_A,
model_dir="./Toyota_Prius_ONELAB", # path for the model files
use_gui=True, # select if you want to open the final model in Gmsh.
gmsh="", # optional gmsh executable.
# If use_gui is True, pyemmo will try to find a Gmsh executable on your computer.
getdp="", # optional getdp executable. For simulation in the GUI.
)
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
Setup
After cloning the repository you should install pre-commit package using pip install pre-commit.
After that please update the INSTALL_PYTHON path in the pre-commit hook under "./workingDirectory/pre-commit".
Then run the following command to install the Git hooks:
./workingDirectory/install-hooks.sh
Or if you are on Windows:
install-hooks.bat
These hooks make sure you have formatted your files correctly.
🙏 Acknowledgements
- Thanks to all contributors who helped improve this project.
- This project has received funding from the Bavarian Ministry of Economic Affairs, Regional Development and Energy through the TherCom research project. Special thanks to Siemens Electric Motor Plant Bad Neustadt a. d. Saale for supporting it.
License
Publications
Run Sphinx to create Documentation
To create or update the documentation you will need to do:
- Install the doc requirements with:
pip install -r requirements-doc.txt. - Make sure pyemmo is found by either creating a pyemmo.pth file in the site-packages folder or use
pip install -e .. - To fully build the documentation including the PYLEECAN api subpackage you need to install PYLEECAN. Currently we have to use the Github version since there is no new release yet:
pip install git+https://gitlab.com/Eomys/pyleecan/tree/update-python-version.git - Run Sphinx to build the docs e.g. in html
doc\make.bat html.
You can run doc\make.bat plane to see the build options.
Further information on building the documentation can be found in the Sphinx documentation.
Metadata
Release files for pyemmo 1.6.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyemmo-1.6.1.tar.gz | 716.0 kB | Without provenance | Details for pyemmo-1.6.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyemmo-1.6.1-py3-none-any.whl | Python 3 | none | any | Details for pyemmo-1.6.1-py3-none-any.whl |
Total release size: 1.7 MB
Release files / pyemmo-1.6.1.tar.gz
| Download URL | pyemmo-1.6.1.tar.gz |
|---|---|
| Size | 716.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
676e2d1c6264cb85587d2bc1ffd4d0729cd5d938b0046bb0ee3766a5961faba3
|
|
BLAKE2b-256 checksum How to use checksums |
4749fa07db0dd25ceaa427bb4193ade7853c5075eec4a44dfde04a1268cf61e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Release files / pyemmo-1.6.1-py3-none-any.whl
| Download URL | pyemmo-1.6.1-py3-none-any.whl |
|---|---|
| Size | 948.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
363011af581524f4461d15dca80736eb46e43e36f18977de03a2be8546773a16
|
|
BLAKE2b-256 checksum How to use checksums |
671bbbaafd0f645510341d28b351b8919ceddfba80f6e94592840d99d2f12146
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Security for pyemmo 1.6.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.