Skip to content

Conversation

@pavelacamposp
Copy link
Owner

This PR adds unit and integration tests for all the modules in the project using pytest. Additionally, it fixes some unintended behavior in utility modules.

Key changes:

  • Added unit and integration tests for all modules.
  • Removed placeholder test test_placeholder.py.
  • Fixed the persistent excitation check for Hankel matrices.
  • Fixed initial steps highlighting in animation plots.
  • Removed an unused parameter from the nonlinear controller TypedDict.

Modify the persistent excitation condition evaluation in
`evaluate_persistent_excitation` to check for `rank >= n * order`
insted of requiring an exact match. This aligns with the theoretical
definition, allowing signals that are more "exciting" than necessary
to pass this check.
Modify plot functions to only select initial step plot elements
(`rect`, `right_rect_line`, `left_rect_line`, `init_text`,
`control_text`) when initial steps highlighting is enabled.

Previously, these elements were always selected from their storage
lists, causing errors when they were not initialized (e.g., when
initial steps highlighting was disabled).
Remove the `c` parameter from `NonlinearDataDrivenMPCParams`. This
parameter was mistakenly included and is not used by the nonlinear
data-driven MPC controller.
Set the CI workflow container to `python:3.12-slim-bullseye`, which
includes `gcc` and other essential build tools required by libraries
used during test execution.
Install ffmpeg in the CI workflow runner to support saving
animation files during tests.

This prevents the following error during CI workflow tests:
"FileNotFoundError: [Errno 2] No such file or directory: 'ffmpeg'"
@pavelacamposp pavelacamposp self-assigned this Jun 4, 2025
@pavelacamposp
Copy link
Owner Author

The added tests are well-structured and provide 98% coverage across the codebase. As all checks have passed, I’m proceeding with the merge.

@pavelacamposp pavelacamposp merged commit 67a137a into main Jun 4, 2025
1 check passed
@pavelacamposp pavelacamposp deleted the feature/add-tests branch June 4, 2025 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant