Metadata-Version: 2.4
Name: pyemmo
Version: 1.5.0.dev2
Summary: PyEMMO is a interface for modeling electrical machines in the open-source FEA software Onelab
Author: AG-EM TTZ-EMO, Sasithon Koenig
Author-email: Max Schuler <agem.ttz-emo@thws.de>
Maintainer-email: Max Schuler <agem.ttz-emo@thws.de>
License-Expression: GPL-3.0-or-later
Project-URL: Repository, https://gitlab.ttz-emo.thws.de/ag-em/pyemmo
Keywords: electrical machine,simulation,onelab,getdp,gmsh,fea
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: swat_em>=0.6.3
Requires-Dist: pygetdp>=1.0.0
Requires-Dist: gmsh<4.14,>=4.10.3
Requires-Dist: matplotlib>=3.3.4
Requires-Dist: numpy>=1.23.1
Requires-Dist: parse>=1.19.0
Requires-Dist: splines>=0.3.2
Provides-Extra: pyleecan
Requires-Dist: pyleecan>=1.5.1; python_version < "3.10" and extra == "pyleecan"
Dynamic: license-file

<!--
Copyright (c) 2018-2024 M. Schuler, TTZ-EMO, Technical University of Applied Sciences Wuerzburg-Schweinfurt.

This file is part of PyEMMO
(see https://gitlab.ttz-emo.thws.de/ag-em/pyemmo).

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->

<!-- This is a comment -->
<!-- This is a simple example package. You can use
[Github-flavored Markdown](https://guides.github.com/features/mastering-markdown/)
to write your content. -->

<!-- ![PyEMMO project logo](./doc/images/PyEMMO_Logo.png) -->
<img src="./doc/images/PyEMMO_Logo.png" width="200">

# PyEMMO
_**Py**thon **E**lectrical **M**achine **M**odelling in **O**NELAB_

PyEMMO is a interface for modeling electrical machines in the open-source FEA software [ONELAB](https://onelab.info/).
The goal of the project is to automate model creation and the simulation workflow for electrical machines with ONELAB.
<!-- That's why it name stands for **Py**thon **E**lectrical **M**achine **M**odelling in **O**NELAB -->


## Installation

Use the package manager [pip](https://pip.pypa.io/en/stable/) to install PyEMMO.

```bash
pip install https://github.com/ttz-emo/pyemmo.git
```

You will need versions of [Gmsh](https://gmsh.info/) and [GetDP](https://getdp.info/) 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](https://github.com/Eomys/pyleecan) project to create a electrical machine instance and feeding it into the PyEMMO-Pyleecan interface.
- Have a look at the [Pyleecan tutorials](https://pyleecan.org/tutorials.html) on how to use Pyleecan. Especially the tutorial on ["How to define a machine"](https://pyleecan.org/01_tuto_Machine.html).
- See the [Pyleecan API tutorial](tutorials/pyleecan_api.py) for detailed instructions on how to create a ONELAB model from a Pyleecan machine object.


## 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:

```sh
./workingDirectory/install-hooks.sh
```

Or if you are on Windows:

```sh
install-hooks.bat
```
These hooks make sure you have formatted your files correctly.

## License

[GPLv3](https://www.gnu.org/licenses/gpl-3.0.html)

## Publications

- [2023: PyEMMO - a Python based software for the finite element modelling of electrical machines in ONELAB](https://nbn-resolving.org/urn:nbn:de:bvb:863-opus-55489)


## Run Sphinx to create Documentation

To create or update the documentation you will need to do:

1. Install the doc requirments with: `pip install -r requirements-doc.txt`.
2. Make sure pyemmo is found by either creating a *pyemmo.pth* file in the *site-packages* folder or use `pip install -e .`.
3. To fully build the documentation including the pyleecan api subpackage you need to install pyleecan. Currently we have to use the Github version since the new release is not out yet: `pip install git+https://gitlab.com/Eomys/pyleecan/tree/update-python-version.git`
4. 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.
Futher information on building the documentation can be found in the [Sphinx documentation](https://www.sphinx-doc.org/en/master/tutorial/index.html).
