Metadata-Version: 2.4
Name: swgo-array-trigger
Version: 0.1.0
Summary: Python bindings for the SWGO Array Trigger
Author-Email: Johannes Bennemann <johannes.bennemann@mpi-hd.mpg.de>
Maintainer-Email: Johannes Bennemann <johannes.bennemann@mpi-hd.mpg.de>
License-Expression: MPL-2.0
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python :: 3 :: Only
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: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Programming Language :: C++
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Operating System :: POSIX :: Linux
Project-URL: Homepage, https://gitlab.com/swgo-collaboration/simulation/swgo-array-trigger
Requires-Python: >=3.9
Requires-Dist: typing_extensions
Description-Content-Type: text/markdown

# Python Bindings for the SWGO Array Trigger

This are the Python bindings for the SWGO Array Trigger.
The bindings can be installed from PyPI:
```bash
pip install swgo-array-trigger
```
If your operating system is not supported, you can install them manually:
```bash
git clone --recursive git@gitlab.com:swgo-collaboration/simulation/swgo-array-trigger-python-bindings.git
cd swgo-array-trigger-python-bindings
python -m pip install .
```

## Usage

The main interface can be used as:
```python
import libarraytrigger as libat
main_trigger = libat.MainTrigger("settings.yaml")
events = main_trigger.apply(input_data)
```
Here `input_data` is a list of TriggerData objects (e.g. from swgo-wave).
The output is a list of lists of TriggerData (the events).

It is possible to cache lists of TriggerData:
```python
# write/read all events at once
libat.TriggerDataCache.write(cache_path, [input_data])
events = libat.TriggerDataCache.read(cache_path)
# write/read events one by one
writer = libat.TriggerDataCacheWriter(cache_path)
writer.write(input_data)
del writer
reader = libat.TriggerDataCache(cache_path)
while reader.has_next():
    event = reader.next_batch()
```
Caching is for short term storage only, the data format is not compatible between versions.
