Skip to content

Polish: fix worst-fitness bug, typos, cross-platform paths, test warnings - #15

Merged
jcrvz merged 1 commit into
masterfrom
copilot/task-9259576-278207916-46acb4dc-3808-4444-b3b1-4bf35b51bf94
Apr 13, 2026
Merged

jcrvz merged 1 commit into
masterfrom
copilot/task-9259576-278207916-46acb4dc-3808-4444-b3b1-4bf35b51bf94

Conversation

Copilot AI commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

Several accumulated quality issues across the framework have been addressed: a correctness bug in population tracking, docstring/README typos, platform-specific path construction, and a pytest warning.

Bug Fix

  • population.py: __update_best_and_worst() assigned current_worst_fitness = np.min(fitness) — the best value. Changed to np.max(fitness). This directly corrupted mass computation in gravitational_search, which subtracts current_worst_fitness to derive agent masses.

Typos

  • metaheuristic.py: "mataheuristic" → "metaheuristic"
  • hyperheuristic.py: "meatheuristic" (×2), "vealues", "Diccionary", "retreived"
  • operators.py: "paramenter"
  • README.md: "auxiliar" → "auxiliary"; "may do not work. They are currently under developing." → "may not work. They are currently under development."

Cross-Platform Paths

Replaced hardcoded /-joined paths with os.path.join:

  • hyperheuristic.py: "collections/" + heuristic_space → os.path.join("collections", heuristic_space); added missing import os; removed the stale # TODO: fix for any OS comment
  • tools.py: temporal_full_path + "/" + file_name → os.path.join(temporal_full_path, file_name)

Misc

  • tools.py: renamed subfolder_splitted_name → subfolder_name_parts ("splitted" is non-standard English)
  • tests/test_makefile.py: removed return True/False from two test functions, eliminating PytestReturnNotNoneWarning

Copilot AI requested a review from jcrvz April 13, 2026 13:23
@jcrvz
jcrvz marked this pull request as ready for review April 13, 2026 13:25
@jcrvz
jcrvz merged commit c242856 into master Apr 13, 2026
11 checks passed
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.

2 participants