diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 16f08e3..c83850c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,10 +67,10 @@ jobs: - uses: actions/checkout@v2 with: fetch-depth: 0 - - name: Set up Python 3.8 + - name: Set up Python 3.11 uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.11 - name: Install tox run: | python -m pip install --upgrade pip diff --git a/MANIFEST.in b/MANIFEST.in index 19a62f2..cb99df4 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1 @@ -include RELIC-INFO exclude stwcs/version.py diff --git a/doc/rtd_requirements.yaml b/doc/rtd_requirements.yaml index 3db3133..c1512bc 100644 --- a/doc/rtd_requirements.yaml +++ b/doc/rtd_requirements.yaml @@ -6,4 +6,4 @@ dependencies: - astropy - pip - graphviz - + - sphinx_rtd_theme>1.2.0 diff --git a/doc/source/conf.py b/doc/source/conf.py index 6c323d1..9b18616 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -15,6 +15,7 @@ import importlib # Check Sphinx version import sphinx +import sphinx_rtd_theme # If extensions (or modules to document with autodoc) are in another directory, diff --git a/setup.cfg b/setup.cfg index e6f9d08..1d7c88f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -10,7 +10,7 @@ github_project = spacetelescope/stwcs [tool:pytest] minversion = 3.9 -norecursedirs = build docs/_build relic +norecursedirs = build docs/_build filterwarnings= ignore:.*Card is too long* ignore:.*Some non-standard WCS keywords* @@ -22,6 +22,11 @@ filterwarnings= builder = html warning-is-error = 1 +[docs] +docs = + sphinx + sphinx-rtd-theme + [flake8] # E402, E501, E722 should be added back to the selection list # once they are made to pass. diff --git a/stwcs/tests/test_updatewcs.py b/stwcs/tests/test_updatewcs.py index b227e99..c6bc51b 100644 --- a/stwcs/tests/test_updatewcs.py +++ b/stwcs/tests/test_updatewcs.py @@ -1,8 +1,10 @@ import shutil import os +import warnings from astropy import wcs from astropy.io import fits +from astropy.wcs import FITSFixedWarning from .. import updatewcs from ..updatewcs import apply_corrections from ..distortion import utils as dutils @@ -11,8 +13,9 @@ from numpy import testing import pytest - from . import data + + data_path = os.path.split(os.path.abspath(data.__file__))[0] os.environ['ASTROMETRY_STEP_CONTROL'] = 'Off' @@ -464,6 +467,9 @@ def test_update_stis_asn(): shutil.copyfile(stis_asn_orig_file, fname) shutil.copyfile(idc_orig_file, idctab) + warnings.simplefilter("ignore", category=FITSFixedWarning)#, + # message=" 'datfix' made the change 'Set MJD-OBS to 50853.000000 from DATE-OBS'.") + expnames = updatewcs.updatewcs(fname) assert expnames[0] == os.path.basename(fname_expname1) diff --git a/stwcs/updatewcs/corrections.py b/stwcs/updatewcs/corrections.py index 7dec568..67349c1 100644 --- a/stwcs/updatewcs/corrections.py +++ b/stwcs/updatewcs/corrections.py @@ -348,8 +348,8 @@ def updateWCS(cls, ext_wcs, ref_wcs): if n >= m and n >= 2: idcval = np.array([[cx[n, m]], [cy[n, m]]]) sipval = np.dot(imatr, idcval) - akeys1[m, n - m] = sipval[0] - bkeys1[m, n - m] = sipval[1] + akeys1[m, n - m] = sipval[0].item() + bkeys1[m, n - m] = sipval[1].item() Akey = "A_%d_%d" % (m, n - m) Bkey = "B_%d_%d" % (m, n - m) kw2update[Akey] = sipval[0, 0] * ext_wcs.binned, sip_comment