Skip to content

Commit

Permalink
fix: correct type hinting in load_best_genome().
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianFredrikJohnsen committed Oct 24, 2024
1 parent d024937 commit a014b3f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def save_best_genome(genome: Genome, generation: int, name: str):
with open(f'{path}/best_genome_{generation}.obj', 'wb') as f:
pickle.dump(genome, f) # type: ignore

def load_best_genome(generation: int, name: str) -> None:
def load_best_genome(generation: int, name: str) -> Genome:
"""Loads the best genome from the given generation. If -1 is passed as argument, the latest generation is displayed."""
if generation == -1: # Find the genome from the latest generation.
files = os.listdir(f'data/{name}/good_genomes')
Expand Down

0 comments on commit a014b3f

Please sign in to comment.