{"action":"opened","number":139,"pull_request":{"url":"https://api.github.com/repos/NSLS-II/metadatastore/pulls/139","id":34491906,"html_url":"https://github.com/NSLS-II/metadatastore/pull/139","diff_url":"https://github.com/NSLS-II/metadatastore/pull/139.diff","patch_url":"https://github.com/NSLS-II/metadatastore/pull/139.patch","issue_url":"https://api.github.com/repos/NSLS-II/metadatastore/issues/139","number":139,"state":"open","locked":false,"title":"ENH: Add count_events, a stopgap.","user":{"login":"danielballan","id":2279598,"avatar_url":"https://avatars.githubusercontent.com/u/2279598?v=3","gravatar_id":"","url":"https://api.github.com/users/danielballan","html_url":"https://github.com/danielballan","followers_url":"https://api.github.com/users/danielballan/followers","following_url":"https://api.github.com/users/danielballan/following{/other_user}","gists_url":"https://api.github.com/users/danielballan/gists{/gist_id}","starred_url":"https://api.github.com/users/danielballan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielballan/subscriptions","organizations_url":"https://api.github.com/users/danielballan/orgs","repos_url":"https://api.github.com/users/danielballan/repos","events_url":"https://api.github.com/users/danielballan/events{/privacy}","received_events_url":"https://api.github.com/users/danielballan/received_events","type":"User","site_admin":false},"body":"Now that `find_events` returns a generator, there is no way to know how many Events are there without looping through them all. This add a new function `count_events` that uses mongo to count the size of the query results without actually building the Event documents.\r\n\r\n*This is a temporary solution.* In the long term, it will likely be replaced by one of the following:\r\n\r\n* counting each Event stream at the end of a scan and storing those tallies in the RunStop\r\n* making `find_events` return a special pims-like object, a generator that knows its own length","created_at":"2015-04-30T19:18:42Z","updated_at":"2015-04-30T19:18:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/NSLS-II/metadatastore/pulls/139/commits","review_comments_url":"https://api.github.com/repos/NSLS-II/metadatastore/pulls/139/comments","review_comment_url":"https://api.github.com/repos/NSLS-II/metadatastore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NSLS-II/metadatastore/issues/139/comments","statuses_url":"https://api.github.com/repos/NSLS-II/metadatastore/statuses/161c4c472161dce5c06e465d28884deebe36cbdc","head":{"label":"danielballan:count-events","ref":"count-events","sha":"161c4c472161dce5c06e465d28884deebe36cbdc","user":{"login":"danielballan","id":2279598,"avatar_url":"https://avatars.githubusercontent.com/u/2279598?v=3","gravatar_id":"","url":"https://api.github.com/users/danielballan","html_url":"https://github.com/danielballan","followers_url":"https://api.github.com/users/danielballan/followers","following_url":"https://api.github.com/users/danielballan/following{/other_user}","gists_url":"https://api.github.com/users/danielballan/gists{/gist_id}","starred_url":"https://api.github.com/users/danielballan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielballan/subscriptions","organizations_url":"https://api.github.com/users/danielballan/orgs","repos_url":"https://api.github.com/users/danielballan/repos","events_url":"https://api.github.com/users/danielballan/events{/privacy}","received_events_url":"https://api.github.com/users/danielballan/received_events","type":"User","site_admin":false},"repo":{"id":28867664,"name":"metadataStore","full_name":"danielballan/metadataStore","owner":{"login":"danielballan","id":2279598,"avatar_url":"https://avatars.githubusercontent.com/u/2279598?v=3","gravatar_id":"","url":"https://api.github.com/users/danielballan","html_url":"https://github.com/danielballan","followers_url":"https://api.github.com/users/danielballan/followers","following_url":"https://api.github.com/users/danielballan/following{/other_user}","gists_url":"https://api.github.com/users/danielballan/gists{/gist_id}","starred_url":"https://api.github.com/users/danielballan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielballan/subscriptions","organizations_url":"https://api.github.com/users/danielballan/orgs","repos_url":"https://api.github.com/users/danielballan/repos","events_url":"https://api.github.com/users/danielballan/events{/privacy}","received_events_url":"https://api.github.com/users/danielballan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/danielballan/metadataStore","description":"NSLS2 Beamlines MetadataStore prototype implemented in MongoDB","fork":true,"url":"https://api.github.com/repos/danielballan/metadataStore","forks_url":"https://api.github.com/repos/danielballan/metadataStore/forks","keys_url":"https://api.github.com/repos/danielballan/metadataStore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/danielballan/metadataStore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/danielballan/metadataStore/teams","hooks_url":"https://api.github.com/repos/danielballan/metadataStore/hooks","issue_events_url":"https://api.github.com/repos/danielballan/metadataStore/issues/events{/number}","events_url":"https://api.github.com/repos/danielballan/metadataStore/events","assignees_url":"https://api.github.com/repos/danielballan/metadataStore/assignees{/user}","branches_url":"https://api.github.com/repos/danielballan/metadataStore/branches{/branch}","tags_url":"https://api.github.com/repos/danielballan/metadataStore/tags","blobs_url":"https://api.github.com/repos/danielballan/metadataStore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/danielballan/metadataStore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/danielballan/metadataStore/git/refs{/sha}","trees_url":"https://api.github.com/repos/danielballan/metadataStore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/danielballan/metadataStore/statuses/{sha}","languages_url":"https://api.github.com/repos/danielballan/metadataStore/languages","stargazers_url":"https://api.github.com/repos/danielballan/metadataStore/stargazers","contributors_url":"https://api.github.com/repos/danielballan/metadataStore/contributors","subscribers_url":"https://api.github.com/repos/danielballan/metadataStore/subscribers","subscription_url":"https://api.github.com/repos/danielballan/metadataStore/subscription","commits_url":"https://api.github.com/repos/danielballan/metadataStore/commits{/sha}","git_commits_url":"https://api.github.com/repos/danielballan/metadataStore/git/commits{/sha}","comments_url":"https://api.github.com/repos/danielballan/metadataStore/comments{/number}","issue_comment_url":"https://api.github.com/repos/danielballan/metadataStore/issues/comments{/number}","contents_url":"https://api.github.com/repos/danielballan/metadataStore/contents/{+path}","compare_url":"https://api.github.com/repos/danielballan/metadataStore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/danielballan/metadataStore/merges","archive_url":"https://api.github.com/repos/danielballan/metadataStore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/danielballan/metadataStore/downloads","issues_url":"https://api.github.com/repos/danielballan/metadataStore/issues{/number}","pulls_url":"https://api.github.com/repos/danielballan/metadataStore/pulls{/number}","milestones_url":"https://api.github.com/repos/danielballan/metadataStore/milestones{/number}","notifications_url":"https://api.github.com/repos/danielballan/metadataStore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/danielballan/metadataStore/labels{/name}","releases_url":"https://api.github.com/repos/danielballan/metadataStore/releases{/id}","created_at":"2015-01-06T14:46:42Z","updated_at":"2015-03-31T21:11:13Z","pushed_at":"2015-04-30T19:16:17Z","git_url":"git://github.com/danielballan/metadataStore.git","ssh_url":"git@github.com:danielballan/metadataStore.git","clone_url":"https://github.com/danielballan/metadataStore.git","svn_url":"https://github.com/danielballan/metadataStore","homepage":"","size":1618,"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":"NSLS-II:master","ref":"master","sha":"8a4d51a0ff8f2b06cca7d6753b64ce503060c677","user":{"login":"NSLS-II","id":8700262,"avatar_url":"https://avatars.githubusercontent.com/u/8700262?v=3","gravatar_id":"","url":"https://api.github.com/users/NSLS-II","html_url":"https://github.com/NSLS-II","followers_url":"https://api.github.com/users/NSLS-II/followers","following_url":"https://api.github.com/users/NSLS-II/following{/other_user}","gists_url":"https://api.github.com/users/NSLS-II/gists{/gist_id}","starred_url":"https://api.github.com/users/NSLS-II/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NSLS-II/subscriptions","organizations_url":"https://api.github.com/users/NSLS-II/orgs","repos_url":"https://api.github.com/users/NSLS-II/repos","events_url":"https://api.github.com/users/NSLS-II/events{/privacy}","received_events_url":"https://api.github.com/users/NSLS-II/received_events","type":"Organization","site_admin":false},"repo":{"id":20021829,"name":"metadatastore","full_name":"NSLS-II/metadatastore","owner":{"login":"NSLS-II","id":8700262,"avatar_url":"https://avatars.githubusercontent.com/u/8700262?v=3","gravatar_id":"","url":"https://api.github.com/users/NSLS-II","html_url":"https://github.com/NSLS-II","followers_url":"https://api.github.com/users/NSLS-II/followers","following_url":"https://api.github.com/users/NSLS-II/following{/other_user}","gists_url":"https://api.github.com/users/NSLS-II/gists{/gist_id}","starred_url":"https://api.github.com/users/NSLS-II/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NSLS-II/subscriptions","organizations_url":"https://api.github.com/users/NSLS-II/orgs","repos_url":"https://api.github.com/users/NSLS-II/repos","events_url":"https://api.github.com/users/NSLS-II/events{/privacy}","received_events_url":"https://api.github.com/users/NSLS-II/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NSLS-II/metadatastore","description":"NSLS2 Beamlines MetadataStore prototype implemented in MongoDB","fork":false,"url":"https://api.github.com/repos/NSLS-II/metadatastore","forks_url":"https://api.github.com/repos/NSLS-II/metadatastore/forks","keys_url":"https://api.github.com/repos/NSLS-II/metadatastore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NSLS-II/metadatastore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NSLS-II/metadatastore/teams","hooks_url":"https://api.github.com/repos/NSLS-II/metadatastore/hooks","issue_events_url":"https://api.github.com/repos/NSLS-II/metadatastore/issues/events{/number}","events_url":"https://api.github.com/repos/NSLS-II/metadatastore/events","assignees_url":"https://api.github.com/repos/NSLS-II/metadatastore/assignees{/user}","branches_url":"https://api.github.com/repos/NSLS-II/metadatastore/branches{/branch}","tags_url":"https://api.github.com/repos/NSLS-II/metadatastore/tags","blobs_url":"https://api.github.com/repos/NSLS-II/metadatastore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NSLS-II/metadatastore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NSLS-II/metadatastore/git/refs{/sha}","trees_url":"https://api.github.com/repos/NSLS-II/metadatastore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NSLS-II/metadatastore/statuses/{sha}","languages_url":"https://api.github.com/repos/NSLS-II/metadatastore/languages","stargazers_url":"https://api.github.com/repos/NSLS-II/metadatastore/stargazers","contributors_url":"https://api.github.com/repos/NSLS-II/metadatastore/contributors","subscribers_url":"https://api.github.com/repos/NSLS-II/metadatastore/subscribers","subscription_url":"https://api.github.com/repos/NSLS-II/metadatastore/subscription","commits_url":"https://api.github.com/repos/NSLS-II/metadatastore/commits{/sha}","git_commits_url":"https://api.github.com/repos/NSLS-II/metadatastore/git/commits{/sha}","comments_url":"https://api.github.com/repos/NSLS-II/metadatastore/comments{/number}","issue_comment_url":"https://api.github.com/repos/NSLS-II/metadatastore/issues/comments{/number}","contents_url":"https://api.github.com/repos/NSLS-II/metadatastore/contents/{+path}","compare_url":"https://api.github.com/repos/NSLS-II/metadatastore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NSLS-II/metadatastore/merges","archive_url":"https://api.github.com/repos/NSLS-II/metadatastore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NSLS-II/metadatastore/downloads","issues_url":"https://api.github.com/repos/NSLS-II/metadatastore/issues{/number}","pulls_url":"https://api.github.com/repos/NSLS-II/metadatastore/pulls{/number}","milestones_url":"https://api.github.com/repos/NSLS-II/metadatastore/milestones{/number}","notifications_url":"https://api.github.com/repos/NSLS-II/metadatastore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NSLS-II/metadatastore/labels{/name}","releases_url":"https://api.github.com/repos/NSLS-II/metadatastore/releases{/id}","created_at":"2014-05-21T13:17:44Z","updated_at":"2015-04-30T13:09:16Z","pushed_at":"2015-04-30T14:33:42Z","git_url":"git://github.com/NSLS-II/metadatastore.git","ssh_url":"git@github.com:NSLS-II/metadatastore.git","clone_url":"https://github.com/NSLS-II/metadatastore.git","svn_url":"https://github.com/NSLS-II/metadatastore","homepage":"","size":3160,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":11,"forks":6,"open_issues":11,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NSLS-II/metadatastore/pulls/139"},"html":{"href":"https://github.com/NSLS-II/metadatastore/pull/139"},"issue":{"href":"https://api.github.com/repos/NSLS-II/metadatastore/issues/139"},"comments":{"href":"https://api.github.com/repos/NSLS-II/metadatastore/issues/139/comments"},"review_comments":{"href":"https://api.github.com/repos/NSLS-II/metadatastore/pulls/139/comments"},"review_comment":{"href":"https://api.github.com/repos/NSLS-II/metadatastore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NSLS-II/metadatastore/pulls/139/commits"},"statuses":{"href":"https://api.github.com/repos/NSLS-II/metadatastore/statuses/161c4c472161dce5c06e465d28884deebe36cbdc"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":24,"deletions":1,"changed_files":2}}