maximus-python-scientific
Skill1 starsChanged 4 months agoMITView on GitHub
Reproducible Python for science, ML, and data analysis: pinned deps, fixed seeds, versioned data (DVC), config files, MLflow, CI checks, Docker/Binder. Use for 'reproducible', 'experiment', 'research code', 'paper results', 'Jupyter to production', or pipelines that will run more than once.
- Installs packages
In this repository49 other files it gives its agents.
- core/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- file-opsSkill
- maximus-agent-designSkill
- maximus-ai-cost-controlSkill
- maximus-ai-data-pipelineSkill
- maximus-ai-fluency-for-buildersSkill
- maximus-ai-product-specSkill
- maximus-ai-safety-governanceSkill
- maximus-ai-ux-patternsSkill
- maximus-brainSkill
- maximus-build-featureSkill
- maximus-chain-of-verificationSkill
- maximus-code-reviewSkill
- maximus-contact-intelligenceSkill
- maximus-counterparty-discoverySkill
- maximus-debug-incidentSkill
- maximus-deep-research-proSkill
- maximus-deep-researchSkill
- maximus-design-specSkill
- maximus-devops-shipSkill
- maximus-eval-and-testSkill
- maximus-fine-tuningSkill
- maximus-fintech-paymentsSkill
- maximus-investigative-researchSkill
- maximus-k3-model-selectionSkill
- maximus-k3-self-hostingSkill
- maximus-literature-reviewSkill
- maximus-llm-model-selectionSkill
- maximus-local-research-assistantSkill
- maximus-local-research-assistantSkill
- maximus-mlops-deploySkill
- maximus-ollama-opsSkill
- maximus-openclaw-localSkill
- maximus-people-finder-recruiterSkill
- maximus-people-finderSkill
- maximus-plan-implementationSkill
- maximus-prompt-engineeringSkill
- maximus-rag-pipelineSkill
- maximus-replit-handoff-proSkill
- maximus-slm-evalSkill
- maximus-slm-local-finetuneSkill
- maximus-slm-local-stackSkill
- maximus-slm-tool-callingSkill
- maximus-transaction-analystSkill
- maximus-write-articleSkill
- memory-keeperSkill
- skill-templateSkill
- web-researchSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 27
If any pillar is missing, results are not reproducible.
- Very specific: line 33
Use a virtual environment per project: python -m venv .venv or uv venv.
- Very specific: line 71
Notebooks are for exploration, not production: When a notebook's logic is final, extract functions into src/ modules and call them from a …
- Very specific: line 84
No hard-coded paths, thresholds, or hyperparameters in code.
- Distinctive: line 95
Commit configs to git. Every result traces back to a config + a git SHA.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Maximus — Python Scientific & Reproducible Pipelines
A scientific result is only as credible as its reproducibility. A pipeline that only runs on the author's laptop is folklore, not science. This skill is the discipline that makes Python work re-executable by anyone, including future-you.
When to use
- Building any analysis, experiment, or model that produces results others (or future-you) need to reproduce.
- Promoting an exploratory Jupyter notebook to production or to a paper submission.
- The user mentions: research, paper, journal, experiment, reproducibility, seeds, DVC, MLflow, deterministic, Binder, Zenodo, or "make this reproducible".
- Building a data pipeline that will run on a schedule or be handed off to a teammate.
The four pillars of reproducibility
- Locked environment — exact library versions captured.
- Versioned code — full git history; tagged releases for submissions.
- Versioned data — provenance, checksums, and ideally DVC or git-LFS.
- Automated, single-command pipeline —
make allorpython run.pyreproduces everything from raw data to final outputs.
If any pillar is missing, results are not reproducible. Period.
Procedure
1. Environment lock
- Use a virtual environment per project:
python -m venv .venvoruv venv. Activate before any install. - Pin exact versions in
requirements.txt(orpyproject.tomlwith a lock file).numpy==1.26.4, notnumpy>=1.26. - Record the Python version:
python --version >> environment_info.txt. Record OS and arch — results can differ between Linux/macOS and x86/ARM. - For team or paper-grade reproducibility, ship a
Dockerfile:FROM python:3.12-slim WORKDIR /app COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY . . CMD ["python", "run_analysis.py"]
2. Seeds and determinism
Set seeds at the top of every entry-point script:
import os, random
import numpy as np
SEED = 42
os.environ["PYTHONHASHSEED"] = "0"
random.seed(SEED)
np.random.seed(SEED)
# rng = np.random.default_rng(SEED) # preferred for new code
# Framework-specific
# torch.manual_seed(SEED); torch.cuda.manual_seed_all(SEED); torch.use_deterministic_algorithms(True)
# tf.random.set_seed(SEED)
# sklearn: pass random_state=SEED to every estimator and splitReport the seed in the methods section / README so exact reproduction is possible.
3. Code structure
data/(raw, immutable; gitignored or DVC-tracked),src/(pipeline code as importable modules),notebooks/(exploration only, never production),tests/,configs/,results/(generated, gitignored),Dockerfile,Makefile,README.md.- Notebooks are for exploration, not production. When a notebook's logic is final, extract functions into
src/modules and call them from a slim driver script. Then write a unit test against the extracted function. - Pipeline as a sequence of pure functions:
raw = load_data(cfg.input_path) clean = clean_data(raw) features = build_features(clean, cfg) model = train(features, cfg) save_results(model, evaluate(model, features), cfg.output_path) - Checkpoints between expensive steps:
cleaned.to_parquet("checkpoints/01_cleaned.parquet"). Add a--resumeflag that skips completed checkpoints.
4. Configuration
- No hard-coded paths, thresholds, or hyperparameters in code. Put them in
configs/<name>.yaml:seed: 42 data: input: data/raw/observations.csv train_split: 0.8 model: type: random_forest n_estimators: 200 - Load with
yaml.safe_load. Pass the loaded config object through the pipeline. - Commit configs to git. Every result traces back to a config + a git SHA.
5. Data versioning and provenance
- Raw data is immutable. Never edit raw files; transformations write to
data/processed/. - Record provenance: URL/query, download date, and checksum.
import hashlib with open("data/raw/observations.csv", "rb") as f: checksum = hashlib.sha256(f.read()).hexdigest() - For large data, use DVC or git-LFS to version files alongside code without bloating git.
6. Testing
- Unit tests for every transformer in
src/: given known input, produce known output. - Schema and null-rate tests at the data-loading boundary (pandera, great_expectations, or a hand-rolled check). Bad data is the most common silent failure.
- End-to-end smoke test on a tiny sample dataset — runs in seconds, exercises the full pipeline. Wire it to CI.
7. CI
- GitHub Actions workflow that installs the locked environment, runs unit tests, then runs the end-to-end smoke pipeline on each push. This catches reproducibility-breaking changes immediately rather than during peer review.
8. Packaging for sharing
- For a paper/journal submission: archive on Zenodo or Figshare to get a DOI. Include raw data (or instructions to obtain), all code, environment files, README with run instructions, and expected outputs for verification.
- For interactive sharing: add a
requirements.txtand a Binder badge.
9. ML-specific additions
- Versioned experiments: MLflow or Weights & Biases. Log every run with seed, config, git SHA, metrics, and artifact paths.
- Data validation gate: schema + distribution check before the model trains. Block the run if it fails.
- Model evaluation gate: defined threshold a candidate must beat to be promoted. Automated; not a human eyeball.
- Pipeline object, not loose transforms:
sklearn.pipeline.Pipelineor equivalent — bake every transform into the same object you serialize, so train-time and inference-time transforms cannot diverge. - No hard-coded column names in transformers. Pull column lists from config or from the schema.
Gotchas
- Notebook-only science doesn't reproduce. Extract functions and test them.
numpy>=1.26is not a pin. Use==.- Forgetting
random_state=on a single sklearn estimator makes the whole pipeline non-deterministic. - Editing raw data files destroys provenance. Raw is immutable; transformations write elsewhere.
- Hard-coded paths turn a portable pipeline into a personal one. Configs always.
- Missing the Docker image means another machine's library mix breaks your numerical results in ways that are hours to diagnose.
- Skipping the data-validation gate lets bad data train silently bad models.
Output
A reproducible project tree (or PR adding the reproducibility layer to an existing one): requirements.txt or lock, Dockerfile, configs/, src/, tests/, Makefile, README.md with the exact reproduction commands. Final chat summary lists: pinned versions count, seed-set locations, CI status, and the single command to reproduce.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

