Skip to content

Commit

Permalink
Merge branch 'main' into paddy/ruff-lint
Browse files Browse the repository at this point in the history
  • Loading branch information
paddyroddy committed Sep 18, 2024
2 parents fb63a5a + d7bd1e2 commit 8e6ba5e
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/test-constraints.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
--prefer-binary
--only-binary numpy,scipy,healpy,healpix
--prefer-binary
29 changes: 29 additions & 0 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test examples

on:
push:
paths:
- "glass/**"
pull_request:
paths:
- "glass/**"

concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
test-examples:
name: Test examples
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.x"
cache: pip
- run: pipx run --spec '.[examples]' jupyter execute examples/**/*.ipynb
44 changes: 40 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,56 @@
name: Release

on:
workflow_dispatch:
inputs:
target:
description: 'Deployment target. Can be "pypi" or "testpypi"'
default: "testpypi"
release:
types:
- published

jobs:
dist:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4

- name: Build SDist and wheel
run: pipx run build

- name: Check metadata
run: pipx run twine check dist/*

- uses: actions/upload-artifact@v4
with:
path: dist/*

publish:
name: Publish on PyPI
needs: [dist]
runs-on: ubuntu-latest
environment:
name: publish
url: https://pypi.org/p/glass
permissions:
id-token: write

steps:
- uses: actions/checkout@v4
- run: pipx run build
- uses: pypa/[email protected]
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist

- name: List distributions to be deployed
run: ls -l dist/

- if: github.event.inputs.target == 'pypi' || (github.event_name == 'release' && github.event.action == 'published')
uses: pypa/gh-action-pypi-publish@release/v1

- if: github.event.inputs.target == 'testpypi'
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
13 changes: 0 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,3 @@ jobs:
sudo apt-get update
sudo apt-get install pandoc
- run: pipx run --spec '.[docs]' sphinx-build -W -b html docs _build/html

examples:
name: Examples
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.x"
cache: pip
- run: pipx run --spec '.[examples]' jupyter execute examples/**/*.ipynb
21 changes: 21 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
args:
- --fix=lf
- id: trailing-whitespace
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: python-check-blanket-type-ignore
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.3
hooks:
Expand Down
2 changes: 1 addition & 1 deletion docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ and for the cosmological background. Make sure you have CAMB installed:
$ python -c 'import camb' # should not give an error
If you want to compute the angular matter power spectra in the examples, you
need the `glass.ext.camb` package:
need the ``glass.ext.camb`` package:

.. code-block:: console
Expand Down
4 changes: 2 additions & 2 deletions docs/manual/releases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ These notes document the changes between individual *GLASS* releases.
power spectra by index from a list using GLASS ordering.

* The :func:`~glass.galaxies.gaussian_phz()` function now accepts bounds using
`lower=` and `upper=` keyword parameters.
``lower=`` and ``upper=`` keyword parameters.


2023.6 (30 Jun 2023)
Expand Down Expand Up @@ -157,7 +157,7 @@ These notes document the changes between individual *GLASS* releases.
by window functions using :func:`glass.shells.restrict` and
:func:`glass.shells.partition`.

- The ``zmin`` and ``zmax`` parameters of `glass.galaxies.redshifts_from_nz`
- The ``zmin`` and ``zmax`` parameters of ``glass.galaxies.redshifts_from_nz``
have been removed for the same reason.

- The ``glass.lensing.multi_plane_weights`` function, which computed all
Expand Down

0 comments on commit 8e6ba5e

Please sign in to comment.