Releases: jorenham/optype
Releases · jorenham/optype
v0.11.0
What's Changed
optype.numpy
- NumPy 2.3.0 support, and two minor
optype.numpy
fixes on older numpy versions by @jorenham in #336 - [BREAKING]
optype.numpy.AnyFloat64DType
withoutNone
by @jorenham in #346
Dependencies
- mypy 1.16.0 by @jorenham in #334
- Bump numpy from 2.3.0 to 2.3.1 in the actions group by @dependabot in #339
- bump
ruff
to0.12.2
by @jorenham in #341 - bump
mypy
to1.16.1
by @jorenham in #342 - bump
basedpyright
to1.30.0
(pyright 1.1.403) by @jorenham in #343 - bump
tox
to4.27.0
by @jorenham in #344 - bump
pytest
to8.4.1
by @jorenham in #345
Continuous integration
Other Changes
Full Changelog: v0.10.0...v0.11.0
v0.10.0
What's Changed
optype.numpy
- prefer gradual type parameter defaults by @jorenham in #316
- remove type parameters for individual
numpy
shape axes by @jorenham in #317 - optionally gradual unbounded shape-types by @jorenham in #318
- require
numpy >= 1.25
by @jorenham in #320 - stop using
NBitBase
inoptype.numpy.compat
by @jorenham in #326 ToJustInt64
numpy array-like aliases forint64
by @jorenham in #328- numpy version agnostic gradual shape type defaults by @jorenham in #329
- numpy scalar type parameter gradual defaults by @jorenham in #330
numpy.CanArrayFunction
contravariance assignability fix by @jorenham in #331optype.numpy.SequenceND
compatibility with numpy by @jorenham in #332
Dependencies
- bump
ruff
to0.11.4
by @jorenham in #310 - update development dependencies by @jorenham in #312
- bump development dependencies by @jorenham in #313
- bump basedpyright to 1.29.2 (pyright 1.1.401) by @jorenham in #321
- require
python >= 3.11
by @jorenham in #322 - bump
ruff
to0.11.11
by @jorenham in #327
Continuous integration
- read-only ci permissions by @jorenham in #323
- bump
scientific-python/repo-review
tov0.12.2
by @jorenham in #324 - fix dependabot config by @jorenham in #325
Other Changes
- prepare for next release by @jorenham in #309
- bump
astral-sh/setup-uv
tov6
by @jorenham in #311 - prepare for the optype 0.10.0 release by @jorenham in #319
Full Changelog: v0.9.3...v0.10.0
v0.9.3
This bugfix release addresses an issue where the 2- and 3-d optype.numpy
array-like type aliases were not assignable to their *ND
variants, e.g.:
import numpy as np
import optype.numpy as onp
def fn(x: onp.ToFloatND) -> int:
return np.asarray(x).size
def f2(x: onp.ToFloat2D) -> int:
return fn(x) # will no longer be rejected
This additionally works around an issue in typing_extensions==4.13.0
that results in a TypeError
being raised when taking the union of typing.TypeAliasType
and typing_extension.TypeAliasType
on (at least) Python 3.12.
What's Changed
optype.numpy
- update development dependencies, and more flexible pyright config by @jorenham in #307
- fix
To{}(2|3)D
not being assignable toTo{}ND
by @jorenham in #308
Other Changes
Full Changelog: v0.9.2...v0.9.3
v0.9.2
What's Changed
optype
- mark
optype.Just*
as@final
and simplify metaclasses by @jorenham in #299 - add
optype.JustDate
by @jorenham in #300
optype.numpy
numpy>=2.2
fixes for array- and dtype-likes by @jorenham in #301- new
optype.numpy.random
submodule by @jorenham in #302 - common numpy literal types by @jorenham in #303
Dependencies
- update the dev deps by @jorenham in #291
- bump
numpy
to2.2.3
by @jorenham in #292 - remove pre-commit by @jorenham in #296
- update development dependencies by @jorenham in #297
- bump
basedmypy
to2.10.0
by @jorenham in #298
Other Changes
Full Changelog: v0.9.1...v0.9.2
v0.9.1
What's Changed
optype.numpy
- fix longdouble dtype name literal by @jorenham in #283
- remove
float80
andcomplex160
from[c]longdouble
by @jorenham in #285 - add
onp.NDim0
, which, unlikeNDim
, excludes0
by @jorenham in #286 - add literal
onp.To[Just]{False,True}
aliases by @jorenham in #287 - generic
onp.ToArrayStrict{1,2,3}D
by @jorenham in #288
Dependencies
Other Changes
Full Changelog: v0.9.0...v0.9.1
v0.9.0
Highlights
- ⚡ Faster
import optype as op
by deferring submodule imports (#251) - ✨ New
op.io
submodule (docs) (#253) - ✨ New and improved
op.Just
types (docs):Just[T]
- Accepts_: T
iff.type(_) is T
.JustInt
- Accepts_: int
and literal ints, rejects e.g._: bool
JustFloat
- Accepts_: float
, rejects e.g._: int
and_: numpy.float64
JustComplex
- Accepts_: complex
, rejects_: float
and_: numpy.complex128
JustBytes
- Accepts_: bytes
and bytes-literals, rejects_: bytearray
,_: memoryview
, and_: numpy.bytes_
JustObject
- Accepts_: object
, rejects everything else. Useful for annotating sentinels likeDEFAULT = object()
.
- ✨ New
op.numpy.is_array_{0,1,2,3,n}d
typeguards (docs) (#270)
Deprecations
- The
op.typing.Just*
types are deprecated in favor ofop.Just*
.
What's Changed
optype
- generic
optype.HasClass
: suprisingly useful! by @jorenham in #257 - move
Just*
fromoptype.typing
tooptype
and deprecate by @jorenham in #258 - custom runtime-checkable
Just*
types by @jorenham in #260 Just
without redundant typing hacks by @jorenham in #261- add
JustObject
by @jorenham in #264 - add
JustBytes
by @jorenham in #265 - change
HasFunc
andHasWrapped
generic type params by @jorenham in #267 - change
HasTypeParams
type params by @jorenham in #268
optype.numpy
- prefer
Just{Float,Complex}
overJust[{float,complex}]
inoptype.numpy
by @jorenham in #240 - add the missing
Just
types toonp.Any*DType
by @jorenham in #243 optype.numpy.is_
typeguard by @jorenham in #270- split the private
op.numpy._any_dtype
module into two by @jorenham in #275 - new
optype.numpy.ToDType
alias by @jorenham in #276
Dependencies
- ruff 0.9.1, basedpyright 1.23.2, basedmypy 2.9.1 by @jorenham in #239
- bump
basedpyright
to1.24.0
by @jorenham in #255 - bump
ruff
to0.9.2
by @jorenham in #259 - bump
numpy
to2.2.2
(dev-only) by @jorenham in #263 - bump
pre-commit
to4.1.0
by @jorenham in #271
Continuous integration
- trigger the build & publish workflow on (pre)release by @jorenham in #238
- automatically label PR's by @jorenham in #247
- add
CODEOWNERS
by @jorenham in #248
Other Changes
- more consistent style for imports and exports by @jorenham in #246
- lazy submodule imports by @jorenham in #251
optype.io
by @jorenham in #253- stop using
__future__.annotations
andtyping.TYPE_CHECKING
by @jorenham in #256 - cleaner
ruff.lint.isort
config by @jorenham in #262 - cleaner private module structure by @jorenham in #266
- format
pyproject.toml
by @jorenham in #269 - update the auto-release changelog config by @jorenham in #272
- globally ignore common inline typechecker ignores by @jorenham in #273
Full Changelog: v0.8.0...v0.9.0
v0.8.0
What's Changed
optype.numpy
- accept more valid numpy array-likes in
optype.numpy.To*{1,2,3,N}
by @jorenham in #214 onp.Any[U]Int{DType,Array}
fornp.int_
by @jorenham in #224- include
opt.Just[{int,float,complex}]
inonp.Any{Int,Float,Complex}{Array,DType}
by @jorenham in #225 - new
onp.compat
module, andAny
as shape-type default onnumpy<2.1
by @jorenham in #226 - new
onp.Matrix
andonp.MArray[{0,1,2,3}D]
aliases by @jorenham in #228 onp.AnyBytes8DType
fornp.dtype("c")
by @jorenham in #230- new
onp.ToJust{Bool,Float,Complex}
aliases by @jorenham in #231 - new
onp.To[Just]{Float64,Complex128}*
aliases by @jorenham in #232
optype.pickle
optype.typing
Dependencies
- migrate from
codespell
totypos
by @jorenham in #213 - bump
basedmypy
to2.8.0
andbasedpyright
to1.22.1
by @jorenham in #218 - update development dependencies by @jorenham in #223
Continuous integration
- test & typecheck all of the supported numpy versions by @jorenham in #227
- PyPI trusted publishing by @jorenham in #234
Other Changes
- update the security policy by @jorenham in #216
- automatically generated release notes configuration by @jorenham in #233
New Contributors
Full Changelog: v0.7.3...v0.8.0
v0.7.3
Highlights
optype
is now onconda-forge
, thanks to @lucascolley (docs)- [
optype.numpy
] TheCanArrayND
type now optionally accepts a second shape-type argument (docs) - [
optype.numpy
] NewArray0D
andCanArray0D
aliases for 0-dimensional numpy arrays (not scalars) (docs) - [
optype.numpy
] NewTo*Strict{1,2,3}D
array-like types with "strict" shape, useful for non-overlapping shape-type overloads (docs)
Fixes
- Fix
ImportError
onpython >= 3.13
withouttyping_extensions
installed
What's Changed
- fix license metadata by @jorenham in #202
- bump
ruff
to0.8.1
by @jorenham in #203 - Conda installation instructions by @jorenham in #204
- fix
typing_extensions
import onpython>=3.13
by @jorenham in #205 - optional
onp.CanArrayND
shape-type param, improved shape-type compatibility by @jorenham in #206 onp.To*Strict{1,2,3}D
: array-like aliases with strict shape-type by @jorenham in #207- fix (more)
typing_extensions
imports onpython>=3.13
by @jorenham in #208 - 0-d numpy array aliases by @jorenham in #209
Full Changelog: v0.7.2...v0.7.3
v0.7.2
Highlights
optype.numpy.To*3D
- Array-like aliases for 3-D array-likes (docs)optype.numpy.ToJustInt*
- Scalar- and array-like aliases for just integer array-likes, i.e.bool
andnp.bool_
will be rejected (docs)
Fixes
What's Changed
ruff 0.8.0
andbasedpyright 1.22.0
by @jorenham in #195- workaround for a mypy bug with recursive sequences types by @jorenham in #196
- export
SequenceND
fromoptype.numpy
by @jorenham in #197 - 3-d aliases for arrays and array-likes in
optype.numpy
by @jorenham in #198 ToJustInt
scalar- and array-likes inoptype.numpy
by @jorenham in #199
Full Changelog: v0.7.1...v0.7.2