Skip to content

Conversation

Copy link

Copilot AI commented Nov 18, 2025

Implements per-iteration Pareto front archiving. Previously, self.history['pareto_front'] was overwritten each step; only the final state was preserved.

Changes

  • Per-iteration Pareto storage: Keys changed from pareto_front to pareto_front_{iteration}, preserving full optimization trajectory
  • CSV export per iteration: Added history/pareto_iteration{i}.csv alongside existing particle exports
  • Control flag: FileManager.saving_history_enabled gates all per-iteration I/O (particles + Pareto)
  • Data structure fix: Replaced failing numpy structured arrays with list-of-dicts, resolving ValueError with mixed parameter types (int/float/bool)
  • Zarr export: Added Pickle codec support for object arrays

Usage

pso = patatune.MOPSO(...)
pso.optimize(num_iterations=100)

# Access evolution of Pareto front
for i in range(100):
    pareto = pso.history[f'pareto_front_{i}']
    # Each entry: {'position': array, 'fitness': array}

# Disable if storage is a concern
patatune.FileManager.saving_history_enabled = False

Fixes the structured array bug that prevented history saving from working at all.

Original prompt

This section details on the original issue you should resolve

<issue_title>Save history of archived solutions</issue_title>
<issue_description>Save the pareto of each iteration and allow to export it (with a flag to enable the feature)</issue_description>

Comments on the Issue (you are @copilot in this section)

@rsreds #43 adds the history of each step in the output. Needs to add the history of the pareto too

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Save history of archived solutions with pareto export option Save Pareto front history per iteration with configurable export Nov 18, 2025
Copilot AI requested a review from rsreds November 18, 2025 10:48
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.

Save history of archived solutions

2 participants