TODO

v2

We will be moving away from using nptyping in v2.0.0.

It was written for an older era in python before the dramatic changes in the Python type system and is no longer actively maintained. We will be reimplementing a syntax that extends its array specification syntax to include things like ranges and extensible dtypes with varying precision (and is much less finnicky to deal with).

Validation

Todo

Support pydantic value/range constraints - less than, greater than, etc.

Todo

Support different precision modes - eg. exact precision, or minimum precision where specifying a float32 would also accept a float64, etc.

Metadata

Todo

Use names in nptyping annotations in generated JSON schema metadata

All TODOs

Todo

To better support static type hinting and inspection (ie. so the type checker is not only aware of the union of all return_types, but the specific array type that was passed on model instantiation, as well as potentially do shape and dtype checks during type checking (eg. so a wrongly shaped or dtyped array assignment will be highlighted as wrong), we will be exploring adding mypy/pylance/pyright hooks for dynamic type evaluation.

original entry

Todo

NWB Compatibility

Precision: NWB allows for a sort of hierarchy of type specification - a less precise type also allows the data to be specified in a more precise type

original entry

Todo

Sorry this is unreadable, need to recall how to change the theme for generated mermaid diagrams but it is very late and i want to push this.

original entry

Todo

Future versions will support interfaces providing type maps for declaring equality between dtypes that may be specific to that library but should be considered equivalent to numpy or other library’s dtypes.

original entry

Todo

Future versions will also support declaring minimum or maximum precisions, so one might say “at least a 16-bit float” and also accept a 32-bit float.

original entry

Todo

numpydantic currently does not support structured dtypes or numpy.recarray specifications like nptyping does. It will in future versions.

original entry

Todo

numpydantic also does not support the variable shape definition form like

Shape['Dim, Dim']

where there are two dimensions of any shape as long as they are equal because at the moment it appears impossible to express dynamic constraints (ie. minItems/maxItems that depend on the shape of another array) in JSON Schema. A future minor version will allow them by generating a JSON schema with a warning that the equal shape constraint will not be represented.

See: https://github.com/orgs/json-schema-org/discussions/730

original entry

Todo

Support pydantic value/range constraints - less than, greater than, etc.

original entry

Todo

Support different precision modes - eg. exact precision, or minimum precision where specifying a float32 would also accept a float64, etc.

original entry

Todo

Use names in nptyping annotations in generated JSON schema metadata

original entry