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(base.Fitness): fitness value contains np.nan is now invalid #445

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

Conversation

yxliang01
Copy link
Contributor

This fixes #440 .

@yxliang01 yxliang01 changed the title fix(base.Fitness): fitness contains np.nan is now invalid fix(base.Fitness): fitness value contains np.nan is now invalid Dec 12, 2019
@@ -225,7 +226,7 @@ def dominates(self, other, obj=slice(None)):
@property
def valid(self):
"""Assess if a fitness is valid or not."""
return len(self.wvalues) != 0
return len(self.wvalues) != 0 and all(not np.isnan(val) for val in self.wvalues)
Copy link
Contributor

Choose a reason for hiding this comment

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

How about

Suggested change
return len(self.wvalues) != 0 and all(not np.isnan(val) for val in self.wvalues)
return len(self.wvalues) != 0 and not np.isnan(self.wvalues).any()

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.

HallOfFame does not store the best when np.nan involved
2 participants