# Spark3DBatch
Python library to launch (batch) Spark3D simulations.
`SPARK3D` versions `> 2016` should be supported, but last tests were done on
`SPARK3D 2025 SP4`.

## Installation
1. Create a dedicated Python environment, activate it.
2. Run `pip install spark3d-batch`.

> [!NOTE]
> If you are completely new to Python and these instructions are unclear, check [this tutorial](https://python-guide.readthedocs.io/en/latest/).
> In particular, you will want to:
> 1. [Install Python](https://python-guide.readthedocs.io/en/latest/starting/installation/) 3.9 or higher.
> 2. [Learn to use Python environments](https://python-guide.readthedocs.io/en/latest/dev/virtualenvs/), `pipenv` or `virtualenv`.
> 3. [Install a Python IDE](https://python-guide.readthedocs.io/en/latest/dev/env/#ides) such as Spyder or VSCode.

3. Set the environment variable `$SPARK3DPATH` to point to the folder containing the SPARK3D executable.
   In general, adding the following line to your `.bashrc` will do the trick:
   ```bash
   export SPARK3DPATH="/opt/cst/CST_Studio_Suite_20XX/SPARK3D/"
   ```

> [!IMPORTANT]
> Not tested on Windows.

## Usage

Two options:

1. Provide a `SPKX` file,
2. Provide a `XML` file and a field map.
   - `XML` can be generated by unzipping a `SPKX` file, allowing you to modify
   the simulation parameters with a script.
   - Field maps can be `F3E`, `DSP` or `MFE`.

## To-do

### Important
- [x] Allow for control over accelerating field instead of power
- [x] Change how the path to SPARK3D is declared. Currently not robust at all.

### Secondary
- [x] Package test data

### Tertiary
- [ ] Complete installation instructions
- [ ] Static typing to detect allowed keys in `XML`
- [ ] CLI interface
- [x] On `pip`
- [ ] Tests
- [ ] Use `logging` instead of `printc`
- [x] Add `release.py`
