{"action":"created","issue":{"url":"https://api.github.com/repos/ljvmiranda921/pyswarms/issues/165","repository_url":"https://api.github.com/repos/ljvmiranda921/pyswarms","labels_url":"https://api.github.com/repos/ljvmiranda921/pyswarms/issues/165/labels{/name}","comments_url":"https://api.github.com/repos/ljvmiranda921/pyswarms/issues/165/comments","events_url":"https://api.github.com/repos/ljvmiranda921/pyswarms/issues/165/events","html_url":"https://github.com/ljvmiranda921/pyswarms/pull/165","id":341353076,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAxNTE2MTg4","number":165,"title":"Add functions","user":{"login":"jayspeidell","id":26357788,"node_id":"MDQ6VXNlcjI2MzU3Nzg4","avatar_url":"https://avatars3.githubusercontent.com/u/26357788?v=4","gravatar_id":"","url":"https://api.github.com/users/jayspeidell","html_url":"https://github.com/jayspeidell","followers_url":"https://api.github.com/users/jayspeidell/followers","following_url":"https://api.github.com/users/jayspeidell/following{/other_user}","gists_url":"https://api.github.com/users/jayspeidell/gists{/gist_id}","starred_url":"https://api.github.com/users/jayspeidell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jayspeidell/subscriptions","organizations_url":"https://api.github.com/users/jayspeidell/orgs","repos_url":"https://api.github.com/users/jayspeidell/repos","events_url":"https://api.github.com/users/jayspeidell/events{/privacy}","received_events_url":"https://api.github.com/users/jayspeidell/received_events","type":"User","site_admin":false},"labels":[{"id":645411971,"node_id":"MDU6TGFiZWw2NDU0MTE5NzE=","url":"https://api.github.com/repos/ljvmiranda921/pyswarms/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":961920752,"node_id":"MDU6TGFiZWw5NjE5MjA3NTI=","url":"https://api.github.com/repos/ljvmiranda921/pyswarms/labels/unit%20tests","name":"unit tests","color":"f9e22f","default":false},{"id":658852818,"node_id":"MDU6TGFiZWw2NTg4NTI4MTg=","url":"https://api.github.com/repos/ljvmiranda921/pyswarms/labels/v0.3.0","name":"v0.3.0","color":"c2e0c6","default":false}],"state":"closed","locked":false,"assignee":{"login":"jayspeidell","id":26357788,"node_id":"MDQ6VXNlcjI2MzU3Nzg4","avatar_url":"https://avatars3.githubusercontent.com/u/26357788?v=4","gravatar_id":"","url":"https://api.github.com/users/jayspeidell","html_url":"https://github.com/jayspeidell","followers_url":"https://api.github.com/users/jayspeidell/followers","following_url":"https://api.github.com/users/jayspeidell/following{/other_user}","gists_url":"https://api.github.com/users/jayspeidell/gists{/gist_id}","starred_url":"https://api.github.com/users/jayspeidell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jayspeidell/subscriptions","organizations_url":"https://api.github.com/users/jayspeidell/orgs","repos_url":"https://api.github.com/users/jayspeidell/repos","events_url":"https://api.github.com/users/jayspeidell/events{/privacy}","received_events_url":"https://api.github.com/users/jayspeidell/received_events","type":"User","site_admin":false},"assignees":[{"login":"jayspeidell","id":26357788,"node_id":"MDQ6VXNlcjI2MzU3Nzg4","avatar_url":"https://avatars3.githubusercontent.com/u/26357788?v=4","gravatar_id":"","url":"https://api.github.com/users/jayspeidell","html_url":"https://github.com/jayspeidell","followers_url":"https://api.github.com/users/jayspeidell/followers","following_url":"https://api.github.com/users/jayspeidell/following{/other_user}","gists_url":"https://api.github.com/users/jayspeidell/gists{/gist_id}","starred_url":"https://api.github.com/users/jayspeidell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jayspeidell/subscriptions","organizations_url":"https://api.github.com/users/jayspeidell/orgs","repos_url":"https://api.github.com/users/jayspeidell/repos","events_url":"https://api.github.com/users/jayspeidell/events{/privacy}","received_events_url":"https://api.github.com/users/jayspeidell/received_events","type":"User","site_admin":false},{"login":"whzup","id":39431903,"node_id":"MDQ6VXNlcjM5NDMxOTAz","avatar_url":"https://avatars3.githubusercontent.com/u/39431903?v=4","gravatar_id":"","url":"https://api.github.com/users/whzup","html_url":"https://github.com/whzup","followers_url":"https://api.github.com/users/whzup/followers","following_url":"https://api.github.com/users/whzup/following{/other_user}","gists_url":"https://api.github.com/users/whzup/gists{/gist_id}","starred_url":"https://api.github.com/users/whzup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whzup/subscriptions","organizations_url":"https://api.github.com/users/whzup/orgs","repos_url":"https://api.github.com/users/whzup/repos","events_url":"https://api.github.com/users/whzup/events{/privacy}","received_events_url":"https://api.github.com/users/whzup/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2018-07-15T21:17:09Z","updated_at":"2018-07-17T04:37:13Z","closed_at":"2018-07-17T03:46:03Z","author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/ljvmiranda921/pyswarms/pulls/165","html_url":"https://github.com/ljvmiranda921/pyswarms/pull/165","diff_url":"https://github.com/ljvmiranda921/pyswarms/pull/165.diff","patch_url":"https://github.com/ljvmiranda921/pyswarms/pull/165.patch"},"body":"<!--- Provide a general summary of your changes in the Title above -->\r\n\r\n## Description\r\nObjective Function Updates: Verified Goldstein and Booth functions working and removed TODO tags. Fixed Bulkin No 6 and removed TODO tag. Implemented Cross-in-Tray, Easom, Eggholder, Himmelblau's, Holder Table, and Three Hump Camel functions. File is getting long so I sorted the functions and added a list of functions and their corresponding function name to the docstring.\r\n\r\nBug fix: Added 'z-axis' to formatters/Designer attribute 'labels' to prevent index out of range error when plotting in 3D.\r\n\r\nNew feature: It's hard to visualize some functions with a continuous colormap, so I added a colormaps property to the Designer class in formatters.py to allow the user to choose whichever one they want. It uses the same style as other properties of the class, and the module imports matplotlib.cm to validate both types of colormaps in matplotlib. I edited plotters/plot_countour to initialize a Designer object with a default colormap if none is provided. I've tested with every category of colormap as well as custom colormaps and verified that it is working as intended. I made the edit because I personally find it easier to understand the contours when they use a discreet colormap.\r\n\r\nDefault parameter change: Mesher.delta from 0.001 to 0.1. This makes it safe to run many of the functions on an average computer. With 0.001, a computer with 8GB of RAM will crash above a domain size of [8, 8]. Increasing by two orders of magnitude allows most provided functions to run without crashing due to memory errors and doesn't visibly impact graph quality. \r\n\r\n## Related Issue\r\n\r\nAdd more benchmark functions #158\r\n\r\nFixing a bug: Designer only had two axis labels by default, so I added \"z-axis\". \r\n\r\nAdded a feature: Designer accepts a colormap from the user. \r\n\r\nFixing memory error: The Mesher.delta parameter of 0.001 has a high chance of causing crashes to memory errors. 0.1 is safer for most of the functions in single_obj.py, but some will still crash. \r\n\r\n## Motivation and Context\r\n\r\nAdding a colormap attribute to Designer made easier to verify the functions I implemented because it enabled me to use discreet colormaps. \r\n\r\nI fixed the range out of error bug because it caused a crash. \r\n\r\nI changed the default parameter of Mesher.delta because it uses a massive amount of memory. \r\n\r\n## How Has This Been Tested?\r\n\r\nI created a notebook with all the added functions and tested each function as I implemented it. All functions function in the full domain and visually match examples found online, and the minimums are what they should be. \r\n\r\nThen I used flask8 and black. I restricted flask8 and black testing to the files that I edited in each commit. \r\n\r\nI also ran py.test. It got a lot of warnings, but I made sure that my edits didn't add any new ones on top of those that occur in a fresh clone of the development branch. \r\n\r\n\r\n## Screenshots (if appropriate):\r\n\r\n## Types of changes\r\n<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->\r\n- [X] Bug fix (non-breaking change which fixes an issue)\r\n- [X] New feature (non-breaking change which adds functionality)\r\n- [ ] Breaking change (fix or feature that would cause existing functionality to change)\r\n\r\n## Checklist:\r\n<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->\r\n<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->\r\n- [X] My code follows the code style of this project.\r\n- [ ] My change requires a change to the documentation.\r\n- [ ] I have updated the documentation accordingly.\r\n- [X] I have read the **CONTRIBUTING** document.\r\n- [ ] I have added tests to cover my changes.\r\n- [X] All new and existing tests passed.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ljvmiranda921/pyswarms/issues/comments/405456925","html_url":"https://github.com/ljvmiranda921/pyswarms/pull/165#issuecomment-405456925","issue_url":"https://api.github.com/repos/ljvmiranda921/pyswarms/issues/165","id":405456925,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNTQ1NjkyNQ==","user":{"login":"ljvmiranda921","id":12949683,"node_id":"MDQ6VXNlcjEyOTQ5Njgz","avatar_url":"https://avatars0.githubusercontent.com/u/12949683?v=4","gravatar_id":"","url":"https://api.github.com/users/ljvmiranda921","html_url":"https://github.com/ljvmiranda921","followers_url":"https://api.github.com/users/ljvmiranda921/followers","following_url":"https://api.github.com/users/ljvmiranda921/following{/other_user}","gists_url":"https://api.github.com/users/ljvmiranda921/gists{/gist_id}","starred_url":"https://api.github.com/users/ljvmiranda921/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ljvmiranda921/subscriptions","organizations_url":"https://api.github.com/users/ljvmiranda921/orgs","repos_url":"https://api.github.com/users/ljvmiranda921/repos","events_url":"https://api.github.com/users/ljvmiranda921/events{/privacy}","received_events_url":"https://api.github.com/users/ljvmiranda921/received_events","type":"User","site_admin":false},"created_at":"2018-07-17T04:37:13Z","updated_at":"2018-07-17T04:37:13Z","author_association":"OWNER","body":"Hi @jayspeidell \r\n\r\n> I'll create the \"fix plotters module\" issue now and then split the two contributions into separate branches.\r\n\r\nAwesome! We do this so that we have a well-documented history of all problems, bugs, etc. in the project\r\n\r\n> Before I do another pull request, how do I make sure that the pull request references a specific issue?\r\n\r\nMake sure that the commits for one PR is only concerned with a specific issue (i.e, one for #158 and another for the one you'll create). \r\n\r\nI believe that for the single-objective functions PR, the only file that should change will be the `single_obj.py` (because you added new functions) and `test_single_obj.py` (because of new tests).\r\nFor another PR, I assume that only the files related to the `plotters` module should change. \r\n\r\nYou can check your commits at the \"Commits\" tab near the PR title. \r\n\r\nSo again: \r\n - one branch is only for single-objective functions, and \r\n - another branch for fixing the plotters module. \r\n\r\nBoth of them should **branch from** the `development` branch :+1: \r\nThis may be a loose example, but this is how i think the two branches should be made:\r\n\r\n```shell\r\n$ # Currently in development branch\r\n$ git checkout -b add-functions # Creates add-functions branch and jumps there\r\n$ # Add all changes related to add-functions\r\n$ git checkout development # Goes back to the development branch\r\n$ git checkout -b fix-plotters-module # Creates fix-plotters-module branch and jumps there\r\n$ # Add all changes/fixes related to fix-plotters-module\r\n```\r\n\r\nThen you can push the changes in your two branches and do two PRs :+1: \r\n"}}
{"actor":{"display_login":"ljvmiranda921"}}