-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: nstarman <[email protected]>
- Loading branch information
Showing
9 changed files
with
1,192 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,9 +3,9 @@ name: CI | |
on: | ||
push: | ||
branches: | ||
- main | ||
- main | ||
tags: | ||
- '*' | ||
- "*" | ||
pull_request: | ||
|
||
concurrency: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
ci: | ||
autoupdate_schedule: "monthly" | ||
autoupdate_commit_msg: "chore: update pre-commit hooks" | ||
autofix_commit_msg: "style: pre-commit fixes" | ||
|
||
default_stages: [pre-commit, pre-push] | ||
|
||
repos: | ||
- repo: meta | ||
hooks: | ||
- id: check-useless-excludes | ||
|
||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: "v5.0.0" | ||
hooks: | ||
- id: check-added-large-files | ||
- id: check-case-conflict | ||
- id: check-merge-conflict | ||
- id: check-yaml | ||
- id: debug-statements | ||
- id: end-of-file-fixer | ||
- id: mixed-line-ending | ||
- id: name-tests-test | ||
args: ["--pytest-test-first"] | ||
- id: trailing-whitespace | ||
|
||
- repo: https://github.com/pre-commit/pygrep-hooks | ||
rev: "v1.10.0" | ||
hooks: | ||
- id: rst-backticks | ||
- id: rst-directive-colons | ||
- id: rst-inline-touching-normal | ||
|
||
- repo: https://github.com/python-jsonschema/check-jsonschema | ||
rev: 0.29.4 | ||
hooks: | ||
- id: check-dependabot | ||
- id: check-github-workflows | ||
- id: check-readthedocs | ||
|
||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: "v0.7.3" | ||
hooks: | ||
# Run the linter | ||
- id: ruff | ||
types_or: [python, pyi, jupyter] | ||
args: ["--fix", "--show-fixes"] | ||
# Run the formatter | ||
- id: ruff-format | ||
types_or: [python, pyi, jupyter] | ||
|
||
- repo: https://github.com/adamchainz/blacken-docs | ||
rev: "1.19.1" | ||
hooks: | ||
- id: blacken-docs | ||
additional_dependencies: [black==23.*] | ||
|
||
- repo: https://github.com/rbubley/mirrors-prettier | ||
rev: "v3.3.3" | ||
hooks: | ||
- id: prettier | ||
types_or: [yaml, markdown, html, css, scss, javascript, json] | ||
args: [--prose-wrap=always] | ||
|
||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: "v1.13.0" | ||
hooks: | ||
- id: mypy | ||
files: src | ||
additional_dependencies: | ||
- pytest | ||
|
||
- repo: https://github.com/codespell-project/codespell | ||
rev: "v2.3.0" | ||
hooks: | ||
- id: codespell | ||
|
||
- repo: https://github.com/abravalheri/validate-pyproject | ||
rev: v0.23 | ||
hooks: | ||
- id: validate-pyproject | ||
|
||
- repo: local | ||
hooks: | ||
- id: disallow-caps | ||
name: Disallow improper capitalization | ||
language: pygrep | ||
entry: PyBind|Numpy|Cmake|CCache|Github|PyTest | ||
exclude: .pre-commit-config.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
"""Minimal definition of the Array API.""" | ||
|
||
from __future__ import annotations | ||
|
||
from typing import Any, Protocol | ||
|
||
|
||
class HasArrayNameSpace(Protocol): | ||
"""Minimal defintion of the Array API.""" | ||
|
||
def __array_namespace__(self) -> Any: ... | ||
|
||
|
||
class Array(HasArrayNameSpace, Protocol): | ||
"""Minimal defintion of the Array API.""" | ||
|
||
def __pow__(self, other: Any) -> Array: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
"""Minimal definition of the Quantity API.""" | ||
|
||
__all__ = ["Quantity", "ArrayQuantity", "Unit"] | ||
|
||
from typing import Protocol, runtime_checkable | ||
|
||
from astropy.units import UnitBase as Unit | ||
|
||
from ._array_api import Array | ||
|
||
|
||
@runtime_checkable | ||
class Quantity(Protocol): | ||
"""Minimal definition of the Quantity API.""" | ||
|
||
value: Array | ||
unit: Unit | ||
|
||
|
||
@runtime_checkable | ||
class ArrayQuantity(Quantity, Array, Protocol): | ||
"""An array-valued Quantity.""" | ||
|
||
... |
Oops, something went wrong.