Skip to content

Commit

Permalink
Merge pull request #36 from willow-ahrens/array-api-changes
Browse files Browse the repository at this point in the history
Drop python 3.9, Add creation functions.
  • Loading branch information
mtsokol committed Apr 29, 2024
2 parents 874fd1b + 7f0b390 commit c8b2059
Show file tree
Hide file tree
Showing 12 changed files with 194 additions and 688 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python: ['3.9', '3.10', '3.11']
python: ['3.10', '3.11', '3.12']
include:
- os: macos-latest
python: '3.9'
python: '3.10'
- os: windows-latest
python: '3.9'
python: '3.10'
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
Expand Down
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ coverage.xml
.hypothesis/
.pytest_cache/
cover/
junit/

# Translations
*.mo
Expand Down Expand Up @@ -99,7 +100,7 @@ ipython_config.py
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock
poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
Expand Down Expand Up @@ -157,4 +158,7 @@ cython_debug/
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
.idea/

# mac os
.DS_Store
600 changes: 0 additions & 600 deletions poetry.lock

This file was deleted.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[tool.poetry]
name = "finch-tensor"
version = "0.1.12"
version = "0.1.14"
description = ""
authors = ["Willow Ahrens <willow.marie.ahrens@gmail.com>"]
readme = "README.md"
packages = [{include = "finch", from = "src"}]

[tool.poetry.dependencies]
python = "^3.9"
python = "^3.10"
juliapkg = "^0.1.10"
juliacall = "^0.9.15"
numpy = "^1.19"
Expand Down
9 changes: 0 additions & 9 deletions requirements.txt

This file was deleted.

47 changes: 37 additions & 10 deletions src/finch/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
from operator import (
add as add,
sub as subtract,
mul as multiply,
floordiv as floor_divide,
truediv as divide,
matmul as matmul,
neg as negative,
pos as positive,
abs as abs,
pow as pow,
invert as bitwise_invert,
xor as bitwise_xor,
or_ as bitwise_or,
and_ as bitwise_and,
lshift as bitwise_left_shift,
rshift as bitwise_right_shift
)

from .levels import (
Dense,
Element,
Expand All @@ -19,25 +38,15 @@
random,
eye,
tensordot,
matmul,
permute_dims,
where,
nonzero,
multiply,
sum,
prod,
max,
min,
all,
any,
add,
subtract,
divide,
floor_divide,
pow,
positive,
negative,
abs,
cos,
cosh,
acos,
Expand All @@ -62,6 +71,12 @@
round,
floor,
ceil,
full,
full_like,
ones,
ones_like,
zeros,
zeros_like,
)
from .compiled import (
lazy,
Expand Down Expand Up @@ -168,4 +183,16 @@
"round",
"floor",
"ceil",
"full",
"full_like",
"ones",
"ones_like",
"zeros",
"zeros_like",
"bitwise_and",
"bitwise_or",
"bitwise_left_shift",
"bitwise_right_shift",
"bitwise_xor",
"bitwise_invert",
]
26 changes: 26 additions & 0 deletions src/finch/dtypes.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import numpy as np

from .julia import jl


Expand All @@ -17,3 +19,27 @@
complex64: jl.DataType = jl.ComplexF32
complex128: jl.DataType = jl.ComplexF64
bool: jl.DataType = jl.Bool

number: jl.DataType = jl.Number
complex: jl.DataType = jl.Complex
integer: jl.DataType = jl.Integer
abstract_float: jl.DataType = jl.AbstractFloat

jl_to_np_dtype = {
int_: np.int_,
int8: np.int8,
int16: np.int16,
int32: np.int32,
int64: np.int64,
uint8: np.uint8,
uint16: np.uint16,
uint32: np.uint32,
uint64: np.uint64,
float16: np.float16,
float32: np.float32,
float64: np.float64,
complex64: np.complex64,
complex128: np.complex128,
bool: np.bool_,
None: None,
}
2 changes: 1 addition & 1 deletion src/finch/julia.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import juliapkg

_FINCH_VERSION = "0.6.22"
_FINCH_VERSION = "0.6.23"
_FINCH_HASH = "9177782c-1635-4eb9-9bfb-d9dfa25e6bce"

deps = juliapkg.deps.load_cur_deps()
Expand Down
Loading

0 comments on commit c8b2059

Please sign in to comment.