Skip to main content

Scientific type definitions (ArrayLike, ColorLike) and validation

Project description

scitex-types

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.2.tar.gz (27.2 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.2-py3-none-any.whl (19.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: scitex_types-0.1.2.tar.gz
  • Upload date:
  • Size: 27.2 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.2.tar.gz
Algorithm Hash digest
SHA256 a1a0871732a66ac83b14ad7fc46cb151cbfe54547ee69e7b802687f72755a3bc
MD5 ca5e688891b4375b5bafd371aec0580b
BLAKE2b-256 d7653d48c625bcc4bbe957e4228a7fab0377e533c8a9b14f133a97a9d82f962d

See more details on using hashes here.

Provenance

The following attestation bundles were made for scitex_types-0.1.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: scitex_types-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 19.1 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8c60563a8c3128c2dad1739a0a207d5bba1ea363c7a3fb0f08047cd5d87869e6
MD5 fb64f5fa8fb383db7fab3f5ff71703b9
BLAKE2b-256 ad32661811e933e1d52d5f493c6c210f62539ff92d94a69f2ce8b8f2953d692c

See more details on using hashes here.

Provenance

The following attestation bundles were made for scitex_types-0.1.2-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