Metadata-Version: 2.2
Name: libskit
Version: 0.2
Summary: A package for simulation and analysis of LIBS spectra.
Author-Email: "Christoph H. Egerland" <christoph.egerland@dlr.de>
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3 :: Only
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: Programming Language :: Python :: 3.13
Requires-Python: >=3.8
Requires-Dist: numpy>=1.20.0
Requires-Dist: pandas>=1.3.0
Requires-Dist: scipy>=1.7.0
Requires-Dist: matplotlib>=3.5.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: molmass>=2021.6.18
Requires-Dist: nlopt>=2.7.0
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Provides-Extra: full
Requires-Dist: plotly>=5.0.0; extra == "full"
Requires-Dist: ipywidgets>=7.6.0; extra == "full"
Requires-Dist: ipympl; extra == "full"
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: coverage[toml]; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: pydantic>=2.0.0; extra == "dev"
Description-Content-Type: text/markdown

# LIBSkit

[![CI](https://github.com/DLR-WR/libskit/actions/workflows/ci.yml/badge.svg)](https://github.com/DLR-WR/libskit/actions/workflows/ci.yml)
[![Documentation Status](https://readthedocs.org/projects/libskit/badge/?version=latest)](https://libskit.readthedocs.io/en/latest/)
[![PyPI](https://img.shields.io/pypi/v/libskit.svg)](https://pypi.org/project/libskit/)

A software tool for the simulation and analysis of laser-induced breakdown spectroscopy (LIBS) spectra.

The simulation core is written in C++ with Python bindings via pybind11. Atomic databases (NIST ASD lines, ionization energies, energy levels) are bundled with the package and loaded automatically on import.

## Quick Start

```python
import libskit
import numpy as np

# Create an LTE plasma model
model = libskit.LTEModel(
    {"Si": 0.72, "Na": 0.09, "Ca": 0.19},   # %
    temperature=17300.0,                    # K
    electron_density=2.53e23,               # m^-3
    length=2.4e-3                           # m
)

# Define an instrument and calculate a spectrum
wavelengths = np.arange(250, 900, 0.05)                       # nm
instrument = libskit.GenericSpectrometer(0.05, 0.001)         # nm
spectrum = instrument.calculate_spectrum(wavelengths, model)
```

## Installation

This package is only available as a source build — it is not published on PyPI or any package registry.

Source builds need a Clang toolchain with the Enzyme automatic-differentiation plugin.

- **Linux**: ``sudo apt install cmake ninja-build git clang llvm-dev``
- **macOS**: install LLVM/Clang and CMake, then build Enzyme against that LLVM
- **Windows**: use an LLVM/Clang toolchain with Enzyme available

Then:
```bash
git clone <repository-url>
cd libskit

python -m venv .venv
source .venv/bin/activate  # Linux/macOS
# .venv\Scripts\activate   # Windows

pip install -r requirements.txt
./scripts/dev.sh
```

This builds the Enzyme plugin and installs the package in one step.

> **Note:** Eigen3 is downloaded automatically during build if not found on your system.

## Prerequisites (for development)
To build the code from source you need:
- Clang-compatible C++20 compiler
- CMake 3.15+
- Python 3.8+

## Tutorials 

The `notebooks/` directory in this repository contains a curated set of tutorials (`tutorial_1_…` through `tutorial_7_…`).


## Contributors
Christoph H. Egerland

## License
MIT
