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

Updated sample code to new API #296

Closed
wants to merge 4 commits into from
Closed

Conversation

ndngo
Copy link

@ndngo ndngo commented Feb 18, 2019

Description

Updated sample code in the README to work with the new API

Related Issue

#287

Motivation and Context

The API changed so the code samples in the README needed to be updated to conform to the new API.

How Has This Been Tested?

The code samples were tested by running the code and ensuring that the results are similar to the expected results before the API change. The testing environment was Python 3 on Windows Subsystem for Linux. Each code sample was executed and the output was compared to expected output shown in the README.

Screenshots (if appropriate):

Swarm visualization
test
test1
test2

Types of changes

  • [ x] 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.
  • 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
Owner

@ljvmiranda921 ljvmiranda921 left a comment

Choose a reason for hiding this comment

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

Hi @ndngo ! Thank you for your contribution!

Some small updates from you before we merge your branch:

  • I think it would be better to remove the Dependencies section. Since we have requirements.txt, there's no need for that anymore
  • The way we represent the output as seen in the README:
>>> 2017-10-03 10:12:33,859 - pyswarms.single.global_best - INFO - Iteration 1/100, cost: 0.131244226714
>>> 2017-10-03 10:12:33,878 - pyswarms.single.global_best - INFO - Iteration 26/100, cost: 1.60297958653e-05
>>> 2017-10-03 10:12:33,893 - pyswarms.single.global_best - INFO - Iteration 51/100, cost: 1.60297958653e-05
>>> 2017-10-03 10:12:33,906 - pyswarms.single.global_best - INFO - Iteration 76/100, cost: 2.12638727702e-06
>>> 2017-10-03 10:12:33,921 - pyswarms.single.global_best - INFO - ================================
Optimization finished!
Final cost: 0.0000
Best value: [-0.0003521098028145481, -0.00045459382339127453]

Is now outdated. Currently we have a progress bar showing up. I'm wondering how we can show that. Maybe a GIF using ASCIInema might help?

@ndngo
Copy link
Author

ndngo commented Feb 20, 2019

@ljvmiranda921 I've removed the dependencies section and added a gif showing the progress bar.

@ljvmiranda921
Copy link
Owner

Hi @ndngo sorry for the late reply! Got busy at work!

Let me check this one on Sunday, unless @stevenbw beats me into it!

Copy link
Owner

@ljvmiranda921 ljvmiranda921 left a comment

Choose a reason for hiding this comment

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

Note to self before merging: ensure that contributor’s list is updated

@ljvmiranda921
Copy link
Owner

Merged! Thank you for your contribution @ndngo !

@ljvmiranda921
Copy link
Owner

@all-contributors please add @ndngo for documentation

@allcontributors
Copy link
Contributor

@ljvmiranda921

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

Repository owner deleted a comment from allcontributors bot Feb 24, 2019
@ljvmiranda921
Copy link
Owner

Woops another one, @all-contributors please add @ndngo for documentation

@allcontributors
Copy link
Contributor

@ljvmiranda921

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

@iconoclast007
Copy link

Does pyswam do multiobjective? Would love to see a user-defined multiobective problem, say 2 and then 3 variables

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

3 participants