{"action":"created","comment":{"url":"https://api.github.com/repos/refnx/refnx/pulls/comments/211149415","pull_request_review_id":147509919,"id":211149415,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMTE0OTQxNQ==","diff_hunk":"@@ -0,0 +1,307 @@\n+from __future__ import print_function, division\n+import numpy as np\n+try:\n+    from Bio.PDB import PDBParser\n+except ImportError:\n+    print('biopython must be installed to use MDSimulation')\n+    pass\n+try:\n+    import periodictable as pt\n+except ImportError:\n+    print('periodictable must be installed to use automatically generate '\n+          'scattering lengths, either install periodic table or use a .lgt '\n+          'file.')\n+    pass\n+from refnx.analysis import Parameters\n+from refnx.reflect import structure, Component\n+\n+\n+class MDSimulation(Component):\n+    \"\"\"\n+    Determines the scattering length density profile along the z-axis of a\n+    molecular dynamics output file (PDB format, unless MDAnalysis is\n+    installed). Lateral averaging occurs in the x-y plane.\n+\n+    Parameters\n+    ----------\n+    pdbfile: str\n+        The path and name of the .pdb file or for which the reflectometry\n+        should be found.\n+    layer_thickness: float, optional\n+        The thickness of the layers that the simulation cell should be sliced\n+        into. This will depend on the size of the particles in the simulation,\n+        for example a coarse-grained forcefield simulation will require thicker\n+        layers to stop overbinning.\n+    cut_off: float, optional","path":"refnx/reflect/_mdsimulation.py","position":35,"original_position":35,"commit_id":"fa13db83efb8b878b61a5077662931ac4543886b","original_commit_id":"fa13db83efb8b878b61a5077662931ac4543886b","user":{"login":"andyfaff","id":702934,"node_id":"MDQ6VXNlcjcwMjkzNA==","avatar_url":"https://avatars2.githubusercontent.com/u/702934?v=4","gravatar_id":"","url":"https://api.github.com/users/andyfaff","html_url":"https://github.com/andyfaff","followers_url":"https://api.github.com/users/andyfaff/followers","following_url":"https://api.github.com/users/andyfaff/following{/other_user}","gists_url":"https://api.github.com/users/andyfaff/gists{/gist_id}","starred_url":"https://api.github.com/users/andyfaff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andyfaff/subscriptions","organizations_url":"https://api.github.com/users/andyfaff/orgs","repos_url":"https://api.github.com/users/andyfaff/repos","events_url":"https://api.github.com/users/andyfaff/events{/privacy}","received_events_url":"https://api.github.com/users/andyfaff/received_events","type":"User","site_admin":false},"body":"How does cut_off work? Does it cut_off before flip?","created_at":"2018-08-20T06:14:59Z","updated_at":"2018-08-20T06:32:46Z","html_url":"https://github.com/refnx/refnx/pull/215#discussion_r211149415","pull_request_url":"https://api.github.com/repos/refnx/refnx/pulls/215","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/refnx/refnx/pulls/comments/211149415"},"html":{"href":"https://github.com/refnx/refnx/pull/215#discussion_r211149415"},"pull_request":{"href":"https://api.github.com/repos/refnx/refnx/pulls/215"}}},"pull_request":{"url":"https://api.github.com/repos/refnx/refnx/pulls/215","id":206416156,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA2NDE2MTU2","html_url":"https://github.com/refnx/refnx/pull/215","diff_url":"https://github.com/refnx/refnx/pull/215.diff","patch_url":"https://github.com/refnx/refnx/pull/215.patch","issue_url":"https://api.github.com/repos/refnx/refnx/issues/215","number":215,"state":"open","locked":false,"title":"ENH: Scattering length density profile from a molecular dynamics simulation trajectory file.","user":{"login":"arm61","id":15774281,"node_id":"MDQ6VXNlcjE1Nzc0Mjgx","avatar_url":"https://avatars3.githubusercontent.com/u/15774281?v=4","gravatar_id":"","url":"https://api.github.com/users/arm61","html_url":"https://github.com/arm61","followers_url":"https://api.github.com/users/arm61/followers","following_url":"https://api.github.com/users/arm61/following{/other_user}","gists_url":"https://api.github.com/users/arm61/gists{/gist_id}","starred_url":"https://api.github.com/users/arm61/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arm61/subscriptions","organizations_url":"https://api.github.com/users/arm61/orgs","repos_url":"https://api.github.com/users/arm61/repos","events_url":"https://api.github.com/users/arm61/events{/privacy}","received_events_url":"https://api.github.com/users/arm61/received_events","type":"User","site_admin":false},"body":"Addition of the ability to obtain a SLD profile directly from a molecular dynamics simulation using the `Simulation` class. This uses `MDAnalysis` to read in a pdb file and calculates the scattering length density of each layer. This currently requires a dictionary file (see `simulation.lgt`) to know the relevant scattering length for each individual atom type as defined in the simulation file.","created_at":"2018-08-06T14:25:51Z","updated_at":"2018-08-20T06:32:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f54a0aa4ef1b20c7f295304832cc9586ba68159b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/refnx/refnx/pulls/215/commits","review_comments_url":"https://api.github.com/repos/refnx/refnx/pulls/215/comments","review_comment_url":"https://api.github.com/repos/refnx/refnx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/refnx/refnx/issues/215/comments","statuses_url":"https://api.github.com/repos/refnx/refnx/statuses/fa13db83efb8b878b61a5077662931ac4543886b","head":{"label":"arm61:simulation","ref":"simulation","sha":"fa13db83efb8b878b61a5077662931ac4543886b","user":{"login":"arm61","id":15774281,"node_id":"MDQ6VXNlcjE1Nzc0Mjgx","avatar_url":"https://avatars3.githubusercontent.com/u/15774281?v=4","gravatar_id":"","url":"https://api.github.com/users/arm61","html_url":"https://github.com/arm61","followers_url":"https://api.github.com/users/arm61/followers","following_url":"https://api.github.com/users/arm61/following{/other_user}","gists_url":"https://api.github.com/users/arm61/gists{/gist_id}","starred_url":"https://api.github.com/users/arm61/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arm61/subscriptions","organizations_url":"https://api.github.com/users/arm61/orgs","repos_url":"https://api.github.com/users/arm61/repos","events_url":"https://api.github.com/users/arm61/events{/privacy}","received_events_url":"https://api.github.com/users/arm61/received_events","type":"User","site_admin":false},"repo":{"id":89147307,"node_id":"MDEwOlJlcG9zaXRvcnk4OTE0NzMwNw==","name":"refnx","full_name":"arm61/refnx","owner":{"login":"arm61","id":15774281,"node_id":"MDQ6VXNlcjE1Nzc0Mjgx","avatar_url":"https://avatars3.githubusercontent.com/u/15774281?v=4","gravatar_id":"","url":"https://api.github.com/users/arm61","html_url":"https://github.com/arm61","followers_url":"https://api.github.com/users/arm61/followers","following_url":"https://api.github.com/users/arm61/following{/other_user}","gists_url":"https://api.github.com/users/arm61/gists{/gist_id}","starred_url":"https://api.github.com/users/arm61/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arm61/subscriptions","organizations_url":"https://api.github.com/users/arm61/orgs","repos_url":"https://api.github.com/users/arm61/repos","events_url":"https://api.github.com/users/arm61/events{/privacy}","received_events_url":"https://api.github.com/users/arm61/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/arm61/refnx","description":"Neutron and X-ray reflectometry analysis in Python","fork":true,"url":"https://api.github.com/repos/arm61/refnx","forks_url":"https://api.github.com/repos/arm61/refnx/forks","keys_url":"https://api.github.com/repos/arm61/refnx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/arm61/refnx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/arm61/refnx/teams","hooks_url":"https://api.github.com/repos/arm61/refnx/hooks","issue_events_url":"https://api.github.com/repos/arm61/refnx/issues/events{/number}","events_url":"https://api.github.com/repos/arm61/refnx/events","assignees_url":"https://api.github.com/repos/arm61/refnx/assignees{/user}","branches_url":"https://api.github.com/repos/arm61/refnx/branches{/branch}","tags_url":"https://api.github.com/repos/arm61/refnx/tags","blobs_url":"https://api.github.com/repos/arm61/refnx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/arm61/refnx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/arm61/refnx/git/refs{/sha}","trees_url":"https://api.github.com/repos/arm61/refnx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/arm61/refnx/statuses/{sha}","languages_url":"https://api.github.com/repos/arm61/refnx/languages","stargazers_url":"https://api.github.com/repos/arm61/refnx/stargazers","contributors_url":"https://api.github.com/repos/arm61/refnx/contributors","subscribers_url":"https://api.github.com/repos/arm61/refnx/subscribers","subscription_url":"https://api.github.com/repos/arm61/refnx/subscription","commits_url":"https://api.github.com/repos/arm61/refnx/commits{/sha}","git_commits_url":"https://api.github.com/repos/arm61/refnx/git/commits{/sha}","comments_url":"https://api.github.com/repos/arm61/refnx/comments{/number}","issue_comment_url":"https://api.github.com/repos/arm61/refnx/issues/comments{/number}","contents_url":"https://api.github.com/repos/arm61/refnx/contents/{+path}","compare_url":"https://api.github.com/repos/arm61/refnx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/arm61/refnx/merges","archive_url":"https://api.github.com/repos/arm61/refnx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/arm61/refnx/downloads","issues_url":"https://api.github.com/repos/arm61/refnx/issues{/number}","pulls_url":"https://api.github.com/repos/arm61/refnx/pulls{/number}","milestones_url":"https://api.github.com/repos/arm61/refnx/milestones{/number}","notifications_url":"https://api.github.com/repos/arm61/refnx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/arm61/refnx/labels{/name}","releases_url":"https://api.github.com/repos/arm61/refnx/releases{/id}","deployments_url":"https://api.github.com/repos/arm61/refnx/deployments","created_at":"2017-04-23T14:20:57Z","updated_at":"2018-08-06T14:19:10Z","pushed_at":"2018-08-10T12:35:29Z","git_url":"git://github.com/arm61/refnx.git","ssh_url":"git@github.com:arm61/refnx.git","clone_url":"https://github.com/arm61/refnx.git","svn_url":"https://github.com/arm61/refnx","homepage":"http://refnx.github.io","size":48778,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"refnx:master","ref":"master","sha":"2e9ba66003d3dbd47f7a644c2d9ccb5dc20e5743","user":{"login":"refnx","id":14886975,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0ODg2OTc1","avatar_url":"https://avatars1.githubusercontent.com/u/14886975?v=4","gravatar_id":"","url":"https://api.github.com/users/refnx","html_url":"https://github.com/refnx","followers_url":"https://api.github.com/users/refnx/followers","following_url":"https://api.github.com/users/refnx/following{/other_user}","gists_url":"https://api.github.com/users/refnx/gists{/gist_id}","starred_url":"https://api.github.com/users/refnx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/refnx/subscriptions","organizations_url":"https://api.github.com/users/refnx/orgs","repos_url":"https://api.github.com/users/refnx/repos","events_url":"https://api.github.com/users/refnx/events{/privacy}","received_events_url":"https://api.github.com/users/refnx/received_events","type":"Organization","site_admin":false},"repo":{"id":43357027,"node_id":"MDEwOlJlcG9zaXRvcnk0MzM1NzAyNw==","name":"refnx","full_name":"refnx/refnx","owner":{"login":"refnx","id":14886975,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0ODg2OTc1","avatar_url":"https://avatars1.githubusercontent.com/u/14886975?v=4","gravatar_id":"","url":"https://api.github.com/users/refnx","html_url":"https://github.com/refnx","followers_url":"https://api.github.com/users/refnx/followers","following_url":"https://api.github.com/users/refnx/following{/other_user}","gists_url":"https://api.github.com/users/refnx/gists{/gist_id}","starred_url":"https://api.github.com/users/refnx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/refnx/subscriptions","organizations_url":"https://api.github.com/users/refnx/orgs","repos_url":"https://api.github.com/users/refnx/repos","events_url":"https://api.github.com/users/refnx/events{/privacy}","received_events_url":"https://api.github.com/users/refnx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/refnx/refnx","description":"Neutron and X-ray reflectometry analysis in Python","fork":false,"url":"https://api.github.com/repos/refnx/refnx","forks_url":"https://api.github.com/repos/refnx/refnx/forks","keys_url":"https://api.github.com/repos/refnx/refnx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/refnx/refnx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/refnx/refnx/teams","hooks_url":"https://api.github.com/repos/refnx/refnx/hooks","issue_events_url":"https://api.github.com/repos/refnx/refnx/issues/events{/number}","events_url":"https://api.github.com/repos/refnx/refnx/events","assignees_url":"https://api.github.com/repos/refnx/refnx/assignees{/user}","branches_url":"https://api.github.com/repos/refnx/refnx/branches{/branch}","tags_url":"https://api.github.com/repos/refnx/refnx/tags","blobs_url":"https://api.github.com/repos/refnx/refnx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/refnx/refnx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/refnx/refnx/git/refs{/sha}","trees_url":"https://api.github.com/repos/refnx/refnx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/refnx/refnx/statuses/{sha}","languages_url":"https://api.github.com/repos/refnx/refnx/languages","stargazers_url":"https://api.github.com/repos/refnx/refnx/stargazers","contributors_url":"https://api.github.com/repos/refnx/refnx/contributors","subscribers_url":"https://api.github.com/repos/refnx/refnx/subscribers","subscription_url":"https://api.github.com/repos/refnx/refnx/subscription","commits_url":"https://api.github.com/repos/refnx/refnx/commits{/sha}","git_commits_url":"https://api.github.com/repos/refnx/refnx/git/commits{/sha}","comments_url":"https://api.github.com/repos/refnx/refnx/comments{/number}","issue_comment_url":"https://api.github.com/repos/refnx/refnx/issues/comments{/number}","contents_url":"https://api.github.com/repos/refnx/refnx/contents/{+path}","compare_url":"https://api.github.com/repos/refnx/refnx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/refnx/refnx/merges","archive_url":"https://api.github.com/repos/refnx/refnx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/refnx/refnx/downloads","issues_url":"https://api.github.com/repos/refnx/refnx/issues{/number}","pulls_url":"https://api.github.com/repos/refnx/refnx/pulls{/number}","milestones_url":"https://api.github.com/repos/refnx/refnx/milestones{/number}","notifications_url":"https://api.github.com/repos/refnx/refnx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/refnx/refnx/labels{/name}","releases_url":"https://api.github.com/repos/refnx/refnx/releases{/id}","deployments_url":"https://api.github.com/repos/refnx/refnx/deployments","created_at":"2015-09-29T09:11:19Z","updated_at":"2018-08-15T05:25:59Z","pushed_at":"2018-08-15T05:25:57Z","git_url":"git://github.com/refnx/refnx.git","ssh_url":"git@github.com:refnx/refnx.git","clone_url":"https://github.com/refnx/refnx.git","svn_url":"https://github.com/refnx/refnx","homepage":"https://refnx.readthedocs.io","size":45155,"stargazers_count":4,"watchers_count":4,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":8,"open_issues":2,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/refnx/refnx/pulls/215"},"html":{"href":"https://github.com/refnx/refnx/pull/215"},"issue":{"href":"https://api.github.com/repos/refnx/refnx/issues/215"},"comments":{"href":"https://api.github.com/repos/refnx/refnx/issues/215/comments"},"review_comments":{"href":"https://api.github.com/repos/refnx/refnx/pulls/215/comments"},"review_comment":{"href":"https://api.github.com/repos/refnx/refnx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/refnx/refnx/pulls/215/commits"},"statuses":{"href":"https://api.github.com/repos/refnx/refnx/statuses/fa13db83efb8b878b61a5077662931ac4543886b"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"andyfaff"}}