Skip to content

Commit

Permalink
Merge branch 'master' into credibility-interval
Browse files Browse the repository at this point in the history
  • Loading branch information
williamjameshandley committed May 15, 2024
2 parents fe25aeb + 8726a90 commit 3e6bd4b
Show file tree
Hide file tree
Showing 37 changed files with 1,505 additions and 370 deletions.
91 changes: 72 additions & 19 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Upgrade pip and install linters
run: |
python -m pip install --upgrade pip
Expand Down Expand Up @@ -67,11 +67,14 @@ jobs:
extras: true

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install hdf5 for macOS
if: ${{ matrix.os == 'macos-latest' }}
run: brew install hdf5 c-blosc

- name: Install dependencies
run: |
Expand All @@ -87,7 +90,10 @@ jobs:
run: python -m pytest --cov=anesthetic tests

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}


conda:
runs-on: ${{ matrix.os }}
Expand All @@ -102,32 +108,37 @@ jobs:
python-version: '3.11'

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install hdf5 for macOS
if: ${{ matrix.os == 'macos-latest' }}
run: brew install hdf5 c-blosc

- name: Install dependencies
shell: bash -l {0}
run: |
conda config --append channels conda-forge
conda install pytest pytest-cov
conda install scipy numpy 'matplotlib>=3.6.1' 'pandas>=2.0.0'
conda install scipy numpy 'matplotlib>=3.6.1,<3.9.0' 'pandas~=2.2.0'
- name: Test with pytest
shell: bash -l {0}
run: python -m pytest --cov=anesthetic tests

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}

test-build-n-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install pypa/build
Expand All @@ -145,21 +156,63 @@ jobs:
minimum-dependencies:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.9

- name: Install dependencies
- name: Upgrade pip and install tomli
run: |
python -m pip install --upgrade pip
python -m pip install tomli
eval "python -m pip install $(./bin/min_dependencies.py)"
python -m pip install -e ".[test]"
- name: Install minimum dependencies
run: eval "python -m pip install $(./bin/min_dependencies.py)"
- name: Install anesthetic
run: python -m pip install -e ".[test]"

- name: Test with pytest
run: python -m pytest --cov=anesthetic tests
run: python -m pytest tests

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
latest-dependencies:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up latest stable Python 3
uses: actions/setup-python@v5
with:
python-version: 3.x

- name: Upgrade pip and install tomli
run: |
python -m pip install --upgrade pip
python -m pip install tomli
- name: Install latest dependencies
run: eval "python -m pip install $(./bin/latest_dependencies.py)"
- name: Install pytest and anesthetic
run: |
python -m pip install pytest
python -m pip install --no-deps -e .
- name: Test with pytest
run: python -m pytest tests

check-for-new-versions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up latest stable Python 3
uses: actions/setup-python@v5
with:
python-version: 3.x

- name: Upgrade pip and install tomli and requests
run: |
python -m pip install --upgrade pip
python -m pip install tomli requests
- name: Install anesthetic
run: python -m pip install -e ".[test]"

- name: Check anesthetic dependencies are up to date
run: python -m pytest ./bin/check_up_to_date.py
125 changes: 104 additions & 21 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,23 @@ on:
branches:
- master
jobs:
git-tag-and-release:
get-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.step1.outputs.v }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Get version number
run: |
VERSION="$(grep ':Version:' README.rst | awk '{print $2}')"
echo "DIST_VERSION=v${VERSION}" >> $GITHUB_ENV
id: step1
run: echo "v=$(grep ':Version:' README.rst | awk '{print $2}')" >> $GITHUB_OUTPUT

git-tag-and-release:
runs-on: ubuntu-latest
needs: get-version
steps:
- uses: actions/checkout@v4
- name: set version number
run: echo "DIST_VERSION=v${{ needs.get-version.outputs.version }}" >> $GITHUB_ENV
- name: Create Tag
uses: actions/github-script@v6
with:
Expand All @@ -34,9 +43,9 @@ jobs:
pypi-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install pypa/build
Expand All @@ -48,13 +57,27 @@ jobs:
with:
password: ${{ secrets.PYPI_API_TOKEN }}

pypi-public:
needs:
- get-version
- pypi-release
runs-on: ubuntu-latest
steps:
- name: Wait for PyPi
uses: nev7n/wait_for_response@v1
with:
url: "https://files.pythonhosted.org/packages/source/a/anesthetic/anesthetic-${{ needs.get-version.outputs.version }}.tar.gz"
responseCode: 200
timeout: 600000
interval: 10000

aur-release:
needs: pypi-release
needs: pypi-public
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install dependencies
Expand All @@ -63,17 +86,6 @@ jobs:
python -m pip install tomli
- name: Generate PKGBUILD
run: python ./bin/gen_PKGBUILD.py > ./PKGBUILD
- name: Get version number
run: |
VERSION="$(cat ./PKGBUILD | grep pkgver= | awk -F= '{print $2}')"
echo "DIST_VERSION=${VERSION}" >> $GITHUB_ENV
- name: Wait for PyPi
uses: nev7n/wait_for_response@v1
with:
url: "https://files.pythonhosted.org/packages/source/a/anesthetic/anesthetic-${{ env.DIST_VERSION }}.tar.gz"
responseCode: 200
timeout: 600000
interval: 10000
- name: Publish AUR package
uses: KSXGitHub/[email protected]
with:
Expand All @@ -83,3 +95,74 @@ jobs:
commit_username: ${{ secrets.AUR_USERNAME }}
commit_email: ${{ secrets.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}

conda-release:
needs: pypi-public
name: Build and deploy to conda
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Conda environment creation and activation
uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.11
auto-update-conda: false
auto-activate-base: false
show-channel-urls: true
- name: install dependencies
shell: bash -el {0}
run: conda install grayskull conda-build anaconda-client
- name: Generate meta.yaml from grayskull
shell: bash -el {0}
run: grayskull pypi --strict-conda-forge anesthetic
- name: Build and upload the conda packages
uses: uibcdf/[email protected]
with:
meta_yaml_dir: anesthetic
python-version: 3.11
user: handley-lab
label: 'main'
token: ${{ secrets.ANACONDA_TOKEN }} # Replace with the right name of your secret

conda-build:
needs:
- conda-release
- get-version
name: test installation from conda
runs-on: ubuntu-latest
steps:
- name: Conda environment creation and activation
uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.11
auto-update-conda: false
auto-activate-base: false
show-channel-urls: true
- name: install from conda
shell: bash -el {0}
run: conda install -c handley-lab anesthetic
- name: get install version
shell: bash -el {0}
run: echo "install_version=$(python -c 'import anesthetic; print(anesthetic.__version__)')" >> $GITHUB_ENV
- name: fail if versions not matching
if: ${{ env.install_version != needs.get-version.outputs.version }}
run: exit 1

pypi-build:
needs:
- pypi-public
- get-version
name: test installation from pypi
runs-on: ubuntu-latest
steps:
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install from pypi
run: pip install anesthetic
- name: get install version
run: echo "install_version=$(python -c 'import anesthetic; print(anesthetic.__version__)')" >> $GITHUB_ENV
- name: fail if versions not matching
if: ${{ env.install_version != needs.get-version.outputs.version }}
run: exit 1
4 changes: 2 additions & 2 deletions .github/workflows/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ jobs:
version-is-unit-incremented:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Upgrade pip and install linters
run: |
python -m pip install --upgrade pip
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ plikHM_TTTEEE_lowl_lowE_lensing_NS/
*~
.pytest_cache/*
.coverage

.DS_Store
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.8"
python: "3.11"

# Build documentation in the docs/ directory with Sphinx
sphinx:
Expand Down
15 changes: 12 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
anesthetic: nested sampling post-processing
===========================================
:Authors: Will Handley and Lukas Hergt
:Version: 2.5.0
:Version: 2.9.0
:Homepage: https://github.com/handley-lab/anesthetic
:Documentation: http://anesthetic.readthedocs.io/

Expand All @@ -18,6 +18,9 @@ anesthetic: nested sampling post-processing
.. image:: https://badge.fury.io/py/anesthetic.svg
:target: https://badge.fury.io/py/anesthetic
:alt: PyPi location
.. image:: https://anaconda.org/handley-lab/anesthetic/badges/version.svg
:target: https://anaconda.org/handley-lab/anesthetic
:alt: Conda location
.. image:: https://zenodo.org/badge/175663535.svg
:target: https://zenodo.org/badge/latestdoi/175663535
:alt: Permanent DOI for this release
Expand Down Expand Up @@ -72,7 +75,13 @@ Installation
pip install anesthetic
or from the repository
via conda

.. code:: bash
conda install -c handley-lab anesthetic
or from the github repository

.. code:: bash
Expand All @@ -96,7 +105,7 @@ Dependencies

Basic requirements:

- Python 3.6+
- Python 3.9+
- `matplotlib <https://pypi.org/project/matplotlib/>`__
- `numpy <https://pypi.org/project/numpy/>`__
- `scipy <https://pypi.org/project/scipy/>`__
Expand Down
Loading

0 comments on commit 3e6bd4b

Please sign in to comment.