Skip to main content

Scientific type definitions (ArrayLike, ColorLike) and validation

Project description

scitex-types

PyPI Python Tests Install Test Coverage Docs License: AGPL v3

Scientific type definitions (ArrayLike, ColorLike) and validation utilities.

Interfaces: Python ⭐⭐⭐ (primary) · CLI — · MCP — · Skills ⭐ · Hook — · HTTP —

Problem and Solution

# Problem Solution
1 numpy.typing.ArrayLike covers only NumPy -- functions that also accept Torch/DataFrame/Series need a hand-rolled Union ArrayLike, ColorLike -- stable aliases spanning list/tuple/np.ndarray/pd.DataFrame/pd.Series/xr.DataArray/torch.Tensor + matplotlib color inputs
2 Runtime "is this a list of floats?" is a 3-line comprehension is_array_like(), is_list_of_type(lst, float) -- clear predicates, no isinstance chain

Installation

pip install scitex-types

With optional dependencies:

pip install scitex-types[numpy,pandas]
pip install scitex-types[all]

Usage

from scitex_types import ArrayLike, ColorLike, is_array_like, is_list_of_type

# Type annotations
def process(data: ArrayLike) -> None: ...
def set_color(c: ColorLike) -> None: ...

# Runtime checks
is_array_like([1, 2, 3])           # True
is_list_of_type([1, 2, 3], int)    # True

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scitex_types-0.1.3.tar.gz (30.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scitex_types-0.1.3-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

Details for the file scitex_types-0.1.3.tar.gz.

File metadata

  • Download URL: scitex_types-0.1.3.tar.gz
  • Upload date:
  • Size: 30.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for scitex_types-0.1.3.tar.gz
Algorithm Hash digest
SHA256 142c200ef11aa85023baf00ac5475a0e201c4cf8336e5f9e6ea49a2733c1de47
MD5 5343620ea82d4e85de9bfd06cf1fd1eb
BLAKE2b-256 945c8d4a68c2846a1674b96fbbe381a15b7d2040af5617bcabd41d1d8b65fc1c

See more details on using hashes here.

Provenance

The following attestation bundles were made for scitex_types-0.1.3.tar.gz:

Publisher: publish-pypi.yml on ywatanabe1989/scitex-types

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scitex_types-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: scitex_types-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 19.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for scitex_types-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 336df9d74bb8bb1e2debada008c7028bc7c32a4e71c0e87cb9e2e5c57d4bb9f6
MD5 e274bb3465f68d20664e6a34b8749f8d
BLAKE2b-256 77216274c323e54b1ce68ef40b5a674f0cc4c7296af0c331ed4a069e774d63a9

See more details on using hashes here.

Provenance

The following attestation bundles were made for scitex_types-0.1.3-py3-none-any.whl:

Publisher: publish-pypi.yml on ywatanabe1989/scitex-types

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page