Skip to content

Add verbose parameter support to CMAEvolutionStrategyOpt #946

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 23, 2025

Conversation

ChrisRackauckas
Copy link
Member

Summary

Fixes #572 - This PR adds support for the verbose parameter to control printing when using CMAEvolutionStrategyOpt solver.

Problem

Users reported that CMAEvolutionStrategyOpt() produces excessive output that cannot be suppressed, even when using verbose=false. This was because the optimizer wasn't accepting or using the verbose parameter.

Solution

  • Added verbose::Bool = false parameter to the __map_optimizer_args function
  • Set logger verbosity based on verbose parameter:
    • verbose=falseverbosity=0 (minimal output)
    • verbose=trueverbosity=1 (detailed output)
  • Consistent with other optimizers in the package that accept the verbose parameter

Usage

# Suppress printing (default behavior)
solve(prob, CMAEvolutionStrategyOpt(), verbose=false)

# Enable verbose output if needed
solve(prob, CMAEvolutionStrategyOpt(), verbose=true)

Testing

  • Verified that the __map_optimizer_args function accepts the verbose parameter
  • Confirmed that logger verbosity is set correctly based on the parameter value
  • Maintains backward compatibility (default is verbose=false)

🤖 Generated with Claude Code

Fixes #572 - Added support for the `verbose` parameter to control
printing when using CMAEvolutionStrategyOpt solver.

Changes:
- Added `verbose::Bool = false` parameter to __map_optimizer_args
- Set logger verbosity based on verbose parameter (0 for false, 1 for true)
- Consistent with other optimization solvers in the package

Usage:
```julia
# Suppress printing (default)
solve(prob, CMAEvolutionStrategyOpt(), verbose=false)

# Enable verbose output
solve(prob, CMAEvolutionStrategyOpt(), verbose=true)
```

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@ChrisRackauckas ChrisRackauckas merged commit 2327311 into master Jul 23, 2025
24 of 29 checks passed
@ChrisRackauckas ChrisRackauckas deleted the fix-cma-verbosity branch July 23, 2025 11:27
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.

Prevent printing when using CMAEvolutionStrategyOpt solver
1 participant