Skip to content

Commit

Permalink
Merge branch 'main' into renovate/numpy-2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
paddyroddy authored Sep 11, 2024
2 parents 37bf181 + 782279e commit 110eeb5
Show file tree
Hide file tree
Showing 21 changed files with 63 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
id-token: write
steps:
# yamllint disable-line rule:line-length
- uses: paddyroddy/.github/actions/python/deployment@ac424c5397b4f9c7a6c082bb7196373a887e44f4 # v0
- uses: paddyroddy/.github/actions/python/deployment@cae02393710f18f5fbacd9545d1a38f0d661758e # v0
with:
pyproject-toml: ./pyproject.toml
python-version: "3.12"
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
# yamllint disable-line rule:line-length
- uses: paddyroddy/.github/actions/python/pdoc@ac424c5397b4f9c7a6c082bb7196373a887e44f4 # v0
- uses: paddyroddy/.github/actions/python/pdoc@cae02393710f18f5fbacd9545d1a38f0d661758e # v0
with:
docs-dependency-section: .[docs]
gh-pages-publish-directory: ./html/sleplet
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4

- name: Set up python
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
with:
python-version: "3.12"
cache: pip
Expand All @@ -47,7 +47,7 @@ jobs:
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4

- name: Set up python
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
with:
python-version: "3.12"
cache: pip
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/licence.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
# yamllint disable-line rule:line-length
- uses: paddyroddy/.github/actions/licence@ac424c5397b4f9c7a6c082bb7196373a887e44f4 # v0
- uses: paddyroddy/.github/actions/licence@cae02393710f18f5fbacd9545d1a38f0d661758e # v0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
licence-file: ./LICENCE.txt
2 changes: 1 addition & 1 deletion .github/workflows/links.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ jobs:
timeout-minutes: 2
steps:
# yamllint disable-line rule:line-length
- uses: paddyroddy/.github/actions/links@ac424c5397b4f9c7a6c082bb7196373a887e44f4 # v0
- uses: paddyroddy/.github/actions/links@cae02393710f18f5fbacd9545d1a38f0d661758e # v0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/linting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ jobs:
runs-on: ubuntu-latest
steps:
# yamllint disable-line rule:line-length
- uses: paddyroddy/.github/actions/linting@ac424c5397b4f9c7a6c082bb7196373a887e44f4 # v0
- uses: paddyroddy/.github/actions/linting@cae02393710f18f5fbacd9545d1a38f0d661758e # v0
with:
pre-commit-config: ./.pre-commit-config.yaml
2 changes: 1 addition & 1 deletion .github/workflows/paper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

- name: Upload
# yamllint disable-line rule:line-length
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4
with:
name: paper
path: paper/paper.pdf
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- "3.12"
steps:
# yamllint disable-line rule:line-length
- uses: paddyroddy/.github/actions/python/tox@ac424c5397b4f9c7a6c082bb7196373a887e44f4 # v0
- uses: paddyroddy/.github/actions/python/tox@cae02393710f18f5fbacd9545d1a38f0d661758e # v0
with:
cache-path: |-
.tox
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.213.0
rev: v0.226.0
hooks:
- id: general-hooks
- id: python-hooks
11 changes: 11 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[type.py]
extend-ignore-re = [
"(?:=|>|<)\\s*color",
"\"(?:color\":\\s\"|ax\":\\s)",
"\\.Center\\(",
"\\w=\"center\"",
"ax(?:s?[,.]\\w|\\s*=\\s*\\w|,|\\[|:\\s\\w)",
"center=\\w",
"color(?:=\"|=\\w|\\.colors\\.|_range)",
"mpl\\.colors\\.",
]
24 changes: 12 additions & 12 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
Examples of behaviour that contributes to a positive environment for our
community include:

- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
- Accepting responsibility and apologising to those affected by our mistakes,
and learning from the experience
- Focusing on what is best not just for us as individuals, but for the overall
community

