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 2 times, most recently from c347c07 to 1917234 Compare November 26, 2025 17:17
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 1917234 to 8d9c7f5 Compare December 9, 2025 07:57
@juan-g-bonilla juan-g-bonilla merged commit 5c370a8 into develop Dec 9, 2025
12 checks passed
@juan-g-bonilla juan-g-bonilla deleted the feature/1191-py-sysmodel-directors branch December 9, 2025 09:48
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Basilisk Dec 9, 2025
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: Done

Development

Successfully merging this pull request may close these issues.

Support abstract classes implemented in Python that inherit SysModel

3 participants