{"action":"created","comment":{"url":"https://api.github.com/repos/choderalab/software-development/pulls/comments/86700565","pull_request_review_id":7345099,"id":86700565,"diff_hunk":"@@ -0,0 +1,216 @@\n+# Python coding best practices\n+\n+You are writing code that you and other people will read and modify multiple times, so there are few things to keep in mind that will simplify your life:\n+- **Keep it simple, clean and documented.** Your code and your documentation are your best methods section! Write it so that your colleagues can understand it easily, and that you will remember what you did 6 months from now.\n+- **Make it robust and extensible.** Writing robust code means you will spend less time debugging, or even worse, analyzing results from an incorrect code. Writing extensible code means you will spend less time modifying it.\n+\n+This article tries to offer practical suggestions on how to achieve these two (sometimes clashing) goals.\n+\n+1. [Use a modern environment](#use-a-modern-environment)\n+2. [Keep clean and adhere to PEP8](#keep-clean-and-adhere-to-pep8)\n+3. [Document your code](#document-your-code)\n+4. [Find bugs before they find you](#find-bugs-before-they-find-you)\n+5. [Know the basics of OOP design](#know-the-basics-of-oop-design)\n+\n+\n+## Use a modern environment\n+\n+- **Support Python 3!** Almost all scientific packages have now added Python 3 support, and many are making plans to drop Python 2.\n+\n+- **Use a good editor.** Until you try, you have no idea how much it can speed you up. It will catch syntactic (and some semantic) errors for you. Autocompletion will save you from misspelling variable/function names. The \"jump to definition\" (and documentation) feature will spare you a lot of file browsing looking for other code. My personal favorite is PyCharm, but any editor with those features will do.\n+\n+\n+## Keep clean and adhere to PEP8\n+\n+[PEP8](https://www.python.org/dev/peps/pep-0008/) is document defining a stylistic standard to make Python code more readable/understandable. Almost the entirety of python packages out there adopt it. The document is not the most exciting read, but the good news is __you don't have to read it if you are using a good editor__ that will highlight PEP8 violations. Here are summarized the most practically useful guidelines with a brief rationale.","path":"PYTHON_CODING.md","position":25,"original_position":25,"commit_id":"92a200b14d230cc2ccdfba84d020679ab00f2de5","original_commit_id":"92a200b14d230cc2ccdfba84d020679ab00f2de5","user":{"login":"andrrizzi","id":1682142,"avatar_url":"https://avatars.githubusercontent.com/u/1682142?v=3","gravatar_id":"","url":"https://api.github.com/users/andrrizzi","html_url":"https://github.com/andrrizzi","followers_url":"https://api.github.com/users/andrrizzi/followers","following_url":"https://api.github.com/users/andrrizzi/following{/other_user}","gists_url":"https://api.github.com/users/andrrizzi/gists{/gist_id}","starred_url":"https://api.github.com/users/andrrizzi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrrizzi/subscriptions","organizations_url":"https://api.github.com/users/andrrizzi/orgs","repos_url":"https://api.github.com/users/andrrizzi/repos","events_url":"https://api.github.com/users/andrrizzi/events{/privacy}","received_events_url":"https://api.github.com/users/andrrizzi/received_events","type":"User","site_admin":false},"body":"Ok! I found a link explaining how to enable it on Atom too. Will add instructions.","created_at":"2016-11-07T00:03:49Z","updated_at":"2016-11-07T00:03:49Z","html_url":"https://github.com/choderalab/software-development/pull/23#discussion_r86700565","pull_request_url":"https://api.github.com/repos/choderalab/software-development/pulls/23","_links":{"self":{"href":"https://api.github.com/repos/choderalab/software-development/pulls/comments/86700565"},"html":{"href":"https://github.com/choderalab/software-development/pull/23#discussion_r86700565"},"pull_request":{"href":"https://api.github.com/repos/choderalab/software-development/pulls/23"}}},"pull_request":{"url":"https://api.github.com/repos/choderalab/software-development/pulls/23","id":92505532,"html_url":"https://github.com/choderalab/software-development/pull/23","diff_url":"https://github.com/choderalab/software-development/pull/23.diff","patch_url":"https://github.com/choderalab/software-development/pull/23.patch","issue_url":"https://api.github.com/repos/choderalab/software-development/issues/23","number":23,"state":"open","locked":false,"title":"Python coding best practices","user":{"login":"andrrizzi","id":1682142,"avatar_url":"https://avatars.githubusercontent.com/u/1682142?v=3","gravatar_id":"","url":"https://api.github.com/users/andrrizzi","html_url":"https://github.com/andrrizzi","followers_url":"https://api.github.com/users/andrrizzi/followers","following_url":"https://api.github.com/users/andrrizzi/following{/other_user}","gists_url":"https://api.github.com/users/andrrizzi/gists{/gist_id}","starred_url":"https://api.github.com/users/andrrizzi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrrizzi/subscriptions","organizations_url":"https://api.github.com/users/andrrizzi/orgs","repos_url":"https://api.github.com/users/andrrizzi/repos","events_url":"https://api.github.com/users/andrrizzi/events{/privacy}","received_events_url":"https://api.github.com/users/andrrizzi/received_events","type":"User","site_admin":false},"body":"Fixes #10 . Ready for review.\r\n\r\nI kept this as a general Python introduction article which refers to the testing and documentation tutorials (@gregoryross and @bas-rustenburg). I kept the OOP design discussion for a separate article since it's somewhat more advanced. I'll write this next week.\r\n\r\nI'd like feedback particularly on the `Find bugs before they find you` section, where I compiled a list of patterns that can mask bugs. Are there some I should add/remove?","created_at":"2016-11-06T22:30:03Z","updated_at":"2016-11-07T00:03:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a07fa4bdf58695defb27a50d2ba936a2495d42c5","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/choderalab/software-development/pulls/23/commits","review_comments_url":"https://api.github.com/repos/choderalab/software-development/pulls/23/comments","review_comment_url":"https://api.github.com/repos/choderalab/software-development/pulls/comments{/number}","comments_url":"https://api.github.com/repos/choderalab/software-development/issues/23/comments","statuses_url":"https://api.github.com/repos/choderalab/software-development/statuses/92a200b14d230cc2ccdfba84d020679ab00f2de5","head":{"label":"choderalab:best-python","ref":"best-python","sha":"92a200b14d230cc2ccdfba84d020679ab00f2de5","user":{"login":"choderalab","id":4217481,"avatar_url":"https://avatars.githubusercontent.com/u/4217481?v=3","gravatar_id":"","url":"https://api.github.com/users/choderalab","html_url":"https://github.com/choderalab","followers_url":"https://api.github.com/users/choderalab/followers","following_url":"https://api.github.com/users/choderalab/following{/other_user}","gists_url":"https://api.github.com/users/choderalab/gists{/gist_id}","starred_url":"https://api.github.com/users/choderalab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/choderalab/subscriptions","organizations_url":"https://api.github.com/users/choderalab/orgs","repos_url":"https://api.github.com/users/choderalab/repos","events_url":"https://api.github.com/users/choderalab/events{/privacy}","received_events_url":"https://api.github.com/users/choderalab/received_events","type":"Organization","site_admin":false},"repo":{"id":71163583,"name":"software-development","full_name":"choderalab/software-development","owner":{"login":"choderalab","id":4217481,"avatar_url":"https://avatars.githubusercontent.com/u/4217481?v=3","gravatar_id":"","url":"https://api.github.com/users/choderalab","html_url":"https://github.com/choderalab","followers_url":"https://api.github.com/users/choderalab/followers","following_url":"https://api.github.com/users/choderalab/following{/other_user}","gists_url":"https://api.github.com/users/choderalab/gists{/gist_id}","starred_url":"https://api.github.com/users/choderalab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/choderalab/subscriptions","organizations_url":"https://api.github.com/users/choderalab/orgs","repos_url":"https://api.github.com/users/choderalab/repos","events_url":"https://api.github.com/users/choderalab/events{/privacy}","received_events_url":"https://api.github.com/users/choderalab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/choderalab/software-development","description":"A primer on software development best practices for computational chemistry","fork":false,"url":"https://api.github.com/repos/choderalab/software-development","forks_url":"https://api.github.com/repos/choderalab/software-development/forks","keys_url":"https://api.github.com/repos/choderalab/software-development/keys{/key_id}","collaborators_url":"https://api.github.com/repos/choderalab/software-development/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/choderalab/software-development/teams","hooks_url":"https://api.github.com/repos/choderalab/software-development/hooks","issue_events_url":"https://api.github.com/repos/choderalab/software-development/issues/events{/number}","events_url":"https://api.github.com/repos/choderalab/software-development/events","assignees_url":"https://api.github.com/repos/choderalab/software-development/assignees{/user}","branches_url":"https://api.github.com/repos/choderalab/software-development/branches{/branch}","tags_url":"https://api.github.com/repos/choderalab/software-development/tags","blobs_url":"https://api.github.com/repos/choderalab/software-development/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/choderalab/software-development/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/choderalab/software-development/git/refs{/sha}","trees_url":"https://api.github.com/repos/choderalab/software-development/git/trees{/sha}","statuses_url":"https://api.github.com/repos/choderalab/software-development/statuses/{sha}","languages_url":"https://api.github.com/repos/choderalab/software-development/languages","stargazers_url":"https://api.github.com/repos/choderalab/software-development/stargazers","contributors_url":"https://api.github.com/repos/choderalab/software-development/contributors","subscribers_url":"https://api.github.com/repos/choderalab/software-development/subscribers","subscription_url":"https://api.github.com/repos/choderalab/software-development/subscription","commits_url":"https://api.github.com/repos/choderalab/software-development/commits{/sha}","git_commits_url":"https://api.github.com/repos/choderalab/software-development/git/commits{/sha}","comments_url":"https://api.github.com/repos/choderalab/software-development/comments{/number}","issue_comment_url":"https://api.github.com/repos/choderalab/software-development/issues/comments{/number}","contents_url":"https://api.github.com/repos/choderalab/software-development/contents/{+path}","compare_url":"https://api.github.com/repos/choderalab/software-development/compare/{base}...{head}","merges_url":"https://api.github.com/repos/choderalab/software-development/merges","archive_url":"https://api.github.com/repos/choderalab/software-development/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/choderalab/software-development/downloads","issues_url":"https://api.github.com/repos/choderalab/software-development/issues{/number}","pulls_url":"https://api.github.com/repos/choderalab/software-development/pulls{/number}","milestones_url":"https://api.github.com/repos/choderalab/software-development/milestones{/number}","notifications_url":"https://api.github.com/repos/choderalab/software-development/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/choderalab/software-development/labels{/name}","releases_url":"https://api.github.com/repos/choderalab/software-development/releases{/id}","deployments_url":"https://api.github.com/repos/choderalab/software-development/deployments","created_at":"2016-10-17T17:26:37Z","updated_at":"2016-10-17T17:26:37Z","pushed_at":"2016-11-06T22:30:03Z","git_url":"git://github.com/choderalab/software-development.git","ssh_url":"git@github.com:choderalab/software-development.git","clone_url":"https://github.com/choderalab/software-development.git","svn_url":"https://github.com/choderalab/software-development","homepage":null,"size":30,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":20,"forks":0,"open_issues":20,"watchers":0,"default_branch":"master"}},"base":{"label":"choderalab:master","ref":"master","sha":"54964f1feb225ad7919a94d76329e14ce160c2c7","user":{"login":"choderalab","id":4217481,"avatar_url":"https://avatars.githubusercontent.com/u/4217481?v=3","gravatar_id":"","url":"https://api.github.com/users/choderalab","html_url":"https://github.com/choderalab","followers_url":"https://api.github.com/users/choderalab/followers","following_url":"https://api.github.com/users/choderalab/following{/other_user}","gists_url":"https://api.github.com/users/choderalab/gists{/gist_id}","starred_url":"https://api.github.com/users/choderalab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/choderalab/subscriptions","organizations_url":"https://api.github.com/users/choderalab/orgs","repos_url":"https://api.github.com/users/choderalab/repos","events_url":"https://api.github.com/users/choderalab/events{/privacy}","received_events_url":"https://api.github.com/users/choderalab/received_events","type":"Organization","site_admin":false},"repo":{"id":71163583,"name":"software-development","full_name":"choderalab/software-development","owner":{"login":"choderalab","id":4217481,"avatar_url":"https://avatars.githubusercontent.com/u/4217481?v=3","gravatar_id":"","url":"https://api.github.com/users/choderalab","html_url":"https://github.com/choderalab","followers_url":"https://api.github.com/users/choderalab/followers","following_url":"https://api.github.com/users/choderalab/following{/other_user}","gists_url":"https://api.github.com/users/choderalab/gists{/gist_id}","starred_url":"https://api.github.com/users/choderalab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/choderalab/subscriptions","organizations_url":"https://api.github.com/users/choderalab/orgs","repos_url":"https://api.github.com/users/choderalab/repos","events_url":"https://api.github.com/users/choderalab/events{/privacy}","received_events_url":"https://api.github.com/users/choderalab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/choderalab/software-development","description":"A primer on software development best practices for computational chemistry","fork":false,"url":"https://api.github.com/repos/choderalab/software-development","forks_url":"https://api.github.com/repos/choderalab/software-development/forks","keys_url":"https://api.github.com/repos/choderalab/software-development/keys{/key_id}","collaborators_url":"https://api.github.com/repos/choderalab/software-development/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/choderalab/software-development/teams","hooks_url":"https://api.github.com/repos/choderalab/software-development/hooks","issue_events_url":"https://api.github.com/repos/choderalab/software-development/issues/events{/number}","events_url":"https://api.github.com/repos/choderalab/software-development/events","assignees_url":"https://api.github.com/repos/choderalab/software-development/assignees{/user}","branches_url":"https://api.github.com/repos/choderalab/software-development/branches{/branch}","tags_url":"https://api.github.com/repos/choderalab/software-development/tags","blobs_url":"https://api.github.com/repos/choderalab/software-development/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/choderalab/software-development/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/choderalab/software-development/git/refs{/sha}","trees_url":"https://api.github.com/repos/choderalab/software-development/git/trees{/sha}","statuses_url":"https://api.github.com/repos/choderalab/software-development/statuses/{sha}","languages_url":"https://api.github.com/repos/choderalab/software-development/languages","stargazers_url":"https://api.github.com/repos/choderalab/software-development/stargazers","contributors_url":"https://api.github.com/repos/choderalab/software-development/contributors","subscribers_url":"https://api.github.com/repos/choderalab/software-development/subscribers","subscription_url":"https://api.github.com/repos/choderalab/software-development/subscription","commits_url":"https://api.github.com/repos/choderalab/software-development/commits{/sha}","git_commits_url":"https://api.github.com/repos/choderalab/software-development/git/commits{/sha}","comments_url":"https://api.github.com/repos/choderalab/software-development/comments{/number}","issue_comment_url":"https://api.github.com/repos/choderalab/software-development/issues/comments{/number}","contents_url":"https://api.github.com/repos/choderalab/software-development/contents/{+path}","compare_url":"https://api.github.com/repos/choderalab/software-development/compare/{base}...{head}","merges_url":"https://api.github.com/repos/choderalab/software-development/merges","archive_url":"https://api.github.com/repos/choderalab/software-development/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/choderalab/software-development/downloads","issues_url":"https://api.github.com/repos/choderalab/software-development/issues{/number}","pulls_url":"https://api.github.com/repos/choderalab/software-development/pulls{/number}","milestones_url":"https://api.github.com/repos/choderalab/software-development/milestones{/number}","notifications_url":"https://api.github.com/repos/choderalab/software-development/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/choderalab/software-development/labels{/name}","releases_url":"https://api.github.com/repos/choderalab/software-development/releases{/id}","deployments_url":"https://api.github.com/repos/choderalab/software-development/deployments","created_at":"2016-10-17T17:26:37Z","updated_at":"2016-10-17T17:26:37Z","pushed_at":"2016-11-06T22:30:03Z","git_url":"git://github.com/choderalab/software-development.git","ssh_url":"git@github.com:choderalab/software-development.git","clone_url":"https://github.com/choderalab/software-development.git","svn_url":"https://github.com/choderalab/software-development","homepage":null,"size":30,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":20,"forks":0,"open_issues":20,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/choderalab/software-development/pulls/23"},"html":{"href":"https://github.com/choderalab/software-development/pull/23"},"issue":{"href":"https://api.github.com/repos/choderalab/software-development/issues/23"},"comments":{"href":"https://api.github.com/repos/choderalab/software-development/issues/23/comments"},"review_comments":{"href":"https://api.github.com/repos/choderalab/software-development/pulls/23/comments"},"review_comment":{"href":"https://api.github.com/repos/choderalab/software-development/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/choderalab/software-development/pulls/23/commits"},"statuses":{"href":"https://api.github.com/repos/choderalab/software-development/statuses/92a200b14d230cc2ccdfba84d020679ab00f2de5"}}}}
{"actor":{"display_login":"andrrizzi"}}