Metadata-Version: 2.4
Name: pyemsol
Version: 2026.9.2+cm.ubuntu
Summary: A Python wrapper of EMSolution
Home-page: https://github.com/EMSolution-SSIL/pyemsol
Author: Hiroyuki Kaimori
License: LICENSE.txt
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Build Tools
Classifier: License :: OSI Approved :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3.11
Classifier: Operating System :: POSIX :: Linux
Requires-Python: ~=3.11.0
Description-Content-Type: text/markdown
Dynamic: author
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: requires-python
Dynamic: summary

# **pyemsol** : Python dynamic module of EMSolution
``` note
note:  
pyemsol.pyd works in Python 3.9 and 3.11 environments. the module .pyd and .whl are different modules.
```

## How to make .whl (for Developper)

For building and installing as a package, your directory structure should look like this:

```arduino
pyemsol/
│
├── pyemsol/
│   └── __init__.py
│   └── pyemsol.pyd
│   └── # related libraries *.dll or *.so
│
├── README.md
└── setup.py
```

Then build .whl:

```sh
# windows
python setup.py bdist_wheel --python-tag cp311 --py-limited-api cp311 --plat-name win_amd64
# or
python -m build --wheel
# linux
python setup.py bdist_wheel --python-tag cp311 --plat-name manylinux1_x86_64
```

## Installation

To install this package, you can use `pip`:

```sh
pip install pyemsol-2024.11.1-cp39-cp39-win_amd64.whl # Install the wheel file using pip on Windows
```
```sh
pip install pyemsol-2024.11.1-cp39-cp39-manylinux1_x86_64.whl # Install the wheel file using pip on Linux (RedHut family)
```

### Additional Dependencies
Please note that this package requires additional dependencies that are available via Conda. After installing the package, make sure to install the following Conda packages:

```sh
conda install -c conda-forge pybind11 pybind11-abi
conda install -c conda-forge mkl mkl-include
```

## How to use after installation

To activate the Python environment.

```sh
conda activate env_name
```

**pyemsol** module can be imported in any Python script as:

```python
import pyemsol
```
to chek what function can be used,
```python
import pyemsol
print(dir(pyemsol))
```
the functions are written in `__init__py` in the installed folder with `pyemsol.pyd`

it expects that the print function shows like this.

['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', 'finalize', 'initialize', 'pyemsol', 'run', 'set_message_callback', 'solve', 'update_Time_Function', 'update_properties_in_design_domain', 'update_properties_to_elements', 'version', 'terminate']

## How to set up after installation on Linux

`pyemsol.so` is a dynamic link library, so it is needed to set the library path which related to the `pyemsol`.
the related libraries are stored in the installed directory by `pip install`.

If you need `LD_LIBRARY_PATH` to be set automatically whenever you open a terminal:
Add the export command to your ~/.bashrc or ~/.profile (depending on your shell and preferences):

```bash
echo 'export LD_LIBRARY_PATH=/path/to/pyemsol/lib:$LD_LIBRARY_PATH' >> ~/.bashrc
source ~/.bashrc
```

```note
note:  
on Windows, this set up does not need.
```

## How to use without installation
``` note
if you have `pyemsol.pyd` (Windows) or `pyemsol.so` (Linux) as dynamic link library, you can follow this process.
`pyemsol` works in Python 3.9 environment.
```
1. Placing the **pyemsol**
Place **pyemsol** in the accessible folder to Python.

```python
import sys
sys.path.append('/path/to/pyemsol')
import pyemsol
```

2. Importing **pyemsol**
Place the same folder of your Python script. then,

```python
import pyemsol
```
