peterbell10 on annotation-extractor-replacer
Move annotations out from funct… (compare)
[Unknown, Quansight]
3 new commits pushed to `master` by hameerabbasi
`Quansight-Labs/uarray@a996dd1- Modernize the CI and wheel building system.
Quansight-Labs/uarray@b672ede- Make clang-format happy.
Quansight-Labs/uarray@1c38db3` - Merge pull request #260 from hameerabbasi/update-cibw
[Unknown, Quansight]
Pull request merged by hameerabbasi
<https://github.com/Quansight-Labs/uarray/pull/260|\#260 Modernize the CI and wheel building system.>
- Fix typo in README.md
Quansight-Labs/uarray@4e4d310- Make coverage work again.
Quansight-Labs/uarray@32d18f6` - Merge pull request #261 from hameerabbasi/typo
requirements.txt
that is new enough to have the try_last
argument for backends and right now v0.6.0 is the latest on PyPI.
- Change artifact names to be nicer.
Quansight-Labs/uarray@c136ee9- Update versioneer.
Quansight-Labs/uarray@3562def` - Merge pull request #262 from hameerabbasi/artifact-names
- Fix versioneer on Windows.
Quansight-Labs/uarray@d313e90` - Merge pull request #263 from hameerabbasi/fix-versioneer
- Downgrade versioneer to 0.20.
Quansight-Labs/uarray@35e28db` - Merge pull request #264 from hameerabbasi/fix-versioneer
[Unknown, Quansight]
New issue created by Smit-create
<https://github.com/Quansight-Labs/uarray/issues/265|\#265 BUG: \`all\_of\_type\` changes dimension of 2D array>
Here is the code that shows that all_of_type
changes the dimension of sos_f32
below:
>>> from scipy._lib.uarray import all_of_type
>>> import numpy as np
>>> @all_of_type(np.ndarray)
... def f(p):
... return p
...
>>> sos_f32 = np.array([[4., 5., 6., 1., 2., 3.]], dtype=np.float32)
>>> sos_f32
array([[4., 5., 6., 1., 2., 3.]], dtype=float32)
>>> sos_f32.shape
(1, 6)
>>> f(sos_f32)
(<Dispatchable: type=<class 'numpy.ndarray'>, value=array([4., 5., 6., 1., 2., 3.], dtype=float32)>,)
>>> f(sos_f32)[0].value.shape
(6,)
I was expecting sos_f32
and f(sos_f32)[0].value
to have same dimensions. Is this a bug?
- Change versioneer to setuptools_scm.
Quansight-Labs/uarray@43e0788` - Merge pull request #266 from hameerabbasi/setuptools-scm
[Unknown, Quansight]
Pull request opened by rgommers
<https://github.com/Quansight-Labs/uarray/pull/267|\#267 Fix build warning from vectorcall.h>
Warning looks like:
[9/1557] Compiling C++ object scipy/_lib/_uarray/_uarray.cpython-310-darwin.so.p/vectorcall.cxx.o
warning: unknown warning option '-Wno-terminate' [-Wunknown-warning-option]
In file included from ../scipy/_lib/_uarray/vectorcall.cxx:1:
../scipy/_lib/_uarray/vectorcall.h:12:6: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined]
^
../scipy/_lib/_uarray/vectorcall.h:10:5: note: expanded from macro 'Q_HAS_VECTORCALL'
(!defined(PYPY_VERSION) && (PY_VERSION_HEX >= 0x03080000))
^
../scipy/_lib/_uarray/vectorcall.h:20:6: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined]
^
../scipy/_lib/_uarray/vectorcall.h:10:5: note: expanded from macro 'Q_HAS_VECTORCALL'
(!defined(PYPY_VERSION) && (PY_VERSION_HEX >= 0x03080000))
^
../scipy/_lib/_uarray/vectorcall.h:26:6: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined]
^
../scipy/_lib/_uarray/vectorcall.h:10:5: note: expanded from macro 'Q_HAS_VECTORCALL'
(!defined(PYPY_VERSION) && (PY_VERSION_HEX >= 0x03080000))
^
4 warnings generated.
Reviewers: @peterbell10
[Unknown, Quansight]
New issue created by thomasjpfan
<https://github.com/Quansight-Labs/uarray/issues/270|\#270 Build wheels with Py\_LIMITED\_API & abi3>
There are quite a few wheels for uarray on pypi. Given the limited scope of uarray, is it possible to build uarray wheels with Py_LIMITED_API
on?
Looking at cryptography on pypi, there are less wheels for most architectures. (pypy still need their own builds)
XREF: pypa/cibuildwheel#78
[Unknown, Quansight]
Pull request opened by BvB93
<https://github.com/Quansight-Labs/uarray/pull/273|\#273 ENH: Add annotations for the \`uarray.\_uarray\` extension module>
Recently I noticed in scipy that uarray is still lacking type annotations, so if there is any interest I would very much like to contribute them.
This PR in particular focuses on the uarray._uarray
extension module. As the latter is written in C++, it is necessary to resort to .pyi stub files for distributing PEP 484 type annotations.
- Minor maintenance fixes.
Quansight-Labs/uarray@ca75f1e` - Merge pull request #272 from hameerabbasi/minor
[Unknown, Quansight]
Pull request opened by peterbell10
<https://github.com/Quansight-Labs/uarray/pull/274|\#274 Proof of concept: annotation-based argument extractor/replacer>
This explores the posibility of automatically generating the argument extractor and replacer based on inline type annotations (for simple cases). So, for example scipy.fft.fft
might look like:
@_dispatch
def fft(x: ua.typing.Dispatchable[ArrayLike, np.ndarray], n=None, axis=-1,
norm=None, overwrite_x=False, workers=None, *, plan=None):
pass
The signature is inspected ahead-of-time so as to minimize call overhead but a Python implementation is still too slow. ~400 ns for
even a simple f(x)
signature. However, if it were lowered to C++ then the concept may still be viable.
This also relies on typing.Annotated
to specify dispatch_type
and coercible
but typing.Annotated
itself requires Python 3.9. It may be possible to emulate on earlier python versions, otherwise I think the dispatch metadata would need to go elsewhere. Perhaps something like:
@_dispatch([ua.DispatchableArg(name='x', dispatch_type=np.ndarray, coercible=True)])
def fft(x, n=None, axis=-1, norm=None, overwrite_x=False, workers=None, *, plan=None):
pass
cc @thomasjpfan