From 792f6344dfae702e5fd202448e7941a5773f8855 Mon Sep 17 00:00:00 2001 From: Thomas Robitaille Date: Thu, 24 Feb 2022 16:24:53 +0000 Subject: [PATCH 1/3] No longer test against casatools and casatasks since spectral-cube now depends on casa-formats-io by default --- azure-pipelines.yml | 3 +-- glue_astronomy/io/spectral_cube/tests/test_spectral_cube.py | 2 -- setup.cfg | 2 +- tox.ini | 6 +----- 4 files changed, 3 insertions(+), 10 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index cc5d3a4..29441ea 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -26,12 +26,11 @@ jobs: libraries: {} coverage: 'false' - - linux: py36-test-casa + - linux: py37-test - linux: py38-test - linux: py39-test - linux: py310-test-dev - - macos: py36-test-casa - windows: py37-test - macos: py38-test - windows: py39-test-dev diff --git a/glue_astronomy/io/spectral_cube/tests/test_spectral_cube.py b/glue_astronomy/io/spectral_cube/tests/test_spectral_cube.py index 1658a4f..aafde2c 100644 --- a/glue_astronomy/io/spectral_cube/tests/test_spectral_cube.py +++ b/glue_astronomy/io/spectral_cube/tests/test_spectral_cube.py @@ -12,7 +12,6 @@ def test_identifier_fits(): def test_identifier_casa(): - pytest.importorskip('casatools') assert is_spectral_cube(get_pkg_data_filename('data/cube_3d.image')) @@ -38,7 +37,6 @@ def test_reader_fits_4d_fullstokes(): def test_reader_casa(): - pytest.importorskip('casatools') data = read_spectral_cube(get_pkg_data_filename('data/cube_3d.image')) assert isinstance(data['STOKES I'], np.ndarray) assert data.shape == (2, 3, 4) diff --git a/setup.cfg b/setup.cfg index e87fa04..37b1bcd 100644 --- a/setup.cfg +++ b/setup.cfg @@ -21,7 +21,7 @@ install_requires = glue-core>=1.0 regions>=0.4 specutils>=0.7 - spectral-cube>=0.5.0 + spectral-cube>=0.6.0 [options.extras_require] docs = diff --git a/tox.ini b/tox.ini index 9d2ed75..d708ecf 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,7 @@ [tox] -envlist = py{36,37,38,39,310}-{test,docs}-{casa,dev} +envlist = py{36,37,38,39,310}-{test,docs}-{,dev} requires = pip >= 18.0 setuptools >= 30.3.0 -indexserver = - NRAO = https://casa-pip.nrao.edu/repository/pypi-group/simple [testenv] passenv = @@ -13,8 +11,6 @@ changedir = deps = dev: git+https://github.com/astropy/astropy dev: git+https://github.com/astropy/specutils - casa: :NRAO:casatools - casa: :NRAO:casatasks extras = test: test docs: docs From 58e958e2bfc0d7019bb828957df2a17c0561c833 Mon Sep 17 00:00:00 2001 From: Thomas Robitaille Date: Thu, 24 Feb 2022 16:35:09 +0000 Subject: [PATCH 2/3] Bump minimum required Python to 3.7 --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 37b1bcd..f172958 100644 --- a/setup.cfg +++ b/setup.cfg @@ -13,7 +13,7 @@ long_description_content_type = text/x-rst [options] zip_safe = False packages = find: -python_requires = >=3.6 +python_requires = >=3.7 setup_requires = setuptools_scm install_requires = From edc6f0ca3ad5bfc08752bb8b76a59d8d0e100ca2 Mon Sep 17 00:00:00 2001 From: "Pey Lian Lim (Github)" <2090236+pllim@users.noreply.github.com> Date: Thu, 24 Feb 2022 19:56:04 -0500 Subject: [PATCH 3/3] Fix casa test --- .../io/spectral_cube/tests/test_spectral_cube.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/glue_astronomy/io/spectral_cube/tests/test_spectral_cube.py b/glue_astronomy/io/spectral_cube/tests/test_spectral_cube.py index aafde2c..7239717 100644 --- a/glue_astronomy/io/spectral_cube/tests/test_spectral_cube.py +++ b/glue_astronomy/io/spectral_cube/tests/test_spectral_cube.py @@ -1,6 +1,5 @@ import numpy as np -import pytest -from astropy.utils.data import get_pkg_data_filename +from astropy.utils.data import get_pkg_data_filename, get_pkg_data_path from glue.qglue import parse_data from spectral_cube import SpectralCube @@ -12,7 +11,7 @@ def test_identifier_fits(): def test_identifier_casa(): - assert is_spectral_cube(get_pkg_data_filename('data/cube_3d.image')) + assert is_spectral_cube(get_pkg_data_path('data/cube_3d.image')) def test_reader_fits(): @@ -37,8 +36,9 @@ def test_reader_fits_4d_fullstokes(): def test_reader_casa(): - data = read_spectral_cube(get_pkg_data_filename('data/cube_3d.image')) - assert isinstance(data['STOKES I'], np.ndarray) + from dask import array as dask_array + data = read_spectral_cube(get_pkg_data_path('data/cube_3d.image')) + assert isinstance(data['STOKES I'], dask_array.Array) assert data.shape == (2, 3, 4)