Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 24 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
defaults:
run:
shell: bash -el {0}

name: CI
jobs:
test:
defaults:
run:
shell: bash -el {0}
strategy:
matrix:
os: [ubuntu-latest]
Expand All @@ -17,7 +18,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
Expand All @@ -29,7 +30,25 @@ jobs:
- name: Run tests
run: |
poetry run pytest --junit-xml=test-${{ matrix.os }}-Python-${{ matrix.python }}.xml
- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v5
mypy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install package
run: |
poetry install --with test
- name: Run tests
run: |
poetry run mypy .



on:
# Trigger the workflow on push or pull request,
Expand Down
1 change: 1 addition & 0 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ sparse = "*"
numba = ">=0.60"
scipy = "*"
numpy = "==2.*"
mypy = ">=1.15.0,<2"

[feature.test.tasks]
test = { cmd = "pytest", depends-on = ["compile"] }
Expand Down
21 changes: 21 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,28 @@ pytest-cov = "^4.1.0"
sparse = "^0.16.0"
scipy = "^1.7"
numba = "^0.61.0"
mypy = "^1.15.0"

[build-system]
requires = ["poetry-core>=1.0.8"]
build-backend = "poetry.core.masonry.api"

[tool.ruff.lint]
select = ["F", "E", "W", "I", "B", "UP", "YTT", "BLE", "C4", "T10", "ISC", "ICN", "PIE", "PYI", "RSE", "RET", "SIM", "PGH", "FLY", "NPY", "PERF"]

[tool.ruff.lint.isort.sections]
numpy = ["numpy", "numpy.*", "scipy", "scipy.*"]

[tool.ruff.format]
quote-style = "double"
docstring-code-format = true

[tool.ruff.lint.isort]
section-order = [
"future",
"standard-library",
"numpy",
"third-party",
"first-party",
"local-folder",
]
31 changes: 30 additions & 1 deletion src/finch/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,31 @@
from . import finch_logic
from .interface import *
from .interface import (
compute,
elementwise,
expand_dims,
fuse,
fused,
identify,
lazy,
multiply,
permute_dims,
prod,
reduce,
squeeze,
)

__all__ = [
"lazy",
"compute",
"finch_logic",
"fuse",
"fused",
"permute_dims",
"expand_dims",
"squeeze",
"identify",
"reduce",
"elementwise",
"prod",
"multiply",
]
13 changes: 11 additions & 2 deletions src/finch/algebra/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
from .algebra import *
from .algebra import (
element_type,
fill_value,
fixpoint_type,
init_value,
is_associative,
query_property,
register_property,
return_type,
)

__all__ = [
"fill_value",
Expand All @@ -9,4 +18,4 @@
"is_associative",
"query_property",
"register_property",
]
]
Loading