Skip to main content

antares-devkit

Provides tools and utility methods to write and debug ANTARES filters with Python.

ANTARES is an Alert Broker developed by the NSF NOIRLab for ZTF and LSST.

If you want to write and submit a filter to ANTARES please follow the steps to submit a filter in our documentation. If you wrote a filter for antares and is not in the devkit repository, contact us and we'll send you your code from our backup.

Installation

The ANTARES DevKit supports Python version 3.9 and up and can be installed with pip:

pip install antares-devkit

Basic Usage

The DevKit can be used in a local environment and also on NSF NOIRLab’s Astro Data Lab Jupyter environment.

A basic example of creating and executing a filter is provided below.

Create a HelloWorld filter:

from antares_devkit.models import BaseFilter


class HelloWorld(BaseFilter):
    OUTPUT_LOCUS_TAGS = [
        {"name": "hello_world", "description": "hello!"},
    ]

    def _run(self, locus):
        print("Hello Locus ", locus.locus_id)

Run the filter on a random ANTARES locus:

from antares_client import search
from antares_devkit.models import DevKitLocus
from antares_devkit.utils import filter_report

# fetch a random locus from the antares database using the antares-client
client_locus = search.get_random_locus()
devkit_locus = DevKitLocus.model_validate(client_locus.to_devkit())

# execute the filter
HelloWorld().run(devkit_locus)

For more information and additional examples visit our DevKit guide.

Development

How does this work?

This repository can be shipped as a python package on pip and also can be used in installations using the repository with tags. Then the filter_runner docker image in the antares main repository is going to install all the filters and required packages, then we use a gcp bucket to know which filters are enabled or disabled.

docker build -t antares_devkit:3.9 -f test/Dockerfile .
docker run -v $(pwd)/antares_devkit:/usr/src/app/antares_devkit -v $(pwd)/test:/usr/src/app/test -it antares_devkit:3.9
uv run pytest test

How to setup local environment (with conda)

conda create -n devkit python=3.9 -y
conda activate devkit
pip install uv
uv sync --all-groups --all-extras

How to add a filter dependency

uv add "{package_name}" --optional filter-dependencies

or for jupyter lab libraries use:

uv add "{package_name}" --optional jupyter

How to add a dev dependency

uv add "{package_name}" --group dev

or for docs libraries use:

uv add "{package_name}" --group docs

How to run a jupyter notebook

uv run --with jupyter jupyter lab

How to write documentation

Add md files and update mkdocs.yml to add them in the nav.

How to update filters src

  1. Execute uv run python scripts/update_filters_src.py
  2. Paste the output in mkdocs.yml within the nav.Filters replacing the entire section.

How to view the documentation locally

Install necessary dependencies:

uv sync --group docs

Serve the docs:

uv run mkdocs serve

Metadata

Release files for antares-devkit 0.12.0

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

Source distribution (sdist)

Source distribution for antares-devkit 0.12.0
File Size Uploaded Provenance Actions
antares_devkit-0.12.0.tar.gz 13.9 MB Without provenance Details for antares_devkit-0.12.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for antares-devkit 0.12.0
File Interpreter ABI Platform Actions
antares_devkit-0.12.0-py3-none-any.whl Python 3 none any Details for antares_devkit-0.12.0-py3-none-any.whl

Total release size: 28.2 MB

Release files / antares_devkit-0.12.0.tar.gz

Download URL antares_devkit-0.12.0.tar.gz
Size 13.9 MB
Tags Source
SHA-256 checksum
How to use checksums
d86f6235537e16169e5c7d895054d942fd1134aff42a203ac94e5b6e2ed60a5e
BLAKE2b-256 checksum
How to use checksums
ae0c81be49dd55507a807e4ee1a445fca1641bba8c8d5075a71d2b60de9fbf2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / antares_devkit-0.12.0-py3-none-any.whl

Download URL antares_devkit-0.12.0-py3-none-any.whl
Size 14.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
0429535f1b8ccdb13f6caf9b411ca7449194d9a1fa7aed33c4e872712165e024
BLAKE2b-256 checksum
How to use checksums
b3945ac28ddf5a32525472844fe3d92f10d9d7fcc2ceae4c805be04f27e01a72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Security for antares-devkit 0.12.0

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