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: no pool preds for random heuristic #277

Merged
merged 4 commits into from Sep 13, 2023

Conversation

arthur-thuy
Copy link
Contributor

Summary:

Issue #274

Features:

/

Checklist:

  • Your code is documented (To validate this, add your module to tests/documentation_test.py).
  • Your code is tested with unit tests.
  • You moved your Issue to the PR state.

Copy link
Member

@Dref360 Dref360 left a comment

Choose a reason for hiding this comment

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

Thank you for your PR!

Small comment and could we add some test to be sure that it doesn't call self.get_probabilities?

@@ -79,7 +79,10 @@ def step(self, pool=None) -> bool:
indices = None

if len(pool) > 0:
probs = self.get_probabilities(pool, **self.kwargs)
if self.heuristic.__class__.__name__ == "Random":
Copy link
Member

Choose a reason for hiding this comment

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

I think we can use isinstance(self.heuristic, Random) here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the comment! I added a unit test that checks whether self.get_probabilities is called with unittest.mock.patch.

Copy link
Member

@Dref360 Dref360 left a comment

Choose a reason for hiding this comment

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

Looks great thank you!

LGTM

@Dref360 Dref360 enabled auto-merge (squash) September 13, 2023 13:37
@Dref360 Dref360 merged commit ce55a85 into baal-org:master Sep 13, 2023
2 checks passed
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