Skip to content

Releases: jorenham/optype

v0.9.2

12 Mar 22:14
v0.9.2
fac2fa2
Compare
Choose a tag to compare

What's Changed

optype

optype.numpy

Dependencies

Other Changes

Full Changelog: v0.9.1...v0.9.2

v0.9.1

05 Feb 15:17
v0.9.1
f6abd80
Compare
Choose a tag to compare

What's Changed

optype.numpy

Dependencies

Other Changes

Full Changelog: v0.9.0...v0.9.1

v0.9.0

21 Jan 15:06
v0.9.0
c885a31
Compare
Choose a tag to compare

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 like DEFAULT = 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 of op.Just*.

What's Changed

optype

optype.numpy

  • prefer Just{Float,Complex} over Just[{float,complex}] in optype.numpy by @jorenham in #240
  • add the missing Just types to onp.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

Continuous integration

Other Changes

Full Changelog: v0.8.0...v0.9.0

v0.8.0

28 Dec 07:25
v0.8.0
f026d89
Compare
Choose a tag to compare

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} for np.int_ by @jorenham in #224
  • include opt.Just[{int,float,complex}] in onp.Any{Int,Float,Complex}{Array,DType} by @jorenham in #225
  • new onp.compat module, and Any as shape-type default on numpy<2.1 by @jorenham in #226
  • new onp.Matrix and onp.MArray[{0,1,2,3}D] aliases by @jorenham in #228
  • onp.AnyBytes8DType for np.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

  • add JustFloat and JustComplex to optype.typing by @jorenham in #215

Dependencies

Continuous integration

Other Changes

New Contributors

Full Changelog: v0.7.3...v0.8.0

v0.7.3

30 Nov 23:28
v0.7.3
2438b36
Compare
Choose a tag to compare

Highlights

  • optype is now on conda-forge, thanks to @lucascolley (docs)
  • [optype.numpy] The CanArrayND type now optionally accepts a second shape-type argument (docs)
  • [optype.numpy] New Array0D and CanArray0D aliases for 0-dimensional numpy arrays (not scalars) (docs)
  • [optype.numpy] New To*Strict{1,2,3}D array-like types with "strict" shape, useful for non-overlapping shape-type overloads (docs)

Fixes

  • Fix ImportError on python >= 3.13 without typing_extensions installed

What's Changed

Full Changelog: v0.7.2...v0.7.3

v0.7.2

24 Nov 23:47
v0.7.2
98c8dfa
Compare
Choose a tag to compare

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 and np.bool_ will be rejected (docs)

Fixes

  • #194 - workaround for a mypy bug with recursive sequences types

What's Changed

  • ruff 0.8.0 and basedpyright 1.22.0 by @jorenham in #195
  • workaround for a mypy bug with recursive sequences types by @jorenham in #196
  • export SequenceND from optype.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 in optype.numpy by @jorenham in #199

Full Changelog: v0.7.1...v0.7.2

v0.7.1

19 Nov 15:20
v0.7.1
ef6d11b
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.7.0...v0.7.1

v0.7.0

19 Nov 14:21
v0.7.0
487055a
Compare
Choose a tag to compare

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 and JustInt in optype.typing (docs)

What's Changed

New Contributors

Full Changelog: v0.6.1...v0.7.0

v0.6.1

19 Aug 01:12
Compare
Choose a tag to compare

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

What's Changed

Full Changelog: v0.6.0...v0.6.1

v0.6.0

17 Aug 14:29
ce4cfd1
Compare
Choose a tag to compare

Highlights

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 and CanReplace from optype._ to optype.copy._
  • Moved HasDataclassFields from optype._ to optype.dataclasses._
  • Moved CanGetnewargs[Ex], CanReduce[Ex], and Can{Get,Set}state from optype._ to optype.pickle._
  • Any*Array and Any*DType for int_, float64 and complex128 don't include int, float, and complex anymore. See numpy/numpy#27032 (comment) for why this was done.

Full Changelog: v0.5.0...v0.6.0