Installation

Requirements

nsb2 requires Python 3.11 or later.

Basic Installation

Install directly from the git repository:

pip install git+https://github.com/GerritRo/nsb2.git

Using nsb2 with ctapipe

nsb2’s dependency bounds are chosen to overlap those of ctapipe, so the two install into a single environment without a resolver conflict:

pip install ctapipe git+https://github.com/GerritRo/nsb2.git

Development Installation

For development or to access example notebooks, clone the repository:

git clone https://github.com/GerritRo/nsb2.git
cd nsb2
pip install -e ".[dev]"
pre-commit install

This installs additional development dependencies:

  • pytest for running tests

  • mypy for type checking

  • ruff for code linting and formatting

  • pre-commit for running both automatically before each commit

  • commitizen for conventional commits

Running the Tests

pytest

Tests live next to the code they cover, in nsb2/<subpackage>/tests/. Tests that download reference data from STScI, Zenodo or the SVO Filter Profile Service are marked remote_data and are skipped by default; run them explicitly with:

pytest -m remote_data

Building Documentation

To build this documentation locally:

pip install -e ".[docs]"
cd docs
make html

The built documentation will be in docs/_build/html/.

Dependencies

nsb2 depends on:

Package

Purpose

NumPy

Array operations

SciPy

Interpolation and integration

Astropy

Coordinates, units, and time

healpy

HEALPix sky pixelization

scikit-learn

BallTree spatial queries

dust_extinction

Dust extinction models