diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 375b5268..27472ee0 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -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" diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml index cd3fcad5..a9dccf70 100644 --- a/.github/workflows/documentation.yaml +++ b/.github/workflows/documentation.yaml @@ -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 diff --git a/.github/workflows/examples.yaml b/.github/workflows/examples.yaml index 42c04b6d..8fb312b1 100644 --- a/.github/workflows/examples.yaml +++ b/.github/workflows/examples.yaml @@ -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 @@ -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 diff --git a/.github/workflows/licence.yaml b/.github/workflows/licence.yaml index ee465074..616768d9 100644 --- a/.github/workflows/licence.yaml +++ b/.github/workflows/licence.yaml @@ -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 diff --git a/.github/workflows/links.yaml b/.github/workflows/links.yaml index aca8572e..e433b438 100644 --- a/.github/workflows/links.yaml +++ b/.github/workflows/links.yaml @@ -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 }} diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index 8f77ee64..2e0082f9 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -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 diff --git a/.github/workflows/paper.yaml b/.github/workflows/paper.yaml index 0d547fda..bf8eef03 100644 --- a/.github/workflows/paper.yaml +++ b/.github/workflows/paper.yaml @@ -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 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index d9520cb2..225cd438 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 63817a85..35fb4509 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 diff --git a/.typos.toml b/.typos.toml new file mode 100644 index 00000000..f6b91354 --- /dev/null +++ b/.typos.toml @@ -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\\.", +] diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 75153f3e..f4fcf9cf 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -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 @@ -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 @@ -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 . All complaints will be reviewed and investigated promptly and fairly. @@ -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 @@ -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 @@ -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 diff --git a/src/sleplet/_convolution_methods.py b/src/sleplet/_convolution_methods.py index 41d27026..ade3c164 100644 --- a/src/sleplet/_convolution_methods.py +++ b/src/sleplet/_convolution_methods.py @@ -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] diff --git a/src/sleplet/_data/meshes_regions_bird.toml b/src/sleplet/_data/meshes_regions_bird.toml index 1f3d77ac..91f726d6 100644 --- a/src/sleplet/_data/meshes_regions_bird.toml +++ b/src/sleplet/_data/meshes_regions_bird.toml @@ -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" diff --git a/src/sleplet/_data/meshes_regions_cheetah.toml b/src/sleplet/_data/meshes_regions_cheetah.toml index cb69282d..24d2f01d 100644 --- a/src/sleplet/_data/meshes_regions_cheetah.toml +++ b/src/sleplet/_data/meshes_regions_cheetah.toml @@ -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" diff --git a/src/sleplet/_data/meshes_regions_cube.toml b/src/sleplet/_data/meshes_regions_cube.toml index c55b7aec..790de114 100644 --- a/src/sleplet/_data/meshes_regions_cube.toml +++ b/src/sleplet/_data/meshes_regions_cube.toml @@ -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" diff --git a/src/sleplet/_data/meshes_regions_dragon.toml b/src/sleplet/_data/meshes_regions_dragon.toml index a7f7a0dd..5c124f20 100644 --- a/src/sleplet/_data/meshes_regions_dragon.toml +++ b/src/sleplet/_data/meshes_regions_dragon.toml @@ -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" diff --git a/src/sleplet/_data/meshes_regions_homer.toml b/src/sleplet/_data/meshes_regions_homer.toml index 2b88a9b4..7ee65520 100644 --- a/src/sleplet/_data/meshes_regions_homer.toml +++ b/src/sleplet/_data/meshes_regions_homer.toml @@ -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" diff --git a/src/sleplet/_data/meshes_regions_teapot.toml b/src/sleplet/_data/meshes_regions_teapot.toml index bd8ea69d..8b685279 100644 --- a/src/sleplet/_data/meshes_regions_teapot.toml +++ b/src/sleplet/_data/meshes_regions_teapot.toml @@ -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" diff --git a/src/sleplet/_plotly_methods.py b/src/sleplet/_plotly_methods.py index 56817237..be9a015c 100644 --- a/src/sleplet/_plotly_methods.py +++ b/src/sleplet/_plotly_methods.py @@ -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), ) diff --git a/src/sleplet/harmonic_methods.py b/src/sleplet/harmonic_methods.py index 15abdcd9..df1d8df4 100644 --- a/src/sleplet/harmonic_methods.py +++ b/src/sleplet/harmonic_methods.py @@ -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, @@ -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) diff --git a/src/sleplet/meshes/mesh.py b/src/sleplet/meshes/mesh.py index 99c02caf..a0d5f7c4 100644 --- a/src/sleplet/meshes/mesh.py +++ b/src/sleplet/meshes/mesh.py @@ -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"]