Skip to content

Commit

Permalink
CRTFParser is deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
keflavich committed Oct 18, 2024
1 parent e88dc72 commit 031eef8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion spectral_cube/spectral_cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -2069,7 +2069,10 @@ def subcube_from_crtfregion(self, crtf_region, allow_empty=False):
import regions

if isinstance(crtf_region, str):
region_list = regions.CRTFParser(crtf_region).shapes.to_regions()
if hasattr(regions, 'CRTFParser'):
region_list = regions.CRTFParser(crtf_region).shapes.to_regions()
else:
region_list = regions.Regions.read(crtf_region)
else:
raise TypeError("{0} should be a CRTF string".format(crtf_region))

Expand Down

0 comments on commit 031eef8

Please sign in to comment.