OCDocker.Console.session module

Console session helpers: namespace construction, REPL loop, and utilities.

Builds the preloaded interactive namespace (docking modules, Initialise symbols, print_args, clean_test_files) and runs the command loop with tab-completion and history.

OCDocker.Console.session.clean_test_files(baseProtPath, baseLigPath, baseDecPath, baseCanPath)[source]

Reset the test_files folder to its original state.

Parameters:
  • baseProtPath (str) – Path to the base protein folder.

  • baseLigPath (str) – Path to the base ligand folder.

  • baseDecPath (str) – Path to the base decoy folder.

  • baseCanPath (str) – Path to the base candidates folder.

Return type:

None

OCDocker.Console.session.print_args(program='')[source]

Print environment variables and optionally program-specific settings.

Console usage examples:

  • print_args() — environment overview

  • print_args('paths') — relevant paths and binaries

  • print_args('db') — database connections

  • print_args('vina') — Vina parameters

  • print_args('smina') — Smina parameters

  • print_args('plants') — PLANTS parameters

  • print_args('gnina') — Gnina parameters (if configured)

  • print_args('oddt') — ODDT parameters

  • print_args('all') — print all sections

Parameters:

program (str, optional) – Section selector (paths, db, vina, smina, plants, gnina, oddt, all). Empty string prints the overview only.

Return type:

None

OCDocker.Console.session.build_namespace()[source]

Build the interactive console namespace after environment bootstrap.

Returns:

Mapping of names exposed in the REPL (Initialise symbols, docking modules, helpers).

Return type:

dict[str, Any]

OCDocker.Console.session.run_interactive(namespace, *, use_ipython=False)[source]

Run the interactive console loop.

Parameters:
  • namespace (Mapping[str, Any]) – Preloaded namespace for Python execution.

  • use_ipython (bool, optional) – When True and IPython is installed, use IPython.embed instead of the simple command loop.

Returns:

Exit code (0 for success).

Return type:

int