Skip to content

Releases: jorenham/optype

v0.11.0

09 Jul 16:28
v0.11.0
5ea0cae
Compare
Choose a tag to compare

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 without None by @jorenham in #346

Dependencies

Continuous integration

  • use github.ref instead of github.sha in the concurrency.group of CI by @jorenham in #337

Other Changes

Full Changelog: v0.10.0...v0.11.0

v0.10.0

28 May 22:42
v0.10.0
833e10c
Compare
Choose a tag to compare

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 in optype.numpy.compat by @jorenham in #326
  • ToJustInt64 numpy array-like aliases for int64 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 #331
  • optype.numpy.SequenceND compatibility with numpy by @jorenham in #332

Dependencies

Continuous integration

Other Changes

Full Changelog: v0.9.3...v0.10.0

v0.9.3

31 Mar 16:59
v0.9.3
4ddfa90
Compare
Choose a tag to compare

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 to To{}ND by @jorenham in #308

Other Changes

Full Changelog: v0.9.2...v0.9.3

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