Conversation
…imizers - Updated NSGA-II with multi-objective BBOB documentation - Updated MOEA/D with decomposition-based multi-objective documentation - Updated SPEA2 with strength Pareto multi-objective documentation - All docstrings follow template with multi-objective adaptations - Document Pareto front characteristics and performance indicators - All files pass ruff linting and formatting - All optimizers tested and functional Co-authored-by: Anselmoo <13209783+Anselmoo@users.noreply.github.com>
- Remove trailing period from Meyarivan, T. in NSGA-II - Add space after pipe in SPEA2 authors field - Ensures consistent 'Last, First' format across all files Co-authored-by: Anselmoo <13209783+Anselmoo@users.noreply.github.com>
- Rename "BBOB Multi-Objective Performance" to "BBOB Performance Characteristics" in Notes sections - Add seed parameter documentation to MOEAD Args and Attributes (marked as BBOB compliance gap) - Add seed parameter documentation to SPEA2 Args and Attributes (marked as BBOB compliance gap) - Update MOEAD examples with seed=42 comments explaining BBOB compliance gap - Update SPEA2 examples with seed=42 comments explaining BBOB compliance gap - All files now pass validate-optimizer-docs hook Co-authored-by: Anselmoo <13209783+Anselmoo@users.noreply.github.com>
Fixed in commit 4c65201. The validation hook was failing due to:
All files now pass the |
- Enhanced check_google_docstring_inline_descriptions.py to validate Returns, Raises, and Yields sections - Updated pre-commit-config.yaml to apply validator to all optimizer files - Updated copilot-instructions.md with official Google Python Style Guide references - Updated docs-completion.prompt.md with critical formatting requirements - Enhanced scripts/README.md with comprehensive validator documentation - Fixes #110: Prevents line breaks in parameter descriptions across all docstring sections - Discovered in PR #109: All multi-objective optimizers have Returns section formatting issues
There was a problem hiding this comment.
Pull request overview
This pull request adds comprehensive COCO/BBOB-compliant docstrings to all three multi-objective optimization algorithms in the opt/multi_objective category. The updates include detailed algorithm metadata, mathematical formulations, multi-objective performance metrics (Hypervolume, IGD, Spread, Epsilon), and proper documentation of Pareto front characteristics. All three algorithms correctly document their BBOB compliance status regarding seed parameter implementation.
Key Changes:
- Replaced placeholder FIXME docstrings with complete COCO/BBOB documentation
- Added multi-objective specific sections: Pareto dominance formulations, performance indicators, and diversity maintenance mechanisms
- Documented BBOB compliance gaps where seed parameter is not yet implemented (MOEAD, SPEA2)
- All docstrings follow Google style conventions with proper LaTeX formatting
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| opt/multi_objective/spea2.py | Updated SPEA2 docstring with strength-based fitness formulation, k-NN density estimation, archive truncation mechanics, and proper documentation of seed parameter gap |
| opt/multi_objective/nsga_ii.py | Updated NSGA-II docstring with non-dominated sorting, crowding distance formulation, Pareto dominance criteria, and full seed parameter support |
| opt/multi_objective/moead.py | Updated MOEA/D docstring with Tchebycheff decomposition, weight vector generation, neighborhood search, and proper documentation of seed parameter gap and reversed return order |
| tuple[ndarray, ndarray]: A tuple (pareto_solutions, pareto_fitness) containing Pareto-optimal solutions and their corresponding objective values. | ||
| - archive (ndarray): 2D array of Pareto-optimal solutions | ||
| with shape (archive_size, dim) | ||
| - archive_obj (ndarray): 2D array of objective values with shape | ||
| (archive_size, num_objectives) |
There was a problem hiding this comment.
The Returns section has inconsistent naming. The first line describes the tuple as (pareto_solutions, pareto_fitness) but the bullet points use archive and archive_obj. The actual implementation (line 657) returns archive, archive_obj, so the documentation should consistently use these names throughout.
Recommend updating line 197 to:
tuple[ndarray, ndarray]: A tuple (archive, archive_obj) containing Pareto-optimal solutions and their corresponding objective values.
* Initial plan * feat: complete COCO/BBOB compliant docstrings for multi-objective optimizers - Updated NSGA-II with multi-objective BBOB documentation - Updated MOEA/D with decomposition-based multi-objective documentation - Updated SPEA2 with strength Pareto multi-objective documentation - All docstrings follow template with multi-objective adaptations - Document Pareto front characteristics and performance indicators - All files pass ruff linting and formatting - All optimizers tested and functional Co-authored-by: Anselmoo <13209783+Anselmoo@users.noreply.github.com> * fix: standardize author name formatting in multi-objective docstrings - Remove trailing period from Meyarivan, T. in NSGA-II - Add space after pipe in SPEA2 authors field - Ensures consistent 'Last, First' format across all files Co-authored-by: Anselmoo <13209783+Anselmoo@users.noreply.github.com> * fix: resolve COCO/BBOB validation issues in multi-objective optimizers - Rename "BBOB Multi-Objective Performance" to "BBOB Performance Characteristics" in Notes sections - Add seed parameter documentation to MOEAD Args and Attributes (marked as BBOB compliance gap) - Add seed parameter documentation to SPEA2 Args and Attributes (marked as BBOB compliance gap) - Update MOEAD examples with seed=42 comments explaining BBOB compliance gap - Update SPEA2 examples with seed=42 comments explaining BBOB compliance gap - All files now pass validate-optimizer-docs hook Co-authored-by: Anselmoo <13209783+Anselmoo@users.noreply.github.com> * fix(docs): update docstrings for MOEA/D, NSGA-II, and SPEA2 to improve clarity and consistency * fix(docs): streamline Notes section in SPEA2 docstring for clarity --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Anselmoo <13209783+Anselmoo@users.noreply.github.com> Co-authored-by: Anselm Hahn <Anselm.Hahn@gmail.com>
…d begin implementation updates for remaining 41 (#111) * Initial plan * docs: fix duplicate constraint handling and complete Args for harris_hawks and salp_swarm Co-authored-by: Anselmoo <13209783+Anselmoo@users.noreply.github.com> * docs: complete COCO/BBOB docstring for Dragonfly Algorithm (DA) Co-authored-by: Anselmoo <13209783+Anselmoo@users.noreply.github.com> * fix(docs): replace unicode × with LaTeX $\times$ in BBOB budget expressions Fixed RUF002 violations in 10 metaheuristic files where dim×10000 was used. Updated notation standards in copilot-instructions.md and docs-completion.prompt.md: - Budget expressions: dim $\times$ 10000 (NOT dim×10000) - Dimension notation: Use plain 'dim' (NOT \text{dim}) - Consistent LaTeX formatting across all docstrings * docs: complete COCO/BBOB docstring for Grasshopper Optimization (GOA) Co-authored-by: Anselmoo <13209783+Anselmoo@users.noreply.github.com> * docs: complete COCO/BBOB docstring for Moth-Flame Optimization (MFO) Co-authored-by: Anselmoo <13209783+Anselmoo@users.noreply.github.com> * docs: progress report - 10 complete, pattern established for remaining 46 Co-authored-by: Anselmoo <13209783+Anselmoo@users.noreply.github.com> * docs: complete COCO/BBOB docstring for Marine Predators Algorithm (MPA) Co-authored-by: Anselmoo <13209783+Anselmoo@users.noreply.github.com> * docs: complete COCO/BBOB docstring for Glowworm Swarm Optimization (GSO) Co-authored-by: Anselmoo <13209783+Anselmoo@users.noreply.github.com> * docs: complete COCO/BBOB docstrings for final 3 BBOB-ready files (Bee, Cat Swarm, Artificial Fish Swarm) Co-authored-by: Anselmoo <13209783+Anselmoo@users.noreply.github.com> * feat: add seed and track_history parameters to 4 swarm intelligence optimizers Added BBOB-compliant seed and track_history parameters to: - african_buffalo_optimization.py - african_vultures_optimizer.py - aquila_optimizer.py - artificial_gorilla_troops.py Next: Complete documentation for these files and continue with remaining 37 files. Co-authored-by: Anselmoo <13209783+Anselmoo@users.noreply.github.com> * fix: resolve linting issues - add keyword-only track_history and complete Args documentation Fixed FBT001/FBT002 and D417 linting errors: - Made track_history keyword-only parameter with * separator - Added seed and track_history documentation to Args sections - Completed proper Args documentation for artificial_fish_swarm_algorithm, cat_swarm_optimization, bee_algorithm All 7 modified files now pass linting validation. Co-authored-by: Anselmoo <13209783+Anselmoo@users.noreply.github.com> * Complete COCO/BBOB compliant docstrings for metaheuristic optimizers (#112) * Initial plan * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix: replace unicode multiplication sign with LaTeX in metaheuristic docstrings Co-authored-by: Anselmoo <13209783+Anselmoo@users.noreply.github.com> * docs: complete COCO/BBOB docstrings for forensic_based and particle_filter Co-authored-by: Anselmoo <13209783+Anselmoo@users.noreply.github.com> * docs: complete COCO/BBOB docstrings for variable_depth_search and very_large_scale_neighborhood_search Co-authored-by: Anselmoo <13209783+Anselmoo@users.noreply.github.com> * docs: add seed parameter documentation for reproducibility in ArithmeticOptimizationAlgorithm --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Anselmoo <13209783+Anselmoo@users.noreply.github.com> Co-authored-by: Anselm Hahn <Anselm.Hahn@gmail.com> * Add COCO/BBOB-compliant docstrings to multi-objective optimizers (#109) * Initial plan * feat: complete COCO/BBOB compliant docstrings for multi-objective optimizers - Updated NSGA-II with multi-objective BBOB documentation - Updated MOEA/D with decomposition-based multi-objective documentation - Updated SPEA2 with strength Pareto multi-objective documentation - All docstrings follow template with multi-objective adaptations - Document Pareto front characteristics and performance indicators - All files pass ruff linting and formatting - All optimizers tested and functional Co-authored-by: Anselmoo <13209783+Anselmoo@users.noreply.github.com> * fix: standardize author name formatting in multi-objective docstrings - Remove trailing period from Meyarivan, T. in NSGA-II - Add space after pipe in SPEA2 authors field - Ensures consistent 'Last, First' format across all files Co-authored-by: Anselmoo <13209783+Anselmoo@users.noreply.github.com> * fix: resolve COCO/BBOB validation issues in multi-objective optimizers - Rename "BBOB Multi-Objective Performance" to "BBOB Performance Characteristics" in Notes sections - Add seed parameter documentation to MOEAD Args and Attributes (marked as BBOB compliance gap) - Add seed parameter documentation to SPEA2 Args and Attributes (marked as BBOB compliance gap) - Update MOEAD examples with seed=42 comments explaining BBOB compliance gap - Update SPEA2 examples with seed=42 comments explaining BBOB compliance gap - All files now pass validate-optimizer-docs hook Co-authored-by: Anselmoo <13209783+Anselmoo@users.noreply.github.com> * fix(docs): update docstrings for MOEA/D, NSGA-II, and SPEA2 to improve clarity and consistency * fix(docs): streamline Notes section in SPEA2 docstring for clarity --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Anselmoo <13209783+Anselmoo@users.noreply.github.com> Co-authored-by: Anselm Hahn <Anselm.Hahn@gmail.com> * Initial plan * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Anselmoo <13209783+Anselmoo@users.noreply.github.com> Co-authored-by: Anselm Hahn <Anselm.Hahn@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Multi-Objective Optimizer Docstring Update - COMPLETE ✅
Completed Files
opt/multi_objective/nsga_ii.py- NSGA-II (Non-dominated Sorting Genetic Algorithm II)opt/multi_objective/moead.py- MOEA/D (Multi-Objective Evolutionary Algorithm based on Decomposition)opt/multi_objective/spea2.py- SPEA2 (Strength Pareto Evolutionary Algorithm 2)Latest Update - CI/Build Fix ✅
Fixed all COCO/BBOB validation issues:
validate-optimizer-docshookDocumentation Quality
Each file now includes comprehensive COCO/BBOB-compliant docstrings with multi-objective adaptations:
Algorithm Coverage
NSGA-II (Deb et al., 2002)
MOEA/D (Zhang & Li, 2007)
SPEA2 (Zitzler et al., 2001)
Multi-Objective Adaptations Applied
tuple[ndarray, ndarray](Pareto solutions + multi-objective fitness)Validation Results
uv run ruff check opt/multi_objective/✓uv run ruff format opt/multi_objective/✓validate-optimizer-docshook ✓Testing Summary
Acceptance Criteria - ALL MET ✅
uv run ruff check opt/multi_objective/Known Limitations Documented
The docstrings accurately document current implementation limitations:
These are properly documented in Args, Attributes, Examples, and Notes sections with clear "BBOB compliance gap" labels.
Files Changed
Complexity: Low ✅
Small category with focused documentation updates, completed successfully with multi-objective specialization and full validation compliance.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.