Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix overriding termination in GA class #505

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

DavidDB33
Copy link

@DavidDB33 DavidDB33 commented Nov 20, 2023

Before, the code could not set a termination condition using the termination argument in the Algorithm class when using the GA subclass.
I saw that the standard procedure is to set a default termination condition if it is unset, but in the GA class, after calling super().__init__, no matter the termination argument set, the termination variable is later overridden.

With this PR, the code using GA with a termination condition worked as expected.

I had yet to check other algorithms or tests. I publish this PR with little care, but I am okay with someone suggesting checking more to get this right.

P.S.: Thank you for publishing and maintaining this package. It is very useful.

@DavidDB33 DavidDB33 changed the base branch from develop to main November 20, 2023 00:43
@blankjul
Copy link
Collaborator

I remember setting this caused issues with other algorithms. This would require some testing.

Did you have a chance to check if this change has any unwanted side-effects?

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.

None yet

2 participants