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

Test assertions in search (#27) #40

Merged
merged 2 commits into from Oct 3, 2017
Merged

Test assertions in search (#27) #40

merged 2 commits into from Oct 3, 2017

Conversation

jazcap53
Copy link
Contributor

@jazcap53 jazcap53 commented Oct 3, 2017

Tests that a bad type for the optimizer parameter to GridSearch() raises a TypeError.
Tests that a bad type for the optimizer parameter or the n_selection_iters parameter
to RandomSearch() raises a TypeError.

Author: jazcap53
Email: andrew.jarcho@gmail.com

jazcap53 and others added 2 commits October 3, 2017 16:49
Tests that a bad type for the optimizer parameter to GridSearch() raises a TypeError.
Tests that a bad type for the optimizer parameter or the n_selection_iters parameter
    to RandomSearch() raises a TypeError.

Author: jazcap53
Email: andrew.jarcho@gmail.com
I quickly changed a class name just to make it consistent with other tests. I decided to do it on my own to save
you the hassle of editing and committing for just a very small fix, and so that we can merge immediately.
bad_optimizer = 'LocalBestPSO' # a string instead of a class object
with self.assertRaises(TypeError):
g = GridSearch(bad_optimizer, self.n_particles, self.dimensions,
Copy link
Owner

Choose a reason for hiding this comment

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

I see, I think I understand what you mean earlier. I guess this is the way to go when initializing objects.

{'c1': 2, 'c2': 6, 'k': 5, 'w': 0.9, 'p': 0}])

class Instantiate(Base):
Copy link
Owner

Choose a reason for hiding this comment

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

Hmmm, just for consistency, please rename this to Instantiation

@ljvmiranda921
Copy link
Owner

Hey @jazcap53,

I believe all the tests you did are fine. There's one tiny fix that I required: changing Instantiate to Instantiation, but I figured I'll just modify it by my own to save you the hassle of editing and committing for just a very small request.

Either way, all tests are good and this PR will be merged.

@ljvmiranda921 ljvmiranda921 merged commit 62affc5 into ljvmiranda921:master Oct 3, 2017
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