API-Dokumentation
Die automatisch generierte API-Dokumentation basiert auf den Docstrings im Python-Code.
Hauptmodule
Robust launcher for the application. When executed as a script from the repository root or from an installed package folder the module src.main should be executed as a module so that its intra-package relative imports work correctly. On Windows executing a script inside a package folder often fails with „attempted relative import with no known parent“ if the module is simply imported; to avoid this we prefer runpy.run_module and fall back to sensible import attempts.
This file is intentionally small and defensive so users can run the repository
entrypoint (python main.py) or the installed entrypoint that points here.
Device Management
Data Controller
Helper Classes
Debug Utilities
Automatisch generierte Dokumentation
MainWindow
DataController
DeviceManager
Control
Plot
Helper Classes
Debug Utils
Arduino
Connection
Verwendung
Die API-Dokumentation wird automatisch aus den Docstrings im Code generiert. Stellen Sie sicher, dass Ihre Funktionen und Klassen ordnungsgemäß dokumentiert sind:
class MainWindow(QMainWindow):
"""Main window of the HRNGGUI application.
It handles the user interface, the device connection and the
processing of the recorded data. The implementation is split
into several functional sections:
1. Initialization and setup
2. Data processing and statistics
3. Measurement management
4. UI event handlers
5. Device control
6. Helper functions
"""
def __init__(self, device_manager: DeviceManager, parent=None):
"""
Initialisiert das Hauptfenster und alle Komponenten der Anwendung.
Args:
device_manager (DeviceManager): Der verbundene Geräte-Manager
parent: Das übergeordnete Widget (optional)
"""
# Implementation...
Docstring-Stile
Die Dokumentation unterstützt sowohl Google- als auch NumPy-Style Docstrings:
Google Style
def function_with_types_in_docstring(param1, param2):
"""Example function with types documented in the docstring.
Args:
param1 (int): The first parameter.
param2 (str): The second parameter.
Returns:
bool: The return value. True for success, False otherwise.
"""
return True
NumPy Style
def function_with_numpy_docstring(param1, param2):
"""Example function with NumPy style docstring.
Parameters
----------
param1 : int
The first parameter.
param2 : str
The second parameter.
Returns
-------
bool
The return value. True for success, False otherwise.
"""
return True