Metadata-Version: 2.4
Name: soxspipe
Version: 0.18.0
Summary: A python package and command-line tools to The data-reduction pipeline for the SOXS instrument
Author-email: David Young <david.young.rse@gmail.com>
License-Expression: GPL-3.0-or-later
Project-URL: Homepage, https://github.com/thespacedoctor/soxspipe
Keywords: soxs, eso, data, pipeline, spectra
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Topic :: Utilities
Requires-Python: <3.14,>=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pyyaml==6.0.2
Requires-Dist: fundamentals==2.7.6
Requires-Dist: astropy==6.1.2
Requires-Dist: ccdproc==2.4.2
Requires-Dist: docopt==0.6.2
Requires-Dist: photutils==1.13.0
Requires-Dist: matplotlib
Requires-Dist: numpy==2.1.0
Requires-Dist: numba>=0.61
Requires-Dist: unicodecsv==0.14.1
Requires-Dist: pandas<3,>=2.2.3
Requires-Dist: tabulate==0.9.0
Requires-Dist: bottleneck==1.4.0
Requires-Dist: multiprocess==0.70.16
Requires-Dist: specutils==1.16.0
Requires-Dist: humanize==4.11.0
Requires-Dist: line_profiler
Requires-Dist: memory_profiler
Requires-Dist: scikit-learn
Requires-Dist: jinja2
Provides-Extra: docs
Requires-Dist: build; extra == "docs"
Requires-Dist: sphinx; extra == "docs"
Requires-Dist: sphinx-autodoc2; extra == "docs"
Requires-Dist: myst-parser; extra == "docs"
Requires-Dist: furo; extra == "docs"
Requires-Dist: sphinx-inline-tabs; extra == "docs"
Requires-Dist: sphinxext-opengraph; extra == "docs"
Requires-Dist: sphinx-autobuild; extra == "docs"
Requires-Dist: linkify-it-py; extra == "docs"
Requires-Dist: sphinxcontrib-mermaid; extra == "docs"
Requires-Dist: sphinx-togglebutton; extra == "docs"
Requires-Dist: sphinx_copybutton; extra == "docs"
Requires-Dist: sphinx_tippy; extra == "docs"
Requires-Dist: sphinx_design; extra == "docs"
Requires-Dist: pygments-csv-lexer; extra == "docs"
Requires-Dist: sphinxcontrib-svg2pdfconverter; extra == "docs"
Requires-Dist: sphinx-remove-toctrees; extra == "docs"
Requires-Dist: sphinxcontrib.bibtex; extra == "docs"
Provides-Extra: tests
Requires-Dist: diff-cover==10.5.1; extra == "tests"
Requires-Dist: pytest; extra == "tests"
Requires-Dist: pytest-cov; extra == "tests"
Requires-Dist: ruff==0.16.5; extra == "tests"
Provides-Extra: dev
Requires-Dist: soxspipe[docs,tests]; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Requires-Dist: debuggy; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"
Dynamic: license-file

# soxspipe



