Skip to content

Conversation

@AngelFP
Copy link
Member

@AngelFP AngelFP commented Jan 12, 2024

Adds new methods to the ExplorationDiagnostics to:

  • plot the Pareto frontier
  • get the best evaluations
  • get the paths to the evaluation folders
  • delete the evaluation folders

image

@AngelFP AngelFP added the enhancement New feature or request label Jan 15, 2024
@AngelFP AngelFP changed the title [WIP] Add new plots and methods to ExplorationDiagnostics Add new plots and methods to ExplorationDiagnostics Jan 16, 2024
@AngelFP AngelFP requested a review from delaossa January 16, 2024 15:23
Copy link
Collaborator

@delaossa delaossa left a comment

Choose a reason for hiding this comment

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

Excellent! Thank you very much for this PR.

Copy link
Collaborator

@delaossa delaossa left a comment

Choose a reason for hiding this comment

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

Excellent! Thank you very much for this PR.

Comment on lines +113 to 117
"""Create a dict with the path to the sim dir of each evaluation."""
self._sim_dir_paths = {}
ensemble_dir_path = os.path.join(
self._exploration.exploration_dir_path, "evaluations"
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just a comment:
This creates a separate dictionary with the simulation directory paths with the trial indexes as keys.
An alternative solution could be to add the simulation paths as a new column to the history DataFrame (adding None when not present).

Comment on lines +121 to +126
if sim_dir.startswith("sim"):
try:
trial_index = int(sim_dir[3:])
self._sim_dir_paths[trial_index] = os.path.join(
ensemble_dir_path, sim_dir
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Very minor:
This removes the "sim" part of the simulation directory name and converts the rest to an integer which matches the trial_index by construction.
Maybe is clearer is we do: trial_index = int(sim_dir.lstrip("sim"))

Comment on lines +537 to +539
if objectives is None:
if len(self.objectives) == 2:
objectives = self.objectives
Copy link
Collaborator

@delaossa delaossa Jan 25, 2024

Choose a reason for hiding this comment

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

If no objectives are given, it will work only when two objectives are found in the exploration folder.
It could work as well when there are more than two objectives by selecting the first two of them by default:

if len(self.objectives) >= 2:
    objectives = self.objectives[:2]

@delaossa delaossa merged commit 4df8623 into main Jan 25, 2024
@AngelFP AngelFP deleted the feature/new_plots branch January 25, 2024 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants