LabChain: Enabling reproducible and modular scientific experiments in Python

Read full text
Authors: Manuel Couto, Javier Parapar, David E. Losada
Cited by: 2
References: 7

Abstract

Python’s flexibility accelerates research prototyping but frequently results in unmaintainable code and duplicated computational effort. The absence of software engineering practices in academic development leads to fragile experiments where even minor modifications require rerunning expensive computations from scratch. LabChain addresses this through a pipeline-and-filter architecture with hash-based caching that automatically identifies and reuses intermediate results. When evaluating multiple classifiers on the same embeddings, the framework computes embeddings once—regardless of how many classifiers are tested. This automatic reuse extends across research teams: if another researcher applies different models to the same preprocessed data, LabChain detects existing results and eliminates redundant computation. Beyond efficiency, the framework’s modular structure reduces technical debt that obscures experimental logic. Pipelines serialize to JSON for reproducibility and distributed execution across computational clusters. A mental health detection case study demonstrates dual impact: computational savings exceeding 12 hours per task with reduced CO 2 emissions, alongside substantial scientific improvements—performance gains up to 192.3% in some tasks. These improvements emerged from clearer experimental organization that exposed a critical preprocessing bug hidden in the original monolithic implementation. LabChain proves that software engineering discipline amplifies scientific discovery.

Fields of Study & Subjects

Scientific Computing and Data Management Computational Physics and Python Applications Machine Learning in Materials Science

Publication details

Journal / source
SoftwareX
Publisher
Elsevier BV
Volume
33
Pages
102543–102543
Publication date
1 February 2026
Language
EN