From fb935bcdff4753eef2c93a1a68fecc88dd55fc6b Mon Sep 17 00:00:00 2001 From: Matt Hilton Date: Wed, 18 Oct 2023 11:19:49 +0200 Subject: [PATCH 01/10] Testing stuff --- astLib-tests.yml | 13 ++++++++++ tox.ini | 65 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 astLib-tests.yml create mode 100644 tox.ini diff --git a/astLib-tests.yml b/astLib-tests.yml new file mode 100644 index 0000000..1df3f0e --- /dev/null +++ b/astLib-tests.yml @@ -0,0 +1,13 @@ +name: astLib-tests +channels: + - conda-forge + - nodefaults +dependencies: + - python>=3.8,<3.11 + - pip + - pytest-cov + - compilers + - make + - swig + - pip: + - -r requirements.txt diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..e0f7f44 --- /dev/null +++ b/tox.ini @@ -0,0 +1,65 @@ +[tox] +requires = + tox-conda + setuptools >= 30.3.0 + pip >= 19.3.1 +envlist = + py{38,39,310}-test{,-all}{,-latest,-oldest}{,-cov} +; codestyle + +[testenv] + +conda_env = astLib-tests.yml +conda_setup_args= + --override-channels +conda_install_args= + --override-channels + +# Pass through the following environment variables which may be needed for the CI +passenv = HOME WINDIR LC_ALL LC_CTYPE CI TRAVIS + +# Run the tests in a temporary directory to make sure that we don't import +# this package from the source tree +changedir = .tmp/{envname} + +# tox environments are constructed with so-called 'factors' (or terms) +# separated by hyphens, e.g. test-devdeps-cov. Lines below starting with factor: +# will only take effect if that factor is included in the environment name. To +# see a list of example environments that can be run, along with a description, +# run: +# +# tox -l -v +# +description = + run tests + all: using all optional dependencies + latest: with the latest supported version of key dependencies + oldest: with the oldest supported version of key dependencies + cov: and test coverage + +extras = + all: all + +commands = + pip freeze +; !cov: pytest -v --pyargs soliket {posargs} +; cov: pytest -v --pyargs soliket --cov soliket --cov-report=xml --cov-config={toxinidir}/setup.cfg {posargs} + +; [testenv:codestyle] +; skip_install = true +; conda_env = +; changedir = . +; description = check code style, e.g. with flake8 +; deps = flake8 +; commands = flake8 + +; [testenv:docs] +; skip_install = true +; changedir = docs +; description = Make sphinx docs +; deps = +; sphinx +; sphinx_rtd_theme +; commands = +; pip freeze +; sphinx-build -b html . _build From e35175b2048f655960b130417bbeba336d97c84b Mon Sep 17 00:00:00 2001 From: Matt Hilton Date: Wed, 18 Oct 2023 11:45:34 +0200 Subject: [PATCH 02/10] More testing stuff --- .github/workflows/testing.yml | 19 ++++++++----------- tests/test_all.py | 4 ++++ tox.ini | 1 + 3 files changed, 13 insertions(+), 11 deletions(-) create mode 100644 tests/test_all.py diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 8173533..9892af6 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -10,21 +10,18 @@ jobs: fail-fast: false matrix: include: - - name: latest supported versions os: ubuntu-latest python-version: '3.10' toxenv: py310-test-all-latest-cov - - #- name: oldest supported versions - #os: ubuntu-latest - #python-version: '3.8' - #toxenv: py38-test-oldest - - #- name: macOS 11 - #os: macos-11 - #python-version: '3.10' - #toxenv: py310-test-latest + - name: oldest supported versions + os: ubuntu-latest + python-version: '3.8' + toxenv: py38-test-oldest + - name: macOS 11 + os: macos-11 + python-version: '3.10' + toxenv: py310-test-latest steps: - name: Checkout repository diff --git a/tests/test_all.py b/tests/test_all.py new file mode 100644 index 0000000..0feed79 --- /dev/null +++ b/tests/test_all.py @@ -0,0 +1,4 @@ +from astLib import * + +def test_dl(): + assert(2834.89 < astCalc.dl(0.5) < 2834.90) diff --git a/tox.ini b/tox.ini index e0f7f44..42c3b3a 100644 --- a/tox.ini +++ b/tox.ini @@ -42,6 +42,7 @@ extras = commands = pip freeze + pytest -v ; !cov: pytest -v --pyargs soliket {posargs} ; cov: pytest -v --pyargs soliket --cov soliket --cov-report=xml --cov-config={toxinidir}/setup.cfg {posargs} From 0a3ee2b7e26aa51f379625a340e763b9fa730d35 Mon Sep 17 00:00:00 2001 From: Matt Hilton Date: Wed, 18 Oct 2023 12:16:44 +0200 Subject: [PATCH 03/10] Testing fixes --- tox-no-conda.ini | 68 ++++++++++++++++++++++++++++++++++++++++++++++++ tox.ini | 10 ++++--- 2 files changed, 74 insertions(+), 4 deletions(-) create mode 100644 tox-no-conda.ini diff --git a/tox-no-conda.ini b/tox-no-conda.ini new file mode 100644 index 0000000..b8c5189 --- /dev/null +++ b/tox-no-conda.ini @@ -0,0 +1,68 @@ +[tox] +requires = +; tox-conda + setuptools >= 30.3.0 + pip >= 19.3.1 +envlist = + py{38,39,310}-test{,-all}{,-latest,-oldest}{,-cov} +; codestyle + +[testenv] + +deps = pytest + +# Uncomment below (and tox-conda above) if want to use with Anaconda +; conda_env = astLib-tests.yml +; conda_setup_args= +; --override-channels +; conda_install_args= +; --override-channels + +# Pass through the following environment variables which may be needed for the CI +; passenv = HOME WINDIR LC_ALL LC_CTYPE CI TRAVIS + +# Running the tests from within the tests/ dir avoids importing from source tree +changedir = tests + +# tox environments are constructed with so-called 'factors' (or terms) +# separated by hyphens, e.g. test-devdeps-cov. Lines below starting with factor: +# will only take effect if that factor is included in the environment name. To +# see a list of example environments that can be run, along with a description, +# run: +# +# tox -l -v +# +description = + run tests + all: using all optional dependencies + latest: with the latest supported version of key dependencies + oldest: with the oldest supported version of key dependencies + cov: and test coverage + +extras = + all: all + +commands = + pip freeze + pytest -v +; !cov: pytest -v --pyargs soliket {posargs} +; cov: pytest -v --pyargs soliket --cov soliket --cov-report=xml --cov-config={toxinidir}/setup.cfg {posargs} + +; [testenv:codestyle] +; skip_install = true +; conda_env = +; changedir = . +; description = check code style, e.g. with flake8 +; deps = flake8 +; commands = flake8 + +; [testenv:docs] +; skip_install = true +; changedir = docs +; description = Make sphinx docs +; deps = +; sphinx +; sphinx_rtd_theme +; commands = +; pip freeze +; sphinx-build -b html . _build diff --git a/tox.ini b/tox.ini index 42c3b3a..38d9b21 100644 --- a/tox.ini +++ b/tox.ini @@ -9,6 +9,9 @@ envlist = [testenv] +deps = pytest + +# Uncomment below (and tox-conda above) if want to use with Anaconda conda_env = astLib-tests.yml conda_setup_args= --override-channels @@ -16,11 +19,10 @@ conda_install_args= --override-channels # Pass through the following environment variables which may be needed for the CI -passenv = HOME WINDIR LC_ALL LC_CTYPE CI TRAVIS +; passenv = HOME WINDIR LC_ALL LC_CTYPE CI TRAVIS -# Run the tests in a temporary directory to make sure that we don't import -# this package from the source tree -changedir = .tmp/{envname} +# Running the tests from within the tests/ dir avoids importing from source tree +changedir = tests # tox environments are constructed with so-called 'factors' (or terms) # separated by hyphens, e.g. test-devdeps-cov. Lines below starting with factor: From 13d3a5054503a1f25976c466bef179bfec616a61 Mon Sep 17 00:00:00 2001 From: Matt Hilton Date: Wed, 18 Oct 2023 12:26:18 +0200 Subject: [PATCH 04/10] Tests --- tox.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 38d9b21..9ce5dfa 100644 --- a/tox.ini +++ b/tox.ini @@ -19,7 +19,8 @@ conda_install_args= --override-channels # Pass through the following environment variables which may be needed for the CI -; passenv = HOME WINDIR LC_ALL LC_CTYPE CI TRAVIS +# (maybe only needed for MacOS?) +passenv = HOME WINDIR LC_ALL LC_CTYPE CI TRAVIS # Running the tests from within the tests/ dir avoids importing from source tree changedir = tests From de7f58663dc09a2848cb2e904a8086ccaa15e1d3 Mon Sep 17 00:00:00 2001 From: Matt Hilton Date: Wed, 18 Oct 2023 20:13:19 +0200 Subject: [PATCH 05/10] Attempted MacOS fix --- .github/workflows/testing.yml | 3 +++ tox.ini | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 9892af6..3c3afa5 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -36,6 +36,9 @@ jobs: shell: bash -el {0} run: | pip install tox-conda + - name: Set MacOS env + if: runner.os == 'MacOS' + run: export SDKROOT="`xcrun --show-sdk-path`" - name: Run Tests shell: bash -el {0} run: | diff --git a/tox.ini b/tox.ini index 9ce5dfa..daf53da 100644 --- a/tox.ini +++ b/tox.ini @@ -19,8 +19,8 @@ conda_install_args= --override-channels # Pass through the following environment variables which may be needed for the CI -# (maybe only needed for MacOS?) -passenv = HOME WINDIR LC_ALL LC_CTYPE CI TRAVIS +# (maybe only needed for MacOS? Doesn't seem so) +; passenv = HOME WINDIR LC_ALL LC_CTYPE CI TRAVIS # Running the tests from within the tests/ dir avoids importing from source tree changedir = tests From 985c2af40e3f17336bca0659f7e871fc4a0b284e Mon Sep 17 00:00:00 2001 From: Matt Hilton Date: Thu, 19 Oct 2023 07:41:53 +0200 Subject: [PATCH 06/10] Another MacOS attempt --- .github/workflows/testing.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 3c3afa5..73f5c21 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -36,10 +36,12 @@ jobs: shell: bash -el {0} run: | pip install tox-conda - - name: Set MacOS env + # - name: Set MacOS env if: runner.os == 'MacOS' run: export SDKROOT="`xcrun --show-sdk-path`" - name: Run Tests shell: bash -el {0} + if: runner.os == 'MacOS' + run: export SDKROOT="`xcrun --show-sdk-path`" run: | tox -e ${{ matrix.toxenv }} ${{ matrix.toxargs }} -- ${{ matrix.toxposargs }} From 8fe9909967492d4e679c7558e01606608bd91a03 Mon Sep 17 00:00:00 2001 From: Matt Hilton Date: Thu, 19 Oct 2023 07:54:01 +0200 Subject: [PATCH 07/10] MacOS again --- .github/workflows/testing.yml | 7 +++---- tox.ini | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 73f5c21..2efbd02 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -37,11 +37,10 @@ jobs: run: | pip install tox-conda # - name: Set MacOS env - if: runner.os == 'MacOS' - run: export SDKROOT="`xcrun --show-sdk-path`" + # if: runner.os == 'MacOS' + # run: export SDKROOT="`xcrun --show-sdk-path`" - name: Run Tests shell: bash -el {0} - if: runner.os == 'MacOS' - run: export SDKROOT="`xcrun --show-sdk-path`" run: | + echo SDKROOT tox -e ${{ matrix.toxenv }} ${{ matrix.toxargs }} -- ${{ matrix.toxposargs }} diff --git a/tox.ini b/tox.ini index daf53da..3d90d70 100644 --- a/tox.ini +++ b/tox.ini @@ -21,6 +21,7 @@ conda_install_args= # Pass through the following environment variables which may be needed for the CI # (maybe only needed for MacOS? Doesn't seem so) ; passenv = HOME WINDIR LC_ALL LC_CTYPE CI TRAVIS +passenv = SDKROOT # Running the tests from within the tests/ dir avoids importing from source tree changedir = tests From ed7306af3dc885d8606ed0a243ea2cf2130fb5eb Mon Sep 17 00:00:00 2001 From: Matt Hilton Date: Thu, 19 Oct 2023 08:23:31 +0200 Subject: [PATCH 08/10] MacOS build test --- .github/workflows/testing.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 2efbd02..72ce071 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -20,6 +20,7 @@ jobs: toxenv: py38-test-oldest - name: macOS 11 os: macos-11 + label: osx-64 python-version: '3.10' toxenv: py310-test-latest @@ -36,11 +37,17 @@ jobs: shell: bash -el {0} run: | pip install tox-conda - # - name: Set MacOS env - # if: runner.os == 'MacOS' - # run: export SDKROOT="`xcrun --show-sdk-path`" - - name: Run Tests + - name: Set env variables for macOS + if: matrix.label == 'osx-64' + run: | + echo "DYLD_FALLBACK_LIBRARY_PATH=${CONDA_PREFIX}/lib" >> $GITHUB_ENV + SDKROOT=$(xcrun --sdk macosx --show-sdk-path) + echo "SDKROOT: ${SDKROOT}" + echo "SDKROOT=${SDKROOT}" >> $GITHUB_ENV + echo "CONDA_BUILD_SYSROOT=${SDKROOT}" >> $GITHUB_ENV + export CFLAGS="-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include" + export LDFLAGS="-L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib" + - name: Run tests shell: bash -el {0} run: | - echo SDKROOT tox -e ${{ matrix.toxenv }} ${{ matrix.toxargs }} -- ${{ matrix.toxposargs }} From e5c318e19957ca47897e184f5212c94757db9dbf Mon Sep 17 00:00:00 2001 From: Matt Hilton Date: Thu, 19 Oct 2023 10:01:18 +0200 Subject: [PATCH 09/10] Docs rejig --- INSTALL.rst | 65 ++++++++++++++++++ README.rst | 161 ++++----------------------------------------- astLib/__init__.py | 2 +- docs/index.rst | 3 + docs/install.rst | 8 +++ docs/usage.rst | 52 ++++++++++++++- setup.py | 19 +----- 7 files changed, 140 insertions(+), 170 deletions(-) create mode 100644 INSTALL.rst create mode 100644 docs/install.rst diff --git a/INSTALL.rst b/INSTALL.rst new file mode 100644 index 0000000..c2dd222 --- /dev/null +++ b/INSTALL.rst @@ -0,0 +1,65 @@ +astLib requires: + +* Python (tested on versions 3.6+) +* Astropy - http://www.astropy.org (tested on version 3.2.1) +* Numpy - http://numpy.scipy.org (tested on version 1.18.1) +* SciPy - http://scipy.org (tested on version 1.3.1) +* Matplotlib - http://matplotlib.sourceforge.net (tested on version 3.1.1) + +Optional: + +* Python Imaging Library - http://www.pythonware.com/products/pil (tested on version 1.1.7) + +Other versions of the software listed above are likely to work. + +You can install astLib via pip: + +.. code-block:: + + pip install astLib --user + + +You may also install using the standard ``setup.py`` script, e.g., as root: + +.. code-block:: + + sudo python setup.py install + + +Alternatively, + +.. code-block:: + + python setup.py install --user + + +will install ``astLib`` under ``$HOME/.local`` (on Ubuntu), and in some other default location on Mac. + +You can also use the ``--prefix`` option, e.g., + +.. code-block:: + + python setup.py install --prefix=$HOME/local + + +and then add, e.g., ``$HOME/local/lib/python3.6/site-packages`` to +$PYTHONPATH (adjust the path according to your Python version number). + +.. code-block:: + + export PYTHONPATH=$HOME/local/lib/python3.6/site-packages:$PYTHONPATH + + +Installation on recent versions of macOS (may no longer be relevant) +==================================================================== + +Some users have reported that the standard method for installing ``astLib`` does not work on recent versions +of macOS (e.g., Big Sur), due to the default compiler flags. The current workaround for this is to install +using: + +.. code-block:: + + CFLAGS="-Wno-error=implicit-function-declaration" python setup.py install + + +Thanks to Michael Cowley and Stefano Covino for helping to resolve this issue. diff --git a/README.rst b/README.rst index 7653e53..10c41a5 100644 --- a/README.rst +++ b/README.rst @@ -1,6 +1,15 @@ .. image:: https://readthedocs.org/projects/astlib/badge/?version=latest -astLib provides some tools for research astronomers who use Python. It is divided into several modules: +**astLib** provides some tools for research astronomers who use Python. + +* **Documentation:** https://astlib.readthedocs.io +* **License:** `LGPL `_ +* **Authors:** Matt Hilton & Steven Boada +* **Installation:** ``pip install astLib`` +* **Support:** Please use the `GitHub issues page `_, + and/or contact `Matt Hilton `_. + +**astLib** is divided into several modules: * astCalc (general calculations, e.g. luminosity distance etc.) * astCoords (coordinate conversions etc.) @@ -14,155 +23,9 @@ The astWCS module is a higher level interface to PyWCSTools, a simple SWIG (http of some of the routines from WCSTools by Jessica Mink (http://tdc-www.harvard.edu/software/wcstools/). It is used by some routines in astCoords, astImages and astPlots. -The goal of astLib was to provide features useful to astronomers that are not included in the scipy +The goal of **astLib** was to provide features useful to astronomers that are not included in the scipy (http://scipy.org), numpy (http://numpy.scipy.org) or matplotlib (http://matplotlib.sourceforge.net) modules on which astLib depends. For a far more extensive set of Python astronomy modules, see astropy (http://www.astropy.org/). -Some scripts using astLib can be found in the examples/ folder provided with the source code distribution. - - -Software needed -=============== - -astLib requires: - -* Python (tested on versions 3.6+) -* Astropy - http://www.astropy.org (tested on version 3.2.1) -* Numpy - http://numpy.scipy.org (tested on version 1.18.1) -* SciPy - http://scipy.org (tested on version 1.3.1) -* Matplotlib - http://matplotlib.sourceforge.net (tested on version 3.1.1) - -Optional: - -* Python Imaging Library - http://www.pythonware.com/products/pil (tested on version 1.1.7) - -Other versions of the software listed above are likely to work. - - -Installation -============ - -You can install astLib via pip: - -.. code-block:: - - pip install astLib --user - - -You may also install using the standard ``setup.py`` script, e.g., as root: - -.. code-block:: - - sudo python setup.py install - - -Alternatively, - -.. code-block:: - - python setup.py install --user - - -will install ``astLib`` under ``$HOME/.local`` (on Ubuntu), and in some other default location on Mac. - -You can also use the ``--prefix`` option, e.g., - -.. code-block:: - - python setup.py install --prefix=$HOME/local - - -and then add, e.g., ``$HOME/local/lib/python3.6/site-packages`` to -$PYTHONPATH (adjust the path according to your Python version number). - -.. code-block:: - - export PYTHONPATH=$HOME/local/lib/python3.6/site-packages:$PYTHONPATH - - -Installation on recent versions of macOS -======================================== - -Some users have reported that the standard method for installing ``astLib`` does not work on recent versions -of macOS (e.g., Big Sur), due to the default compiler flags. The current workaround for this is to install -using: - -.. code-block:: - - CFLAGS="-Wno-error=implicit-function-declaration" python setup.py install - - -Thanks to Michael Cowley and Stefano Covino for helping to resolve this issue. - - -Usage -===== - -To access the routines in the astLib modules, simply: - -.. code-block:: - - from astLib import astCalc - from astLib import astCoords - from astLib import astWCS - - -etc. - -The astWCS module currently provides access to what are (I think) the most commonly needed WCS information -and functions (such as converting between pixel and WCS coordinates etc.). However, should you wish to -access the wrapped WCSTools routines themselves directly: - -.. code-block:: - - from PyWCSTools import wcs - from PyWCSTools import wcscon - -etc. - -Note that PyWCSTools only includes some functions from wcs.c and wcscon.c at present. For examples of usage, -look at the Python code for the astLib.astWCS module. Documentation for the WCSTools routines can be found -here: http://tdc-www.harvard.edu/software/wcstools/subroutines/libwcs.wcs.html. - -As of version 0.11.x+, by default the ``astWCS.WCS`` class is using the ``astropy.wcs`` module instead of -PyWCSTools (this allows one to benefit from some features of ``astropy.wcs`` without having to re-write -code based on ``astWCS.WCS``). To use PyWCSTools instead, set ``useAstropyWCS = False`` when creating a -``WCS`` object. - - -Known issues -============ - -This may no longer apply, but just in case... - -Recent versions of matplotlib (on which astLib depends) now use locale information. On systems where the -decimal point separator is not '.' (e.g. Germany), the astWCS coordinate conversions routines will give -strange results if this is not accounted for. As of version 0.3.0, the astWCS module will detect if this is -the case and print a warning message to the console. - -The workaround for this issue is to add the following after importing any python modules that expicitly set -the locale (such as matplotlib): - -.. code-block:: - - import locale - locale.setlocale(locale.LC_NUMERIC, 'C')" - -Thanks to Markus Demleitner for pointing this out. - - -Documentation -============= - -Documentation is available on the web at http://astlib.readthedocs.io. - - -Bugs -==== - -Please email bug reports to matt.hilton@mykolab.com, and/or use the `GitHub issues page `_. - -Please include details of your operating system, python version, and versions of the python packages -required by astLib that you have installed on your machine. For any WCS-related bugs, it would be helpful -if you could also include the image header as a text file so that I can reproduce them easily. +Some scripts using **astLib** can be found in the examples/ folder provided with the source code distribution. diff --git a/astLib/__init__.py b/astLib/__init__.py index bf22574..9c44747 100644 --- a/astLib/__init__.py +++ b/astLib/__init__.py @@ -13,4 +13,4 @@ """ __all__=['astCalc', 'astCoords', 'astImages', 'astPlots', 'astStats', 'astWCS', 'astSED'] -__version__ = '0.11.9' +__version__ = '0.11.10' diff --git a/docs/index.rst b/docs/index.rst index 5e69598..a1a930c 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -6,10 +6,13 @@ astLib - Python astronomy modules ================================= +.. include:: ../README.rst + .. toctree:: :maxdepth: 2 :caption: Contents: + install usage reference diff --git a/docs/install.rst b/docs/install.rst new file mode 100644 index 0000000..56065b0 --- /dev/null +++ b/docs/install.rst @@ -0,0 +1,8 @@ +.. _InstallPage: + +============ +Installation +============ + + +.. include:: ../INSTALL.rst diff --git a/docs/usage.rst b/docs/usage.rst index 317c3e1..45f9060 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -1,8 +1,56 @@ .. _UsagePage: ============================= -Introduction and Installation +Usage ============================= +To access the routines in the astLib modules, simply: -.. include:: ../README.rst +.. code-block:: + + from astLib import astCalc + from astLib import astCoords + from astLib import astWCS + +etc. + +The astWCS module currently provides access to what are (I think) the most commonly needed WCS information +and functions (such as converting between pixel and WCS coordinates etc.). However, should you wish to +access the wrapped WCSTools routines themselves directly: + +.. code-block:: + + from PyWCSTools import wcs + from PyWCSTools import wcscon + +etc. + +Note that PyWCSTools only includes some functions from wcs.c and wcscon.c at present. For examples of usage, +look at the Python code for the astLib.astWCS module. Documentation for the WCSTools routines can be found +here: http://tdc-www.harvard.edu/software/wcstools/subroutines/libwcs.wcs.html. + +As of version 0.11.x+, by default the ``astWCS.WCS`` class is using the ``astropy.wcs`` module instead of +PyWCSTools (this allows one to benefit from some features of ``astropy.wcs`` without having to re-write +code based on ``astWCS.WCS``). To use PyWCSTools instead, set ``useAstropyWCS = False`` when creating a +``WCS`` object. + + +Known issues (may no longer be relevant) +======================================== + +This may no longer apply, but just in case... + +Recent versions of matplotlib (on which astLib depends) now use locale information. On systems where the +decimal point separator is not '.' (e.g. Germany), the astWCS coordinate conversions routines will give +strange results if this is not accounted for. As of version 0.3.0, the astWCS module will detect if this is +the case and print a warning message to the console. + +The workaround for this issue is to add the following after importing any python modules that expicitly set +the locale (such as matplotlib): + +.. code-block:: + + import locale + locale.setlocale(locale.LC_NUMERIC, 'C')" + +Thanks to Markus Demleitner for pointing this out. diff --git a/setup.py b/setup.py index 1c53409..4052a30 100644 --- a/setup.py +++ b/setup.py @@ -56,24 +56,7 @@ def build_extensions(self): build_ext.build_extensions(self) setup(name='astLib', - version='0.11.9', - url='https://astlib.readthedocs.io', - author='Matt Hilton & Steven Boada', - author_email='matt.hilton@mykolab.com', - classifiers=['Development Status :: 5 - Production/Stable', - 'Environment :: Console', - 'Intended Audience :: Science/Research', - 'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)', - 'Natural Language :: English', - 'Operating System :: POSIX', - 'Programming Language :: Python', - 'Topic :: Scientific/Engineering :: Astronomy', - 'Topic :: Software Development :: Libraries'], - description='A set of python modules for producing simple plots, statistics, common calculations, coordinate conversions, and manipulating FITS images with World Coordinate System (WCS) information.', - long_description="""astLib is a set of Python modules that provides some tools for research astronomers. It can be -used for simple plots, statistics, common calculations, coordinate conversions, and manipulating FITS images -with World Coordinate System (WCS) information through PyWCSTools - a simple wrapping of WCSTools by Jessica Mink. -PyWCSTools is distributed (and developed) as part of astLib.""", + version='0.11.10', packages=['astLib', 'PyWCSTools'], package_data={'astLib': ['data/*']}, cmdclass={"build_ext": build_PyWCSTools_ext}, From 3e398bec7810ac9ce7108f099c457bf1e896438f Mon Sep 17 00:00:00 2001 From: Matt Hilton Date: Thu, 19 Oct 2023 10:02:48 +0200 Subject: [PATCH 10/10] Docs rejig --- MANIFEST.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MANIFEST.in b/MANIFEST.in index 20099c6..42693ab 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -10,3 +10,5 @@ recursive-include PyWCSTools/wcssubs-3.9.5 NEWS recursive-include examples/* *.py include LICENSE include CHANGE_LOG +include README.rst +include INSTALL.rst