diff --git a/.circleci/config.yml b/.circleci/config.yml index 5e3530b37e2..f3d66017c8b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,172 +1,58 @@ version: 2 +# NOTE: We run these in CircleCI because it has better artifacts support. +# TODO: Move to GitHub Actions when its artifacts support improves. jobs: - egg-info-37: - docker: - - image: circleci/python:3.7 - steps: - - checkout - - run: python setup.py egg_info - 32bit: + image-tests-mpl302: docker: - - image: quay.io/pypa/manylinux1_i686 + - image: astropy/image-tests-py37-mpl302:1.10 steps: - checkout - run: - name: Write configuration items to standard location to make sure they are ignored in parallel mode - command: | - mkdir -p $HOME/.astropy/config/ - printf "unicode_output = True\nmax_width = 500" > $HOME/.astropy/config/astropy.cfg - - run: - name: Install dependencies for Python 3.6 - command: /opt/python/cp36-cp36m/bin/pip install "numpy<1.17" scipy pytest pytest-astropy pytest-xdist Cython jinja2 - - run: - name: Run tests for Python 3.6 - command: PYTHONHASHSEED=42 /opt/python/cp36-cp36m/bin/python setup.py test --parallel=4 -a "--durations=50" - - run: - name: Install dependencies for Python 3.7 - command: /opt/python/cp37-cp37m/bin/pip install "numpy<1.17" scipy pytest pytest-astropy pytest-xdist Cython jinja2 pandas - - run: - name: Run tests for Python 3.7 - command: PYTHONHASHSEED=42 /opt/python/cp37-cp37m/bin/python setup.py test --parallel=4 -a "--durations=50" - - run: - name: Install dependencies for Python 3.8 - command: /opt/python/cp38-cp38/bin/pip install numpy pytest pytest-astropy pytest-xdist Cython jinja2 - - run: - name: Run tests for Python 3.8 - command: PYTHONHASHSEED=42 /opt/python/cp38-cp38/bin/python setup.py test --parallel=4 -a "--durations=50" - - image-tests-mpl212: - docker: - - image: astropy/image-tests-py36-mpl212:1.8 - steps: - - checkout + name: Install dependencies + command: pip install -e .[test] pytest-mpl - run: - name: Run tests - command: python3 setup.py test -P visualization --remote-data=astropy --open-files -a "--mpl --mpl-results-path=$PWD/results -W ignore:np.asscalar" - - store_artifacts: - path: results - - image-tests-mpl222: - docker: - - image: astropy/image-tests-py36-mpl222:1.8 - steps: - - checkout + name: Force scipy upgrade + command: pip install scipy -U - run: name: Run tests - command: python3 setup.py test -P visualization --remote-data=astropy --open-files -a "--mpl --mpl-results-path=$PWD/results -W ignore:np.asscalar" - - store_artifacts: - path: results - - image-tests-mpl302: - docker: - - image: astropy/image-tests-py37-mpl302:1.8 - steps: - - checkout - - run: - name: Run tests - command: python3 setup.py test -P visualization --remote-data=astropy --open-files -a "--mpl --mpl-results-path=$PWD/results" + command: pytest -P visualization --remote-data=astropy --open-files --mpl --mpl-results-path=$PWD/results -W ignore:np.asscalar - store_artifacts: path: results image-tests-mpl310: docker: - - image: astropy/image-tests-py37-mpl311:1.8 + - image: astropy/image-tests-py37-mpl311:1.10 steps: - checkout + - run: + name: Install dependencies + command: pip install -e .[test] pytest-mpl - run: name: Run tests - command: python3 setup.py test -P visualization --remote-data=astropy --open-files -a "--mpl --mpl-results-path=$PWD/results" + command: pytest -P visualization --remote-data=astropy --open-files --mpl --mpl-results-path=$PWD/results -W ignore:np.asscalar - store_artifacts: path: results image-tests-mpldev: docker: - - image: astropy/image-tests-py37-base:1.2 + - image: astropy/image-tests-py37-base:1.4 steps: - checkout - run: - name: Install C++ compiler - command: | - apt update - apt install -y g++ - - run: - name: Install Python dependencies, including developer version of Matplotlib - command: pip3 install pytest pytest-mpl pytest-astropy numpy scipy git+https://github.com/matplotlib/matplotlib.git + name: Install tox + command: pip3 install tox - run: name: Run tests - command: python3 setup.py test -P visualization --remote-data=astropy --open-files -a "--mpl --mpl-results-path=$PWD/results" + command: tox -e py37-test-image-mpldev -- -P visualization --remote-data=astropy --open-files --mpl-results-path=$PWD/results -W ignore:np.asscalar - store_artifacts: path: results - html-docs: - docker: - - image: circleci/python:3.7 - steps: - - checkout - - run: - name: Install apt packages - command: | - sudo apt update - sudo apt install -y graphviz - - run: - name: Install Python dependencies - command: | - python3 -m venv venv - . venv/bin/activate - pip install numpydoc matplotlib sphinx --progress-bar off - pip install .[docs,all] --progress-bar off - - run: - name: Make sure flake8 passes - command: | - python3 -m venv venv - . venv/bin/activate - pip install flake8 --progress-bar off - # select options should be the same as in the travis config - flake8 astropy --count --select=E101,W191,W291,W292,W293,W391,E111,E112,E113,E30,E502,E722,E901,E902,E999,F822,F823 - - run: - name: Build Docs - command: venv/bin/python setup.py build_docs -w --parallel=4 - environment: - LC_CTYPE: C - LC_ALL: C - LANG: C - - - run: - name: Prepare for upload - command: | - # If it's not a PR, don't upload - if [ -z "${CIRCLE_PULL_REQUEST}" ]; then - rm -r docs/_build/html - else - # If it is a PR, delete sources and doctrees, because it's a lot - # of files which we don't really need to upload - rm -r docs/_build/html/_sources - rm -r docs/_build/html/_modules - rm -r docs/_build/html/.doctrees - fi - - - store_artifacts: - path: docs/_build/html - - - run: - name: "Built documentation is available at:" - command: DOCS_URL="${CIRCLE_BUILD_URL}/artifacts/${CIRCLE_NODE_INDEX}/${CIRCLE_WORKING_DIRECTORY/#\~/$HOME}/docs/_build/html/index.html"; echo $DOCS_URL - workflows: version: 2 - tests_and_docs: + tests: jobs: - - egg-info-37 - - html-docs - - 32bit - - image-tests-mpl212 - - image-tests-mpl222 - image-tests-mpl302 - image-tests-mpl310 - image-tests-mpldev - -notify: - webhooks: - - url: https://giles.cadair.com/circleci diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index d46aeb053e4..67d06f65597 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -7,9 +7,9 @@ about: Create a report describing unexpected or incorrect behavior in astropy. so you do not need to remove them! --> +https://github.com/astropy/astropy/blob/main/CODE_OF_CONDUCT.md . --> ### Steps to Reproduce - @@ -53,6 +53,7 @@ Please run the following snippet and paste the output below: import platform; print(platform.platform()) import sys; print("Python", sys.version) import numpy; print("Numpy", numpy.__version__) -import scipy; print("Scipy", scipy.__version__) import astropy; print("astropy", astropy.__version__) +import scipy; print("Scipy", scipy.__version__) +import matplotlib; print("Matplotlib", matplotlib.__version__) --> diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 313b4835be2..790af90692d 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -7,9 +7,9 @@ about: Suggest an idea to improve astropy so you do not need to remove them! --> +https://github.com/astropy/astropy/blob/main/CODE_OF_CONDUCT.md . --> +https://github.com/astropy/astropy/blob/main/CODE_OF_CONDUCT.md . --> + + + + This pull request is to address ... Fixes # + +### Checklist for package maintainer(s) + + +This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive. + +- [ ] Do the proposed changes actually accomplish desired goals? +- [ ] Do the proposed changes follow the [Astropy coding guidelines](https://docs.astropy.org/en/latest/development/codeguide.html)? +- [ ] Are tests added/updated as required? If so, do they follow the [Astropy testing guidelines](https://docs.astropy.org/en/latest/development/testguide.html)? +- [ ] Are docs added/updated as required? If so, do they follow the [Astropy documentation guidelines](https://docs.astropy.org/en/latest/development/docguide.html#astropy-documentation-rules-and-guidelines)? +- [ ] Is rebase and/or squash necessary? If so, please provide the author with appropriate instructions. Also see ["When to rebase and squash commits"](https://docs.astropy.org/en/latest/development/when_to_rebase.html). +- [ ] Did the CI pass? If no, are the failures related? If you need to run daily and weekly cron jobs as part of the PR, please apply the `Extra CI` label. +- [ ] Is a change log needed? If yes, did the change log check pass? If no, add the `no-changelog-entry-needed` label. +- [ ] Is a milestone set? Milestone must be set but `astropy-bot` check might be missing; do not let the green checkmark fool you. +- [ ] At the time of adding the milestone, if the milestone set requires a backport to release branch(es), apply the appropriate `backport-X.Y.x` label(s) *before* merge. diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 00000000000..9908bfcddd6 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,145 @@ +Docs: + - docs/* + - docs/_static/* + - docs/_templates/* + - docs/development/**/* + - docs/whatsnew/* + - examples/**/* + - licenses/* + - CITATION + - .mailmap + - readthedocs.yml + - '*.md' + - any: ['*.rst', '!CHANGES.rst'] + +testing: + - astropy/tests/**/* + - codecov.yml + - conftest.py + - '**/conftest.py' + - azure-pipelines.yml + - tox.ini + - .circleci/* + - .github/**/*.yml + - .pep8speaks.yml + - .pyinstaller/**/* + +external: + - astropy/extern/**/* + - cextern/**/* + +installation: + - docs/install.rst + - MANIFEST.in + - pip-requirements + - pyproject.toml + - setup.* + +Release: + - docs/development/releasing.rst + +config: + - '**/config/**/*' + - astropy/extern/configobj/**/* + +constants: + - '**/constants/**/*' + +convolution: + - '**/convolution/**/*' + +coordinates: + - '**/coordinates/**/*' + +cosmology: + - '**/cosmology/**/*' + +io.ascii: + - '**/io/ascii/**/*' + +io.fits: + - '**/io/fits/**/*' + - cextern/cfitsio/**/* + +io.misc: + - astropy/io/misc/* + - astropy/io/misc/pandas/**/* + - astropy/io/misc/tests/**/* + - docs/io/misc.rst + +io.misc.asdf: + - astropy/io/misc/asdf/**/* + - docs/io/asdf-schemas.rst + +io.registry: + - astropy/io/* + - astropy/io/tests/* + - docs/io/registry.rst + +io.votable: + - '**/io/votable/**/*' + +logging: + - astropy/logger.py + - astropy/tests/test_logger.py + - docs/logging.rst + +modeling: + - '**/modeling/**/*' + +nddata: + - '**/nddata/**/*' + +samp: + - '**/samp/**/*' + +stats: + - '**/stats/**/*' + +table: + - '**/table/**/*' + - astropy/extern/jquery/**/* + +time: + - '**/time/**/*' + +timeseries: + - '**/timeseries/**/*' + +uncertainty: + - '**/uncertainty/**/*' + +unified-io: + - docs/io/unified.rst + +units: + - '**/units/**/*' + - astropy/extern/ply/**/* + +utils: + - cextern/expat/**/* + - any: ['**/utils/**/*', + '!astropy/utils/iers/**/*', '!docs/utils/iers.rst', + '!astropy/utils/masked/**/*', '!docs/utils/masked/**/*'] + +utils.iers: + - astropy/utils/iers/**/* + - docs/utils/iers.rst + +utils.masked: + - astropy/utils/masked/**/* + - docs/utils/masked/**/* + +visualization: + - any: ['**/visualization/**/*', '!**/visualization/wcsaxes/**/*'] + +visualization.wcsaxes: + - '**/visualization/wcsaxes/**/*' + +wcs: + - cextern/wcslib/**/* + - any: ['**/wcs/**/*', '!astropy/wcs/wcsapi/**/*', '!docs/wcs/wcsapi.rst'] + +wcs.wcsapi: + - astropy/wcs/wcsapi/**/* + - docs/wcs/wcsapi.rst diff --git a/.github/workflows/cancel_workflows.yml b/.github/workflows/cancel_workflows.yml new file mode 100644 index 00000000000..4765bb7ae36 --- /dev/null +++ b/.github/workflows/cancel_workflows.yml @@ -0,0 +1,17 @@ +name: Cancel duplicate workflows + +on: + workflow_run: + workflows: ["CI", "Daily cron", "Weekly cron", "Check PR change log"] + types: + - requested + +# Note: This has to be in workflow_run so it works for PRs from forks. +jobs: + cancel: + runs-on: ubuntu-latest + steps: + - name: Cancel previous runs + uses: styfle/cancel-workflow-action@3d86a7cc43670094ac248017207be0295edbc31d # 0.8.0 + with: + workflow_id: ${{ github.event.workflow.id }} diff --git a/.github/workflows/check_changelog.yml b/.github/workflows/check_changelog.yml new file mode 100644 index 00000000000..1c750457f35 --- /dev/null +++ b/.github/workflows/check_changelog.yml @@ -0,0 +1,16 @@ +name: Check PR change log + +on: + # So it cannot be skipped. + pull_request_target: + types: [opened, synchronize, labeled, unlabeled] + +jobs: + changelog_checker: + name: Check if towncrier change log entry is correct + runs-on: ubuntu-latest + steps: + - uses: pllim/actions-towncrier-changelog@main + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BOT_USERNAME: gilesbot diff --git a/.github/workflows/ci_cron_daily.yml b/.github/workflows/ci_cron_daily.yml new file mode 100644 index 00000000000..3720b9fce12 --- /dev/null +++ b/.github/workflows/ci_cron_daily.yml @@ -0,0 +1,79 @@ +name: Daily cron + +on: + schedule: + # run every day at 3am UTC + - cron: '0 3 * * *' + pull_request: + # We also want this workflow triggered if the 'Extra CI' label is added + # or present when PR is updated + types: + - synchronize + - labeled + +env: + ARCH_ON_CI: "normal" + IS_CRON: "true" + +jobs: + tests: + runs-on: ${{ matrix.os }} + if: (github.repository == 'astropy/astropy' && (github.event_name == 'schedule' || contains(github.event.pull_request.labels.*.name, 'Extra CI'))) + strategy: + fail-fast: false + matrix: + include: + + - name: Bundling with pyinstaller + os: ubuntu-latest + python: 3.8 + toxenv: pyinstaller + + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + - name: Install language-pack-de and tzdata + if: ${{ matrix.os == 'ubuntu-latest' }} + run: sudo apt-get install language-pack-de tzdata + - name: Install Python dependencies + run: python -m pip install --upgrade tox + - name: Run tests + run: tox ${{ matrix.toxargs}} -e ${{ matrix.toxenv}} -- ${{ matrix.toxposargs}} + + # TODO: Remove debug-only when ready for production. + # NOTE: remove-pr-stale-when-updated includes comments/milestones, resulting in false negative. + stalebot: + runs-on: ubuntu-latest + if: github.repository == 'astropy/astropy' && github.event_name == 'schedule' + steps: + - uses: actions/stale@v3 + with: + debug-only: true + + repo-token: ${{ secrets.GITHUB_TOKEN }} + operations-per-run: 50 + ascending: false + + days-before-issue-stale: -1 + days-before-issue-close: 7 + remove-issue-stale-when-updated: false + close-issue-message: 'I am going to close this issue because it was marked with **Close?**, but if you feel that this issue should stay open, then feel free to re-open, remove **Close?** and **closed-by-bot** labels, and apply **keep-open** label.' + stale-issue-label: 'Close?' + close-issue-label: 'closed-by-bot' + exempt-issue-labels: 'keep-open' + any-of-issue-labels: 'Close?' + + days-before-pr-stale: 150 + days-before-pr-close: 30 + remove-pr-stale-when-updated: false + stale-pr-message: 'This pull request is stale because it has been open 150 days with no activity. Remove **Close?** or this will be closed in 30 days. Apply **keep-open** if you want to keep it open indefinitely.' + close-pr-message: 'I am going to close this pull request as per my previous message, but if you feel that this PR should stay open, then feel free to re-open, remove **Close?** and **closed-by-bot** labels, and apply **keep-open** label.' + stale-pr-label: 'Close?' + close-pr-label: 'closed-by-bot' + exempt-pr-labels: 'keep-open' diff --git a/.github/workflows/ci_cron_weekly.yml b/.github/workflows/ci_cron_weekly.yml new file mode 100644 index 00000000000..b91302760bd --- /dev/null +++ b/.github/workflows/ci_cron_weekly.yml @@ -0,0 +1,124 @@ +name: Weekly cron + +on: + schedule: + # run every Monday at 6am UTC + - cron: '0 6 * * 1' + pull_request: + # We also want this workflow triggered if the 'Extra CI' label is added + # or present when PR is updated + types: + - synchronize + - labeled +env: + IS_CRON: 'true' + +jobs: + tests: + runs-on: ${{ matrix.os }} + if: (github.repository == 'astropy/astropy' && (github.event_name == 'schedule' || contains(github.event.pull_request.labels.*.name, 'Extra CI'))) + env: + ARCH_ON_CI: "normal" + strategy: + fail-fast: false + matrix: + include: + + # We check numpy-dev also in a job that only runs from cron, so that + # we can spot issues sooner. We do not use remote data here, since + # that gives too many false positives due to URL timeouts. We also + # install all dependencies via pip here so we pick up the latest + # releases. + - name: Python 3.7 with dev version of key dependencies + os: ubuntu-latest + python: 3.7 + toxenv: py37-test-devdeps + + - name: Documentation link check + os: ubuntu-latest + python: 3.7 + toxenv: linkcheck + + # TODO: Uncomment when 3.10 is more mature. Should we use devdeps? + # Test against Python dev in cron job. + #- name: Python dev with basic dependencies + # os: ubuntu-latest + # python: 3.10-dev + # toxenv: pydev-test + + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + - name: Install language-pack-de and tzdata + if: ${{ matrix.os == 'ubuntu-latest' }} + run: sudo apt-get install language-pack-de tzdata + - name: Install graphviz + if: ${{ matrix.toxenv == 'linkcheck' }} + run: sudo apt-get install graphviz + - name: Install Python dependencies + run: python -m pip install --upgrade tox + - name: Run tests + run: tox ${{ matrix.toxargs}} -e ${{ matrix.toxenv}} -- ${{ matrix.toxposargs}} + + + tests_more_architectures: + + # The following architectures are emulated and are therefore slow, so + # we include them just in the weekly cron. These also serve as a test + # of using system libraries and using pytest directly. + + runs-on: ubuntu-18.04 + name: Python 3.7 + if: (github.repository == 'astropy/astropy' && (github.event_name == 'schedule' || contains(github.event.pull_request.labels.*.name, 'Extra CI'))) + env: + ARCH_ON_CI: ${{ matrix.arch }} + + strategy: + fail-fast: false + matrix: + include: + - arch: aarch64 + - arch: s390x + # Uncomment when we ready to fix the failures, see PR 11697 + #- arch: ppc64le + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: uraimo/run-on-arch-action@v2.0.5 + name: Run tests + id: build + with: + arch: ${{ matrix.arch }} + distro: buster + + shell: /bin/bash + + install: | + echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list + apt-get update -q -y + apt-get install -q -y git \ + g++ \ + pkg-config \ + python3 \ + python3-configobj \ + python3-numpy \ + python3-ply \ + python3-venv \ + cython3 \ + wcslib-dev/buster-backports \ + libcfitsio-dev \ + liberfa1 + + run: | + python3 -m venv --system-site-packages tests + source tests/bin/activate + ASTROPY_USE_SYSTEM_ALL=1 pip3 install -e .[test] + python3 -m pytest diff --git a/.github/workflows/ci_workflows.yml b/.github/workflows/ci_workflows.yml new file mode 100644 index 00000000000..ebab689bba4 --- /dev/null +++ b/.github/workflows/ci_workflows.yml @@ -0,0 +1,179 @@ +name: CI + +on: + push: + branches: + - main + tags: + - '*' + pull_request: + +env: + ARCH_ON_CI: "normal" + IS_CRON: "false" + +jobs: + initial_checks: + name: Mandatory checks before CI + runs-on: ubuntu-latest + steps: + - name: Check base branch + uses: actions/github-script@v3 + if: github.event_name == 'pull_request' + with: + script: | + const skip_label = 'skip-basebranch-check'; + const { default_branch: allowed_basebranch } = context.payload.repository; + const pr = context.payload.pull_request; + if (pr.user.login === 'meeseeksmachine') { + core.info(`Base branch check is skipped since this is auto-backport by ${pr.user.login}`); + return; + } + if (pr.labels.find(lbl => lbl.name === skip_label)) { + core.info(`Base branch check is skipped due to the presence of ${skip_label} label`); + return; + } + if (pr.base.ref !== allowed_basebranch) { + core.setFailed(`PR opened against ${pr.base.ref}, not ${allowed_basebranch}`); + } else { + core.info(`PR opened correctly against ${allowed_basebranch}`); + } + + tests: + name: ${{ matrix.name }} + runs-on: ${{ matrix.os }} + needs: initial_checks + strategy: + fail-fast: true + matrix: + include: + + - name: Code style checks + os: ubuntu-latest + python: 3.x + toxenv: codestyle + + - name: Python 3.9 with minimal dependencies + os: ubuntu-latest + python: 3.9 + toxenv: py39-test + + # NOTE: In the build below we also check that tests do not open and + # leave open any files. This has a performance impact on running the + # tests, hence why it is not enabled by default. + - name: Python 3.8 with all optional dependencies + os: ubuntu-latest + python: 3.8 + toxenv: py38-test-alldeps + toxargs: -v --develop + toxposargs: --open-files + + - name: Python 3.7 with oldest supported version of all dependencies + os: ubuntu-16.04 + python: 3.7 + toxenv: py37-test-oldestdeps + + - name: Python 3.8 with numpy 1.17 and full coverage + os: ubuntu-latest + python: 3.8 + toxenv: py38-test-alldeps-numpy117-cov-clocale + toxposargs: --remote-data=astropy + + - name: Python 3.8 with all optional dependencies (Windows) + os: windows-latest + python: 3.8 + toxenv: py38-test-alldeps + toxposargs: --durations=50 + + - name: Python 3.7 with all optional dependencies (MacOS X) + os: macos-latest + python: 3.7 + toxenv: py37-test-alldeps + toxposargs: --durations=50 + + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + - name: Install language-pack-fr and tzdata + if: startsWith(matrix.os, 'ubuntu') + run: sudo apt-get install language-pack-fr tzdata + - name: Install Python dependencies + run: python -m pip install --upgrade tox codecov + - name: Run tests + run: tox ${{ matrix.toxargs }} -e ${{ matrix.toxenv }} -- ${{ matrix.toxposargs }} + # TODO: Do we need --gcov-glob "*cextern*" ? + - name: Upload coverage to codecov + if: ${{ contains(matrix.toxenv,'-cov') }} + uses: codecov/codecov-action@v1 + with: + file: ./coverage.xml + + allowed_failures: + name: ${{ matrix.name }} + runs-on: ${{ matrix.os }} + needs: initial_checks + strategy: + fail-fast: false + matrix: + include: + - name: (Allowed Failure) Python 3.7 with remote data and dev version of key dependencies + os: ubuntu-latest + python: 3.7 + toxenv: py37-test-devdeps + toxposargs: --remote-data=any + + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + - name: Install language-pack-de and tzdata + if: startsWith(matrix.os, 'ubuntu') + run: sudo apt-get install language-pack-de tzdata + - name: Install Python dependencies + run: python -m pip install --upgrade tox codecov + - name: Run tests + run: tox ${{ matrix.toxargs }} -e ${{ matrix.toxenv }} -- ${{ matrix.toxposargs }} + + parallel_and_32bit: + name: 32-bit and parallel + runs-on: ubuntu-latest + needs: initial_checks + container: + image: quay.io/pypa/manylinux1_i686 + steps: + # TODO: Use newer checkout actions when https://github.com/actions/checkout/issues/334 fixed + - name: Checkout code + uses: actions/checkout@v1 + with: + fetch-depth: 0 + - name: Write configuration items to standard location to make sure they are ignored in parallel mode + run: | + mkdir -p $HOME/.astropy/config/ + printf "unicode_output = True\nmax_width = 500" > $HOME/.astropy/config/astropy.cfg + # In addition to testing 32-bit, we also use the 3.7 builds to + # test the ability to run the test suite in parallel. + - name: Install dependencies for Python 3.7 + run: /opt/python/cp37-cp37m/bin/pip install tox + - name: Run tests for Python 3.7 + run: /opt/python/cp37-cp37m/bin/python -m tox -e py37-test -- -n=4 --durations=50 + # We use the 3.8 build to check that running tests twice in a row in the + # same Python session works without issues. This catches cases where + # running the tests changes the module state permanently. Note that we + # shouldn't also test the parallel build here since that enforces a degree + # of isolation of tests which will interfere with what we are trying to do + # here. + - name: Install dependencies for Python 3.8 + run: /opt/python/cp38-cp38/bin/pip install tox + - name: Run tests for Python 3.8 + run: /opt/python/cp38-cp38/bin/python -m tox -e py38-test-double diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 00000000000..c6da7969946 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,75 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + schedule: + # run every Wednesday at 6am UTC + - cron: '0 6 * * 3' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + language: ['cpp', 'python'] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] + # Learn more: + # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + if: matrix.language != 'cpp' + uses: github/codeql-action/autobuild@v1 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + - name: Set up Python + uses: actions/setup-python@v2 + if: matrix.language == 'cpp' + with: + python-version: 3.9 + + - name: Manual build + if: matrix.language == 'cpp' + run: | + pip install -U pip setuptools_scm wheel + pip install extension-helpers jinja2 cython numpy pyerfa + python setup.py build_ext --inplace + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/label_issue_actions.yml b/.github/workflows/label_issue_actions.yml new file mode 100644 index 00000000000..1bc833d97f1 --- /dev/null +++ b/.github/workflows/label_issue_actions.yml @@ -0,0 +1,25 @@ +name: On Issue Labeled + +on: + issues: + types: + - labeled + +jobs: + # The label here needs to be the same as that set for actions/stale (stalebot) + # job in ci_cron_daily.yml + stalebot: + runs-on: ubuntu-latest + if: contains(github.event.issue.labels.*.name, 'Close?') + steps: + - name: Stale issue message + uses: actions/github-script@v3 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + github.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: 'This issue was labeled as **Close?**. Remove **Close?** label or this will be closed after 7 days. (This is currently a dry-run.)' + }) diff --git a/.github/workflows/open_actions.yml b/.github/workflows/open_actions.yml new file mode 100644 index 00000000000..000f80a7a19 --- /dev/null +++ b/.github/workflows/open_actions.yml @@ -0,0 +1,77 @@ +name: "When Opened" + +on: + issues: + types: + - opened + pull_request_target: + types: + - opened + +jobs: + triage: + runs-on: ubuntu-latest + steps: + - name: Label PR + uses: actions/labeler@main + if: github.event_name == 'pull_request_target' + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + - name: Greet new contributors + uses: actions/first-interaction@v1 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + issue-message: > + Welcome to Astropy 👋 and thank you for your first issue! + + + A project member will respond to you as soon as possible; in + the meantime, please double-check the [guidelines for submitting + issues](https://github.com/astropy/astropy/blob/main/CONTRIBUTING.md#reporting-issues) + and make sure you've provided the requested details. + + + If you feel that this issue has not been responded to in a timely + manner, please leave a comment mentioning our software support + engineer @embray, or send a message directly to the [development + mailing list](http://groups.google.com/group/astropy-dev). If + the issue is urgent or sensitive in nature (e.g., a security + vulnerability) please send an e-mail directly to the private e-mail + feedback@astropy.org. + pr-message: > + Welcome to Astropy 👋 and congratulations on your first pull + request! 🎉 + + + A project member will respond to you as soon as possible; in the + meantime, please have a look over the [Checklist for Contributed + Code](https://github.com/astropy/astropy/blob/main/CONTRIBUTING.md#checklist-for-contributed-code) + and make sure you've addressed as many of the questions there as + possible. + + + If you feel that this pull request has not been responded to in a + timely manner, please leave a comment mentioning our software + support engineer @embray, or send a message directly to the + [development mailing + list](http://groups.google.com/group/astropy-dev). If the issue is + urgent or sensitive in nature (e.g., a security vulnerability) + please send an e-mail directly to the private e-mail + feedback@astropy.org. + - name: 'Comment Draft PR' + uses: actions/github-script@v3 + if: github.event.pull_request.draft == true + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + github.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: '👋 Thank you for your draft pull request! Do you know that you can use `[ci skip]` or `[skip ci]` in your commit messages to skip running continuous integration tests until you are ready?' + }) + # We can take this out when astropy-bot comes back online, maybe... Until next year! + #- name: Special comment + # uses: pllim/action-special_pr_comment@main + # with: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index d4729a8324b..1efe03bb1ff 100644 --- a/.gitignore +++ b/.gitignore @@ -8,15 +8,18 @@ __pycache__ # Ignore .c files by default to avoid including generated code. If you want to -# add a non-generated .c extension, use `git add -f filename.c`. +# add a non-generated .c extension, put that into the src/ subdirectory of a +# package or else use `git add -f filename.c`. *.c +!astropy/*/src/*.c +astropy/modeling/src/projections.c # Other generated files MANIFEST -astropy/version.py astropy/cython_version.py astropy/wcs/include/wcsconfig.h astropy/_erfa/core.py +astropy/_version.py # Sphinx _build @@ -42,6 +45,16 @@ develop-eggs distribute-*.tar.gz .venv venv +# we are not currently using pipenv directly, but people who +# install astropy with pipenv will have these files generated +Pipfile +Pipfile.lock + +# pyinstaller files +.pyinstaller/astropy_tests/ +.pyinstaller/run_astropy_tests +.pyinstaller/run_astropy_tests.spec + # Other .cache @@ -55,6 +68,8 @@ venv .coverage cover htmlcov +.hypothesis +.github_cache # Mac OSX .DS_Store @@ -68,3 +83,6 @@ v # VSCode .vscode + +.tmp +pip-wheel-metadata diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 6a20fa6e5f8..00000000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "astropy_helpers"] - path = astropy_helpers - url = https://github.com/astropy/astropy-helpers.git diff --git a/.mailmap b/.mailmap index 549d9ae6d85..62e825a7373 100644 --- a/.mailmap +++ b/.mailmap @@ -21,8 +21,10 @@ Ana Posses Anany Shrey Jain <31594632+ananyashreyjain@users.noreply.github.com> Andy Casey Aniket Kulkarni +Aniket Sanghi Anirudh Katipally Anne Archibald +Anne Archibald Anthony Horton Asish Panda Asra Nizami @@ -36,11 +38,17 @@ Benjamin Alan Weaver Benjamin Roulston Benjamin Winkel Bogdan Nicula +Brett Morris Brett Morris +Brett Morris +Brian Soto Brian Svoboda -Brigitta Sipocz -Brigitta Sipocz +Brigitta Sipőcz +Brigitta Sipőcz +Brigitta Sipőcz Bryce Nordgren +Chris Osborne <2087801o@student.gla.ac.uk> +Chris Simpson Christian Clauss Christoph Gohlke Christopher Bonnett @@ -80,12 +88,15 @@ Emily Deibert Emma Hogan Eric Depagne Eric Koch -Erik M. Bray -Erik M. Bray -Erik M. Bray +E. Madison Bray +E. Madison Bray +E. Madison Bray Esteban Pardo Sánchez Francesco Montesano +Gabriel Perren +Gabriel Perren Geert Barentsen +George Galvin Gerrit Schellenberger Giorgio Calderone Graham Kanarek @@ -137,6 +148,7 @@ Joseph Schlitz Juan Carlos Segovia Juan Luis Cano Rodríguez Juan Luis Cano Rodríguez +Juan Luis Cano Rodríguez Julien Woillez Julien Woillez Jurien Huisman @@ -147,14 +159,18 @@ Karl Vyhmeister Kelle Cruz Kevin Gullikson Kirill Tchernyshyov +Kris Stern +Kris Stern Kyle Barbary Kyle Oman Larry Bradley Larry Bradley Laura Watkins Lauren Glattly <44421608+lglattly@users.noreply.github.com> +Lennard Kiehl Leo Singer Leonardo Ferreira <[leonardo.ferreira.furg@gmail.com]> +Lia Corrales Lingyi Hu Lisa Martin <48742903+lisamartin72@users.noreply.github.com> Lisa Walter @@ -162,6 +178,7 @@ Loïc Séguin-C Luke G. Bouma Luke Kelley Madhura Parikh +Magali Mebsout Magnus Persson Maneesh Yadav Mangala Gowri Krishnamoorthy @@ -171,24 +188,32 @@ Matteo Bachetti Matthieu Baumann Mavani Bhautik +Michael Hirsch +Michael Lindner-D'Addario <38199062+MDAddario@users.noreply.github.com> Michael Mommert Michael Mommert Michael Seifert Michele Costa +Michele Costa Miguel de Val-Borro Mihai Cara +Mihai Cara Mike Alexandersen Mikhail Minin Moataz Hisham Nabil Freij Nadia Dencheva Nadia Dencheva +Nathaniel Starkman Neil Crighton Nicholas Earl Nicholas Earl Nicholas Earl +Nick Lloyd +Nora Luetzgendorf Ole Streicher Ole Streicher +Parikshit Sakurikar Patricio Rojo Pauline Barmby Perry Greenfield @@ -196,20 +221,26 @@ Pey Lian Lim Pey Lian Lim <2090236+pllim@users.noreply.github.com> Pratik Patel Pritish Chakraborty +Ricky O'Steen <39831871+rosteen@users.noreply.github.com> Ritiek Malhotra Ritwick DSouza Rohan Rajpal Rohit Kapoor Rohit Patil Rohit Patil +Roman Tolesnikov Ryan Cooke Sam Verstocken Sanjeev Dubey Sara Ogaz Sergio Pascual Shantanu Srivastava +Shilpi Jain +Shivansh Mishra +Shivansh Mishra Simon Conseil Simon Conseil +Simon Conseil Simon Liedtke Sourabh Cheedella Steve Crawford @@ -233,5 +264,7 @@ Vital Fernández Yash Kumar Yash Sharma +Yingqi Ying <33911276+dyq0811@users.noreply.github.com> Zach Edwards +Zac Hatfield-Dodds Zé Vinicius diff --git a/.pep8speaks.yml b/.pep8speaks.yml new file mode 100644 index 00000000000..35c53d219eb --- /dev/null +++ b/.pep8speaks.yml @@ -0,0 +1,47 @@ +scanner: + diff_only: True + linter: flake8 + +flake8: + max-line-length: 100 + select: + - E101 # mix of tabs and spaces + - W191 # use of tabs + - W291 # trailing whitespace + - W292 # no newline at end of file + - W293 # trailing whitespace + - W391 # blank line at end of file + - E111 # 4 spaces per indentation level + - E112 # 4 spaces per indentation level + - E113 # 4 spaces per indentation level + - E301 # expected 1 blank line, found 0 + - E302 # expected 2 blank lines, found 0 + - E303 # too many blank lines (3) + - E304 # blank lines found after function decorator + - E305 # expected 2 blank lines after class or function definition + - E306 # expected 1 blank line before a nested definition + - E502 # the backslash is redundant between brackets + - E722 # do not use bare except + - E901 # SyntaxError or IndentationError + - E902 # IOError + - E999 # SyntaxError -- failed to compile a file into an Abstract Syntax Tree + - F822 # undefined name in __all__ + - F823 # local variable name referenced before assignment + +no_blank_comment: True +descending_issues_order: False + +message: + opened: + header: > + Hello @{name} :wave:! Thanks for opening this pull request, we are + very grateful for your contribution! I'm a friendly :robot: that + checks for style issues in this pull request, since this project + follows the [PEP8](https://www.python.org/dev/peps/pep-0008/) style + guidelines. I've listed some small issues I found below, but please + don't hesitate to ask if any of them are unclear! + updated: + header: > + Hello @{name} :wave:! It looks like you've made some changes in your + pull request, so I've checked the code again for style. + no_errors: "There are no PEP8 style issues with this pull request - thanks! :tada:" diff --git a/.pyinstaller/hooks/hook-skyfield.py b/.pyinstaller/hooks/hook-skyfield.py new file mode 100644 index 00000000000..41788647041 --- /dev/null +++ b/.pyinstaller/hooks/hook-skyfield.py @@ -0,0 +1,5 @@ +# NOTE: this hook should be added to +# https://github.com/pyinstaller/pyinstaller-hooks-contrib +# once that repository is ready for pull requests +from PyInstaller.utils.hooks import collect_data_files +datas = collect_data_files('skyfield') diff --git a/.pyinstaller/run_astropy_tests.py b/.pyinstaller/run_astropy_tests.py new file mode 100644 index 00000000000..d5371adf5f0 --- /dev/null +++ b/.pyinstaller/run_astropy_tests.py @@ -0,0 +1,72 @@ +import os +import sys +import pytest +import shutil +import astropy # noqa + +ROOT = os.path.join(os.path.dirname(__file__), '../') + +# Make sure we don't allow any arguments to be passed - some tests call +# sys.executable which becomes this script when producing a pyinstaller +# bundle, but we should just error in this case since this is not the +# regular Python interpreter. +if len(sys.argv) > 1: + print("Extra arguments passed, exiting early") + sys.exit(1) + +for root, dirnames, files in os.walk(os.path.join(ROOT, 'astropy')): + # Copy over the astropy 'tests' directories and their contents + for dirname in dirnames: + final_dir = os.path.relpath(os.path.join(root.replace('astropy', 'astropy_tests'), dirname), ROOT) + # We only copy over 'tests' directories, but not astropy/tests (only + # astropy/tests/tests) since that is not just a directory with tests. + if dirname == 'tests' and not root.endswith('astropy'): + shutil.copytree(os.path.join(root, dirname), final_dir, dirs_exist_ok=True) + else: + # Create empty __init__.py files so that 'astropy_tests' still + # behaves like a single package, otherwise pytest gets confused + # by the different conftest.py files. + init_filename = os.path.join(final_dir, '__init__.py') + if not os.path.exists(os.path.join(final_dir, '__init__.py')): + os.makedirs(final_dir, exist_ok=True) + with open(os.path.join(final_dir, '__init__.py'), 'w') as f: + f.write("#") + # Copy over all conftest.py files + for file in files: + if file == 'conftest.py': + final_file = os.path.relpath(os.path.join(root.replace('astropy', 'astropy_tests'), file), ROOT) + shutil.copy2(os.path.join(root, file), final_file) + +# Add the top-level __init__.py file +with open(os.path.join('astropy_tests', '__init__.py'), 'w') as f: + f.write("#") + +# Copy the top-level conftest.py +shutil.copy2(os.path.join(ROOT, 'astropy', 'conftest.py'), + os.path.join('astropy_tests', 'conftest.py')) + +# We skip a few tests, which are generally ones that rely on explicitly +# checking the name of the current module (which ends up starting with +# astropy_tests rather than astropy). + +SKIP_TESTS = ['test_exception_logging_origin', + 'test_log', + 'test_configitem', + 'test_config_noastropy_fallback', + 'test_no_home', + 'test_path', + 'test_rename_path', + 'test_data_name_third_party_package', + 'test_pkg_finder', + 'test_wcsapi_extension', + 'test_find_current_module_bundle', + 'test_download_parallel_fills_cache'] + +# Run the tests! +sys.exit(pytest.main(['astropy_tests', + '-k ' + ' and '.join('not ' + test for test in SKIP_TESTS)], + plugins=['pytest_doctestplus.plugin', + 'pytest_openfiles.plugin', + 'pytest_remotedata.plugin', + 'pytest_mpl.plugin', + 'pytest_astropy_header.display'])) diff --git a/.readthedocs.yml b/.readthedocs.yml index 07d9c1b7bec..775fb374b02 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -3,10 +3,16 @@ version: 2 build: image: latest +sphinx: + builder: html + configuration: docs/conf.py + fail_on_warning: true + # Install regular dependencies. # Then, install special pinning for RTD. python: - version: 3.6 + version: 3.8 + system_packages: false install: - method: pip path: . @@ -14,8 +20,5 @@ python: - docs - all -submodules: - include: all - # Don't build any extra formats formats: [] diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e90fcd25297..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,250 +0,0 @@ -# We set the language to c because python isn't supported on the MacOS X nodes -# on Travis. However, the language ends up being irrelevant anyway, since we -# install Python ourselves using conda. -language: c - -compiler: gcc - -# Cache can be cleared from the travis settings menu, see docs currently at -# https://docs.travis-ci.com/user/caching#Clearing-Caches -cache: - - ccache - -os: - - linux - -stage: Comprehensive tests - -# Setting sudo to false opts in to Travis-CI container-based builds. -sudo: false - -# The apt packages below are needed for sphinx builds, which can no longer -# be installed with sudo apt-get. -# tzdata is included to ensure system leap seconds are up to date. -addons: - apt: - packages: - - graphviz - - language-pack-de - - tzdata - -env: - global: - # Set defaults to avoid repeating in most cases - - PYTHON_VERSION=3.6 - - NUMPY_VERSION=stable - - MAIN_CMD='python setup.py' - - CONDA_DEPENDENCIES='Cython jinja2' - - CONDA_ALL_DEPENDENCIES='Cython jinja2 scipy h5py matplotlib pyyaml pandas pytz html5lib beautifulsoup4 ipython mpmath bleach bottleneck' - - DEV_PIP_DEP='asdf>=2.3 Cython jinja2 scipy h5py matplotlib pyyaml scikit-image pandas pytz html5lib beautifulsoup4 ipython mpmath bleach bottleneck' - - ASDF_PIP_DEP='asdf>=2.3' - - SETUP_XVFB=True - - EVENT_TYPE='push pull_request' - - SETUP_CMD='test' - - INSTALL_WITH_PIP=False - - PIP_FLAGS="" - - EXTRAS_INSTALL="" - # Run test suite twice in a row without cleaning - - DOUBLE_PLAY=False - - USE_CI_HELPERS=True - # Use this for the dependencies when not using ci-helpers - - OTHER_DEPENDENCY_PREFERENCES='' - - # PEP8 errors/warnings: - # E101 - mix of tabs and spaces - # W191 - use of tabs - # W291 - trailing whitespace - # W292 - no newline at end of file - # W293 - trailing whitespace - # W391 - blank line at end of file - # E111 - 4 spaces per indentation level - # E112 - 4 spaces per indentation level - # E113 - 4 spaces per indentation level - # E301 - expected 1 blank line, found 0 - # E302 - expected 2 blank lines, found 0 - # E303 - too many blank lines (3) - # E304 - blank lines found after function decorator - # E305 - expected 2 blank lines after class or function definition - # E306 - expected 1 blank line before a nested definition - # E502 - the backslash is redundant between brackets - # E722 - do not use bare except - # E901 - SyntaxError or IndentationError - # E902 - IOError - # E999: SyntaxError -- failed to compile a file into an Abstract Syntax Tree - # # F821: undefined name # Note: Removed for now because of heavy use of units.si - # F822: undefined name in __all__ - # F823: local variable name referenced before assignment - - FLAKE8_OPT="--select=E101,W191,W291,W292,W293,W391,E111,E112,E113,E30,E502,E722,E901,E902,E999,F822,F823" - -stages: - # Do the style check and a single test job, don't proceed if it fails - - name: Initial tests - # Do the rest of the tests - - name: Comprehensive tests - - name: Final tests - - name: Cron tests - if: type = cron - -matrix: - - # Don't wait for allowed failures - fast_finish: true - - include: - # Try MacOS X. - - os: osx - stage: Cron tests - env: SETUP_CMD='test --remote-data=astropy' - CONDA_DEPENDENCIES="$CONDA_ALL_DEPENDENCIES clang" - PIP_DEPENDENCIES="scikit-image jplephem $ASDF_PIP_DEP" - CCOMPILER=clang - EVENT_TYPE='cron' - DOUBLE_PLAY=True - - # Try all python versions and Numpy versions. Since we can assume that - # the Numpy developers have taken care of testing Numpy with different - # versions of Python, we can vary Python and Numpy versions at the same - # time. - - os: linux - env: PYTHON_VERSION=3.6 NUMPY_VERSION=1.16 - INSTALL_CMD='python setup.py build_ext --inplace' - PIP_DEPENDENCIES='pytest-astropy' - TEST_CMD='pytest --open-files --doctest-rst' - script: - - $INSTALL_CMD - - $TEST_CMD - - # Now try with all optional dependencies. We also include the --readonly - # flag to make sure no files are being written to the temporary install - # location during testing. We also use this build to make sure that the - # dependencies get correctly installed with pip. - - os: linux - env: SETUP_CMD='test --remote-data=astropy --readonly' - LC_CTYPE=C.ascii LC_ALL=C - PIP_DEPENDENCIES="" CONDA_DEPENDENCIES="" - INSTALL_WITH_PIP=True - EXTRAS_INSTALL="test,all" - - - os: linux - stage: Initial tests - env: PYTHON_VERSION=3.7 CONDA_DEPENDENCIES=$CONDA_ALL_DEPENDENCIES - PIP_DEPENDENCIES="scikit-image $ASDF_PIP_DEP" - SETUP_CMD='test -a "--durations=50"' - compiler: clang - - # Full tests with coverage checks. - - os: linux - env: SETUP_CMD='test --coverage --remote-data=astropy --readonly' - CONDA_DEPENDENCIES=$CONDA_ALL_DEPENDENCIES - PIP_DEPENDENCIES="scikit-image codecov objgraph jplephem bintrees sortedcontainers $ASDF_PIP_DEP" - LC_CTYPE=C.ascii LC_ALL=C - CFLAGS='--coverage -fno-inline-functions -O0' - MATPLOTLIB_VERSION=2.1 - EVENT_TYPE='push pull_request cron' - - # Try on Windows - - os: windows - stage: Final tests - env: PYTHON_VERSION=3.7 SETUP_CMD='test --readonly' - CONDA_DEPENDENCIES="" - PIP_DEPENDENCIES="Cython scipy h5py beautifulsoup4 html5lib jinja2 pyyaml matplotlib scikit-image pytz pandas objgraph asdf" - - # Do a PEP8/pyflakes test with flake8 - - os: linux - stage: Initial tests - env: MAIN_CMD="flake8 astropy --count $FLAKE8_OPT" SETUP_CMD='' - - # Try developer version of Numpy with optional dependencies and also - # run all remote tests. Since both cases will be potentially - # unstable, we combine them into a single unstable build that we can - # mark as an allowed failure below. - - os: linux - stage: Final tests - env: PYTHON_VERSION=3.7 NUMPY_VERSION=dev SETUP_CMD='test --remote-data' - CONDA_DEPENDENCIES='' - PIP_DEPENDENCIES=$DEV_PIP_DEP - MATPLOTLIB_VERSION=dev - - # We check numpy-dev also in a job that only runs from cron, so that - # we can spot issues sooner. We do not use remote data here, since - # that gives too many false positives due to URL timeouts. - # We also install all dependencies via pip here so we pick up the latest - # releases. - - os: linux - stage: Cron tests - env: NUMPY_VERSION=dev MATPLOTLIB_VERSION=dev EVENT_TYPE='cron' - CONDA_DEPENDENCIES='' - PIP_DEPENDENCIES=$DEV_PIP_DEP - - # Run documentation link check in a cron job. - # Was originally in CircleCI doc build but links are too flaky, so - # we moved it here instead. - # NOTE: matplotlib pinning should be consistent with CircleCI HTML job. - - os: linux - stage: Cron tests - env: SETUP_CMD='build_docs -b linkcheck' EVENT_TYPE='cron' - MATPLOTLIB_VERSION="<3.1" - PIP_DEPENDENCIES="" CONDA_DEPENDENCIES="" - INSTALL_WITH_PIP=True - EXTRAS_INSTALL="docs" - - # Testing with Travis provided Python3.8. Change this job to a regular - # one once conda supports python3.8. Make sure we use released numpy rather - # than some kind of dev coming natively from the Travis environment - - language: python - stage: Final tests - dist: xenial - python: 3.8-dev - env: INSTALL_WITH_PIP=True EXTRAS_INSTALL="test" USE_CI_HELPERS=False - OTHER_DEPENDENCY_PREFERENCES='numpy==1.17.3' PIP_FLAGS="--pre" - - allow_failures: - - os: linux - stage: Final tests - env: PYTHON_VERSION=3.7 NUMPY_VERSION=dev SETUP_CMD='test --remote-data' - CONDA_DEPENDENCIES='' - PIP_DEPENDENCIES=$DEV_PIP_DEP - MATPLOTLIB_VERSION=dev - -before_install: - - # We need to use CCOMPILER otherwise Travis overwrites CC if we define it - # in env: above. - - if [ ! -z $CCOMPILER ]; then - export CC=$CCOMPILER; - fi - - # Check CC variable - - echo $CC - - # Write configuration items to standard location to make sure they are - # ignored (the tests will fail if not) - - mkdir -p $HOME/.astropy/config/ - - printf "unicode_output = True\nmax_width = 500" > $HOME/.astropy/config/astropy.cfg - - -install: - - if [[ $USE_CI_HELPERS == True ]]; then - git clone git://github.com/astropy/ci-helpers.git; - source ci-helpers/travis/setup_conda.sh; - fi - - if [[ $INSTALL_WITH_PIP == True ]]; then - if [ -z $EXTRAS_INSTALL ]; then - pip install -e . ${OTHER_DEPENDENCY_PREFERENCES} ${PIP_FLAGS}; - else - pip install -e .[$EXTRAS_INSTALL] ${OTHER_DEPENDENCY_PREFERENCES} ${PIP_FLAGS}; - fi - fi - -script: - - if [[ $DOUBLE_PLAY == True ]]; then - $MAIN_CMD $SETUP_CMD; - $MAIN_CMD $SETUP_CMD; - else - $MAIN_CMD $SETUP_CMD; - fi - -after_success: - - if [[ $SETUP_CMD == *--coverage* ]]; then - codecov --gcov-glob "*cextern*"; - fi diff --git a/CHANGES.rst b/CHANGES.rst index eb69054cf8f..ec818bfbfcb 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,245 +1,1226 @@ -4.1 (unreleased) +4.2.1 (2021-04-01) +================== + +Bug Fixes +--------- + +astropy.cosmology +^^^^^^^^^^^^^^^^^ + +- Fixed an issue where specializations of the comoving distance calculation + for certain cosmologies could not handle redshift arrays. [#10980] + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Fix bug where manual fixes to invalid header cards were not preserved when + saving a FITS file. [#11108] + +astropy.io.votable +^^^^^^^^^^^^^^^^^^ + +- ``NumericArray`` converter now properly broadcasts scalar mask to array. + [#11157] + +astropy.table +^^^^^^^^^^^^^ + +- Fix bug when initializing a ``Table`` subclass that uses ``TableAttribute``'s. + If the data were an instance of the table then attributes provided in the + table initialization call could be ignored. [#11217] + +astropy.time +^^^^^^^^^^^^ + +- Change epoch of ``TimeUnixTAI`` (``"unix_tai"``) from ``1970-01-01T00:00:00 UTC`` + to ``1970-01-01T00:00:00 TAI`` to match the intended and documented behaviour. + This essentially changes the resulting times by 8.000082 seconds, the initial + offset between TAI and UTC. [#11249] + +astropy.units +^^^^^^^^^^^^^ + +- Fixed a bug with the ``quantity_input`` decorator where allowing + dimensionless inputs for an argument inadvertently disabled any checking of + compatible units for that argument. [#11283] + +astropy.utils +^^^^^^^^^^^^^ + +- Fix a bug so that ``np.shape``, ``np.ndim`` and ``np.size`` again work on + classes that use ``ShapedLikeNDArray``, like representations, frames, + sky coordinates, and times. [#11133] + +astropy.wcs +^^^^^^^^^^^ + +- Fix error when a user defined ``proj_point`` parameter is passed to ``fit_wcs_from_points``. [#11139] + + +Other Changes and Additions +--------------------------- + + +- Change epoch of ``TimeUnixTAI`` (``"unix_tai"``) from ``1970-01-01T00:00:00 UTC`` + to ``1970-01-01T00:00:00 TAI`` to match the intended and documented behaviour. + This essentially changes the resulting times by 8.000082 seconds, the initial + offset between TAI and UTC. [#11249] + + +4.2 (2020-11-24) ================ New Features ------------ +astropy.convolution +^^^^^^^^^^^^^^^^^^^ + +- Methods ``convolve`` and ``convolve_fft`` both now return Quantity arrays + if user input is given in one. [#10822] + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Numpy functions that broadcast, change shape, or index (like + ``np.broadcast_to``, ``np.rot90``, or ``np.roll``) now work on + coordinates, frames, and representations. [#10337] + +- Add a new science state ``astropy.coordinates.erfa_astrom.erfa_astrom`` and + two classes ``ErfaAstrom``, ``ErfaAstromInterpolator`` as wrappers to + the ``pyerfa`` astrometric functions used in the coordinate transforms. + Using ``ErfaAstromInterpolator``, which interpolates astrometric properties for + ``SkyCoord`` instances with arrays of obstime, can dramatically speed up + coordinate transformations while keeping microarcsecond resolution. + Depending on needed precision and the obstime array in question, speed ups + reach factors of 10x to >100x. [#10647] + +- ``galactocentric_frame_defaults`` can now also be used as a registry, with + user-defined parameter values and metadata. [#10624] + +- Method ``.realize_frame`` from coordinate frames now accepts ``**kwargs``, + including ``representation_type``. [#10727] + +- Avoid an unnecessary call to ``erfa.epv00`` in transformations between + ``CIRS`` and ``ICRS``, improving performance by 50 %. [#10814] + +- A new equatorial coordinate frame, with RA and Dec measured w.r.t to the True + Equator and Equinox (TETE). This frame is commonly known as "apparent place" + and is the correct frame for coordinates returned from JPL Horizons. [#10867] + +- Added a context manager ``impose_finite_difference_dt`` to the + ``TransformGraph`` class to override the finite-difference time step + attribute (``finite_difference_dt``) for all transformations in the graph + with that attribute. [#10341] + +- Improve performance of ``SpectralCoord`` by refactoring internal + implementation. [#10398] + +astropy.cosmology +^^^^^^^^^^^^^^^^^ + +- The final version of the Planck 2018 cosmological parameters are included + as the ``Planck18`` object, which is now the default cosmology. The + parameters are identical to those of the ``Planck18_arXiv_v2`` object, + which is now deprecated and will be removed in a future release. [#10915] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Added NFW profile and tests to modeling package [#10505] + +- Added missing logic for evaluate to compound models [#10002] + +- Stop iteration in ``FittingWithOutlierRemoval`` before reaching ``niter`` if + the masked points are no longer changing. [#10642] + +- Keep a (shallow) copy of ``fit_info`` from the last iteration of the wrapped + fitter in ``FittingWithOutlierRemoval`` and also record the actual number of + iterations performed in it. [#10642] + +- Added attributes for fitting uncertainties (covariance matrix, standard + deviations) to models. Parameter covariance matrix can be accessed via + ``model.cov_matrix``, standard deviations by ``model.stds`` or individually + for each parameter by ``parameter.std``. Currently implemented for + ``LinearLSQFitter`` and ``LevMarLSQFitter``. [#10552] + +- N-dimensional least-squares statistic and specific 1,2,3-D methods [#10670] + +astropy.stats +^^^^^^^^^^^^^ + +- Added ``circstd`` function to obtain a circular standard deviation. [#10690] + +astropy.table +^^^^^^^^^^^^^ + +- Allow initializing a ``Table`` using a list of ``names`` in conjunction with + a ``dtype`` from a numpy structured array. The list of ``names`` overrides the + names specified in the ``dtype``. [#10419] + +astropy.time +^^^^^^^^^^^^ + +- Add new ``isclose()`` method to ``Time`` and ``TimeDelta`` classes to allow + comparison of time objects to within a specified tolerance. [#10646] + +- Improve initialization time by a factor of four when creating a scalar ``Time`` + object in a format like ``unix`` or ``cxcsec`` (time delta from a reference + epoch time). [#10406] + +- Improve initialization time by a factor of ~25 or more for large arrays of + string times in ISO, ISOT or year day-of-year formats. This is done with a new + C-based time parser that can be adapted for other fixed-format custom time + formats. [#10360] + +- Numpy functions that broadcast, change shape, or index (like + ``np.broadcast_to``, ``np.rot90``, or ``np.roll``) now work on times. + [#10337, #10502] + +astropy.timeseries +^^^^^^^^^^^^^^^^^^ + +- Improve memory and speed performance when iterating over the entire time + column of a ``TimeSeries`` object. Previously this involved O(N^2) operations + and memory. [#10889] + +astropy.units +^^^^^^^^^^^^^ + +- ``Quantity.to`` has gained a ``copy`` option to allow copies to be avoided + when the units do not change. [#10517] + +- Added the ``spat`` unit of solid angle that represents the full sphere. + [#10726] + +astropy.utils +^^^^^^^^^^^^^ + +- ``ShapedLikeNDArray`` has gained the capability to use numpy functions + that broadcast, change shape, or index. [#10337] + +- ``get_free_space_in_dir`` now takes a new ``unit`` keyword and + ``check_free_space_in_dir`` takes ``size`` defined as ``Quantity``. [#10627] + +- New ``astropy.utils.data.conf.allow_internet`` configuration item to + control downloading data from the Internet. Setting ``allow_internet=False`` + is the same as ``remote_timeout=0``. Using ``remote_timeout=0`` to control + internet access will stop working in a future release. [#10632] + +- New ``is_url`` function so downstream packages do not have to secretly use + the hidden ``_is_url`` anymore. [#10684] + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ + +- Added the ``Quadrangle`` patch for ``WCSAxes`` for a latitude-longitude + quadrangle. Unlike ``matplotlib.patches.Rectangle``, the edges of this + patch will be rendered as curved lines if appropriate for the WCS + transformation. [#10862] + +- The position of tick labels are now only calculated when needed. If any text + parameters are changed (color, font weight, size etc.) that don't effect the + tick label position, the positions are not recomputed, improving performance. + [#10806] + +astropy.wcs +^^^^^^^^^^^ + +- ``WCS.to_header()`` now appends comments to SIP coefficients. [#10480] + +- A new property ``dropped_world_dimensions`` has been added to + ``SlicedLowLevelWCS`` to record information about any world axes removed by + slicing a WCS. [#10195] + +- New ``WCS.proj_plane_pixel_scales()`` and ``WCS.proj_plane_pixel_area()`` + methods to return pixel scales and area, respectively, as Quantity. [#10872] + + +API Changes +----------- + astropy.config ^^^^^^^^^^^^^^ -astropy.constants -^^^^^^^^^^^^^^^^^ +- ``set_temp_config`` now preserves the existing cache rather than deleting + it and relying on reloading it from the previous config file. This ensures + that any programmatically made changes are preserved as well. [#10474] -astropy.convolution +- Configuration path detection logic has changed: Now, it looks for ``~`` first + before falling back to older logic. In addition, ``HOMESHARE`` is no longer + used in Windows. [#10705] + +astropy.coordinates ^^^^^^^^^^^^^^^^^^^ +- The passing of frame classes (as opposed to frame instances) to the + ``transform_to()`` methods of low-level coordinate-frame classes has been + deprecated. Frame classes can still be passed to the ``transform_to()`` + method of the high-level ``SkyCoord`` class, and using ``SkyCoord`` is + recommended for all typical use cases of transforming coordinates. [#10475] + +astropy.stats +^^^^^^^^^^^^^ + +- Added a ``grow`` parameter to ``SigmaClip``, ``sigma_clip`` and + ``sigma_clipped_stats``, to allow expanding the masking of each deviant + value to its neighbours within a specified radius. [#10613] + +- Passing float ``n`` to ``poisson_conf_interval`` when using + ``interval='kraft-burrows-nousek'`` now raises ``TypeError`` as its value + must be an integer. [#10838] + +astropy.table +^^^^^^^^^^^^^ + +- Change ``Table.columns.keys()`` and ``Table.columns.values()`` to both return + generators instead of a list. This matches the behavior for Python ``dict`` + objects. [#10543] + +- Removed the ``FastBST`` and ``FastRBT`` indexing engines because they depend + on the ``bintrees`` package, which is no longer maintained and is deprecated. + Instead, use the ``SCEngine`` indexing engine, which is similar in + performance and relies on the ``sortedcontainers`` package. [#10622] + +- When slicing a mixin column in a table that had indices, the indices are no + longer copied since they generally are not useful, having the wrong shape. + With this, the behaviour becomes the same as that for a regular ``Column``. + (Note that this does not affect slicing of a table; sliced columns in those + will continue to carry a sliced version of any indices). [#10890] + +- Change behavior so that when getting a single item out of a mixin column such + as ``Time``, ``TimeDelta``, ``SkyCoord`` or ``Quantity``, the ``info`` + attribute is no longer copied. This improves performance, especially when the + object is an indexed column in a ``Table``. [#10889] + +- Raise a TypeError when a scalar column is added to an unsized table. [#10476] + +- The order of columns when creating a table from a ``list`` of ``dict`` may be + changed. Previously, the order was alphabetical because the ``dict`` keys + were assumed to be in random order. Since Python 3.7, the keys are always in + order of insertion, so ``Table`` now uses the order of keys in the first row + to set the column order. To alphabetize the columns to match the previous + behavior, use ``t = t[sorted(t.colnames)]``. [#10900] + +astropy.time +^^^^^^^^^^^^ + +- Refactor ``Time`` and ``TimeDelta`` classes to inherit from a common + ``TimeBase`` class. The ``TimeDelta`` class no longer inherits from ``Time``. + A number of methods that only apply to ``Time`` (e.g. ``light_travel_time``) + are no longer available in the ``TimeDelta`` class. [#10656] + +astropy.units +^^^^^^^^^^^^^ + +- The ``bar`` unit is no longer wrongly considered an SI unit, meaning that + SI decompositions like ``(u.kg*u.s**-2* u.sr**-1 * u.nm**-1).si`` will + no longer include it. [#10586] + +astropy.utils +^^^^^^^^^^^^^ + +- Shape-related items from ``astropy.utils.misc`` -- ``ShapedLikeNDArray``, + ``check_broadcast``, ``unbroadcast``, and ``IncompatibleShapeError`` -- + have been moved to their own module, ``astropy.utils.shapes``. They remain + importable from ``astropy.utils``. [#10337] + +- ``check_hashes`` keyword in ``check_download_cache`` is deprecated and will + be removed in a future release. [#10628] + +- ``hexdigest`` keyword in ``import_file_to_cache`` is deprecated and will + be removed in a future release. [#10628] + + +Bug Fixes +--------- + +astropy.config +^^^^^^^^^^^^^^ + +- Fix a few issues with ``generate_config`` when used with other packages. + [#10893] + astropy.coordinates ^^^^^^^^^^^^^^^^^^^ -astropy.cosmology -^^^^^^^^^^^^^^^^^ +- Fixed a bug in the coordinate-frame attribute ``CoordinateAttribute`` where + the internal transformation could behave differently depending on whether + the input was a low-level coordinate frame or a high-level ``SkyCoord``. + ``CoordinateAttribute`` now always performs a ``SkyCoord``-style internal + transformation, including the by-default merging of frame attributes. [#10475] -astropy.extern +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Fixed an issue of ``Model.render`` when the input ``out`` datatype is not + float64. [#10542] + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ + +- Fix support for referencing WCSAxes coordinates by their world axes names. + [#10484] + +astropy.wcs +^^^^^^^^^^^ + +- Objective functions called by ``astropy.wcs.fit_wcs_from_points`` were + treating longitude and latitude distances equally. Now longitude scaled + properly. [#10759] + + +Other Changes and Additions +--------------------------- + +- Minimum version of required Python is now 3.7. [#10900] + +- Minimum version of required Numpy is now 1.17. [#10664] + +- Minimum version of required Scipy is now 1.1. [#10900] + +- Minimum version of required PyYAML is now 3.13. [#10900] + +- Minimum version of required Matplotlib is now 3.0. [#10900] + +- The private ``_erfa`` module has been converted to its own package, + ``pyerfa``, which is a required dependency for astropy, and can be imported + with ``import erfa``. Importing ``_erfa`` from ``astropy`` will give a + deprecation warning. [#10329] + +- Added ``optimize=True`` flag to calls of ``yacc.yacc`` (as already done for + ``lex.lex``) to allow running in ``python -OO`` session without raising an + exception in ``astropy.units.format``. [#10379] + +- Shortened FITS comment strings for some D2IM and CPDIS FITS keywords to + reduce the number of FITS ``VerifyWarning`` warnings when working with WCSes + containing lookup table distortions. [#10513] + +- When importing astropy without first building the extension modules first, + raise an error directly instead of trying to auto-build. [#10883] + + + +4.1 (2020-10-21) +================ + +New Features +------------ + +astropy.config ^^^^^^^^^^^^^^ +- Add new function ``generate_config`` to generate the configuration file and + include it in the documentation. [#10148] + +- ``ConfigNamespace.__iter__`` and ``ConfigNamespace.keys`` now yield ``ConfigItem`` + names defined within it. Similarly, ``items`` and ``values`` would yield like a + Python dictionary would. [#10139] + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- Added a new ``SpectralCoord`` class that can be used to define spectral + coordinates and transform them between different velocity frames. [#10185] + +- Angle parsing now supports ``cardinal direction`` in the cases + where angles are initialized as ``string`` instances. eg ``"17°53'27"W"``.[#9859] + +- Allow in-place modification of array-valued ``Frame`` and ``SkyCoord`` objects. + This provides limited support for updating coordinate data values from another + coordinate object of the same class and equivalent frame attributes. [#9857] + +- Added a robust equality operator for comparing ``SkyCoord``, frame, and + representation objects. A comparison like ``sc1 == sc2`` will now return a + boolean or boolean array where the objects are strictly equal in all relevant + frame attributes and coordinate representation values. [#10154] + +- Added the True Equator Mean Equinox (TEME) frame. [#10149] + +- The ``Galactocentric`` frame will now use the "latest" parameter definitions + by default. This currently corresponds to the values defined in v4.0, but will + change with future releases. [#10238] + +- The ``SkyCoord.from_name()`` and Sesame name resolving functionality now is + able to cache results locally and will do so by default. [#9162] + +- Allow in-place modification of array-valued ``Representation`` and ``Differential`` + objects, including of representations with attached differentials. [#10210] + astropy.io.ascii ^^^^^^^^^^^^^^^^ +- Functional Units can now be processed in CDS-tables. [#9971] + +- Allow reading in ASCII tables which have duplicate column names. [#9939] + +- Fixed failure of ASCII ``fast_reader`` to handle ``names``, ``include_names``, + ``exclude_names`` arguments for ``RDB`` formatted tables. Homogenised checks + and exceptions for invalid ``names`` arguments. Improved performance when + parsing "wide" tables with many columns. [#10306] + +- Added type validation of key arguments in calls to ``io.ascii.read()`` and + ``io.ascii.write()`` functions. [#10005] + astropy.io.misc ^^^^^^^^^^^^^^^ +- Added serialization of parameter constraints fixed and bounds. [#10082] + +- Added 'functional_models.py' and 'physical_models.py' to asdf/tags/transform, + with to allow serialization of all functional and physical models. [#10028, #10293] + +- Fix ASDF serialization of circular model inverses, and remove explicit calls + to ``asdf.yamlutil`` functions that became unnecessary in asdf 2.6.0. [#10189, #10384] astropy.io.fits ^^^^^^^^^^^^^^^ -astropy.io.registry -^^^^^^^^^^^^^^^^^^^ +- Added support for writing Dask arrays to disk efficiently for ``ImageHDU`` and + ``PrimaryHDU``. [#9742] + +- Add HDU name and ver to FITSDiff report where appropriate [#10197] astropy.io.votable ^^^^^^^^^^^^^^^^^^ +- New ``exceptions.conf.max_warnings`` configuration item to control the number of times a + type of warning appears before being suppressed. [#10152] + +- No longer ignore attributes whose values were specified as empty + strings. [#10583] + astropy.modeling ^^^^^^^^^^^^^^^^ +- Added Plummer1D model to ``functional_models``. [#9896] + +- Added ``UnitsMapping`` model and ``Model.coerce_units`` to support units on otherwise + unitless models. [#9936] + +- Added ``domain`` and ``window`` attributes to ``repr`` and ``str``. Fixed bug with + ``_format_repr`` in core.py. [#9941] + +- Polynomial attributes ``domain`` and ``window`` are now tuples of size 2 and are + validated. `repr` and `print` show only their non-default values. [#10145] + +- Added ``replace_submodel()`` method to ``CompoundModel`` to modify an + existing instance. [#10176] + +- Delay construction of ``CompoundModel`` inverse until property is accessed, + to support ASDF deserialization of circular inverses in component models. [#10384] astropy.nddata ^^^^^^^^^^^^^^ -astropy.samp -^^^^^^^^^^^^ +- Added support in the ``bitmask`` module for using mnemonic bit flag names + when specifying the bit flags to be used or ignored when converting a bit + field to a boolean. [#10095, #10208] -astropy.stats -^^^^^^^^^^^^^ +- Added ``reshape_as_blocks`` function to reshape a data array into + blocks, which is useful to efficiently apply functions on block + subsets of the data instead of using loops. The reshaped array is a + view of the input data array. [#10214] + +- Added a ``cache`` keyword option to allow caching for ``CCDData.read`` if + filename is a URL. [#10265] astropy.table ^^^^^^^^^^^^^ +- Added ability to specify a custom matching function for table joins. In + particular this makes it possible to do cross-match table joins on ``SkyCoord``, + ``Quantity``, or standard columns, where column entries within a specified + distance are considered to be matched. [#10169] + - Added ``units`` and ``descriptions`` keyword arguments to the Table object initialization and ``Table.read()`` methods. This allows directly setting the ``unit`` and ``description`` for the table columns at the time of creating or reading the table. [#9671] -astropy.tests -^^^^^^^^^^^^^ +- Make table ``Row`` work as mappings, by adding ``.keys()`` and ``.values()`` + methods. With this ``**row`` becomes possible, as does, more simply, turning + a ``Row`` into a dictionary with ``dict(row)``. [#9712] + +- Added two new ``Table`` methods ``.items()`` and ``.values()``, which return + respectively ``tbl.columns.items()`` (iterator over name, column tuples) and + ``tbl.columns.values()`` (list of columns) for a ``Table`` object ``tbl``. [#9780] + +- Added new ``Table`` method ``.round()``, which rounds numeric columns to the + specified number of decimals. [#9862] + +- Updated ``to_pandas()`` and ``from_pandas()`` to use and support Pandas + nullable integer data type for masked integer data. [#9541] + +- The HDF5 writer, ``write_table_hdf5()``, now allows passing through + additional keyword arguments to the ``h5py.Group.create_dataset()``. [#9602] + +- Added capability to add custom table attributes to a ``Table`` subclass. + These attributes are persistent and can be set during table creation. [#10097] + +- Added support for ``SkyCoord`` mixin columns in ``dstack``, ``vstack`` and + ``insert_row`` functions. [#9857] + +- Added support for coordinate ``Representation`` and ``Differential`` mixin + columns. [#10210] astropy.time ^^^^^^^^^^^^ -astropy.timeseries -^^^^^^^^^^^^^^^^^^ - -astropy.uncertainty -^^^^^^^^^^^^^^^^^^^ +- Added a new time format ``unix_tai`` which is essentially Unix time but with + leap seconds included. More precisely, this is the number of seconds since + ``1970-01-01 00:00:08 TAI`` and corresponds to the ``CLOCK_TAI`` clock + available on some linux platforms. [#10081] astropy.units ^^^^^^^^^^^^^ +- Added ``torr`` pressure unit. [#9787] + +- Added the ``equal_nan`` keyword argument to ``isclose`` and ``allclose``, and + updated the docstrings. [#9849] + +- Added ``Rankine`` temperature unit. [#9916] + +- Added integrated flux unit conversion to ``spectral_density`` equivalency. + [#10015] + +- Changed ``pixel_scale`` equivalency to allow scales defined in any unit. + [#10123] + +- The ``quantity_input`` decorator now optionally allows passing through + numeric values or numpy arrays with numeric dtypes to arguments where + ``dimensionless_unscaled`` is an allowed unit. [#10232] + astropy.utils ^^^^^^^^^^^^^ +- Added a new ``MetaAttribute`` class to support easily adding custom attributes + to a subclass of classes like ``Table`` or ``NDData`` that have a ``meta`` + attribute. [#10097] + astropy.visualization ^^^^^^^^^^^^^^^^^^^^^ +- Added ``invalid`` keyword to ``SqrtStretch``, ``LogStretch``, + ``PowerStretch``, and ``ImageNormalize`` classes and the + ``simple_norm`` function. This keyword is used to replace generated + NaN values. [#10182] + +- Fixed an issue where ticks were sometimes not drawn at the edges of a spherical + projection on a WCSAxes. [#10442] + astropy.wcs ^^^^^^^^^^^ -API Changes ------------ +- WCS objects with a spectral axis will now return ``SpectralCoord`` + objects when calling ``pixel_to_world`` instead of ``Quantity``, + and can now take either ``Quantity`` or ``SpectralCoord`` as input + to ``pixel_to_world``. [#10185] -astropy.config -^^^^^^^^^^^^^^ +- Implemented support for the ``-TAB`` algorithm (WCS Paper III). [#9641] -astropy.constants -^^^^^^^^^^^^^^^^^ +- Added an ``_as_mpl_axes`` method to the ``HightLevelWCSWrapper`` class. [#10138] -astropy.convolution -^^^^^^^^^^^^^^^^^^^ +- Add .upper() to ctype or ctype names to wcsapi/fitwcs.py to mitigate bugs from + unintended lower/upper case issues [#10557] + +API Changes +----------- astropy.coordinates ^^^^^^^^^^^^^^^^^^^ -astropy.cosmology -^^^^^^^^^^^^^^^^^ +- The equality operator for comparing ``SkyCoord``, frame, and representation + objects was changed. A comparison like ``sc1 == sc2`` was previously + equivalent to ``sc1 is sc2``. It will now return a boolean or boolean array + where the objects are strictly equal in all relevant frame attributes and + coordinate representation values. If the objects have different frame + attributes or representation types then an exception will be raised. [#10154] -astropy.extern -^^^^^^^^^^^^^^ +- ```SkyCoord.radial_velocity_correction``` now allows you to pass an ```obstime``` directly + when the ```SkyCoord``` also has an ```obstime``` set. In this situation, the position of the + ```SkyCoord``` has space motion applied to correct to the passed ```obstime```. This allows + mm/s radial velocity precision for objects with large space motion. [#10094] + +- For consistency with other astropy classes, coordinate ``Representations`` + and ``Differentials`` can now be initialized with an instance of their own class + if that instance is passed in as the first argument. [#10210] astropy.io.ascii ^^^^^^^^^^^^^^^^ -astropy.io.misc -^^^^^^^^^^^^^^^ +- Changed the behavior when reading a table where both the ``names`` argument + is provided (to specify the output column names) and the ``converters`` + argument is provided (to specify column conversion functions). Previously the + ``converters`` dict names referred to the *input* table column names, but now + they refer to the *output* table column names. [#9739] -astropy.io.fits -^^^^^^^^^^^^^^^ +astropy.io.votable +^^^^^^^^^^^^^^^^^^ -astropy.io.registry +- For FIELDs with datatype="char", store the values as strings instead + of bytes. [#9505] + +astropy.table +^^^^^^^^^^^^^ + +- ``Table.from_pandas`` now supports a ``units`` dictionary as argument to pass units + for columns in the ``DataFrame``. [#9472] + +astropy.time +^^^^^^^^^^^^ + +- Require that ``in_subfmt`` and ``out_subfmt`` properties of a ``Time`` object + have allowed values at the time of being set, either when creating the object + or when setting those properties on an existing ``Time`` instance. Previously + the validation of those properties was not strictly enforced. [#9868] + +astropy.utils +^^^^^^^^^^^^^ + +- Changed the exception raised by ``get_readable_fileobj`` on missing + compression modules (for ``bz2`` or ``lzma``/``xz`` support) to + ``ModuleNotFoundError``, consistent with ``io.fits`` file handlers. [#9761] + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ + +- Deprecated the ``imshow_only_kwargs`` keyword in ``imshow_norm``. + [#9915] + +- Non-finite input values are now automatically excluded in + ``HistEqStretch`` and ``InvertedHistEqStretch``. [#10177] + +- The ``PowerDistStretch`` and ``InvertedPowerDistStretch`` ``a`` + value is restricted to be ``a >= 0`` in addition to ``a != 1``. + [#10177] + +- The ``PowerStretch``, ``LogStretch``, and ``InvertedLogStretch`` + ``a`` value is restricted to be ``a > 0``. [#10177] + +- The ``AsinhStretch`` and ``SinhStretch`` ``a`` value is restricted + to be ``0 < a <= 1``. [#10177] + +Bug Fixes +--------- + +astropy.coordinates ^^^^^^^^^^^^^^^^^^^ +- Fix a bug where for light deflection by the Sun it was always assumed that the + source was at infinite distance, which in the (rare and) absolute worst-case + scenario could lead to errors up to 3 arcsec. [#10666] + astropy.io.votable ^^^^^^^^^^^^^^^^^^ +- For FIELDs with datatype="char", store the values as strings instead + of bytes. [#9505] + +astropy.table +^^^^^^^^^^^^^ + +- Fix a bug that prevented ``Time`` columns from being used to sort a table. + [#10824] + +astropy.wcs +^^^^^^^^^^^ + +- WCS objects with a spectral axis will now return ``SpectralCoord`` + objects when calling ``pixel_to_world`` instead of ``Quantity`` + (note that ``SpectralCoord`` is a sub-class of ``Quantity``). [#10185] + +- Add .upper() to ctype or ctype names to wcsapi/fitwcs.py to mitigate bugs from + unintended lower/upper case issues [#10557] + +- Added bounds to ``fit_wcs_from_points`` to ensure CRPIX is on + input image. [#10346] + + +Other Changes and Additions +--------------------------- + +- The way in which users can specify whether to build astropy against + existing installations of C libraries rather than the bundled one + has changed, and should now be done via environment variables rather + than setup.py flags (e.g. --use-system-erfa). The available variables + are ``ASTROPY_USE_SYSTEM_CFITSIO``, ``ASTROPY_USE_SYSTEM_ERFA``, + ``ASTROPY_USE_SYSTEM_EXPAT``, ``ASTROPY_USE_SYSTEM_WCSLIB``, and + ``ASTROPY_USE_SYSTEM_ALL``. These should be set to ``1`` to build + against the system libraries. [#9730] + +- The infrastructure of the package has been updated in line with the + APE 17 roadmap (https://github.com/astropy/astropy-APEs/blob/master/APE17.rst). + The main changes are that the ``python setup.py test`` and + ``python setup.py build_docs`` commands will no longer work. The easiest + way to replicate these commands is to install the tox + (https://tox.readthedocs.io) package and run ``tox -e test`` and + ``tox -e build_docs``. It is also possible to run pytest and sphinx + directly. Other significant changes include switching to setuptools_scm to + manage the version number, and adding a ``pyproject.toml`` to opt in to + isolated builds as described in PEP 517/518. [#9726] + +- Bundled ``expat`` is updated to version 2.2.9. [#10038] + +- Increase minimum asdf version to 2.6.0. [#10189] + +- The bundled version of PLY was updated to 3.11. [#10258] + +- Removed dependency on scikit-image. [#10214] + +4.0.5 (2021-03-26) +================== + +Bug Fixes +--------- + +astropy.io.fits +^^^^^^^^^^^^^^^ + +- Fix bug where manual fixes to invalid header cards were not preserved when + saving a FITS file. [#11108] + +- Fix parsing of RVKC header card patterns that were not recognised + where multiple spaces were separating field-specifier and value like + "DP1.AXIS.1: 1". [#11301] + +- Fix misleading missing END card error when extra data are found at the end + of the file. [#11285] + +- Fix incorrect wrapping of long card values as CONTINUE cards when some + words in the value are longer than a single card. [#11304] + +astropy.io.misc +^^^^^^^^^^^^^^^ + +- Fixed problem when writing serialized metadata to HDF5 using h5py >= 3.0. + With the newer h5py this was writing the metadata table as a variable-length + string array instead of the previous fixed-length bytes array. Fixed astropy + to force using a fixed-length bytes array. [#11359] + astropy.modeling ^^^^^^^^^^^^^^^^ -astropy.nddata -^^^^^^^^^^^^^^ +- Change ``Voigt1D`` function to use Humlicek's approximation to avoid serious + inaccuracies + option to use (compiled) ``scipy.special.wofz`` error function + for yet more accurate results. [#11177] -astropy.samp +astropy.table +^^^^^^^^^^^^^ + +- Fixed bug when initializing a ``Table`` with a column as list of ``Quantity``, + for example ``Table({'x': [1*u.m, 2*u.m]})``. Previously this resulted in an + ``object`` dtype with no column ``unit`` set, but now gives a float array with + the correct unit. [#11329] + +- Fixed byteorder conversion in ``to_pandas()``, which had incorrectly + triggered swapping when native endianness was stored with explicit + ``dtype`` code ``'<'`` (or ``'>'``) instead of ``'='``. [#11288, #11294] + +- Fixed a compatibility issue with numpy 1.21. Initializing a Table with a + column like ``['str', np.ma.masked]`` was failing in tests due to a change in + numpy. [#11364] + +- Fixed bug when validating the inputs to ``table.hstack``, ``table.vstack``, + and ``table.dstack``. Previously, mistakenly calling ``table.hstack(t1, t2)`` + (instead of ``table.hstack([t1, t2]))`` would return ``t1`` instead of raising + an exception. [#11336] + +- Fixed byteorder conversion in ``to_pandas()``, which had incorrectly + triggered swapping when native endianness was stored with explicit + ``dtype`` code ``'<'`` (or ``'>'``) instead of ``'='``. [#11288] + +astropy.time ^^^^^^^^^^^^ +- Fix leap second update when using a non english locale. [#11062] + +- Fix default assumed location to be the geocenter when transforming times + to and from solar-system barycenter scales. [#11134] + +- Fix inability to write masked times with ``formatted_value``. [#11195] + +astropy.units +^^^^^^^^^^^^^ + +- Ensure ``keepdims`` works for taking ``mean``, ``std``, and ``var`` of + ``Quantity``. [#11198] + +- For ``Quantity.to_string()``, ensure that the precision argument is also + used when the format is not latex. [#11145] + +astropy.wcs +^^^^^^^^^^^ + +- Allow "un-setting" of auxiliary WCS parameters in the ``aux`` attribute of + ``Wcsprm``. [#11166] + + + + + +4.0.4 (2020-11-24) +================== + +Bug Fixes +--------- + +astropy.coordinates +^^^^^^^^^^^^^^^^^^^ + +- The ``norm()`` method for ``RadialDifferential`` no longer requires ``base`` + to be specified. The ``norm()`` method for other non-Cartesian differential + classes now gives a clearer error message if ``base`` is not specified. [#10969] + +- The transformations between ``ICRS`` and any of the heliocentric ecliptic + frames (``HeliocentricMeanEcliptic``, ``HeliocentricTrueEcliptic``, and + ``HeliocentricEclipticIAU76``) now correctly account for the small motion of + the Sun when transforming a coordinate with velocity information. [#10970] + +astropy.io.ascii +^^^^^^^^^^^^^^^^ + +- Partially fixed a performance issue when reading in parallel mode. Parallel + reading currently has substantially worse performance than the default serial + reading, so we now ignore the parallel option and fall back to serial reading. + [#10880] + +- Fixed a bug where "" (blank string) as input data for a boolean type column + was causing an exception instead of indicating a masked value. As a + consequence of the fix, the values "0" and "1" are now also allowed as valid + inputs for boolean type columns. These new allowed values apply for both ECSV + and for basic character-delimited data files ('basic' format with appropriate + ``converters`` specified). [#10995] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Fixed use of weights with ``LinearLSQFitter``. [#10687] + astropy.stats ^^^^^^^^^^^^^ -astropy.table -^^^^^^^^^^^^^ +- Fixed an issue in biweight stats when MAD=0 to give the same output + with and without an input ``axis``. [#10912] + +astropy.time +^^^^^^^^^^^^ + +- Fix a problem with the ``plot_date`` format for matplotlib >= 3.3 caused by + a change in the matplotlib plot date default reference epoch in that release. + [#10876] + +- Improve initialization time by a factor of four when creating a scalar ``Time`` + object in a format like ``unix`` or ``cxcsec`` (time delta from a reference + epoch time). [#10406] + +astropy.visualization +^^^^^^^^^^^^^^^^^^^^^ + +- Fixed the caclulation of the tight bounding box of a ``WCSAxes``. This should + also significantly improve the application of ``tight_layout()`` to figures + containing ``WCSAxes``. [#10797] + + +4.0.3 (2020-10-14) +================== + +Bug Fixes +--------- + +astropy.table +^^^^^^^^^^^^^ + +- Fixed a small bug where initializing an empty ``Column`` with a structured dtype + with a length and a shape failed to give the requested dtype. [#10819] + +Other Changes and Additions +--------------------------- + +- Fixed installation of the source distribution with pip<19. [#10837, #10852] + + +4.0.2 (2020-10-10) +================== + +New Features +------------ -astropy.tests +astropy.utils ^^^^^^^^^^^^^ -astropy.time -^^^^^^^^^^^^ +- ``astropy.utils.data.download_file`` now supports FTPS/FTP over TLS. [#9964] -astropy.timeseries -^^^^^^^^^^^^^^^^^^ +- ``astropy.utils.data`` now uses a lock-free mechanism for caching. This new + mechanism uses a new cache layout and so ignores caches created using earlier + mechanisms (which were causing lockups on clusters). The two cache formats can + coexist but do not share any files. [#10437, #10683] -astropy.uncertainty -^^^^^^^^^^^^^^^^^^^ +- ``astropy.utils.data`` now ignores the config item + ``astropy.utils.data.conf.download_cache_lock_attempts`` since no locking is + done. [#10437, #10683] -astropy.units -^^^^^^^^^^^^^ +- ``astropy.utils.data.download_file`` and related functions now interpret the + parameter or config file setting ``timeout=0`` to mean they should make no + attempt to download files. [#10437, #10683] -astropy.utils -^^^^^^^^^^^^^ +- ``astropy.utils.import_file_to_cache`` now accepts a keyword-only argument + ``replace``, defaulting to True, to determine whether it should replace existing + files in the cache, in a way as close to atomic as possible. [#10437, #10683] -astropy.visualization -^^^^^^^^^^^^^^^^^^^^^ +- ``astropy.utils.data.download_file`` and related functions now treat + ``http://example.com`` and ``http://example.com/`` as equivalent. [#10631] astropy.wcs ^^^^^^^^^^^ -Bug Fixes +- The new auxiliary WCS parameters added in WCSLIB 7.1 are now exposed as + the ``aux`` attribute of ``Wcsprm``. [#10333] + +- Updated bundled version of ``WCSLIB`` to v7.3. [#10433] + + +Bug fixes --------- astropy.config ^^^^^^^^^^^^^^ +- Added an extra fallback to ``os.expanduser('~')`` when trying to find the + user home directory. [#10570] + astropy.constants ^^^^^^^^^^^^^^^^^ +- Corrected definition of parsec to 648 000 / pi AU following IAU 2015 B2 [#10569] + astropy.convolution ^^^^^^^^^^^^^^^^^^^ +- Fixed a bug where a float-typed integers in the argument ``x_range`` of + ``astropy.convolution.utils.discretize_oversample_1D`` (and the 2D version as + well) fails because it uses ``numpy.linspace``, which requires an ``int``. + [#10696] + astropy.coordinates ^^^^^^^^^^^^^^^^^^^ -astropy.cosmology -^^^^^^^^^^^^^^^^^ +- Ensure that for size-1 array ``SkyCoord`` and coordinate frames + the attributes also properly become scalars when indexed with 0. + [#10113] -astropy.extern -^^^^^^^^^^^^^^ +- Fixed a bug where ``SkyCoord.separation()`` and ``SkyCoord.separation_3d`` + were not accepting a frame object. [#10332] + +- Ensure that the ``lon`` values in ``SkyOffsetFrame`` are wrapped correctly at + 180 degree regardless of how the underlying data is represented. [#10163] + +- Fixed an error in the obliquity of the ecliptic when transforming to/from the + ``*TrueEcliptic`` coordinate frames. The error would primarily result in an + inaccuracy in the ecliptic latitude on the order of arcseconds. [#10129] + +- Fixed an error in the computation of the location of solar system bodies where the + Earth location of the observer was ignored during the correction for light travel + time. [#10292] + +- Ensure that coordinates with proper motion that are transformed to other + coordinate frames still can be represented properly. [#10276] + +- Improve the error message given when trying to get a cartesian representation + for coordinates that have both proper motion and radial velocity, but no + distance. [#10276] + +- Fixed an error where ``SkyCoord.apply_space_motion`` would return incorrect + results when no distance is set and proper motion is high. [#10296] + +- Make the parsing of angles thread-safe so that ``Angle`` can be used in + Python multithreading. [#10556] + +- Fixed reporting of ``EarthLocation.info`` which previously raised an exception. + [#10592] astropy.io.ascii ^^^^^^^^^^^^^^^^ -astropy.io.misc -^^^^^^^^^^^^^^^ +- Fixed a bug with the C ``fast_reader`` not correctly parsing newlines when + ``delimiter`` was also set to ``\n`` or ``\r``; ensured consistent handling + of input strings without newline characters. [#9929] astropy.io.fits ^^^^^^^^^^^^^^^ +- Fix integer formats of ``TFORMn=Iw`` columns in ASCII tables to correctly read + values exceeding int32 - setting int16, int32 or int64 according to ``w``. [#9901] + +- Fix unclosed memory-mapped FITS files in ``FITSDiff`` when difference found. + [#10159] + +- Fix crash when reading an invalid table file. [#10171] + +- Fix duplication issue when setting a keyword ending with space. [#10482] + +- Fix ResourceWarning with ``fits.writeto`` and ``pathlib.Path`` object. + [#10599] + +- Fix repr for commentary cards and strip spaces for commentary keywords. + [#10640] + +- Fix compilation of cfitsio with Xcode 12. [#10772] + +- Fix handling of 1-dimensional arrays with a single element in ``BinTableHDU`` [#10768] + +astropy.io.misc +^^^^^^^^^^^^^^^ + +- Fix id URL in ``baseframe-1.0.0`` ASDF schema. [#10223] + +- Write keys to ASDF only if the value is present, to account + for a change in behavior in asdf 2.8. [#10674] + astropy.io.registry ^^^^^^^^^^^^^^^^^^^ +- Fix ``Table.(read|write).help`` when reader or writer has no docstring. [#10460] + astropy.io.votable ^^^^^^^^^^^^^^^^^^ +- Fixed parsing failure of VOTable with no fields. When detecting a non-empty + table with no fields, the following warning/exception is issued: + E25 "No FIELDs are defined; DATA section will be ignored." [#10192] + astropy.modeling ^^^^^^^^^^^^^^^^ -astropy.nddata -^^^^^^^^^^^^^^ +- Fixed a problem with mapping ``input_units`` and ``return_units`` + of a ``CompoundModel`` to the units of the constituent models. [#10158] -astropy.samp -^^^^^^^^^^^^ +- Removed hard-coded names of inputs and outputs. [#10174] + +- Fixed a problem where slicing a ``CompoundModel`` by name will crash if + there ``fix_inputs`` operators are present. [#10224] + +- Removed a limitation of fitting of data with units with compound models + without units when the expression involves operators other than addition + and subtraction. [#10415] + +- Fixed a problem with fitting ``Linear1D`` and ``Planar2D`` in model sets. [#10623] + +- Fixed reported module name of ``math_functions`` model classes. [#10694] + +- Fixed reported module name of ``tabular`` model classes. [#10709] + +- Do not create new ``math_functions`` models for ufuncs that are + only aliases (divide and mod). [#10697] + +- Fix calculation of the ``Moffat2D`` derivative with respect to gamma. [#10784] astropy.stats ^^^^^^^^^^^^^ +- Fixed an API regression where ``SigmaClip.__call__`` would convert masked + elements to ``nan`` and upcast the dtype to ``float64`` in its output + ``MaskedArray`` when using the ``axis`` parameter along with the defaults + ``masked=True`` and ``copy=True``. [#10610] + +- Fixed an issue where fully masked ``MaskedArray`` input to + ``sigma_clipped_stats`` gave incorrect results. [#10099] + +- Fixed an issue where ``sigma_clip`` and ``SigmaClip.__call__`` + would return a masked array instead of a ``ndarray`` when + ``masked=False`` and the input was a full-masked ``MaskedArray``. + [#10099] + +- Fixed bug with ``funcs.poisson_conf_interval`` where an integer for N + with ``interval='kraft-burrows-nousek'`` would throw an error with + mpmath backend. [#10427] + +- Fixed bug in ``funcs.poisson_conf_interval`` with + ``interval='kraft-burrows-nousek'`` where certain combinations of source + and background count numbers led to ``ValueError`` due to the choice of + starting value for numerical optimization. [#10618] + astropy.table ^^^^^^^^^^^^^ -astropy.tests -^^^^^^^^^^^^^ +- Fixed a bug when writing a table with mixin columns to FITS, ECSV or HDF5. + If one of the data attributes of the mixin (e.g. ``skycoord.ra``) had the + same name as one of the table column names (``ra``), the column (``ra``) + would be dropped when reading the table back. [#10222] + +- Fixed a bug when sorting an indexed table on the indexed column after first + sorting on another column. [#10103] + +- Fixed a bug in table argsort when called with ``reverse=True`` for an + indexed table. [#10103] + +- Fixed a performance regression introduced in #9048 when initializing a table + from Python lists. Also fixed incorrect behavior (for data types other than + float) when those lists contain ``np.ma.masked`` elements to indicate masked + data. [#10636] + +- Avoid modifying ``.meta`` when serializing columns to FITS. [#10485] + +- Avoid crash when reading a FITS table that contains mixin info and PyYAML + is missing. [#10485] astropy.time ^^^^^^^^^^^^ -astropy.timeseries -^^^^^^^^^^^^^^^^^^ - -astropy.uncertainty -^^^^^^^^^^^^^^^^^^^ +- Ensure that for size-1 array ``Time``, the location also properly becomes + a scalar when indexed with 0. [#10113] astropy.units ^^^^^^^^^^^^^ +- Refined test_parallax to resolve difference between 2012 and 2015 definitions. [#10569] + astropy.utils ^^^^^^^^^^^^^ +- The default IERS server has been updated to use the FTPS server hosted by + CDDIS. [#9964] + +- Fixed memory allocation on 64-bit systems within ``xml.iterparse`` [#10076] + +- Fix case where ``None`` could be used in a numerical computation. [#10126] + astropy.visualization ^^^^^^^^^^^^^^^^^^^^^ +- Fixed a bug where the ``ImageNormalize`` ``clip`` keyword was + ignored when used with calling the object on data. [#10098] + +- Fixed a bug where ``axes.xlabel``/``axes.ylabel`` where not correctly set + nor returned on an ``EllipticalFrame`` class ``WCSAxes`` plot. [#10446] + astropy.wcs ^^^^^^^^^^^ +- Handled WCS 360 -> 0 deg crossover in ``fit_wcs_from_points`` [#10155] + +- Do not issue ``DATREF`` warning when ``MJDREF`` has default value. [#10440] + +- Fixed a bug due to which ``naxis`` argument was ignored if ``header`` + was supplied during the initialization of a WCS object. [#10532] + Other Changes and Additions --------------------------- -- Nothing changed yet. +- Improved the speed of sorting a large ``Table`` on a single column by a factor + of around 5. [#10103] + +- Ensure that astropy can be used inside Application bundles built with + pyinstaller. [#8795] +- Updated the bundled CFITSIO library to 3.49. See + ``cextern/cfitsio/docs/changes.txt`` for additional information. + [#10256, #10665] +- ``extract_array`` raises a ``ValueError`` if the data type of the + input array is inconsistent with the ``fill_value``. [#10602] -4.0.1 (unreleased) +4.0.1 (2020-03-27) ================== Bug fixes @@ -248,91 +1229,196 @@ Bug fixes astropy.config ^^^^^^^^^^^^^^ -astropy.constants -^^^^^^^^^^^^^^^^^ - -astropy.convolution -^^^^^^^^^^^^^^^^^^^ +- Fixed a bug where importing a development version of a package that uses + ``astropy`` configuration system can result in a + ``~/.astropy/config/package..cfg`` file. [#9975] astropy.coordinates ^^^^^^^^^^^^^^^^^^^ -astropy.cosmology -^^^^^^^^^^^^^^^^^ +- Fixed a bug where a vestigal trace of a frame class could persist in the + transformation graph even after the removal of all transformations involving + that frame class. [#9815] -astropy.extern -^^^^^^^^^^^^^^ +- Fixed a bug with ``TransformGraph.remove_transform()`` when the "from" and + "to" frame classes are not explicitly specified. [#9815] + +- Read-only longitudes can now be passed in to ``EarthLocation`` even if + they include angles outside of the range of -180 to 180 degrees. [#9900] + +- ```SkyCoord.radial_velocity_correction``` no longer raises an Exception + when space motion information is present on the SkyCoord. [#9980] + +astropy.io +^^^^^^^^^^ + +- Fixed a bug that prevented the unified I/O infrastructure from working with + datasets that are represented by directories rather than files. [#9866] astropy.io.ascii ^^^^^^^^^^^^^^^^ +- Fixed a bug in the ``fast_reader`` C parsers incorrectly returning entries + of isolated positive/negative signs as ``float`` instead of ``str``. [#9918] + +- Fixed a segmentation fault in the ``fast_reader`` C parsers when parsing an + invalid file with ``guess=True`` and the file contains inconsistent column + numbers in combination with a quoted field; e.g., ``"1 2\n 3 4 '5'"``. + [#9923] + +- Magnitude, decibel, and dex can now be stored in ``ecsv`` files. [#9933] + astropy.io.misc ^^^^^^^^^^^^^^^ +- Magnitude, decibel, and dex can now be stored in ``hdf5`` files. [#9933] + +- Fixed serialization of polynomial models to include non default values of + domain and window values. [#9956, #9961] + +- Fixed a bug which affected overwriting tables within ``hdf5`` files. + Overwriting an existing path with associated column meta data now also + overwrites the meta data associated with the table. [#9950] + +- Fixed serialization of Time objects with location under time-1.0.0 + ASDF schema. [#9983] + astropy.io.fits ^^^^^^^^^^^^^^^ -astropy.io.registry -^^^^^^^^^^^^^^^^^^^ +- Fix regression with ``GroupsHDU`` which needs to modify the header to handle + invalid headers, and fix accesing ``.data`` for empty HDU. [#9711, #9934] -astropy.io.votable -^^^^^^^^^^^^^^^^^^ +- Fix ``fitsdiff`` when its arguments are directories that contain other + directories. [#9711] -astropy.modeling -^^^^^^^^^^^^^^^^ +- Fix writing noncontiguous data to a compressed HDU. [#9958] -astropy.nddata -^^^^^^^^^^^^^^ +- Added verification of ``disp`` (``TDISP``) keyword to ``fits.Column`` and + extended tests for ``TFORM`` and ``TDISP`` validation. [#9978] -astropy.samp -^^^^^^^^^^^^ +- Fix checksum verification to process all HDUs instead of only the first one + because of the lazy loading feature. [#10012] -astropy.stats -^^^^^^^^^^^^^ +- Allow passing ``output_verify`` to ``.close`` when using the context manager. + [#10030] + +- Prevent instantiation of ``PrimaryHDU`` and ``ImageHDU`` with a scalar. + [#10041] + +- Fix column access by attribute with FITS_rec: columns with scaling or columns + from ASCII tables where not properly converted when accessed by attribute + name. [#10069] + +astropy.io.misc +^^^^^^^^^^^^^^^ + +- Magnitude, decibel, and dex can now be stored in ``hdf5`` files. [#9933] + +- Fixed serialization of polynomial models to include non default values of + domain and window values. [#9956, #9961] + +- Fixed a bug which affected overwriting tables within ``hdf5`` files. + Overwriting an existing path with associated column meta data now also + overwrites the meta data associated with the table. [#9950] + +- Fixed serialization of Time objects with location under time-1.0.0 + ASDF schema. [#9983] + +astropy.modeling +^^^^^^^^^^^^^^^^ + +- Fixed a bug in setting default values of parameters of orthonormal + polynomials when constructing a model set. [#9987] astropy.table ^^^^^^^^^^^^^ -astropy.tests -^^^^^^^^^^^^^ +- Fixed bug in ``Table.reverse`` for tables that contain non-mutable mixin columns + (like ``SkyCoord``) for which in-place item update is not allowed. [#9839] + +- Tables containing Magnitude, decibel, and dex columns can now be saved to + ``ecsv`` files. [#9933] + +- Fixed bug where adding or inserting a row fails on a table with an index + defined on a column that is not the first one. [#10027] + +- Ensured that ``table.show_in_browser`` also worked for mixin columns like + ``Time`` and ``SkyCoord``. [#10068] astropy.time ^^^^^^^^^^^^ -* Fix inaccuracy when converting between TimeDelta and datetime.timedelta [#9679] +- Fix inaccuracy when converting between TimeDelta and datetime.timedelta. [#9679] + +- Fixed exception when changing ``format`` in the case when ``out_subfmt`` is + defined and is incompatible with the new format. [#9812] + +- Fixed exceptions in ``Time.to_value()``: when supplying any ``subfmt`` argument + for string-based formats like 'iso', and for ``subfmt='long'`` for the formats + 'byear', 'jyear', and 'decimalyear'. [#9812] + +- Fixed bug where the location attribute was lost when creating a new ``Time`` + object from an existing ``Time`` or list of ``Time`` objects. [#9969] + +- Fixed a bug where an exception occurred when creating a ``Time`` object + if the ``val1`` argument was a regular double and the ``val2`` argument + was a ``longdouble``. [#10034] astropy.timeseries ^^^^^^^^^^^^^^^^^^ -astropy.uncertainty -^^^^^^^^^^^^^^^^^^^ +- Fixed issue with reference time for the ``transit_time`` parameter returned by + the ``BoxLeastSquares`` periodogram. Now, the ``transit_time`` will be within + the range of the input data and arbitrary time offsets/zero points no longer + affect results. [#10013] astropy.units ^^^^^^^^^^^^^ +- Fix for ``quantity_input`` annotation raising an exception on iterable + types that don't define a general ``__contains__`` for checking if ``None`` + is contained (e.g. Enum as of python3.8), by instead checking for instance of + Sequence. [#9948] + +- Fix for ``u.Quantity`` not taking into account ``ndmin`` if constructed from + another ``u.Quantity`` instance with different but convertible unit [#10066] + astropy.utils ^^^^^^^^^^^^^ +- Fixed ``deprecated_renamed_argument`` not passing in user value to + deprecated keyword when the keyword has no new name. [#9981] + +- Fixed ``deprecated_renamed_argument`` not issuing a deprecation warning when + deprecated keyword without new name is passed in as positional argument. + [#9985] + +- Fixed detection of read-only filesystems in the caching code. [#10007] + astropy.visualization ^^^^^^^^^^^^^^^^^^^^^ -astropy.wcs -^^^^^^^^^^^ +- Fixed bug from matplotlib >=3.1 where an empty Quantity array is + sent for unit conversion as an empty list. [#9848] -- The default WCS to celestial frame mapping for world coordinate systems that - specify ``TLON`` and ``TLAT`` coordinates will now return an ITRS frame with - the representation class set to ``SphericalRepresentation``. This fixes a bug - that caused ``WCS.pixel_to_world`` to raise an error for such world - coordinate systems. [#9609] +- Fix bug in ``ZScaleInterval`` to return the array minimum and + maximum when there are less then ``min_npixels`` in the input array. [#9913] + +- Fix a bug in simplifying axis labels that affected non-rectangular frames. + [#8004, #9991] Other Changes and Additions --------------------------- +- Increase minimum asdf version to 2.5.2. [#9996, #9819] + +- Updated bundled version of ``WCSLIB`` to v7.2. [#10021] -4.0 (unreleased) +4.0 (2019-12-16) ================ New Features @@ -386,15 +1472,11 @@ astropy.coordinates astropy.cosmology ^^^^^^^^^^^^^^^^^ + - The pre-publication Planck 2018 cosmological parameters are included as the ``Planck2018_arXiv_v2`` object. Please note that the values are preliminary, - and when the paper is accepted a final version will be included as ``Planck18``. - [#8111] - -astropy.extern -^^^^^^^^^^^^^^ - -- Remove the bundled ``six`` module. [#8315] + and when the paper is accepted a final version will be included as + ``Planck18``. [#8111] astropy.io.ascii ^^^^^^^^^^^^^^^^ @@ -406,7 +1488,8 @@ astropy.io.ascii astropy.io.misc ^^^^^^^^^^^^^^^ -- Eliminate deprecated compatibility mode when writing ``Table`` metadata to HDF5 format. [#8899] +- Eliminate deprecated compatibility mode when writing ``Table`` metadata to + HDF5 format. [#8899] - Add support for orthogonal polynomial models to ASDF. [#9107] @@ -419,9 +1502,6 @@ astropy.io.fits - Allow writing of ``Table`` objects with ``Time`` columns that are also table indices to FITS files. [#8077] -astropy.io.registry -^^^^^^^^^^^^^^^^^^^ - astropy.io.votable ^^^^^^^^^^^^^^^^^^ @@ -438,13 +1518,10 @@ astropy.logger astropy.modeling ^^^^^^^^^^^^^^^^ -- Major rework of modeling internals. - See modeling documentation for details. - ``_ . [#8769] - -- Significant reorganization of the documentation. [#9078, #9171] +- Major rework of modeling internals. `See modeling documentation for details. + `_ . [#8769] -- Add ``Tabular1D.inverse`` [#9083] +- Add ``Tabular1D.inverse``. [#9083] - ``Model.rename`` was changed to add the ability to rename ``Model.inputs`` and ``Model.outputs``. [#9220] @@ -453,30 +1530,29 @@ astropy.modeling specific inputs variable values to constants. [#9135] - ``inputs`` and ``outputs`` are now model instance attributes, and ``n_inputs`` - and ``n_outputs`` are class attributes. Backwards compatible default values of - ``inputs`` and ``outputs`` are generated. ``Model.inputs`` and ``Model.outputs`` - are now settable which allows renaming them on per user case. [#9298] + and ``n_outputs`` are class attributes. Backwards compatible default + values of ``inputs`` and ``outputs`` are generated. ``Model.inputs`` and + ``Model.outputs`` are now settable which allows renaming them on per user + case. [#9298] -- Add a new model representing a sequence of rotations in 3D around an arbitrary - number of axes. [#9369] +- Add a new model representing a sequence of rotations in 3D around an + arbitrary number of axes. [#9369] - Add many of the numpy ufunc functions as models. [#9401] -- Add ``BlackBody`` model. - Deprecate ``BlackBody1D`` model and ``blackbody_nu`` and ``blackbody_lambda`` - functions. [#9282] +- Add ``BlackBody`` model. [#9282] - Add ``Drude1D`` model. [#9452] -- Added analytical King model (KingProjectedAnalytic1D) [#9084] +- Added analytical King model (KingProjectedAnalytic1D). [#9084] -- Added Exponential1D and Logarithmic1D models [#9351] +- Added Exponential1D and Logarithmic1D models. [#9351] astropy.nddata ^^^^^^^^^^^^^^ -- Add a way for technically invalid but unambiguous units in a fits header to be - parsed by ``CCDData``. [#9397] +- Add a way for technically invalid but unambiguous units in a fits header + to be parsed by ``CCDData``. [#9397] - ``NDData`` now only accepts WCS objects which implement either the high, or low level APE 14 WCS API. All WCS objects are converted to a high level WCS @@ -484,9 +1560,6 @@ astropy.nddata all array slices are valid for wcs objects, so some slicing operations which used to work may now fail. [#9067] -astropy.samp -^^^^^^^^^^^^ - astropy.stats ^^^^^^^^^^^^^ @@ -500,9 +1573,8 @@ astropy.stats - A numpy ``MaskedArray`` can now be input to the ``biweight_location``, ``biweight_scale``, and ``biweight_midvariance`` functions. [#9466] -- Removed the warning related to p0 in the Bayesian blocks algorithm. - The caveat related to p0 is described in the docstring for ``Events``. - [#9567] +- Removed the warning related to p0 in the Bayesian blocks algorithm. The + caveat related to p0 is described in the docstring for ``Events``. [#9567] astropy.table ^^^^^^^^^^^^^ @@ -510,7 +1582,7 @@ astropy.table - Improved the implementation of ``Table.replace_column()`` to provide a speed-up of 5 to 10 times for wide tables. The method can now accept any input which convertible to a column of the correct length, not just - ``Column`` subclasses.[#8902] + ``Column`` subclasses. [#8902] - Improved the implementation of ``Table.add_column()`` to provide a speed-up of 2 to 10 (or more) when adding a column to tables, with increasing benefit @@ -529,19 +1601,17 @@ astropy.table It help will in stacking table column depth-wise. [#8939] - Added a new table equality method ``values_equal()`` which allows comparison - table values to another table, list, or value, and returns an element-by-element - equality table. [#9068] + table values to another table, list, or value, and returns an + element-by-element equality table. [#9068] -- Added new ``join_type='cartesian'`` option to the ``join`` operation. - [#9288] +- Added new ``join_type='cartesian'`` option to the ``join`` operation. [#9288] - Allow adding a table column as a list of mixin-type objects, for instance ``t['q'] = [1 * u.m, 2 * u.m]``. [#9165] - Allow table ``join()`` using any sortable key column (e.g. Time), not just ndarray subclasses. A column is considered sortable if there is a - ``.info.get_sortable_arrays()`` method that is implemented. - [#9340] + ``.info.get_sortable_arrays()`` method that is implemented. [#9340] - Added ``Table.iterrows()`` for making row-wise iteration faster. [#8969] @@ -552,8 +1622,8 @@ astropy.table - Prevent unnecessary ERFA warnings when indexing by ``Time`` columns. [#9545] -- Added support for sorting tables which contain non-mutable mixin columns (like - ``SkyCoord``) for which in-place item update is not allowed. [#9549] +- Added support for sorting tables which contain non-mutable mixin columns + (like ``SkyCoord``) for which in-place item update is not allowed. [#9549] - Ensured that inserting ``np.ma.masked`` (or any other value with a mask) into a ``MaskedColumn`` causes a masked entry to be inserted. [#9623] @@ -565,8 +1635,8 @@ astropy.tests ^^^^^^^^^^^^^ - The plugin that handles the custom header in the test output has been - moved to the ``pytest-astropy-header plugin`` package. See the README at - https://github.com/astropy/pytest-astropy-header for information about + moved to the ``pytest-astropy-header plugin`` package. `See the README at + `__ for information about using this new plugin. [#9214] astropy.time @@ -607,8 +1677,9 @@ astropy.uncertainty - ``Distribution`` was rewritten such that it deals better with subclasses. As a result, Quantity distributions now behave correctly with ``to`` methods - yielding new distributions of the kind expected for the starting distribution, - and ``to_value`` yielding ``NdarrayDistribution`` instances. [#9429, #9442] + yielding new distributions of the kind expected for the starting + distribution, and ``to_value`` yielding ``NdarrayDistribution`` instances. + [#9429, #9442] - The ``pdf_*`` properties that were used to calculate statistical properties of ``Distrubution`` instances were changed into methods. This allows one @@ -619,8 +1690,8 @@ astropy.uncertainty astropy.units ^^^^^^^^^^^^^ -- Support for unicode parsing. - Supported at the moment are superscripts, Ohm, Ångström, and the micro-sign. [#9348] +- Support for unicode parsing. Currently supported are superscripts, Ohm, + Ångström, and the micro-sign. [#9348] - Accept non-unit type annotations in @quantity_input. [#8984] @@ -689,14 +1760,15 @@ astropy.visualization astropy.wcs ^^^^^^^^^^^ -- Added a ``astropy.wcs.wcsapi.pixel_to_pixel`` function that can be used - to transform pixel coordinates in one dataset with a WCS to pixel coordinates in - another dataset with a different WCS. This function is designed to be efficient - when the input arrays are broadcasted views of smaller arrays. [#9209] +- Added a ``astropy.wcs.wcsapi.pixel_to_pixel`` function that can be used to + transform pixel coordinates in one dataset with a WCS to pixel coordinates + in another dataset with a different WCS. This function is designed to be + efficient when the input arrays are broadcasted views of smaller + arrays. [#9209] - Added a ``local_partial_pixel_derivatives`` function that can be used to - determine a matrix of partial derivatives of each world coordinate with respect - to each pixel coordinate. [#9392] + determine a matrix of partial derivatives of each world coordinate with + respect to each pixel coordinate. [#9392] - Updated wcslib to v6.4. [#9125] @@ -707,11 +1779,11 @@ astropy.wcs - Added a ``wcs_info_str`` function to ``astropy.wcs.wcsapi`` to show a summary of an APE-14-compliant WCS as a string. [#8546, #9207] -- Added two new optional attributes to the APE 14 low-level WCS: ``pixel_axis_names`` - and ``world_axis_names``. [#9156] +- Added two new optional attributes to the APE 14 low-level WCS: + ``pixel_axis_names`` and ``world_axis_names``. [#9156] -- Updated the WCS class to now correctly take and return ``Time`` objects in the - high-level APE 14 API (e.g. ``pixel_to_world``. [#9376] +- Updated the WCS class to now correctly take and return ``Time`` objects in + the high-level APE 14 API (e.g. ``pixel_to_world``. [#9376] - ``SlicedLowLevelWCS`` now raises ``IndexError`` rather than ``ValueError`` on an invalid slice. [#9067] @@ -719,12 +1791,13 @@ astropy.wcs - Added ``fit_wcs_from_points`` function to ``astropy.wcs.utils``. Fits a WCS object to set of matched detector/sky coordinates. [#9469] +- Fix various bugs in ``SlicedLowLevelWCS`` when the WCS being sliced was one + dimensional. [#9693] + + API Changes ----------- -astropy.config -^^^^^^^^^^^^^^ - astropy.constants ^^^^^^^^^^^^^^^^^ @@ -751,9 +1824,8 @@ astropy.coordinates deprecated since 3.0. [#8892] - Removed the deprecated frame attribute classes, ``FrameAttribute``, - ``TimeFrameAttribute``, - ``QuantityFrameAttribute``,``CartesianRepresentationFrameAttribute``; - deprecated since 3.0. [#9326] + ``TimeFrameAttribute``, ``QuantityFrameAttribute``, + ``CartesianRepresentationFrameAttribute``; deprecated since 3.0. [#9326] - Removed ``longitude`` and ``latitude`` attributes from ``EarthLocation``; deprecated since 2.0. [#9326] @@ -766,21 +1838,22 @@ astropy.coordinates - Removed the deprecated ``galcen_ra`` and ``galcen_dec`` attributes from the ``Galactocentric`` frame. [#9346] -astropy.cosmology -^^^^^^^^^^^^^^^^^ - astropy.extern ^^^^^^^^^^^^^^ +- Remove the bundled ``six`` module. [#8315] + astropy.io.ascii ^^^^^^^^^^^^^^^^ -- Masked column handling has changed, see ``astropy.table`` entry below. [#8789] +- Masked column handling has changed, see ``astropy.table`` entry below. + [#8789] astropy.io.misc ^^^^^^^^^^^^^^^ -- Masked column handling has changed, see ``astropy.table`` entry below. [#8789] +- Masked column handling has changed, see ``astropy.table`` entry below. + [#8789] - Removed deprecated ``usecPickle`` kwarg from ``fnunpickle`` and ``fnpickle``. [#8890] @@ -788,11 +1861,12 @@ astropy.io.misc astropy.io.fits ^^^^^^^^^^^^^^^ -- Masked column handling has changed, see ``astropy.table`` entry below. [#8789] +- Masked column handling has changed, see ``astropy.table`` entry below. + [#8789] - ``io.fits.Header`` has been made safe for subclasses for copying and slicing. - As a result of this change, the private subclass ``CompImageHeader`` now always - should be passed an explicit ``image_header``. [#9229] + As a result of this change, the private subclass ``CompImageHeader`` + now always should be passed an explicit ``image_header``. [#9229] - Removed the deprecated ``tolerance`` option in ``fitsdiff`` and ``io.fits.diff`` classes. [#9520] @@ -801,22 +1875,18 @@ astropy.io.fits ``compressionType``, ``tileSize``, ``hcompScale``, ``hcompSmooth``, ``quantizeLevel``. [#9520] -astropy.io.registry -^^^^^^^^^^^^^^^^^^^ - astropy.io.votable ^^^^^^^^^^^^^^^^^^ - Changed ``pedantic`` argument to ``verify`` and change it to have three - string-based options (``ignore``, ``warn``, and ``exception``) instead of just - being a boolean. In addition, changed default to ``ignore``, which means + string-based options (``ignore``, ``warn``, and ``exception``) instead of + just being a boolean. In addition, changed default to ``ignore``, which means that warnings will not be shown by default when loading VO tables. [#8715] astropy.modeling ^^^^^^^^^^^^^^^^ -- Eliminates support for compound classes (but not compound - instances!) [#8769] +- Eliminates support for compound classes (but not compound instances!) [#8769] - Slicing compound models more restrictive. [#8769] @@ -827,11 +1897,14 @@ astropy.modeling - Compound model parameters now share instance and value with constituent models. [#8769] -- No longer possible to assign slices of parameter values to model - parameters attribute (it is possible to replace it with a complete array). [#8769] +- No longer possible to assign slices of parameter values to model parameters + attribute (it is possible to replace it with a complete array). [#8769] - Many private attributes and methods have changed (see documentation). [#8769] +- Deprecated ``BlackBody1D`` model and ``blackbody_nu`` and + ``blackbody_lambda`` functions. [#9282] + - The deprecated ``rotations.rotation_matrix_from_angle`` was removed. [#9363] - Deprecated and renamed ``MexicanHat1D`` and ``MexicanHat2D`` @@ -839,20 +1912,12 @@ astropy.modeling - Deprecated ``modeling.utils.ExpressionTree``. [#9576] -astropy.nddata -^^^^^^^^^^^^^^ - -astropy.samp -^^^^^^^^^^^^ - astropy.stats ^^^^^^^^^^^^^ -- Removed the ``iters`` keyword from sigma clipping stats functions. - [#8948] +- Removed the ``iters`` keyword from sigma clipping stats functions. [#8948] -- Renamed the ``a`` parameter to ``data`` in biweight stat functions. - [#8948] +- Renamed the ``a`` parameter to ``data`` in biweight stat functions. [#8948] - Renamed the ``a`` parameter to ``data`` in ``median_absolute_deviation``. [#9011] @@ -873,36 +1938,38 @@ astropy.table ^^^^^^^^^^^^^ - The handling of masked columns in the ``Table`` class has changed in a way - that may impact program behavior. Now a ``Table`` with ``masked=False`` may - contain both ``Column`` and ``MaskedColumn`` objects, and adding a masked - column or row to a table no longer "upgrades" the table and columns to masked. - This means that tables with masked data which are read via ``Table.read()`` - will now always have ``masked=False``, though specific columns will be masked as - needed. Two new table properties ``has_masked_columns`` and ``has_masked_values`` - were added. See the ``Masking change in astropy 4.0`` section within - ``_ for details. [#8789] + that may impact program behavior. Now a ``Table`` with ``masked=False`` + may contain both ``Column`` and ``MaskedColumn`` objects, and adding a + masked column or row to a table no longer "upgrades" the table and columns + to masked. This means that tables with masked data which are read via + ``Table.read()`` will now always have ``masked=False``, though specific + columns will be masked as needed. Two new table properties + ``has_masked_columns`` and ``has_masked_values`` were added. See the + `Masking change in astropy 4.0 section within + `_ for + details. [#8789] - Table operation functions such as ``join``, ``vstack``, ``hstack``, etc now - always return a table with ``masked=False``, though the individual columns may - be masked as necessary. [#8957] + always return a table with ``masked=False``, though the individual columns + may be masked as necessary. [#8957] - Changed implementation of ``Table.add_column()`` and ``Table.add_columns()`` - methods. Now it is possible add any object(s) which can be converted or broadcasted - to a valid column for the table. ``Table.__setitem__`` now just calls - ``add_column``. + methods. Now it is possible add any object(s) which can be converted or + broadcasted to a valid column for the table. ``Table.__setitem__`` now + just calls ``add_column``. [#8933] - Changed default table configuration setting ``replace_warnings`` from ``['slice']`` to ``[]``. This removes the default warning when replacing a table column that is a slice of another column. [#9144] -- Removed the non-public method ``astropy.table.np_utils.recarray_fromrecords``. - [#9165] +- Removed the non-public method + ``astropy.table.np_utils.recarray_fromrecords``. [#9165] astropy.tests ^^^^^^^^^^^^^ -- In addition to ``DeprecationWarning``, now ``FutureWarning`` and ``ImportWarning`` - would also be turned into exceptions. [#8506] +- In addition to ``DeprecationWarning``, now ``FutureWarning`` and + ``ImportWarning`` would also be turned into exceptions. [#8506] - ``warnings_to_ignore_by_pyver`` option in ``enable_deprecations_as_exceptions()`` has changed. Please refer to API @@ -999,38 +2066,31 @@ astropy.utils because the class now uses ``__slots__`` any attributes on the class have to be explicitly given a slot. [#8998] -- ``IERS`` tables now use ``nan`` to mark missing values (rather than ``1e20``). - [#9226] +- ``IERS`` tables now use ``nan`` to mark missing values + (rather than ``1e20``). [#9226] astropy.visualization ^^^^^^^^^^^^^^^^^^^^^ -- The default ``clip`` value is now ``False`` in ``ImageNormalize``. - [#9478] +- The default ``clip`` value is now ``False`` in ``ImageNormalize``. [#9478] - The default ``clip`` value is now ``False`` in ``simple_norm``. [#9698] - Infinite values are now excluded when calculating limits in - ``ManualInterval`` and ``MinMaxInterval``. They were already - excluded in all other interval classes. [#9480] - -astropy.wcs -^^^^^^^^^^^ + ``ManualInterval`` and ``MinMaxInterval``. They were already excluded in + all other interval classes. [#9480] Bug Fixes --------- -astropy.config -^^^^^^^^^^^^^^ - -astropy.constants -^^^^^^^^^^^^^^^^^ - astropy.convolution ^^^^^^^^^^^^^^^^^^^ +- Fixed ``nan_treatment='interpolate'`` option to ``convolve_fft`` to properly + take into account ``fill_value``. [#8122] + astropy.coordinates ^^^^^^^^^^^^^^^^^^^ @@ -1043,29 +2103,14 @@ astropy.coordinates to set, e.g., ``representation_type``, or refer to the class by its fully qualified name). [#8561] -astropy.cosmology -^^^^^^^^^^^^^^^^^ - -astropy.extern -^^^^^^^^^^^^^^ - -astropy.io.ascii -^^^^^^^^^^^^^^^^ - -astropy.io.misc -^^^^^^^^^^^^^^^ - astropy.io.fits ^^^^^^^^^^^^^^^ - Implemented skip (after warning) of header cards with reserved keywords in ``table_to_hdu``. [#9390] -- Add ``AstropyDeprecationWarning`` to ``read_table_fits`` when ``hdu=`` is selected, but - does not match single present table HDU. [#9512] - -astropy.io.registry -^^^^^^^^^^^^^^^^^^^ +- Add ``AstropyDeprecationWarning`` to ``read_table_fits`` when ``hdu=`` is + selected, but does not match single present table HDU. [#9512] astropy.io.votable ^^^^^^^^^^^^^^^^^^ @@ -1078,9 +2123,6 @@ astropy.io.votable ``