Skip to content

Conversation

@juan-g-bonilla
Copy link
Contributor

Description

  • Added SysModelMixin, a new Python mixin that standardizes:
    • Automatic logError wrapping of overridden director methods.
    • Enforcement of super().__init__() in Python subclasses, with clear error messages.
  • Refactored py_sys_model.i to use this mixin instead of the previous SuperInitChecker and manual method wrapping.
  • Refactored pyStatefulSysModel.i to:
    • Use the correct Basilisk.simulation package.
    • Adopt SysModelMixin for StatefulSysModel, removing custom per-method wrappers.
    • Add default Basilisk exception handling.
  • Updated release notes accordingly.

Verification

Tests src/architecture/system_model/_UnitTest/test_PySysModel.py and src/simulation/mujocoDynamics/_GeneralModuleFiles/_UnitTest/test_stateful_sys_model.py still pass despite the refactor.

Documentation

Update release notes.

@juan-g-bonilla juan-g-bonilla self-assigned this Nov 25, 2025
@juan-g-bonilla juan-g-bonilla requested a review from a team as a code owner November 25, 2025 01:27
@schaubh schaubh added the enhancement New feature or request label Nov 25, 2025
@schaubh schaubh added this to Basilisk Nov 25, 2025
@schaubh schaubh moved this to 👀 In review in Basilisk Nov 25, 2025
@juan-g-bonilla juan-g-bonilla force-pushed the feature/1191-py-sysmodel-directors branch from 531cb98 to f6118a6 Compare November 25, 2025 22:43
@juan-g-bonilla juan-g-bonilla force-pushed the feature/1191-py-sysmodel-directors branch from f6118a6 to c347c07 Compare November 26, 2025 00:25
Errors are logged automatically for all methods implemented in Python.
Sanity check for calling __init__ in the parent implemented without metaclass.
@juan-g-bonilla juan-g-bonilla force-pushed the feature/1191-py-sysmodel-directors branch from c347c07 to 1917234 Compare November 26, 2025 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

Support abstract classes implemented in Python that inherit SysModel

3 participants