Scientific type definitions (ArrayLike, ColorLike) and validation
Project description
scitex-types
Scientific type aliases (ArrayLike, ColorLike) + runtime validation predicates.
Full Documentation · pip install scitex-types
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
# Optional extras:
pip install scitex-types[numpy,pandas]
pip install scitex-types[all]
Quick Start
from scitex_types import ArrayLike, is_array_like, is_list_of_type
def process(data: ArrayLike) -> None: ...
is_array_like([1, 2, 3]) # True
is_list_of_type([1, 2, 3], int) # True
1 Interfaces
Python API
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_array_like("not array") # False
is_list_of_type([1, 2, 3], int) # True
is_list_of_type([1, "x"], int) # False
Part of SciTeX
scitex-types is part of SciTeX.
Four Freedoms for Research
- The freedom to run your research anywhere — your machine, your terms.
- The freedom to study how every step works — from raw data to final manuscript.
- The freedom to redistribute your workflows, not just your papers.
- The freedom to modify any module and share improvements with the community.
AGPL-3.0 — because we believe research infrastructure deserves the same freedoms as the software it runs on.
License
AGPL-3.0-only (see LICENSE).
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scitex_types-0.1.4.tar.gz.
File metadata
- Download URL: scitex_types-0.1.4.tar.gz
- Upload date:
- Size: 394.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5a4556f78a5ef8422b79fe4c4c699a3885aa7a7984a789fae1bd86e1b3d78fb
|
|
| MD5 |
c30d9a12abba71098b390c4b7b51fd3b
|
|
| BLAKE2b-256 |
b350e3772d72c211002e839f2ad764c199ddbcf9e28d787648faee836e38b0f4
|
Provenance
The following attestation bundles were made for scitex_types-0.1.4.tar.gz:
Publisher:
publish-pypi.yml on ywatanabe1989/scitex-types
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scitex_types-0.1.4.tar.gz -
Subject digest:
d5a4556f78a5ef8422b79fe4c4c699a3885aa7a7984a789fae1bd86e1b3d78fb - Sigstore transparency entry: 1417515427
- Sigstore integration time:
-
Permalink:
ywatanabe1989/scitex-types@e6e88920df09d70698aea0b45a24474eec67d6b7 -
Branch / Tag:
refs/heads/develop - Owner: https://github.com/ywatanabe1989
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@e6e88920df09d70698aea0b45a24474eec67d6b7 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file scitex_types-0.1.4-py3-none-any.whl.
File metadata
- Download URL: scitex_types-0.1.4-py3-none-any.whl
- Upload date:
- Size: 20.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9c466a3b838a73cefcccddb006813f30aee54b42da488fb11537afcd87c78d8
|
|
| MD5 |
bef8b669a8abd38300a381c11714ac1b
|
|
| BLAKE2b-256 |
b98c5940e4d6e7efbbb6df65dbfd1eba572867a415d5c72299cf7a2df00f5d38
|
Provenance
The following attestation bundles were made for scitex_types-0.1.4-py3-none-any.whl:
Publisher:
publish-pypi.yml on ywatanabe1989/scitex-types
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scitex_types-0.1.4-py3-none-any.whl -
Subject digest:
a9c466a3b838a73cefcccddb006813f30aee54b42da488fb11537afcd87c78d8 - Sigstore transparency entry: 1417515526
- Sigstore integration time:
-
Permalink:
ywatanabe1989/scitex-types@e6e88920df09d70698aea0b45a24474eec67d6b7 -
Branch / Tag:
refs/heads/develop - Owner: https://github.com/ywatanabe1989
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@e6e88920df09d70698aea0b45a24474eec67d6b7 -
Trigger Event:
workflow_dispatch
-
Statement type: