{"action":"created","comment":{"url":"https://api.github.com/repos/choderalab/openpathsampling/pulls/comments/55209329","id":55209329,"diff_hunk":"@@ -284,6 +284,28 @@ def next(self):\n \n         return ObjectIterator()\n \n+    def index_of(self, sub_traj):\n+        \"\"\"\n+        Return a list of indices of the snapshots in sub_traj within the trajectory\n+\n+        Parameters\n+        ----------\n+        sub_traj : :obj:`Trajectory`\n+\n+        Returns\n+        -------\n+        list of int or None\n+            a list of integer indices or None, if a snapshot is not found in the trajectory\n+        \"\"\"\n+        ret = []\n+        for s in sub_traj:\n+            if s in self:\n+                ret.append(self.index(s))\n+            else:\n+                ret.append(None)\n+\n+        return ret\n+","path":"openpathsampling/engines/trajectory.py","position":25,"original_position":25,"commit_id":"7d13ca28d5c6e6a4ac7470107161aeed15ef1cb1","original_commit_id":"7d13ca28d5c6e6a4ac7470107161aeed15ef1cb1","user":{"login":"dwhswenson","id":8178546,"avatar_url":"https://avatars.githubusercontent.com/u/8178546?v=3","gravatar_id":"","url":"https://api.github.com/users/dwhswenson","html_url":"https://github.com/dwhswenson","followers_url":"https://api.github.com/users/dwhswenson/followers","following_url":"https://api.github.com/users/dwhswenson/following{/other_user}","gists_url":"https://api.github.com/users/dwhswenson/gists{/gist_id}","starred_url":"https://api.github.com/users/dwhswenson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwhswenson/subscriptions","organizations_url":"https://api.github.com/users/dwhswenson/orgs","repos_url":"https://api.github.com/users/dwhswenson/repos","events_url":"https://api.github.com/users/dwhswenson/events{/privacy}","received_events_url":"https://api.github.com/users/dwhswenson/received_events","type":"User","site_admin":false},"body":"Can we keep my implementation in #435?","created_at":"2016-03-07T14:25:30Z","updated_at":"2016-03-07T14:25:30Z","html_url":"https://github.com/choderalab/openpathsampling/pull/441#discussion_r55209329","pull_request_url":"https://api.github.com/repos/choderalab/openpathsampling/pulls/441","_links":{"self":{"href":"https://api.github.com/repos/choderalab/openpathsampling/pulls/comments/55209329"},"html":{"href":"https://github.com/choderalab/openpathsampling/pull/441#discussion_r55209329"},"pull_request":{"href":"https://api.github.com/repos/choderalab/openpathsampling/pulls/441"}}},"pull_request":{"url":"https://api.github.com/repos/choderalab/openpathsampling/pulls/441","id":61911219,"html_url":"https://github.com/choderalab/openpathsampling/pull/441","diff_url":"https://github.com/choderalab/openpathsampling/pull/441.diff","patch_url":"https://github.com/choderalab/openpathsampling/pull/441.patch","issue_url":"https://api.github.com/repos/choderalab/openpathsampling/issues/441","number":441,"state":"open","locked":false,"title":"Fix bug in ensemble.split","user":{"login":"jhprinz","id":5091934,"avatar_url":"https://avatars.githubusercontent.com/u/5091934?v=3","gravatar_id":"","url":"https://api.github.com/users/jhprinz","html_url":"https://github.com/jhprinz","followers_url":"https://api.github.com/users/jhprinz/followers","following_url":"https://api.github.com/users/jhprinz/following{/other_user}","gists_url":"https://api.github.com/users/jhprinz/gists{/gist_id}","starred_url":"https://api.github.com/users/jhprinz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhprinz/subscriptions","organizations_url":"https://api.github.com/users/jhprinz/orgs","repos_url":"https://api.github.com/users/jhprinz/repos","events_url":"https://api.github.com/users/jhprinz/events{/privacy}","received_events_url":"https://api.github.com/users/jhprinz/received_events","type":"User","site_admin":false},"body":"This adresses issue #437 and should fix it.\r\n\r\nIt also add two more features:\r\n1. `reverse : bool` : Chose to reverse the order in which the splitting operates\r\n2. `n_results` : int : Limit the number of results for speed up\r\n\r\nThere are also two new function as short-cuts:\r\n\r\n```\r\nfind_first_subtrajectory(trajectory)\r\nfind_last_subtrajectory(trajectory)\r\n```\r\n\r\nTrajectory has a new function\r\n```\r\ntrajectory.index_of(sub_trajectory)\r\n```\r\n\r\nwhich returns a list of indices where frames in sub_trajectory are located in traj. ","created_at":"2016-03-07T12:34:06Z","updated_at":"2016-03-07T14:25:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e96395cb82506920cfe4bc16205524ae1a265ac3","assignee":{"login":"dwhswenson","id":8178546,"avatar_url":"https://avatars.githubusercontent.com/u/8178546?v=3","gravatar_id":"","url":"https://api.github.com/users/dwhswenson","html_url":"https://github.com/dwhswenson","followers_url":"https://api.github.com/users/dwhswenson/followers","following_url":"https://api.github.com/users/dwhswenson/following{/other_user}","gists_url":"https://api.github.com/users/dwhswenson/gists{/gist_id}","starred_url":"https://api.github.com/users/dwhswenson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwhswenson/subscriptions","organizations_url":"https://api.github.com/users/dwhswenson/orgs","repos_url":"https://api.github.com/users/dwhswenson/repos","events_url":"https://api.github.com/users/dwhswenson/events{/privacy}","received_events_url":"https://api.github.com/users/dwhswenson/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/choderalab/openpathsampling/pulls/441/commits","review_comments_url":"https://api.github.com/repos/choderalab/openpathsampling/pulls/441/comments","review_comment_url":"https://api.github.com/repos/choderalab/openpathsampling/pulls/comments{/number}","comments_url":"https://api.github.com/repos/choderalab/openpathsampling/issues/441/comments","statuses_url":"https://api.github.com/repos/choderalab/openpathsampling/statuses/7d13ca28d5c6e6a4ac7470107161aeed15ef1cb1","head":{"label":"jhprinz:split","ref":"split","sha":"7d13ca28d5c6e6a4ac7470107161aeed15ef1cb1","user":{"login":"jhprinz","id":5091934,"avatar_url":"https://avatars.githubusercontent.com/u/5091934?v=3","gravatar_id":"","url":"https://api.github.com/users/jhprinz","html_url":"https://github.com/jhprinz","followers_url":"https://api.github.com/users/jhprinz/followers","following_url":"https://api.github.com/users/jhprinz/following{/other_user}","gists_url":"https://api.github.com/users/jhprinz/gists{/gist_id}","starred_url":"https://api.github.com/users/jhprinz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhprinz/subscriptions","organizations_url":"https://api.github.com/users/jhprinz/orgs","repos_url":"https://api.github.com/users/jhprinz/repos","events_url":"https://api.github.com/users/jhprinz/events{/privacy}","received_events_url":"https://api.github.com/users/jhprinz/received_events","type":"User","site_admin":false},"repo":{"id":23916614,"name":"openpathsampling","full_name":"jhprinz/openpathsampling","owner":{"login":"jhprinz","id":5091934,"avatar_url":"https://avatars.githubusercontent.com/u/5091934?v=3","gravatar_id":"","url":"https://api.github.com/users/jhprinz","html_url":"https://github.com/jhprinz","followers_url":"https://api.github.com/users/jhprinz/followers","following_url":"https://api.github.com/users/jhprinz/following{/other_user}","gists_url":"https://api.github.com/users/jhprinz/gists{/gist_id}","starred_url":"https://api.github.com/users/jhprinz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhprinz/subscriptions","organizations_url":"https://api.github.com/users/jhprinz/orgs","repos_url":"https://api.github.com/users/jhprinz/repos","events_url":"https://api.github.com/users/jhprinz/events{/privacy}","received_events_url":"https://api.github.com/users/jhprinz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jhprinz/openpathsampling","description":"Explorations of ways to combine MSMs with TIS","fork":true,"url":"https://api.github.com/repos/jhprinz/openpathsampling","forks_url":"https://api.github.com/repos/jhprinz/openpathsampling/forks","keys_url":"https://api.github.com/repos/jhprinz/openpathsampling/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jhprinz/openpathsampling/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jhprinz/openpathsampling/teams","hooks_url":"https://api.github.com/repos/jhprinz/openpathsampling/hooks","issue_events_url":"https://api.github.com/repos/jhprinz/openpathsampling/issues/events{/number}","events_url":"https://api.github.com/repos/jhprinz/openpathsampling/events","assignees_url":"https://api.github.com/repos/jhprinz/openpathsampling/assignees{/user}","branches_url":"https://api.github.com/repos/jhprinz/openpathsampling/branches{/branch}","tags_url":"https://api.github.com/repos/jhprinz/openpathsampling/tags","blobs_url":"https://api.github.com/repos/jhprinz/openpathsampling/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jhprinz/openpathsampling/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jhprinz/openpathsampling/git/refs{/sha}","trees_url":"https://api.github.com/repos/jhprinz/openpathsampling/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jhprinz/openpathsampling/statuses/{sha}","languages_url":"https://api.github.com/repos/jhprinz/openpathsampling/languages","stargazers_url":"https://api.github.com/repos/jhprinz/openpathsampling/stargazers","contributors_url":"https://api.github.com/repos/jhprinz/openpathsampling/contributors","subscribers_url":"https://api.github.com/repos/jhprinz/openpathsampling/subscribers","subscription_url":"https://api.github.com/repos/jhprinz/openpathsampling/subscription","commits_url":"https://api.github.com/repos/jhprinz/openpathsampling/commits{/sha}","git_commits_url":"https://api.github.com/repos/jhprinz/openpathsampling/git/commits{/sha}","comments_url":"https://api.github.com/repos/jhprinz/openpathsampling/comments{/number}","issue_comment_url":"https://api.github.com/repos/jhprinz/openpathsampling/issues/comments{/number}","contents_url":"https://api.github.com/repos/jhprinz/openpathsampling/contents/{+path}","compare_url":"https://api.github.com/repos/jhprinz/openpathsampling/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jhprinz/openpathsampling/merges","archive_url":"https://api.github.com/repos/jhprinz/openpathsampling/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jhprinz/openpathsampling/downloads","issues_url":"https://api.github.com/repos/jhprinz/openpathsampling/issues{/number}","pulls_url":"https://api.github.com/repos/jhprinz/openpathsampling/pulls{/number}","milestones_url":"https://api.github.com/repos/jhprinz/openpathsampling/milestones{/number}","notifications_url":"https://api.github.com/repos/jhprinz/openpathsampling/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jhprinz/openpathsampling/labels{/name}","releases_url":"https://api.github.com/repos/jhprinz/openpathsampling/releases{/id}","deployments_url":"https://api.github.com/repos/jhprinz/openpathsampling/deployments","created_at":"2014-09-11T12:06:28Z","updated_at":"2016-01-15T14:50:50Z","pushed_at":"2016-03-07T14:06:53Z","git_url":"git://github.com/jhprinz/openpathsampling.git","ssh_url":"git@github.com:jhprinz/openpathsampling.git","clone_url":"https://github.com/jhprinz/openpathsampling.git","svn_url":"https://github.com/jhprinz/openpathsampling","homepage":null,"size":211003,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"choderalab:master","ref":"master","sha":"2705a43f22ad2e60fedd0cf70fe8fe7c40002ea3","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":12592267,"name":"openpathsampling","full_name":"choderalab/openpathsampling","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/openpathsampling","description":"An open source Python framework for transition interface and path sampling calculations.","fork":false,"url":"https://api.github.com/repos/choderalab/openpathsampling","forks_url":"https://api.github.com/repos/choderalab/openpathsampling/forks","keys_url":"https://api.github.com/repos/choderalab/openpathsampling/keys{/key_id}","collaborators_url":"https://api.github.com/repos/choderalab/openpathsampling/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/choderalab/openpathsampling/teams","hooks_url":"https://api.github.com/repos/choderalab/openpathsampling/hooks","issue_events_url":"https://api.github.com/repos/choderalab/openpathsampling/issues/events{/number}","events_url":"https://api.github.com/repos/choderalab/openpathsampling/events","assignees_url":"https://api.github.com/repos/choderalab/openpathsampling/assignees{/user}","branches_url":"https://api.github.com/repos/choderalab/openpathsampling/branches{/branch}","tags_url":"https://api.github.com/repos/choderalab/openpathsampling/tags","blobs_url":"https://api.github.com/repos/choderalab/openpathsampling/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/choderalab/openpathsampling/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/choderalab/openpathsampling/git/refs{/sha}","trees_url":"https://api.github.com/repos/choderalab/openpathsampling/git/trees{/sha}","statuses_url":"https://api.github.com/repos/choderalab/openpathsampling/statuses/{sha}","languages_url":"https://api.github.com/repos/choderalab/openpathsampling/languages","stargazers_url":"https://api.github.com/repos/choderalab/openpathsampling/stargazers","contributors_url":"https://api.github.com/repos/choderalab/openpathsampling/contributors","subscribers_url":"https://api.github.com/repos/choderalab/openpathsampling/subscribers","subscription_url":"https://api.github.com/repos/choderalab/openpathsampling/subscription","commits_url":"https://api.github.com/repos/choderalab/openpathsampling/commits{/sha}","git_commits_url":"https://api.github.com/repos/choderalab/openpathsampling/git/commits{/sha}","comments_url":"https://api.github.com/repos/choderalab/openpathsampling/comments{/number}","issue_comment_url":"https://api.github.com/repos/choderalab/openpathsampling/issues/comments{/number}","contents_url":"https://api.github.com/repos/choderalab/openpathsampling/contents/{+path}","compare_url":"https://api.github.com/repos/choderalab/openpathsampling/compare/{base}...{head}","merges_url":"https://api.github.com/repos/choderalab/openpathsampling/merges","archive_url":"https://api.github.com/repos/choderalab/openpathsampling/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/choderalab/openpathsampling/downloads","issues_url":"https://api.github.com/repos/choderalab/openpathsampling/issues{/number}","pulls_url":"https://api.github.com/repos/choderalab/openpathsampling/pulls{/number}","milestones_url":"https://api.github.com/repos/choderalab/openpathsampling/milestones{/number}","notifications_url":"https://api.github.com/repos/choderalab/openpathsampling/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/choderalab/openpathsampling/labels{/name}","releases_url":"https://api.github.com/repos/choderalab/openpathsampling/releases{/id}","deployments_url":"https://api.github.com/repos/choderalab/openpathsampling/deployments","created_at":"2013-09-04T14:06:28Z","updated_at":"2016-01-14T21:15:55Z","pushed_at":"2016-03-07T14:22:21Z","git_url":"git://github.com/choderalab/openpathsampling.git","ssh_url":"git@github.com:choderalab/openpathsampling.git","clone_url":"https://github.com/choderalab/openpathsampling.git","svn_url":"https://github.com/choderalab/openpathsampling","homepage":"","size":211664,"stargazers_count":10,"watchers_count":10,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":61,"forks":8,"open_issues":61,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/choderalab/openpathsampling/pulls/441"},"html":{"href":"https://github.com/choderalab/openpathsampling/pull/441"},"issue":{"href":"https://api.github.com/repos/choderalab/openpathsampling/issues/441"},"comments":{"href":"https://api.github.com/repos/choderalab/openpathsampling/issues/441/comments"},"review_comments":{"href":"https://api.github.com/repos/choderalab/openpathsampling/pulls/441/comments"},"review_comment":{"href":"https://api.github.com/repos/choderalab/openpathsampling/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/choderalab/openpathsampling/pulls/441/commits"},"statuses":{"href":"https://api.github.com/repos/choderalab/openpathsampling/statuses/7d13ca28d5c6e6a4ac7470107161aeed15ef1cb1"}}}}