Metadata-Version: 2.4
Name: scitex-types
Version: 0.1.2
Summary: Scientific type definitions (ArrayLike, ColorLike) and validation
Project-URL: Homepage, https://github.com/ywatanabe1989/scitex-types
Project-URL: Repository, https://github.com/ywatanabe1989/scitex-types
Project-URL: Issues, https://github.com/ywatanabe1989/scitex-types/issues
Author: Yusuke Watanabe
License-Expression: AGPL-3.0
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.10
Provides-Extra: all
Requires-Dist: numpy; extra == 'all'
Requires-Dist: pandas; extra == 'all'
Requires-Dist: torch; extra == 'all'
Requires-Dist: xarray; extra == 'all'
Provides-Extra: dev
Requires-Dist: numpy; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: pytest-cov; extra == 'dev'
Provides-Extra: numpy
Requires-Dist: numpy; extra == 'numpy'
Provides-Extra: pandas
Requires-Dist: pandas; extra == 'pandas'
Provides-Extra: torch
Requires-Dist: torch; extra == 'torch'
Provides-Extra: xarray
Requires-Dist: xarray; extra == 'xarray'
Description-Content-Type: text/markdown

# 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

```bash
pip install scitex-types
```

With optional dependencies:

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

## Usage

```python
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
```
