Skip to content

Commit

Permalink
Merge branch 'main' into add-3-12-support
Browse files Browse the repository at this point in the history
  • Loading branch information
paddyroddy authored Apr 3, 2024
2 parents 2dd0feb + 9eb9bd2 commit 39b0b1a
Show file tree
Hide file tree
Showing 102 changed files with 453 additions and 399 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
---
name: Deploy

# yamllint disable-line rule:truthy
on:
push:
tags:
- "v*"
- v*

jobs:
deploy:
Expand All @@ -14,7 +13,7 @@ jobs:
id-token: write
steps:
# yamllint disable-line rule:line-length
- uses: paddyroddy/.github/actions/python/deployment@5db0473ebf89b7132850d118505c172be8022f97 # v0
- uses: paddyroddy/.github/actions/python/deployment@be31e8f5758700dafb58c5852530e750f1ea69d8 # v0
with:
pyproject-toml: ./pyproject.toml
python-version: "3.12"
3 changes: 1 addition & 2 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: Documentation

# yamllint disable-line rule:truthy
on:
push:
branches:
Expand All @@ -12,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
# yamllint disable-line rule:line-length
- uses: paddyroddy/.github/actions/python/pdoc@5db0473ebf89b7132850d118505c172be8022f97 # v0
- uses: paddyroddy/.github/actions/python/pdoc@be31e8f5758700dafb58c5852530e750f1ea69d8 # v0
with:
docs-dependency-section: .[docs]
gh-pages-publish-directory: ./html/sleplet
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
---
name: Examples

# yamllint disable-line rule:truthy
on:
push:
branches:
- main
- "renovate/**"
- renovate/**
pull_request:

concurrency:
Expand All @@ -22,14 +21,14 @@ jobs:
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- name: Set up python
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5
with:
python-version: "3.12"
cache: pip
cache-dependency-path: pyproject.toml

- name: Cache pooch
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
with:
path: ~/.cache/sleplet
key: readme-${{ hashFiles('pyproject.toml') }}
Expand All @@ -47,14 +46,14 @@ jobs:
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- name: Set up python
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5
with:
python-version: "3.12"
cache: pip
cache-dependency-path: pyproject.toml

- name: Cache pooch
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
with:
path: ~/.cache/sleplet
key: examples-${{ hashFiles('pyproject.toml') }}
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/licence.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
---
name: Update Copyright

# yamllint disable-line rule:truthy
on:
schedule:
- cron: "0 3 1 1 *"
- cron: 0 3 1 1 *

jobs:
update-licence-year:
runs-on: ubuntu-latest
steps:
# yamllint disable-line rule:line-length
- uses: paddyroddy/.github/actions/licence@5db0473ebf89b7132850d118505c172be8022f97 # v0
- uses: paddyroddy/.github/actions/licence@be31e8f5758700dafb58c5852530e750f1ea69d8 # v0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
licence-file: ./LICENCE.txt
5 changes: 2 additions & 3 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
---
name: Linting

# yamllint disable-line rule:truthy
on:
push:
branches:
- main
- "renovate/**"
- renovate/**
pull_request:

jobs:
linting:
runs-on: ubuntu-latest
steps:
# yamllint disable-line rule:line-length
- uses: paddyroddy/.github/actions/linting@5db0473ebf89b7132850d118505c172be8022f97 # v0
- uses: paddyroddy/.github/actions/linting@be31e8f5758700dafb58c5852530e750f1ea69d8 # v0
with:
pre-commit-config: ./.pre-commit-config.yaml
3 changes: 1 addition & 2 deletions .github/workflows/paper.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
---
name: Paper

# yamllint disable-line rule:truthy
on:
push:
branches:
- main
pull_request:
paths:
- "paper/**"
- paper/**

jobs:
paper:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
---
name: Test

# yamllint disable-line rule:truthy
on:
push:
branches:
- main
- "renovate/**"
- renovate/**
pull_request:

jobs:
Expand All @@ -25,7 +24,7 @@ jobs:
- "3.12"
steps:
# yamllint disable-line rule:line-length
- uses: paddyroddy/.github/actions/python/tox@5db0473ebf89b7132850d118505c172be8022f97 # v0
- uses: paddyroddy/.github/actions/python/tox@be31e8f5758700dafb58c5852530e750f1ea69d8 # v0
with:
cache-path: |-
.tox
Expand All @@ -51,6 +50,7 @@ jobs:
uses: coverallsapp/github-action@3dfc5567390f6fa9267c0ee9c251e4c8c3f18949 # v2
with:
parallel-finished: true
# yamllint disable-line rule:quoted-strings
carryforward: "\
run-macos-latest-3.10,\
run-ubuntu-latest-3.10,\
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
repos:
- repo: https://github.com/paddyroddy/.github
rev: v0.130.0
rev: v0.157.0
hooks:
- id: general-hooks
- id: python-hooks
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
[![Coverage Status](https://coveralls.io/repos/github/astro-informatics/sleplet/badge.svg?branch=main)](https://coveralls.io/github/astro-informatics/sleplet?branch=main)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)
[![Renovate](https://img.shields.io/badge/renovate-enabled-orange?logo=renovatebot)](https://renovatebot.com)
[![repostatus](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active)

`SLEPLET` is a Python package for the construction of Slepian wavelets in the
spherical and manifold (via meshes) settings. The API of `SLEPLET` has been
Expand Down
2 changes: 1 addition & 1 deletion examples/arbitrary/_denoising_slepian_wavelet.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def denoising_slepian_wavelet(
slepian_wavelets: sleplet.functions.SlepianWavelets,
snr_in: float,
n_sigma: int,
) -> npt.NDArray[np.complex_]:
) -> npt.NDArray[np.complex128]:
"""Denoising demo using Slepian wavelets."""
# compute wavelet coefficients
w = sleplet.wavelet_methods.slepian_wavelet_forward(
Expand Down
2 changes: 1 addition & 1 deletion examples/arbitrary/_slepian_wavelet_covariance.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def compute_slepian_wavelet_covariance(
slepian_wavelets: sleplet.functions.SlepianWavelets,
*,
var_signal: float,
) -> npt.NDArray[np.float_]:
) -> npt.NDArray[np.float64]:
"""Compute the theoretical covariance of the wavelet coefficients."""
s_p = sleplet.slepian_methods.compute_s_p_omega(L, slepian_wavelets.slepian)
wavelets_reshape = slepian_wavelets.wavelets[
Expand Down
2 changes: 1 addition & 1 deletion examples/arbitrary/africa/denoising_slepian_africa.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

sys.path.append(str(pathlib.Path(__file__).resolve().parents[1]))

from _denoising_slepian_wavelet import denoising_slepian_wavelet # noqa: E402
from _denoising_slepian_wavelet import denoising_slepian_wavelet

B = 3
J_MIN = 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def main() -> None:
)

# plot
f_p = np.zeros(swc.slepian.N, dtype=np.complex_)
f_p = np.zeros(swc.slepian.N, dtype=np.complex128)
for p, coeff in enumerate(swc.wavelet_coefficients):
print(f"plot reconstruction: {p}")
f_p += sleplet.wavelet_methods.slepian_wavelet_inverse(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

sys.path.append(str(pathlib.Path(__file__).resolve().parents[1]))

from _slepian_wavelet_covariance import compute_slepian_wavelet_covariance # noqa: E402
from _slepian_wavelet_covariance import compute_slepian_wavelet_covariance

B = 3
J_MIN = 2
Expand All @@ -32,7 +32,7 @@ def main() -> None:

# initialise matrix
covar_runs_shape = (RUNS, *covar_theory.shape)
covar_data_runs = np.zeros(covar_runs_shape, dtype=np.complex_)
covar_data_runs = np.zeros(covar_runs_shape, dtype=np.complex128)

# set seed
rng = np.random.default_rng(RANDOM_SEED)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def _denoising_slepian_function(
noised_signal: sleplet.functions.SlepianSouthAmerica,
snr_in: float,
n_sigma: int,
) -> npt.NDArray[np.complex_]:
) -> npt.NDArray[np.complex128]:
"""Denoising demo using Slepian function."""
# compute Slepian noise
sigma_noise = sleplet.noise.compute_sigma_noise(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

sys.path.append(str(pathlib.Path(__file__).resolve().parents[1]))

from _denoising_slepian_wavelet import denoising_slepian_wavelet # noqa: E402
from _denoising_slepian_wavelet import denoising_slepian_wavelet

B = 3
J_MIN = 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def main() -> None:
)

# plot
f_p = np.zeros(swc.slepian.N, dtype=np.complex_)
f_p = np.zeros(swc.slepian.N, dtype=np.complex128)
for p, coeff in enumerate(swc.wavelet_coefficients):
print(f"plot reconstruction: {p}")
f_p += sleplet.wavelet_methods.slepian_wavelet_inverse(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

sys.path.append(str(pathlib.Path(__file__).resolve().parents[1]))

from _slepian_wavelet_covariance import compute_slepian_wavelet_covariance # noqa: E402
from _slepian_wavelet_covariance import compute_slepian_wavelet_covariance

B = 3
J_MIN = 2
Expand All @@ -32,7 +32,7 @@ def main() -> None:

# initialise matrix
covar_runs_shape = (RUNS, *covar_theory.shape)
covar_data_runs = np.zeros(covar_runs_shape, dtype=np.complex_)
covar_data_runs = np.zeros(covar_runs_shape, dtype=np.complex128)

# set seed
rng = np.random.default_rng(RANDOM_SEED)
Expand Down
2 changes: 1 addition & 1 deletion examples/mesh/denoising_slepian_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def _denoising_mesh_slepian(
mesh_slepian_wavelets: sleplet.meshes.MeshSlepianWavelets,
snr_in: float,
n_sigma: int,
) -> npt.NDArray[np.complex_ | np.float_]:
) -> npt.NDArray[np.complex128 | np.float64]:
"""Denoising demo using Slepian wavelets."""
# compute wavelet coefficients
w = sleplet.wavelet_methods.slepian_wavelet_forward(
Expand Down
2 changes: 1 addition & 1 deletion examples/mesh/produce_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

sys.path.append(str(pathlib.Path(__file__).resolve().parent))

from denoising_slepian_mesh import main # noqa: E402
from denoising_slepian_mesh import main

MESH_SNR_DICT = {
"cheetah": -8.64,
Expand Down
2 changes: 1 addition & 1 deletion examples/misc/_denoising_axisym.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def denoising_axisym( # noqa: PLR0913
n_sigma: int,
*,
rotate_to_south_america: bool = False,
) -> tuple[npt.NDArray[np.complex_], float | None, float]:
) -> tuple[npt.NDArray[np.complex128], float | None, float]:
"""Reproduce the denoising demo from S2LET paper."""
# compute wavelet coefficients
w = sleplet.wavelet_methods.axisymmetric_wavelet_forward(
Expand Down
2 changes: 1 addition & 1 deletion examples/misc/denoising_axisym_africa.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

sys.path.append(str(pathlib.Path(__file__).resolve().parent))

from _denoising_axisym import denoising_axisym # noqa: E402
from _denoising_axisym import denoising_axisym

B = 2
J_MIN = 0
Expand Down
2 changes: 1 addition & 1 deletion examples/misc/denoising_axisym_earth.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

sys.path.append(str(pathlib.Path(__file__).resolve().parent))

from _denoising_axisym import denoising_axisym # noqa: E402
from _denoising_axisym import denoising_axisym

B = 2
J_MIN = 0
Expand Down
2 changes: 1 addition & 1 deletion examples/misc/denoising_axisym_south_america.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

sys.path.append(str(pathlib.Path(__file__).resolve().parent))

from _denoising_axisym import denoising_axisym # noqa: E402
from _denoising_axisym import denoising_axisym

B = 2
J_MIN = 0
Expand Down
2 changes: 1 addition & 1 deletion examples/misc/wavelet_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def main() -> None:
plt.close()


def _ricker(freq: float) -> npt.NDArray[np.float_]:
def _ricker(freq: float) -> npt.NDArray[np.float64]:
"""Create a Ricker wavelet."""
t = np.arange(-LENGTH / 2, (LENGTH - DELTA_T) / 2, DELTA_T)
return (1.0 - 2.0 * (np.pi**2) * (freq**2) * (t**2)) * np.exp(
Expand Down
2 changes: 1 addition & 1 deletion examples/polar_cap/eigenfunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def main() -> None:
def _helper(
ax: mpl.axes.Axes,
slepian: sleplet.slepian.SlepianPolarCap,
x: npt.NDArray[np.float_],
x: npt.NDArray[np.float64],
i: int,
rank: int,
) -> None:
Expand Down
2 changes: 1 addition & 1 deletion examples/polar_cap/simons_5_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def _helper( # noqa: PLR0913
ax: npt.NDArray[typing.Any],
slepian: sleplet.slepian.SlepianPolarCap,
resolution: int,
x: npt.NDArray[np.float_],
x: npt.NDArray[np.float64],
i: int,
order: int,
rank: int,
Expand Down
4 changes: 2 additions & 2 deletions examples/polar_cap/slepian_coefficients.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
def _earth_region_harmonic_coefficients(
L: int,
theta_max: int,
) -> npt.NDArray[np.float_]:
) -> npt.NDArray[np.float64]:
"""Harmonic coefficients of the Earth for the polar cap region."""
region = sleplet.slepian.Region(theta_max=np.deg2rad(theta_max))
earth = sleplet.functions.Earth(L, region=region)
Expand All @@ -26,7 +26,7 @@ def _earth_region_harmonic_coefficients(
def _earth_region_slepian_coefficients(
L: int,
theta_max: int,
) -> npt.NDArray[np.float_]:
) -> npt.NDArray[np.float64]:
"""Compute the Slepian coefficients."""
region = sleplet.slepian.Region(theta_max=np.deg2rad(theta_max))
earth = sleplet.functions.Earth(L, region=region)
Expand Down
Loading

0 comments on commit 39b0b1a

Please sign in to comment.