Examples of unacceptable behavior include:
Examples of unacceptable behaviour include:

- The use of sexualized language or imagery, and sexual attention or advances of
- The use of sexualised language or imagery, and sexual attention or advances of
any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
Expand All @@ -39,8 +39,8 @@ Examples of unacceptable behavior include:
## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
acceptable behaviour and will take appropriate and fair corrective action in
response to any behaviour that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
Expand All @@ -58,7 +58,7 @@ representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
Instances of abusive, harassing, or otherwise unacceptable behaviour may be
reported to the community leaders responsible for enforcement at
<[email protected]>. All complaints will be reviewed and investigated
promptly and fairly.
Expand All @@ -73,19 +73,19 @@ the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
**Community Impact**: Use of inappropriate language or other behaviour deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
behaviour was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series of
actions.

**Consequence**: A warning with consequences for continued behavior. No
**Consequence**: A warning with consequences for continued behaviour. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
Expand All @@ -95,7 +95,7 @@ ban.
### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
sustained inappropriate behaviour.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
Expand All @@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban.
### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
standards, including sustained inappropriate behaviour, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within the
Expand Down
2 changes: 1 addition & 1 deletion src/sleplet/_convolution_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ def sifting_convolution(
if len(g_coefficient.shape) < len(f_coefficient.shape)
else g_coefficient
)
return (f_coefficient.T[:n] * g_reshape.conj().T[:n]).T
return (f_coefficient.T[:n] * g_reshape.conj().T[:n]).T # type: ignore[return-value]
6 changes: 3 additions & 3 deletions src/sleplet/_data/meshes_regions_bird.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
CAMERA_X = 2
CAMERA_Y = 1
CAMERA_Z = 0
CENTER_X = 0.27
CENTER_Y = 0
CENTER_Z = -0.08
CENTRE_X = 0.27
CENTRE_Y = 0
CENTRE_Z = -0.08
DEFAULT_COLOURBAR_POS = 0.98
DEFAULT_ZOOM = 1.49
FILENAME = "bird.off"
Expand Down
6 changes: 3 additions & 3 deletions src/sleplet/_data/meshes_regions_cheetah.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
CAMERA_X = 3
CAMERA_Y = 1
CAMERA_Z = 0
CENTER_X = 0
CENTER_Y = 0
CENTER_Z = -0.275
CENTRE_X = 0
CENTRE_Y = 0
CENTRE_Z = -0.275
DEFAULT_COLOURBAR_POS = 0.75
DEFAULT_ZOOM = 1.89
FILENAME = "cheetah.off"
Expand Down
6 changes: 3 additions & 3 deletions src/sleplet/_data/meshes_regions_cube.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
CAMERA_X = 1
CAMERA_Y = 1
CAMERA_Z = 1
CENTER_X = 0
CENTER_Y = 0
CENTER_Z = 0.25
CENTRE_X = 0
CENTRE_Y = 0
CENTRE_Z = 0.25
DEFAULT_COLOURBAR_POS = 0.85
DEFAULT_ZOOM = 0.81
FILENAME = "cube.off"
Expand Down
6 changes: 3 additions & 3 deletions src/sleplet/_data/meshes_regions_dragon.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
CAMERA_X = 1
CAMERA_Y = 1
CAMERA_Z = 0
CENTER_X = 0.15
CENTER_Y = 0
CENTER_Z = 0.07
CENTRE_X = 0.15
CENTRE_Y = 0
CENTRE_Z = 0.07
DEFAULT_COLOURBAR_POS = 0.99
DEFAULT_ZOOM = 0.95
FILENAME = "dragon.off"
Expand Down
6 changes: 3 additions & 3 deletions src/sleplet/_data/meshes_regions_homer.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
CAMERA_X = 0
CAMERA_Y = 1
CAMERA_Z = 0.5
CENTER_X = 0
CENTER_Y = 0
CENTER_Z = 0.49
CENTRE_X = 0
CENTRE_Y = 0
CENTRE_Z = 0.49
DEFAULT_COLOURBAR_POS = 0.69
DEFAULT_ZOOM = 0.5
FILENAME = "homer.off"
Expand Down
6 changes: 3 additions & 3 deletions src/sleplet/_data/meshes_regions_teapot.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
CAMERA_X = 0
CAMERA_Y = 1
CAMERA_Z = 1
CENTER_X = -0.055
CENTER_Y = 0
CENTER_Z = 0.1
CENTRE_X = -0.055
CENTRE_Y = 0
CENTRE_Z = 0.1
DEFAULT_COLOURBAR_POS = 0.95
DEFAULT_ZOOM = 0.8
FILENAME = "teapot.off"
Expand Down
8 changes: 4 additions & 4 deletions src/sleplet/_plotly_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ def create_camera( # noqa: PLR0913
z_eye: float,
zoom: float,
*,
x_center: float = 0,
y_center: float = 0,
z_center: float = 0,
x_centre: float = 0,
y_centre: float = 0,
z_centre: float = 0,
) -> go.layout.scene.Camera:
"""Create default camera view with a zoom factor."""
return go.layout.scene.Camera(
eye=go.layout.scene.camera.Eye(x=x_eye / zoom, y=y_eye / zoom, z=z_eye / zoom),
center=go.layout.scene.camera.Center(x=x_center, y=y_center, z=z_center),
center=go.layout.scene.camera.Center(x=x_centre, y=y_centre, z=z_centre),
)