[![](https://zenodo.org/badge/DOI/10.5281/zenodo.8038264.svg)](https://zenodo.org/doi/10.5281/zenodo.8038264) 




<!-- INFO BADGES -->  

[![](https://img.shields.io/pypi/pyversions/soxspipe)](https://pypi.org/project/soxspipe/)
[![](https://img.shields.io/pypi/v/soxspipe)](https://pypi.org/project/soxspipe/)
[![](https://img.shields.io/conda/vn/conda-forge/soxspipe)](https://anaconda.org/conda-forge/soxspipe)
[![](https://static.pepy.tech/badge/soxspipe/month)](https://pepy.tech/project/soxspipe)
[![](https://img.shields.io/github/license/thespacedoctor/soxspipe)](https://github.com/thespacedoctor/soxspipe)

<!-- STATUS BADGES -->  

[![Required tests](https://github.com/thespacedoctor/soxspipe/actions/workflows/tests.yml/badge.svg?branch=develop)](https://github.com/thespacedoctor/soxspipe/actions/workflows/tests.yml)
[![](https://readthedocs.org/projects/soxspipe/badge/?version=main)](https://soxspipe.readthedocs.io/en/main/)
[![](https://img.shields.io/github/issues/thespacedoctor/soxspipe/type:%20bug?label=bug%20issues)](https://github.com/thespacedoctor/soxspipe/issues?q=is%3Aissue+is%3Aopen+label%3A%22type%3A+bug%22+)

*The data-reduction pipeline for the SOXS instrument* (a python package with command-line tools).

Documentation for soxspipe is hosted by [Read the Docs](https://soxspipe.readthedocs.io/en/main/) ([development version](https://soxspipe.readthedocs.io/en/develop/) and [main version](https://soxspipe.readthedocs.io/en/main/)). The code lives on [github](https://github.com/thespacedoctor/soxspipe). Please report any issues you find [here](https://github.com/thespacedoctor/soxspipe/issues).

## Installation

The best way to install or upgrade soxspipe is to use `conda` to install the package in its own isolated environment, as shown here:

``` bash
conda create -n soxspipe python=3.12 soxspipe -c conda-forge
conda activate soxspipe
```

If you have previously installed soxspipe, a warning will be issued stating that a conda environment already exists; select 'y' when asked to remove the existing environment.

To check installation was successful run `soxspipe -v`. This should return the version number of the install.

## Testing

Install the test dependencies and run the required offline suite with Python 3.12:

```bash
python -m pip install -e ".[tests]"
python -m pytest tests/unit tests/integration -m "not slow"
```

The real-data acceptance test is opt-in. The scheduled GitHub Actions workflow downloads the immutable archive named by `tests/real_data/manifest.json`, verifies it, creates a disposable workspace, and runs the representative NIR-offset reduction. To run the acceptance assertions locally after preparing that workspace, set `SOXSPIPE_REAL_DATA_DIR` to its absolute path:

```bash
SOXSPIPE_REAL_DATA_DIR=/absolute/path/to/workspace python -m pytest tests/real_data
```

## Changed-line gates

Two gates run on every pull request into `develop`, and both judge only the lines the pull request changed. Neither one asks the whole package to be clean, so existing debt never blocks an unrelated change:

- **Coverage.** `diff-cover reports/coverage.xml --compare-branch=origin/develop --fail-under=80` requires 80% coverage of changed lines.
- **Lint.** `python tools/lint_ratchet.py --compare-branch origin/develop` fails when a ruff finding lands on a changed line. Ruff has no baseline feature, so the tool intersects `ruff check --output-format json` with the diff hunks itself. Pre-existing findings in the files you touched are counted and printed as context, never gated; the package carries roughly 1,380 of them in total, and `ruff check soxspipe` reports that whole-package figure.

A finding is matched on the line ruff anchors it to. A finding that covers many lines, such as `PLR0915` for an over-long function, is anchored at the `def` line: writing a new over-long function fails the gate, while adding a statement to one that is already over-long does not.

Run the lint gate locally against your staged changes before committing:

```bash
python tools/lint_ratchet.py --staged
```

To run it automatically on every commit, install the hook. It is a convenience, not the gate — `git commit --no-verify` skips it, and the CI step does not:

```bash
python -m pip install -e ".[dev]"
pre-commit install
```

## How to cite soxspipe

If you use `soxspipe` in your work, please cite using the following BibTeX entry: 

```bibtex
@software{Young_soxspipe,
    author = {Young, David R. & Landoni, Marco},
    doi = {10.5281/zenodo.8038264},
    license = {GPL-3.0-only},
    title = {{soxspipe. The SOXS data-reduction pipeline}},
    url = {https://zenodo.org/doi/10.5281/zenodo.8038264}
}
```
