Decorator library: numpy_fn/torch_fn/pandas_fn/xarray_fn/signal_fn type converters, caching, batching, deprecation — standalone module from the SciTeX ecosystem
Project description
scitex-decorators
Decorator library — type conversion (numpy/torch/pandas/xarray), caching, batching, lifecycle.
Full Documentation · pip install scitex-decorators
Installation
pip install scitex-decorators # core (numpy only)
pip install "scitex-decorators[caching]" # + joblib for cache_disk
pip install "scitex-decorators[torch]" # + torch_fn / batch_torch_fn
pip install "scitex-decorators[all]" # everything
Quick Start
import scitex_decorators as dec
@dec.numpy_fn
def kernel(x):
return x ** 2 # x is numpy inside; return matches caller's type
@dec.cache_disk
def expensive(x): ...
1 Interfaces
Python API
import scitex_decorators as dec
# Type-conversion decorators
@dec.numpy_fn ; @dec.torch_fn ; @dec.pandas_fn ; @dec.xarray_fn
@dec.signal_fn
# Caching (joblib for disk, dict for mem)
@dec.cache_disk ; @dec.cache_disk_async ; @dec.cache_mem
# Batching
@dec.batch_fn ; @dec.batch_numpy_fn / batch_torch_fn / batch_pandas_fn
# Lifecycle
@dec.deprecated(reason="…")
@dec.not_implemented
@dec.preserve_doc
@dec.timeout(seconds=10)
@dec.wrap
# Auto-ordering machinery
dec.enable_auto_order() ; dec.disable_auto_order()
# Conversion helpers
dec.to_numpy(x) ; dec.to_torch(x)
dec.is_torch(x) ; dec.is_cuda(x)
Cache directory resolution
cache_disk / cache_disk_async resolve the cache dir in this order:
scitex.config.get_paths().function_cache(only if scitex is installed)${SCITEX_CACHE_DIR}/function_cache${XDG_CACHE_HOME}/scitex-decorators/function_cache~/.cache/scitex-decorators/function_cache
So the package works without the umbrella scitex installed.
Status
Standalone fork of scitex.decorators. Zero scitex.* runtime deps. The
umbrella package's scitex.decorators import path is preserved via a
sys.modules-alias bridge.
Part of SciTeX
scitex-decorators 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
Release history Release notifications | RSS feed
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_decorators-0.1.9.tar.gz.
File metadata
- Download URL: scitex_decorators-0.1.9.tar.gz
- Upload date:
- Size: 32.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41a63b4d93a985f7a7b6bab72ce62f8485a73919124d0ad48f1a939211f38d97
|
|
| MD5 |
c5a0c82ef09fda5a19ea7c2eac445c44
|
|
| BLAKE2b-256 |
f22c54bfded794b294acc5e06ce84a5a7d4e6ff5d1404fb2592716ba1373f53d
|
Provenance
The following attestation bundles were made for scitex_decorators-0.1.9.tar.gz:
Publisher:
publish-pypi.yml on ywatanabe1989/scitex-decorators
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scitex_decorators-0.1.9.tar.gz -
Subject digest:
41a63b4d93a985f7a7b6bab72ce62f8485a73919124d0ad48f1a939211f38d97 - Sigstore transparency entry: 1417558048
- Sigstore integration time:
-
Permalink:
ywatanabe1989/scitex-decorators@2f1be8eacd71a112ce94b2ba2ce8ff78e04bba37 -
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@2f1be8eacd71a112ce94b2ba2ce8ff78e04bba37 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file scitex_decorators-0.1.9-py3-none-any.whl.
File metadata
- Download URL: scitex_decorators-0.1.9-py3-none-any.whl
- Upload date:
- Size: 40.0 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 |
0ccb68236016275a313c8d06ce67917a1efee42f52c96984a00f80d71cde1808
|
|
| MD5 |
daf139d79b24dfb296922ecdcf44c75a
|
|
| BLAKE2b-256 |
b41833a662bcb1fe820c3c7ff7d40daa45cd7fab5b383dcd6f3cf6c69bff0af8
|
Provenance
The following attestation bundles were made for scitex_decorators-0.1.9-py3-none-any.whl:
Publisher:
publish-pypi.yml on ywatanabe1989/scitex-decorators
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scitex_decorators-0.1.9-py3-none-any.whl -
Subject digest:
0ccb68236016275a313c8d06ce67917a1efee42f52c96984a00f80d71cde1808 - Sigstore transparency entry: 1417558055
- Sigstore integration time:
-
Permalink:
ywatanabe1989/scitex-decorators@2f1be8eacd71a112ce94b2ba2ce8ff78e04bba37 -
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@2f1be8eacd71a112ce94b2ba2ce8ff78e04bba37 -
Trigger Event:
workflow_dispatch
-
Statement type: