chaotic_pfc.cli

cli

Unified command-line interface for the chaotic_pfc package.

The parser layout is chaotic-pfc run <experiment> [options], where <experiment> is one of the pipeline stages (attractors, sensitivity, comm-ideal, comm-fir, comm-order-n, lyapunov, sweep compute, sweep plot, all).

Each experiment lives in its own submodule and exposes two functions:

  • add_parser(subparsers) — register the experiment’s own parser and flags onto the given argparse._SubParsersAction.

  • run(args) — execute the experiment using the parsed namespace.

The sub-commands under sweep (compute and plot) use the same pattern recursively, producing a two-level parser tree (run sweep {compute, plot}).

Adding a new experiment is a matter of dropping a new submodule here and appending its name to EXPERIMENTS below.

Functions

build_parser()

Assemble the top-level parser with every experiment registered.

main([argv])

Parse argv (or sys.argv) and dispatch to the right experiment.

chaotic_pfc.cli.build_parser()[source]

Assemble the top-level parser with every experiment registered.

Returns:

A parser whose namespace carries a _run attribute pointing at the callable to invoke for the selected subcommand.

Return type:

argparse.ArgumentParser

chaotic_pfc.cli.main(argv=None)[source]

Parse argv (or sys.argv) and dispatch to the right experiment.

Parameters:

argv (list[str] | None) – Optional list of arguments. Defaults to sys.argv[1:]. Passing an explicit argv is what makes tests.test_cli possible without shelling out to a subprocess.

Returns:

Exit code. 0 on success, 2 when the user requested help without picking a subcommand (argparse convention).

Return type:

int

Modules

analysis

Statistical analysis of sweep data and chaotic-region plotting.

attractors

Phase-space attractors for three Hénon variants.

comm_fir

Chaotic communication through FIR low-pass channel.

comm_ideal

Full communication pipeline over an ideal (noiseless) channel.

comm_order_n

Communication using N-th order Henon with internal FIR filter.

lyapunov

Lyapunov exponent computation (text output + optional CSV).

run_all

Run every experiment in sequence.

sensitivity

Sensitive Dependence on Initial Conditions (SDIC).

sweep

Sweep Lyapunov exponents across (order, cutoff) grid.