Skip to content

CLI

CLI dispatcher mirroring Main.java. Run as python -m src.main --help.

Supported functions (-f / --function): * evaluate_run — port of EvaluateRun; needs --id. * process_dataset — port of ProcessDataset; --id to process one dataset, omit to poll. * process_dataset_print— local feature extraction, prints XML. * extract_features_simple— port of FantailConnector (simple set); --id for one dataset, omit to poll. * extract_features_all — port of FantailConnector (all set, including the sklearn landmarker port); --id for one dataset, omit to poll. * merge_datasets — port of MergeDataset; needs --id (MultiTask task id); writes merged ARFF to --output or stdout. * generate_folds — wraps src.process_dataset.generate_folds.

Unsupported functions (matching Main.java's fallthrough branch): * all_wrong, different_predictions — InstanceBased.java not ported. * challenge — ChallengeSets.java not ported.

Each prints a clear NotImplementedError when invoked. The Java options are mapped 1:1 (-id → --id, -u → --user, etc.) with both short and long forms accepted. Note: Java's -test (holdout rowids for fold generation) is NOT ported — -test / --test here targets test.openml.org (see OpenmlClient).

FOLD_GENERATION_SEED = 0 module-attribute

main(argv=None)

Source code in src/main.py
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
def main(argv: Sequence[str] | None = None) -> int:
    args = _build_parser().parse_args(argv)

    handler = _DISPATCH.get(args.function)
    if handler is None:
        # Mirrors Main.java's "call to unknown function" branch.
        print(f"Error: call to unknown function: {args.function}", file=sys.stderr)
        return 1

    try:
        handler(args)
        return 0
    except NotImplementedError as e:
        print(f"Not implemented: {e}", file=sys.stderr)
        return 0  # Java exits 0 on LegacyWarning; we mirror for NIY.
    except SystemExit:
        raise
    except Exception as e:  # noqa: BLE001 — top-level catch, matches Java.
        print(f"Error: {e}", file=sys.stderr)
        return 1