Skip to content

[SC-9442] Fix param_grid showing duplicated combinations and missing parameters in figure titles#345

Merged
juanmleng merged 2 commits intomainfrom
juan/sc-9442/fix-param_grid-showing-duplicated-combinations-and-missing-parameters-in-figure-titles
Apr 3, 2025
Merged

[SC-9442] Fix param_grid showing duplicated combinations and missing parameters in figure titles#345
juanmleng merged 2 commits intomainfrom
juan/sc-9442/fix-param_grid-showing-duplicated-combinations-and-missing-parameters-in-figure-titles

Conversation

@juanmleng
Copy link
Contributor

Internal Notes for Reviewers

Fix for param_grid list of dictionaries
Fixed a bug where passing a list of dictionaries to param_grid would incorrectly generate a cartesian product of all parameter values. Now, each dictionary in the list is correctly treated as a distinct test configuration, eliminating duplicated test combinations.

Allow param_grid values to be displayed in figure titles
Added a new show_params option to run_test() that enables parameter values to be displayed in figure titles for comparison tests. When enabled, figure titles now include parameter information, making it easier to distinguish between different test configurations in visualizations. The default value is show_params=True. If parameter values are causing the titles to become cluttered or difficult to read, the user can set show_params=False to prevent these values from being displayed.

External Release Notes

@juanmleng juanmleng added bug Something isn't working internal Not to be externalized in the release notes labels Apr 2, 2025
@juanmleng juanmleng self-assigned this Apr 2, 2025
Copy link
Contributor

@cachafla cachafla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 🫡

Copy link
Contributor

@johnwalz97 johnwalz97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice 👍

@github-actions
Copy link
Contributor

github-actions bot commented Apr 3, 2025

PR Summary

This pull request introduces enhancements to the comparison test functions within the validmind library. The primary change is the addition of a show_params boolean parameter to several functions, which allows users to control whether parameter values are included in figure titles during test result comparisons. This enhancement provides greater flexibility in how test results are presented, particularly when dealing with large sets of parameters.

Key changes include:

  • Addition of the show_params parameter to the _build_input_param_string, _combine_figures, combine_results, _run_comparison_test, and run_test functions.
  • Modification of the _build_input_param_string function to handle parameter display based on the show_params flag, including converting parameter values to string representations.
  • Updates to the logic in get_comparison_test_configs to handle different structures of param_grid, allowing for more flexible test configuration generation.

These changes aim to improve the usability and clarity of test result outputs by providing an option to include or exclude parameter details in figure titles.

Test Suggestions

  • Test the run_test function with show_params set to True and verify that parameter values are included in figure titles.
  • Test the run_test function with show_params set to False and verify that parameter values are not included in figure titles.
  • Test the _build_input_param_string function with various parameter types (e.g., lists, strings, custom objects) to ensure correct string representation.
  • Test the get_comparison_test_configs function with both list and dictionary structures for param_grid to ensure correct test configuration generation.
  • Perform regression testing on existing test cases to ensure no unintended changes in behavior.

@juanmleng juanmleng merged commit 7dc3f10 into main Apr 3, 2025
6 checks passed
@johnwalz97 johnwalz97 deleted the juan/sc-9442/fix-param_grid-showing-duplicated-combinations-and-missing-parameters-in-figure-titles branch August 20, 2025 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working internal Not to be externalized in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants