Skip to content

Commit

Permalink
restore change log
Browse files Browse the repository at this point in the history
  • Loading branch information
adityagoel4512 committed Jun 10, 2024
1 parent 9957541 commit 93d4a24
Show file tree
Hide file tree
Showing 12 changed files with 663 additions and 59 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,3 @@ output/
# Type-generated
ndonnx/_types.pyi
ndonnx/__init__.pyi
# pixi environments
.pixi
*.egg-info
15 changes: 15 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.. Versioning follows semantic versioning, see also
https://semver.org/spec/v2.0.0.html. The most important bits are:
* Update the major if you break the public API
* Update the minor if you add new functionality
* Update the patch if you fixed a bug
Changelog
=========

0.4.0 (2024-05-16)
------------------

**Breaking changes**

- The constant propagated value is no longer accessed from the ``eager_value`` property but instead the ``to_numpy()`` method.
- Non Array API functions have been moved to the ``ndonnx.additional`` namespace.
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ ndonnx is an ONNX-backed Python array library that implements the `Array API sta
:caption: Other

Motivation <motivation/motivation>
Changelog <changelog>
27 changes: 0 additions & 27 deletions docs/intros/utils.py

This file was deleted.

3 changes: 2 additions & 1 deletion ndonnx/_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
from __future__ import annotations

import typing
from typing import Callable, Union
from collections.abc import Callable
from typing import Union

import numpy as np
import spox.opset.ai.onnx.v19 as op
Expand Down
6 changes: 3 additions & 3 deletions ndonnx/_core/_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import functools
import warnings
from collections import namedtuple
from collections.abc import Iterable
from typing import TYPE_CHECKING, Callable, Literal
from collections.abc import Callable, Iterable
from typing import TYPE_CHECKING, Literal

import numpy as np

Expand Down Expand Up @@ -100,7 +100,7 @@ def bitwise_xor(self, x, y):
return _binary_op(x, y, opx.bitwise_xor)

def ceil(self, x):
if isinstance(x.dtype, (dtypes.Floating, dtypes.NullableFloating)):
if isinstance(x.dtype, dtypes.Floating | dtypes.NullableFloating):
return _unary_op(x, opx.ceil, dtypes.float64)
return ndx.asarray(x, copy=False)

Expand Down
2 changes: 1 addition & 1 deletion ndonnx/_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def index_normalise(a: Iterable[ScalarIndexType]) -> tuple[ScalarIndexType, ...]


def construct_index(
arr, index: Union[ScalarIndexType, tuple[ScalarIndexType, ...]]
arr, index: ScalarIndexType | tuple[ScalarIndexType, ...]
) -> tuple[ScalarIndexType, ...]:
index_ = index if isinstance(index, tuple) else (index,)
if any(i is Ellipsis for i in index_):
Expand Down
3 changes: 1 addition & 2 deletions ndonnx/additional/_additional.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
from __future__ import annotations

from collections.abc import Mapping, Sequence
from typing import TYPE_CHECKING, TypeVar
from typing import TYPE_CHECKING, TypeAlias, TypeVar

import numpy as np
from typing_extensions import TypeAlias

import ndonnx as ndx
from ndonnx import _opset_extensions as opx
Expand Down
608 changes: 608 additions & 0 deletions pixi.lock

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion pixi.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
[project]
name = "ndonnx"
description = "ONNX backed array library compliant with Array API standard."
authors = [
"Aditya Goel <[email protected]>",
"Christian Bourjau <[email protected]>",
]
channels = ["conda-forge"]
platforms = ["osx-arm64", "osx-64", "linux-64", "linux-aarch64", "win-64"]
readme = "README.md"
repository = "https://github.com/quantco/ndonnx"


[tasks]
postinstall = "pip install --no-build-isolation --no-deps --disable-pip-version-check -e ."
arrayapitests = "ARRAY_API_TESTS_MODULE=ndonnx pytest --max-examples 2 api-coverage-tests/array_api_tests/ --json-report --json-report-file=api-coverage-tests.json -n auto -vv --skips-file=skips.txt"

[dependencies]
python = ">=3.10"
Expand Down Expand Up @@ -40,9 +47,11 @@ pytest-xdist = "*"
hypothesis = "*"
onnxruntime = "*"
onnx = "*"
mypy = ">=1.10.0,<1.11"
[feature.test.tasks]
test = "pytest"
test-coverage = "pytest --cov=ndonnx --cov-report=xml --cov-report=term-missing"
arrayapitests = "ARRAY_API_TESTS_MODULE=ndonnx pytest --max-examples 2 api-coverage-tests/array_api_tests/ --json-report --json-report-file=api-coverage-tests.json -n auto -vv --skips-file=skips.txt"

[feature.lint.dependencies]
pre-commit = "*"
Expand Down
40 changes: 21 additions & 19 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ readme = "README.md"
dynamic = ["version"]
authors = [{ name = "QuantCo, Inc.", email = "[email protected]" }]
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
requires-python = ">=3.10"

Expand All @@ -37,22 +37,24 @@ line-length = 88

[tool.ruff.lint]
ignore = [
"N803", # https://docs.astral.sh/ruff/rules/invalid-argument-name
"N806", # https://docs.astral.sh/ruff/rules/non-lowercase-variable-in-function
"E501", # https://docs.astral.sh/ruff/faq/#is-the-ruff-linter-compatible-with-black
"N803", # https://docs.astral.sh/ruff/rules/invalid-argument-name
"N806", # https://docs.astral.sh/ruff/rules/non-lowercase-variable-in-function
"E501", # https://docs.astral.sh/ruff/faq/#is-the-ruff-linter-compatible-with-black
"UP038", # https://github.com/astral-sh/ruff/issues/7871
"UP007",
]
select = [
# pyflakes
"F",
# pycodestyle
"E",
"W",
# isort
"I",
# pep8-naming
"N",
# pyupgrade
"UP",
# pyflakes
"F",
# pycodestyle
"E",
"W",
# isort
"I",
# pep8-naming
"N",
# pyupgrade
"UP",
]

[tool.ruff.lint.per-file-ignores]
Expand Down
3 changes: 1 addition & 2 deletions tests/ndonnx/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from __future__ import annotations

import json
from typing import Union

import numpy as np
import onnx
Expand All @@ -18,7 +17,7 @@
_get_dtype,
)

Dtype = Union[dtypes.StructType, dtypes.CoreType]
Dtype = dtypes.StructType | dtypes.CoreType


def run(
Expand Down

0 comments on commit 93d4a24

Please sign in to comment.