Main

Inheritance diagram of src.main

Provides the main entry point and application management classes for the simulation.

module:

main

author:

Le Bars, Yoann

class src.main.AppManager(argv: list[str], **kwargs)[source]

Bases: object

Orchestrates the application’s lifecycle: setup, execution, and cleanup.

This class encapsulates the initialisation of translations, argument parsing, logging, and the main window, thereby simplifying the global main function.

Variables:
  • _argv (list[str]) – The raw command-line arguments.

  • _kwargs (dict) – Keyword arguments for programmatic setup.

  • app (QApplication | None) – The core Qt application instance.

  • locale (QLocale | None) – The system locale used for translations.

  • cmd_args (CmdLineArgs | None) – Parsed and validated command-line arguments.

  • logger (Logger | None) – The application’s logging manager.

  • window (MainWindow | None) – The main application window.

app: QApplication | None = None
cmd_args: CmdLineArgs | None = None
locale: QLocale | None = None
logger: Logger | None = None
run() ExitCode[source]

Orchestrates the entire application lifecycle.

This method calls the setup routines, shows the main window, starts the Qt event loop, and ensures that cleanup is performed upon exit. :returns: The application’s exit code.

setup() None[source]

Initialises all application components.

window: MainWindow | None = None
src.main.main(**kwargs: int | float | bool) ExitCode[source]

Main entry point for the application.

Parameters:

kwargs – Keyword arguments for testing, corresponding to command-line options (e.g., n_iter=100, n_bodies=10). If provided, command-line parsing is skipped.

Returns:

The application’s exit code.

Return type:

ExitCode