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

Conversation

@ndngo
Copy link

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.

@ljvmiranda921 ljvmiranda921 self-requested a review Feb 19, 2019

@ljvmiranda921
Copy link
Owner

left a comment

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

This comment has been minimized.

Copy link
Author

commented Feb 20, 2019

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

@ljvmiranda921

This comment has been minimized.

Copy link
Owner

commented Feb 22, 2019

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

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

@ljvmiranda921
Copy link
Owner

left a comment

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

@ljvmiranda921 ljvmiranda921 referenced this pull request Feb 24, 2019
@ljvmiranda921

This comment has been minimized.

Copy link
Owner

commented Feb 24, 2019

Merged! Thank you for your contribution @ndngo !

@ljvmiranda921

This comment has been minimized.

Copy link
Owner

commented Feb 24, 2019

@all-contributors please add @ndngo for documentation

@allcontributors

This comment has been minimized.

Copy link
Contributor

commented Feb 24, 2019

@ljvmiranda921

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

Repository owner deleted a comment from allcontributors bot Feb 24, 2019

@ljvmiranda921

This comment has been minimized.

Copy link
Owner

commented Feb 24, 2019

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

@allcontributors

This comment has been minimized.

Copy link
Contributor

commented Feb 24, 2019

@ljvmiranda921

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.