Skip to content

Commit

Permalink
Merge pull request #29 from BorjaEst/dev
Browse files Browse the repository at this point in the history
add keyboard interruption
  • Loading branch information
BorjaEst authored Mar 27, 2023
2 parents a071639 + a86ff48 commit 1783daf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/gevopy/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.0
1.1.1
3 changes: 3 additions & 0 deletions src/gevopy/experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ def run(self, max_generation=None, max_score=None):
self.eval_phenotypes(self.fitness, save=True)
execution.halloffame.update(self.get_phenotypes())
logger.info("Completed cycle; %s", execution.best_score)
except KeyboardInterrupt:
logger.error("Experiment cancelled by the user 'CTRL+C'")
return execution
except Exception as err:
logger.error("Error %s raised during experiment execution", err)
raise err
Expand Down

0 comments on commit 1783daf

Please sign in to comment.