Releases: jorenham/optype
Releases · jorenham/optype
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
v0.7.1
v0.7.0
Highlights
- [BREAKING] The
optype.numpy.Any*
aliases no longer accept bare scalars types - Coercible scalar- and array-like type aliases
optype.numpy.Array{1,2,3,N}D
(docs) - The new
optype.dlpack
module with DLPack types and enums (docs) - Improved the readability of the
optype.numpy
types - Experimental
Just
andJustInt
inoptype.typing
(docs)
What's Changed
- development dependency updates by @jorenham in #160
- native toml tox config by @jorenham in #161
- switch from
poetry
touv
by @jorenham in #162 - switch from single to double quotes for black compatibility by @jorenham in #163
- enforce
ruff format
by @jorenham in #164 - clean up the internal module structure by @jorenham in #165
- update pre-commit hooks by @pre-commit-ci in #166
- update development dependencies by @jorenham in #168
optype.dlpack
: DLPack types and enums by @jorenham in #169optype.array_api
- dtypes by @jorenham in #170- Revert "
optype.array_api
- dtypes" by @jorenham in #176 - PEP 735 dependency groups, and fixed mypy config by @jorenham in #177
- fix
optype.numpy.CanArray
by @jorenham in #178 optype.types.Deprecated
by @jorenham in #179- simplified
optype.numpy
dtypes by @jorenham in #182 - fix and improve the
optype.numpy.Any*
docs by @jorenham in #183 - improve readability of
optype.numpy
type aliases and protocols by @jorenham in #184 optype.numpy.Array{1,2,3,N}D
aliases by @jorenham in #185- workaround a PEP 696 bug in
typing_extensions.Protocol
affectingCanSequence
by @jorenham in #186 - add SPEC 0 badge by @jorenham in #187
- bump
basedpyright
to1.21.1
(pyright 1.1.389
) by @jorenham in #188 - bump
ruff
to0.7.4
by @jorenham in #189 - experimental
Just
andJustInt
types inoptype.typing
by @jorenham in #191 optype.numpy.To*
coercible scalar- and array-likes by @jorenham in #192
New Contributors
- @pre-commit-ci made their first contribution in #166
Full Changelog: v0.6.1...v0.7.0
v0.6.1
This is a bugfix release with no breaking changes.
However, because optype
now uses less typing.Any
, which could cause type-checkers to report errors that were previously hidden.
Highlights
- Stricter type-checking with basedmypy.
- Removed almost all
typing.Any
uses. See numpy/numpy#27211 for whyAny
is evil. - Fixed several typing errors with numpy 2.1.
What's Changed
- Farewell git-flow by @jorenham in #151
- Add security policy by @jorenham in #152
- Add a sponsor button by @jorenham in #153
- basedmypy by @jorenham in #154
- Bump NumPy to 2.1.0 by @jorenham in #155
- basedmypy badge by @jorenham in #156
- optype 0.6.1 by @jorenham in #157
Full Changelog: v0.6.0...v0.6.1
v0.6.0
Highlights
- Mypy support (strict mode)
- Beartype support
- New standard library modules
- Improvements to
optype.numpy
(it's still optional)- NumPy 2.1 support
- Improved docs
- Shape type aliases`
- Support for
numpy.dtypes.StringDType
(numpy >= 2
) - Reworked
Any*Array
andAny*DType
Breaking changes
- Increased the minimum Python version from 3.10.0 to 3.10.1
- Increased the minimum
typing_extensions
version from 4.7 to 4.8 - Moved
CanCopy
,CanDeepcopy
andCanReplace
fromoptype._
tooptype.copy._
- Moved
HasDataclassFields
fromoptype._
tooptype.dataclasses._
- Moved
CanGetnewargs[Ex]
,CanReduce[Ex]
, andCan{Get,Set}state
fromoptype._
tooptype.pickle._
Any*Array
andAny*DType
forint_
,float64
andcomplex128
don't includeint
,float
, andcomplex
anymore. See numpy/numpy#27032 (comment) for why this was done.
Full Changelog: v0.5.0...v0.6.0