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 optimise methods returning incorrect best_pos #322

Merged
merged 7 commits into from
Apr 25, 2019

Conversation

ichbinjakes
Copy link
Contributor

Description of changes

Fix:

  • BinaryPSO returning correct best_pos
  • GeneralPSO returning correct best_pos
  • LocalBestPSO returning correct best_pos
  • GlobalBestPSO returning correct best_pos

Tests:

  • Added simple test cases for each optimiser
    • I have no experience using pytest but tests work, I can add tests using unittest if needed.

Flake8 / Black reformatted some other code

Related Issue

#321

Motivation and Context

Bug fix

How Has This Been Tested?

Tested using unittest, then "ported' to the pytest files. All test passed.
Followed instruction in contributing.rst, except used new conda env.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • [?] Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project. Tests work but don't match code style
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link
Collaborator

@whzup whzup left a comment

Choose a reason for hiding this comment

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

Very nice to see a PR of you, @ichbinjakes!👍🎊💯 There are some things that I think could be made easier (see comments in the code).

tests/optimizers/test_general_optimizer.py Outdated Show resolved Hide resolved
pyswarms/backend/handlers.py Outdated Show resolved Hide resolved
tests/optimizers/test_binary.py Show resolved Hide resolved
@whzup whzup added bug Bugs, bug fixes, etc. unit tests Test-related changes labels Mar 23, 2019
@whzup
Copy link
Collaborator

whzup commented Apr 25, 2019

This seems good to me 👍 Thank you for your PR @ichbinjakes. Hope you had fun working on it 😄🎊

@ljvmiranda921
Copy link
Owner

Can you squash-merge this, @whzup ? Thank you @ichbinjakes !

@whzup whzup merged commit 9813c80 into ljvmiranda921:master Apr 25, 2019
@ljvmiranda921
Copy link
Owner

Nice!! Thank you again, @ichbinjakes , and to @whzup for conducting the review! I'll be updating the contributor's list this weekend!

@ljvmiranda921
Copy link
Owner

@allcontributors[bot] please add @ichbinjakes for bug and code

@allcontributors
Copy link
Contributor

@ljvmiranda921

I've put up a pull request to add @ichbinjakes! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs, bug fixes, etc. unit tests Test-related changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants