marca-workflow
Declarative, prefix-reusing workflow sweeps for MARCA. Problem-agnostic: it knows nothing about your algorithms -- only ports and variants.
You describe each step as a connector (named inputs/outputs, optional, with a list of variants to sweep). marca-workflow wires the steps by port name, topologically orders them, and sweeps every combination -- computing each shared prefix exactly once and reusing it for every child. The reuse is keyed on the chosen variant indices (a cheap token), never on a hash of the data, so large intermediate objects cost nothing to cache.
Why
A grid sweep A × B × C is a prefix tree: consecutive configurations share a
long prefix. Hand-written nested loops capture that reuse but are rigid — a new
step means editing the loop. marca-workflow keeps the reuse but makes the structure
declarative: add a step by appending one Step.
Example
from marca_workflow import Step, Pipeline
pipe = Pipeline([
Step("rank", run_rank, consumes=("rules", "measures"),
produces="ranked", variants=rankers),
Step("prune", run_prune, consumes=("ranked",),
produces="pruned", variants=pruners),
Step("clf", run_clf, consumes=("pruned",),
produces="model", variants=classifiers),
])
results = pipe.run(
seed={"rules": rules, "measures": im},
sink=lambda ctx: evaluate(ctx["model"]),
)
# [("BordaRank+M1Prune+OrdinalClassifier", <metric>), ...] one record per leaf
rank runs once per ranker, prune once per (ranker, pruner), clf once per
leaf — automatically.
The one rule: steps must be pure
fn(variant, *inputs) -> output must not mutate its inputs after returning
them. The executor memoizes and shares outputs across configurations; mutating a
shared output in place corrupts siblings. Purity is also what makes per-step
parallelism safe (see Step.parallel, reserved).
Concepts
- Port — a named value in the run context. A step
producesone port andconsumeszero or more. Ports not produced by any step are seeds, supplied torun. - Variant — one choice on a step's sweep axis.
variants=(None,)is a step with no algorithm choice (a fixed transform). - Optional step —
optional=True: when the chosen variant isNonethe step is skipped and its output is taken fromfallback. PutNoneinvariantsto sweep "with and without" the step. - Wiring is implicit —
consumes/producesnames form the DAG; declaration order does not matter, dependencies decide execution order.
Validation rejects duplicate writers, cycles, unreachable fallbacks, and missing seeds with clear errors.
Metadata
Release files for marca-workflow 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| marca_workflow-0.1.1.tar.gz | 7.9 kB | Without provenance | Details for marca_workflow-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| marca_workflow-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for marca_workflow-0.1.1-py3-none-any.whl |
Total release size: 15.6 kB
Release files / marca_workflow-0.1.1.tar.gz
| Download URL | marca_workflow-0.1.1.tar.gz |
|---|---|
| Size | 7.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bd7644eccbe5f8ac8c1c3e1ab1e302ae54838a69bcd193f0a93f689ce62c33c5
|
|
BLAKE2b-256 checksum How to use checksums |
839a3f19d233e123475c558cd8169159d46a7e0ec30e4cfeb3ec0675ee2aca82
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.7
|
Release files / marca_workflow-0.1.1-py3-none-any.whl
| Download URL | marca_workflow-0.1.1-py3-none-any.whl |
|---|---|
| Size | 7.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
38ddf8aecd111bfb61ed5e4335bfefbc3f2f1e34bcb5cbcf9d849118e57e04f6
|
|
BLAKE2b-256 checksum How to use checksums |
4caa7542cbfbe9eb528b6679195cf0b184bff544a22358b930bb04efb0ef28f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.7
|
Security for marca-workflow 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.