Skip to main content

Unit Tests

reLAISS Logo

A flexible library for similarity searches of supernovae and their host galaxies.

reLAISS lets you retrieve nearest‑neighbour supernovae (or spot outliers) by combining ZTF $g/r$ light‑curve morphology with Pan‑STARRS host‑galaxy colours. A pre‑built reference index allows users find similar events to a queried object in seconds. reLAISS is designed to be modular; feel free to customize for your own science!

Install

Installation is easy: in a fresh conda environment, run pip install relaiss. If you want even faster performance, you can install both ngt and its python bindings from source; instructions can be found here.

Code Demo

import relaiss as rl

client = rl.ReLAISS()

# load reference data
client.load_reference(
    path_to_sfd_folder='./sfddata-master',  # Directory for SFD dust maps
    weight_lc=3, # Upweight lightcurve features for neighbor search
)

# Find the 5 closest matches to a ZTF transient
neigh = client.find_neighbors(
        ztf_object_id='ZTF21abbzjeq',  # Using the test transient
        n=5,  # number of neighbors to retrieve
        plot=True, # plot and save figures
        save_figures=True,
        path_to_figure_directory='./figures'
    )

# print closest neighbors and their distances
print(neigh[["iau_name", "dist"]])

Citation

If you use reLAISS for your research, please cite the following two works:

@article{Reynolds_2025,
doi = {10.3847/2515-5172/adef56},
url = {https://dx.doi.org/10.3847/2515-5172/adef56},
year = {2025},
month = {jul},
publisher = {The American Astronomical Society},
volume = {9},
number = {7},
pages = {189},
author = {Reynolds, E. and Gagliano, A. and Villar, V. A.},
title = {reLAISS: A Python Package for Flexible Similarity Searches of Supernovae and Their Host Galaxies},
journal = {Research Notes of the AAS},
}


@ARTICLE{2024ApJ...974..172A,
       author = {{Aleo}, P.~D. and {Engel}, A.~W. and {Narayan}, G. and {Angus}, C.~R. and {Malanchev}, K. and {Auchettl}, K. and {Baldassare}, V.~F. and {Berres}, A. and {de Boer}, T.~J.~L. and {Boyd}, B.~M. and {Chambers}, K.~C. and {Davis}, K.~W. and {Esquivel}, N. and {Farias}, D. and {Foley}, R.~J. and {Gagliano}, A. and {Gall}, C. and {Gao}, H. and {Gomez}, S. and {Grayling}, M. and {Jones}, D.~O. and {Lin}, C. -C. and {Magnier}, E.~A. and {Mandel}, K.~S. and {Matheson}, T. and {Raimundo}, S.~I. and {Shah}, V.~G. and {Soraisam}, M.~D. and {de Soto}, K.~M. and {Vicencio}, S. and {Villar}, V.~A. and {Wainscoat}, R.~J.},
        title = "{Anomaly Detection and Approximate Similarity Searches of Transients in Real-time Data Streams}",
      journal = {\apj},
     keywords = {Supernovae, Transient detection, Astronomical methods, Time domain astronomy, Time series analysis, Astrostatistics techniques, Classification, Light curves, Random Forests, 1668, 1957, 1043, 2109, 1916, 1886, 1907, 918, 1935, Astrophysics - High Energy Astrophysical Phenomena, Astrophysics - Instrumentation and Methods for Astrophysics},
         year = 2024,
        month = oct,
       volume = {974},
       number = {2},
          eid = {172},
        pages = {172},
          doi = {10.3847/1538-4357/ad6869},
archivePrefix = {arXiv},
       eprint = {2404.01235},
 primaryClass = {astro-ph.HE},
       adsurl = {https://ui.adsabs.harvard.edu/abs/2024ApJ...974..172A},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

Metadata

Release files for relaiss 1.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for relaiss 1.2.4
File Size Uploaded Provenance Actions
relaiss-1.2.4.tar.gz 4.6 MB Without provenance Details for relaiss-1.2.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for relaiss 1.2.4
File Interpreter ABI Platform Actions
relaiss-1.2.4-py3-none-any.whl Python 3 none any Details for relaiss-1.2.4-py3-none-any.whl

Total release size: 4.6 MB

Release files / relaiss-1.2.4.tar.gz

Download URL relaiss-1.2.4.tar.gz
Size 4.6 MB
Tags Source
SHA-256 checksum
How to use checksums
3a2596650eb97225faa0749b8db694bb34c86a438a9b8cd0666dfd737d841a8e
BLAKE2b-256 checksum
How to use checksums
8307e77a3bb9c6a07fbb0dd961bc37e1e320eccef179a19e33398d91cf53cb9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / relaiss-1.2.4-py3-none-any.whl

Download URL relaiss-1.2.4-py3-none-any.whl
Size 54.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cd5051ee407721aacaf6aba300e0d8ef38378e90bf5f977b69238a6c7cba8ee1
BLAKE2b-256 checksum
How to use checksums
3a158beafbf905237a0192d941331ba987af048b1ba3d9e7e0207c774da94cfb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Security for relaiss 1.2.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page