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 extracted from the SciTeX ecosystem as a standalone package.
Install
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
API
import scitex_decorators as dec
# Type-conversion decorators (cast args before calling, restore after)
@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
# Misc
@dec.deprecated(reason="…")
@dec.not_implemented
@dec.preserve_doc
@dec.timeout(seconds=10)
@dec.wrap
# Auto-ordering machinery (advanced)
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) ; dec.is_nested_decorator(...)
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.
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.3.tar.gz.
File metadata
- Download URL: scitex_decorators-0.1.3.tar.gz
- Upload date:
- Size: 29.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b83595c3d645cfb3913d4879228c253dfdd8671fd59ea71c6ea1d82e87469733
|
|
| MD5 |
ed1dfe78695be41e43513a9d1051ac02
|
|
| BLAKE2b-256 |
898a3fe7ba6f92cc4d8557d2d49d18098d7f1e26c21d37f01558745adc8c38ea
|
Provenance
The following attestation bundles were made for scitex_decorators-0.1.3.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.3.tar.gz -
Subject digest:
b83595c3d645cfb3913d4879228c253dfdd8671fd59ea71c6ea1d82e87469733 - Sigstore transparency entry: 1396187295
- Sigstore integration time:
-
Permalink:
ywatanabe1989/scitex-decorators@e5fb8a7f44d5b6572ef2837c04ce809461437a84 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/ywatanabe1989
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@e5fb8a7f44d5b6572ef2837c04ce809461437a84 -
Trigger Event:
push
-
Statement type:
File details
Details for the file scitex_decorators-0.1.3-py3-none-any.whl.
File metadata
- Download URL: scitex_decorators-0.1.3-py3-none-any.whl
- Upload date:
- Size: 37.2 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 |
1f7199f809606fa1508a8e6c3940603f386ba005139f36e506bd347088cde056
|
|
| MD5 |
5ae52c42e658823e2716296cc1ff135d
|
|
| BLAKE2b-256 |
970527298d10d6d6dbd68578867cedc240b703dee65ce7fcf80a5fa4b6039e09
|
Provenance
The following attestation bundles were made for scitex_decorators-0.1.3-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.3-py3-none-any.whl -
Subject digest:
1f7199f809606fa1508a8e6c3940603f386ba005139f36e506bd347088cde056 - Sigstore transparency entry: 1396187305
- Sigstore integration time:
-
Permalink:
ywatanabe1989/scitex-decorators@e5fb8a7f44d5b6572ef2837c04ce809461437a84 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/ywatanabe1989
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@e5fb8a7f44d5b6572ef2837c04ce809461437a84 -
Trigger Event:
push
-
Statement type: