From 7706b08ef0ee635cd6ed6e94dd87fdf12a21009c Mon Sep 17 00:00:00 2001 From: "Adam Ginsburg (keflavich)" Date: Tue, 24 Jun 2025 19:53:27 -0400 Subject: [PATCH 1/2] add deprecation warnings in the docs --- README.rst | 6 ++++++ docs/index.rst | 10 ++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 630f468..2054744 100644 --- a/README.rst +++ b/README.rst @@ -1,6 +1,12 @@ pyregion ======== +DEPRECATION note +---------------- +pyregion is deprecated in favor of astropy regions (https://astropy-regions.readthedocs.io/en/stable/), as pyregion is no longer maintained. + +Historic Documentation +---------------------- pyregion is a python module to parse ds9 region files. It also supports ciao region files. diff --git a/docs/index.rst b/docs/index.rst index 4e167f4..a074664 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -5,14 +5,16 @@ pyregion :Release: |version| :Date: |today| -pyregion is a python module to parse ds9 region files. -It also supports ciao region files. .. note:: - See also the in-development ``regions`` package + The ``regions`` package at https://github.com/astropy/regions - a new astronomy package for regions based on Astropy. + supercedes pyregion. + The pyregion package is deprecated and unmaintained. + +pyregion is a python module to parse ds9 region files. +It also supports ciao region files. +----------------------------------------+----------------------------------------+ From 64beef2ead19a271be1d974a32b1ae2c624f9124 Mon Sep 17 00:00:00 2001 From: "Adam Ginsburg (keflavich)" Date: Tue, 24 Jun 2025 19:55:08 -0400 Subject: [PATCH 2/2] add import-time deprecation warning --- pyregion/core.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyregion/core.py b/pyregion/core.py index 5890018..aa9132a 100644 --- a/pyregion/core.py +++ b/pyregion/core.py @@ -3,8 +3,12 @@ from .ds9_region_parser import RegionParser from .wcs_converter import check_wcs as _check_wcs +from warnings import DeprecationWarning, warn + _builtin_open = open +warn("The pyregion package is deprecated. Please switch to astropy regions.", DeprecationWarning) + class ShapeList(list): """A list of `~pyregion.Shape` objects.