Expand Down
8 changes: 4 additions & 4 deletions src/sleplet/harmonic_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,14 @@ def rotate_earth_to_south_america(
L: int,
) -> npt.NDArray[np.complex128]:
"""
Rotates the harmonic coefficients of the Earth to a view centered on South America.
Rotates the harmonic coefficients of the Earth to a view centred on South America.
Args:
earth_flm: The spherical harmonic coefficients of the Earth.
L: The spherical harmonic bandlimit.
Returns:
The spherical harmonic coefficients of the Earth centered on South America.
The spherical harmonic coefficients of the Earth centred on South America.
"""
return ssht.rotate_flms(
earth_flm,
Expand All @@ -201,13 +201,13 @@ def rotate_earth_to_africa(
L: int,
) -> npt.NDArray[np.complex128]:
"""
Rotates the harmonic coefficients of the Earth to a view centered on Africa.
Rotates the harmonic coefficients of the Earth to a view centred on Africa.
Args:
earth_flm: The spherical harmonic coefficients of the Earth.
L: The spherical harmonic bandlimit.
Returns:
The spherical harmonic coefficients of the Earth centered on Africa.
The spherical harmonic coefficients of the Earth centred on Africa.
"""
return ssht.rotate_flms(earth_flm, _AFRICA_ALPHA, _AFRICA_BETA, _AFRICA_GAMMA, L)
6 changes: 3 additions & 3 deletions src/sleplet/meshes/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ def __post_init__(self: typing_extensions.Self) -> None:
mesh_config["CAMERA_Y"],
mesh_config["CAMERA_Z"],
mesh_config["REGION_ZOOM"] if self.zoom else mesh_config["DEFAULT_ZOOM"],
x_center=mesh_config["CENTER_X"] if self.zoom else 0,
y_center=mesh_config["CENTER_Y"] if self.zoom else 0,
z_center=mesh_config["CENTER_Z"] if self.zoom else 0,
x_centre=mesh_config["CENTRE_X"] if self.zoom else 0,
y_centre=mesh_config["CENTRE_Y"] if self.zoom else 0,
z_centre=mesh_config["CENTRE_Z"] if self.zoom else 0,
)
self._colourbar_pos = (
mesh_config["REGION_COLOURBAR_POS"]
Expand Down

0 comments on commit 110eeb5

Please sign in to comment.