Reproducibility utilities (random state, timestamps, hashing)
Project description
scitex-repro
Reproducibility utilities — RNG seeding, ID generation, timestamps, array hashing.
Full Documentation · uv pip install scitex-repro[all]
Problem and Solution
| # | Problem | Solution |
|---|---|---|
| 1 | "Seed everything" requires 5+ lines of boilerplate — random.seed() + np.random.seed() + torch.manual_seed() + torch.cuda.manual_seed_all() + tf.random.set_seed() + os.environ[PYTHONHASHSEED] |
RandomStateManager(seed=42) — one call seeds every framework detected in the env; .reset() rewinds mid-experiment |
| 2 | Experiment run directories collide — two parallel runs overwrite each other | gen_ID() + hash_array() — unique directory names like 20260423_2155_abc12345; deterministic array fingerprints for integrity checks |
Installation
pip install scitex-repro
Architecture
src/scitex_repro/
├── __init__.py # public re-exports
├── _RandomStateManager.py # cross-framework RNG seeding (random / numpy / torch / tf)
├── _gen_ID.py # 20260423_2155_<hash> directory IDs
├── _gen_timestamp.py # filesystem-safe timestamps
├── _hash_array.py # deterministic NumPy / pandas fingerprints
└── _config.py # env-var + config defaults
1 Interfaces
Python API
from scitex_repro import RandomStateManager, gen_ID, hash_array
# Cross-framework RNG seeding
rng = RandomStateManager(seed=42)
data = rng("data").random(100)
rng.verify(data, "my_data")
rng.reset()
# Deterministic IDs and array fingerprints
exp_id = gen_ID() # "20260423_2155_abc12345"
fingerprint = hash_array(data)
Demo
flowchart LR
seed["seed=42"] --> rsm["RandomStateManager"]
rsm --> py["random"]
rsm --> np["numpy"]
rsm --> torch["torch (cpu+cuda)"]
rsm --> tf["tensorflow"]
rsm --> hashenv["PYTHONHASHSEED"]
rsm --> data["rng('data').random(100)"]
data --> fp["hash_array(data)"]
rsm --> id["gen_ID()"]
id --> dir[("20260423_2155_abc12345/")]
fp --> integrity[("array fingerprint")]
Quick Start
from scitex_repro import RandomStateManager, gen_ID, hash_array
rng = RandomStateManager(seed=42)
data = rng("data").random(100)
print(gen_ID(), hash_array(data))
Part of SciTeX
scitex-repro is part of SciTeX. Install via
the umbrella with pip install scitex[repro] to use as
scitex.repro (Python) or scitex repro ... (CLI).
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_repro-0.1.5.tar.gz.
File metadata
- Download URL: scitex_repro-0.1.5.tar.gz
- Upload date:
- Size: 8.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc42d63ecccfc9ce53c2e0a4f8627a9323a92cd8b285983a96f9750ddf2890c9
|
|
| MD5 |
d9c8849e11fb43f2b37611d9c92a9fdc
|
|
| BLAKE2b-256 |
0ea666459971e65db369251b7e25785beb813a93c91a71c545f7d61fe1891131
|
Provenance
The following attestation bundles were made for scitex_repro-0.1.5.tar.gz:
Publisher:
pypi-publish-and-github-release-on-tag.yml on ywatanabe1989/scitex-repro
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scitex_repro-0.1.5.tar.gz -
Subject digest:
cc42d63ecccfc9ce53c2e0a4f8627a9323a92cd8b285983a96f9750ddf2890c9 - Sigstore transparency entry: 1568189347
- Sigstore integration time:
-
Permalink:
ywatanabe1989/scitex-repro@57a6722fc20a5ab416ab936da607c5c8949e075b -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/ywatanabe1989
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish-and-github-release-on-tag.yml@57a6722fc20a5ab416ab936da607c5c8949e075b -
Trigger Event:
push
-
Statement type:
File details
Details for the file scitex_repro-0.1.5-py3-none-any.whl.
File metadata
- Download URL: scitex_repro-0.1.5-py3-none-any.whl
- Upload date:
- Size: 8.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6410a31a19ebc32b22f324a90ccd44eaa6c635fb1512e04b31cf29291ebd46cf
|
|
| MD5 |
7eb2db395d546120da1acdf2dee79a8c
|
|
| BLAKE2b-256 |
524160dcde6fb8036e3db7b7ea2e9f038d1708722ce272428dd455eaee66a8e2
|
Provenance
The following attestation bundles were made for scitex_repro-0.1.5-py3-none-any.whl:
Publisher:
pypi-publish-and-github-release-on-tag.yml on ywatanabe1989/scitex-repro
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scitex_repro-0.1.5-py3-none-any.whl -
Subject digest:
6410a31a19ebc32b22f324a90ccd44eaa6c635fb1512e04b31cf29291ebd46cf - Sigstore transparency entry: 1568189488
- Sigstore integration time:
-
Permalink:
ywatanabe1989/scitex-repro@57a6722fc20a5ab416ab936da607c5c8949e075b -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/ywatanabe1989
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish-and-github-release-on-tag.yml@57a6722fc20a5ab416ab936da607c5c8949e075b -
Trigger Event:
push
-
Statement type: