{"action":"created","comment":{"url":"https://api.github.com/repos/mantidproject/mantid/pulls/comments/149273469","pull_request_review_id":74640191,"id":149273469,"diff_hunk":"@@ -0,0 +1,106 @@\n+#include \"MantidHistogramData/HistogramItem.h\"\n+#include \"MantidHistogramData/Histogram.h\"\n+#include <algorithm>\n+#include <utility>\n+\n+using Mantid::HistogramData::HistogramItem;\n+using Mantid::HistogramData::Histogram;\n+using Mantid::HistogramData::BinEdges;\n+using Mantid::HistogramData::Points;\n+\n+HistogramItem::HistogramItem(const Histogram &histogram, const size_t index)\n+    : m_histogram(histogram), m_index(index) {}\n+\n+double HistogramItem::counts() const {\n+  const auto &yMode = histogramRef().yMode();\n+  if (yMode == Histogram::YMode::Counts) {\n+    return histogramRef().counts()[m_index];\n+  } else {\n+    const Frequencies frequency{histogramRef().frequencies()[m_index]};\n+    return Counts(frequency, binEdges())[0];\n+  }\n+}\n+\n+double HistogramItem::countVariance() const {\n+  return histogramRef().countVariances()[m_index];\n+}\n+\n+double HistogramItem::countStandardDeviation() const {\n+  return histogramRef().countStandardDeviations()[m_index];\n+}\n+\n+double HistogramItem::frequency() const {\n+  const auto &yMode = histogramRef().yMode();\n+  if (yMode == Histogram::YMode::Frequencies) {\n+    return histogramRef().frequencies()[m_index];\n+  } else {\n+    const Counts counts{histogramRef().counts()[m_index]};\n+    return Frequencies(counts, binEdges())[0];","path":"Framework/HistogramData/src/HistogramItem.cpp","position":38,"original_position":38,"commit_id":"2e4cd46e581c072ab01fcdc820ddbca04387c071","original_commit_id":"2e4cd46e581c072ab01fcdc820ddbca04387c071","user":{"login":"SimonHeybrock","id":12912489,"avatar_url":"https://avatars1.githubusercontent.com/u/12912489?v=4","gravatar_id":"","url":"https://api.github.com/users/SimonHeybrock","html_url":"https://github.com/SimonHeybrock","followers_url":"https://api.github.com/users/SimonHeybrock/followers","following_url":"https://api.github.com/users/SimonHeybrock/following{/other_user}","gists_url":"https://api.github.com/users/SimonHeybrock/gists{/gist_id}","starred_url":"https://api.github.com/users/SimonHeybrock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SimonHeybrock/subscriptions","organizations_url":"https://api.github.com/users/SimonHeybrock/orgs","repos_url":"https://api.github.com/users/SimonHeybrock/repos","events_url":"https://api.github.com/users/SimonHeybrock/events{/privacy}","received_events_url":"https://api.github.com/users/SimonHeybrock/received_events","type":"User","site_admin":false},"body":"Similar to what I said above: For performance reasons we cannot rely on all the math done by classes like `Frequencies`, you need to implement this yourself, based on the underlying data.","created_at":"2017-11-07T05:11:54Z","updated_at":"2017-11-07T05:39:53Z","html_url":"https://github.com/mantidproject/mantid/pull/21131#discussion_r149273469","pull_request_url":"https://api.github.com/repos/mantidproject/mantid/pulls/21131","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/mantidproject/mantid/pulls/comments/149273469"},"html":{"href":"https://github.com/mantidproject/mantid/pull/21131#discussion_r149273469"},"pull_request":{"href":"https://api.github.com/repos/mantidproject/mantid/pulls/21131"}}},"pull_request":{"url":"https://api.github.com/repos/mantidproject/mantid/pulls/21131","id":150893276,"html_url":"https://github.com/mantidproject/mantid/pull/21131","diff_url":"https://github.com/mantidproject/mantid/pull/21131.diff","patch_url":"https://github.com/mantidproject/mantid/pull/21131.patch","issue_url":"https://api.github.com/repos/mantidproject/mantid/issues/21131","number":21131,"state":"open","locked":false,"title":"Add support for iterating over a Histogram","user":{"login":"samueljackson92","id":2487781,"avatar_url":"https://avatars2.githubusercontent.com/u/2487781?v=4","gravatar_id":"","url":"https://api.github.com/users/samueljackson92","html_url":"https://github.com/samueljackson92","followers_url":"https://api.github.com/users/samueljackson92/followers","following_url":"https://api.github.com/users/samueljackson92/following{/other_user}","gists_url":"https://api.github.com/users/samueljackson92/gists{/gist_id}","starred_url":"https://api.github.com/users/samueljackson92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samueljackson92/subscriptions","organizations_url":"https://api.github.com/users/samueljackson92/orgs","repos_url":"https://api.github.com/users/samueljackson92/repos","events_url":"https://api.github.com/users/samueljackson92/events{/privacy}","received_events_url":"https://api.github.com/users/samueljackson92/received_events","type":"User","site_admin":false},"body":"Add support for iterating over a `Histogram`. \r\n\r\nNote that there will be a increase in the performance test for HistogramTestPerformance as a new test case has been added.\r\n\r\n**To test:**\r\n - Unit tests pass\r\n - Code review\r\n\r\nFixes #21130.\r\n\r\n**Release Notes** \r\n\r\n*Does not need to be in the release notes.*\r\n\r\n---\r\n\r\n#### Reviewer ####\r\n\r\nPlease comment on the following ([full description](http://www.mantidproject.org/Individual_Ticket_Testing)):\r\n\r\n##### Code Review #####\r\n\r\n- [ ] Is the code of an acceptable quality?\r\n- [ ] Does the code conform to the [coding standards](http://www.mantidproject.org/Coding_Standards)?\r\n- [ ] Are the unit tests small and test the class in isolation?\r\n- [ ] If there are changes in the release notes then do they describe the changes appropriately?\r\n\r\n##### Functional Tests #####\r\n\r\n- [ ] Do changes function as described? Add comments below that describe the tests performed?\r\n- [ ] Do the changes handle unexpected situations, e.g. bad input?\r\n- [ ] Has the relevant (user and developer) documentation been added/updated?\r\n\r\nDoes everything look good? Mark the review as **Approve**. A member of `@mantidproject/gatekeepers` will take care of it.\r\n","created_at":"2017-11-06T16:13:14Z","updated_at":"2017-11-07T05:39:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c09808b78a8388279d7b7634066c566aa8733aa7","assignee":{"login":"SimonHeybrock","id":12912489,"avatar_url":"https://avatars1.githubusercontent.com/u/12912489?v=4","gravatar_id":"","url":"https://api.github.com/users/SimonHeybrock","html_url":"https://github.com/SimonHeybrock","followers_url":"https://api.github.com/users/SimonHeybrock/followers","following_url":"https://api.github.com/users/SimonHeybrock/following{/other_user}","gists_url":"https://api.github.com/users/SimonHeybrock/gists{/gist_id}","starred_url":"https://api.github.com/users/SimonHeybrock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SimonHeybrock/subscriptions","organizations_url":"https://api.github.com/users/SimonHeybrock/orgs","repos_url":"https://api.github.com/users/SimonHeybrock/repos","events_url":"https://api.github.com/users/SimonHeybrock/events{/privacy}","received_events_url":"https://api.github.com/users/SimonHeybrock/received_events","type":"User","site_admin":false},"assignees":[{"login":"SimonHeybrock","id":12912489,"avatar_url":"https://avatars1.githubusercontent.com/u/12912489?v=4","gravatar_id":"","url":"https://api.github.com/users/SimonHeybrock","html_url":"https://github.com/SimonHeybrock","followers_url":"https://api.github.com/users/SimonHeybrock/followers","following_url":"https://api.github.com/users/SimonHeybrock/following{/other_user}","gists_url":"https://api.github.com/users/SimonHeybrock/gists{/gist_id}","starred_url":"https://api.github.com/users/SimonHeybrock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SimonHeybrock/subscriptions","organizations_url":"https://api.github.com/users/SimonHeybrock/orgs","repos_url":"https://api.github.com/users/SimonHeybrock/repos","events_url":"https://api.github.com/users/SimonHeybrock/events{/privacy}","received_events_url":"https://api.github.com/users/SimonHeybrock/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":{"url":"https://api.github.com/repos/mantidproject/mantid/milestones/65","html_url":"https://github.com/mantidproject/mantid/milestone/65","labels_url":"https://api.github.com/repos/mantidproject/mantid/milestones/65/labels","id":2590252,"number":65,"title":"Release 3.12","description":"","creator":{"login":"NickDraper","id":1017173,"avatar_url":"https://avatars1.githubusercontent.com/u/1017173?v=4","gravatar_id":"","url":"https://api.github.com/users/NickDraper","html_url":"https://github.com/NickDraper","followers_url":"https://api.github.com/users/NickDraper/followers","following_url":"https://api.github.com/users/NickDraper/following{/other_user}","gists_url":"https://api.github.com/users/NickDraper/gists{/gist_id}","starred_url":"https://api.github.com/users/NickDraper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NickDraper/subscriptions","organizations_url":"https://api.github.com/users/NickDraper/orgs","repos_url":"https://api.github.com/users/NickDraper/repos","events_url":"https://api.github.com/users/NickDraper/events{/privacy}","received_events_url":"https://api.github.com/users/NickDraper/received_events","type":"User","site_admin":false},"open_issues":266,"closed_issues":283,"state":"open","created_at":"2017-06-19T08:22:22Z","updated_at":"2017-11-06T17:13:06Z","due_on":"2018-02-05T08:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/mantidproject/mantid/pulls/21131/commits","review_comments_url":"https://api.github.com/repos/mantidproject/mantid/pulls/21131/comments","review_comment_url":"https://api.github.com/repos/mantidproject/mantid/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mantidproject/mantid/issues/21131/comments","statuses_url":"https://api.github.com/repos/mantidproject/mantid/statuses/2e4cd46e581c072ab01fcdc820ddbca04387c071","head":{"label":"samueljackson92:21130-histogram-iterator","ref":"21130-histogram-iterator","sha":"2e4cd46e581c072ab01fcdc820ddbca04387c071","user":{"login":"samueljackson92","id":2487781,"avatar_url":"https://avatars2.githubusercontent.com/u/2487781?v=4","gravatar_id":"","url":"https://api.github.com/users/samueljackson92","html_url":"https://github.com/samueljackson92","followers_url":"https://api.github.com/users/samueljackson92/followers","following_url":"https://api.github.com/users/samueljackson92/following{/other_user}","gists_url":"https://api.github.com/users/samueljackson92/gists{/gist_id}","starred_url":"https://api.github.com/users/samueljackson92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samueljackson92/subscriptions","organizations_url":"https://api.github.com/users/samueljackson92/orgs","repos_url":"https://api.github.com/users/samueljackson92/repos","events_url":"https://api.github.com/users/samueljackson92/events{/privacy}","received_events_url":"https://api.github.com/users/samueljackson92/received_events","type":"User","site_admin":false},"repo":{"id":95154500,"name":"mantid","full_name":"samueljackson92/mantid","owner":{"login":"samueljackson92","id":2487781,"avatar_url":"https://avatars2.githubusercontent.com/u/2487781?v=4","gravatar_id":"","url":"https://api.github.com/users/samueljackson92","html_url":"https://github.com/samueljackson92","followers_url":"https://api.github.com/users/samueljackson92/followers","following_url":"https://api.github.com/users/samueljackson92/following{/other_user}","gists_url":"https://api.github.com/users/samueljackson92/gists{/gist_id}","starred_url":"https://api.github.com/users/samueljackson92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samueljackson92/subscriptions","organizations_url":"https://api.github.com/users/samueljackson92/orgs","repos_url":"https://api.github.com/users/samueljackson92/repos","events_url":"https://api.github.com/users/samueljackson92/events{/privacy}","received_events_url":"https://api.github.com/users/samueljackson92/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/samueljackson92/mantid","description":"Main repository for Mantid code","fork":true,"url":"https://api.github.com/repos/samueljackson92/mantid","forks_url":"https://api.github.com/repos/samueljackson92/mantid/forks","keys_url":"https://api.github.com/repos/samueljackson92/mantid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/samueljackson92/mantid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/samueljackson92/mantid/teams","hooks_url":"https://api.github.com/repos/samueljackson92/mantid/hooks","issue_events_url":"https://api.github.com/repos/samueljackson92/mantid/issues/events{/number}","events_url":"https://api.github.com/repos/samueljackson92/mantid/events","assignees_url":"https://api.github.com/repos/samueljackson92/mantid/assignees{/user}","branches_url":"https://api.github.com/repos/samueljackson92/mantid/branches{/branch}","tags_url":"https://api.github.com/repos/samueljackson92/mantid/tags","blobs_url":"https://api.github.com/repos/samueljackson92/mantid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/samueljackson92/mantid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/samueljackson92/mantid/git/refs{/sha}","trees_url":"https://api.github.com/repos/samueljackson92/mantid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/samueljackson92/mantid/statuses/{sha}","languages_url":"https://api.github.com/repos/samueljackson92/mantid/languages","stargazers_url":"https://api.github.com/repos/samueljackson92/mantid/stargazers","contributors_url":"https://api.github.com/repos/samueljackson92/mantid/contributors","subscribers_url":"https://api.github.com/repos/samueljackson92/mantid/subscribers","subscription_url":"https://api.github.com/repos/samueljackson92/mantid/subscription","commits_url":"https://api.github.com/repos/samueljackson92/mantid/commits{/sha}","git_commits_url":"https://api.github.com/repos/samueljackson92/mantid/git/commits{/sha}","comments_url":"https://api.github.com/repos/samueljackson92/mantid/comments{/number}","issue_comment_url":"https://api.github.com/repos/samueljackson92/mantid/issues/comments{/number}","contents_url":"https://api.github.com/repos/samueljackson92/mantid/contents/{+path}","compare_url":"https://api.github.com/repos/samueljackson92/mantid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/samueljackson92/mantid/merges","archive_url":"https://api.github.com/repos/samueljackson92/mantid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/samueljackson92/mantid/downloads","issues_url":"https://api.github.com/repos/samueljackson92/mantid/issues{/number}","pulls_url":"https://api.github.com/repos/samueljackson92/mantid/pulls{/number}","milestones_url":"https://api.github.com/repos/samueljackson92/mantid/milestones{/number}","notifications_url":"https://api.github.com/repos/samueljackson92/mantid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/samueljackson92/mantid/labels{/name}","releases_url":"https://api.github.com/repos/samueljackson92/mantid/releases{/id}","deployments_url":"https://api.github.com/repos/samueljackson92/mantid/deployments","created_at":"2017-06-22T20:37:35Z","updated_at":"2017-06-22T20:38:12Z","pushed_at":"2017-11-06T16:17:44Z","git_url":"git://github.com/samueljackson92/mantid.git","ssh_url":"git@github.com:samueljackson92/mantid.git","clone_url":"https://github.com/samueljackson92/mantid.git","svn_url":"https://github.com/samueljackson92/mantid","homepage":"www.mantidproject.org","size":447712,"stargazers_count":0,"watchers_count":0,"language":"C++","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,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mantidproject:master","ref":"master","sha":"a8ddb457e47d75256f65f6182e66351bf0357040","user":{"login":"mantidproject","id":671496,"avatar_url":"https://avatars0.githubusercontent.com/u/671496?v=4","gravatar_id":"","url":"https://api.github.com/users/mantidproject","html_url":"https://github.com/mantidproject","followers_url":"https://api.github.com/users/mantidproject/followers","following_url":"https://api.github.com/users/mantidproject/following{/other_user}","gists_url":"https://api.github.com/users/mantidproject/gists{/gist_id}","starred_url":"https://api.github.com/users/mantidproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mantidproject/subscriptions","organizations_url":"https://api.github.com/users/mantidproject/orgs","repos_url":"https://api.github.com/users/mantidproject/repos","events_url":"https://api.github.com/users/mantidproject/events{/privacy}","received_events_url":"https://api.github.com/users/mantidproject/received_events","type":"Organization","site_admin":false},"repo":{"id":2594116,"name":"mantid","full_name":"mantidproject/mantid","owner":{"login":"mantidproject","id":671496,"avatar_url":"https://avatars0.githubusercontent.com/u/671496?v=4","gravatar_id":"","url":"https://api.github.com/users/mantidproject","html_url":"https://github.com/mantidproject","followers_url":"https://api.github.com/users/mantidproject/followers","following_url":"https://api.github.com/users/mantidproject/following{/other_user}","gists_url":"https://api.github.com/users/mantidproject/gists{/gist_id}","starred_url":"https://api.github.com/users/mantidproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mantidproject/subscriptions","organizations_url":"https://api.github.com/users/mantidproject/orgs","repos_url":"https://api.github.com/users/mantidproject/repos","events_url":"https://api.github.com/users/mantidproject/events{/privacy}","received_events_url":"https://api.github.com/users/mantidproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mantidproject/mantid","description":"Main repository for Mantid code","fork":false,"url":"https://api.github.com/repos/mantidproject/mantid","forks_url":"https://api.github.com/repos/mantidproject/mantid/forks","keys_url":"https://api.github.com/repos/mantidproject/mantid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mantidproject/mantid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mantidproject/mantid/teams","hooks_url":"https://api.github.com/repos/mantidproject/mantid/hooks","issue_events_url":"https://api.github.com/repos/mantidproject/mantid/issues/events{/number}","events_url":"https://api.github.com/repos/mantidproject/mantid/events","assignees_url":"https://api.github.com/repos/mantidproject/mantid/assignees{/user}","branches_url":"https://api.github.com/repos/mantidproject/mantid/branches{/branch}","tags_url":"https://api.github.com/repos/mantidproject/mantid/tags","blobs_url":"https://api.github.com/repos/mantidproject/mantid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mantidproject/mantid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mantidproject/mantid/git/refs{/sha}","trees_url":"https://api.github.com/repos/mantidproject/mantid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mantidproject/mantid/statuses/{sha}","languages_url":"https://api.github.com/repos/mantidproject/mantid/languages","stargazers_url":"https://api.github.com/repos/mantidproject/mantid/stargazers","contributors_url":"https://api.github.com/repos/mantidproject/mantid/contributors","subscribers_url":"https://api.github.com/repos/mantidproject/mantid/subscribers","subscription_url":"https://api.github.com/repos/mantidproject/mantid/subscription","commits_url":"https://api.github.com/repos/mantidproject/mantid/commits{/sha}","git_commits_url":"https://api.github.com/repos/mantidproject/mantid/git/commits{/sha}","comments_url":"https://api.github.com/repos/mantidproject/mantid/comments{/number}","issue_comment_url":"https://api.github.com/repos/mantidproject/mantid/issues/comments{/number}","contents_url":"https://api.github.com/repos/mantidproject/mantid/contents/{+path}","compare_url":"https://api.github.com/repos/mantidproject/mantid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mantidproject/mantid/merges","archive_url":"https://api.github.com/repos/mantidproject/mantid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mantidproject/mantid/downloads","issues_url":"https://api.github.com/repos/mantidproject/mantid/issues{/number}","pulls_url":"https://api.github.com/repos/mantidproject/mantid/pulls{/number}","milestones_url":"https://api.github.com/repos/mantidproject/mantid/milestones{/number}","notifications_url":"https://api.github.com/repos/mantidproject/mantid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mantidproject/mantid/labels{/name}","releases_url":"https://api.github.com/repos/mantidproject/mantid/releases{/id}","deployments_url":"https://api.github.com/repos/mantidproject/mantid/deployments","created_at":"2011-10-17T19:07:38Z","updated_at":"2017-09-24T10:34:08Z","pushed_at":"2017-11-06T22:20:44Z","git_url":"git://github.com/mantidproject/mantid.git","ssh_url":"git@github.com:mantidproject/mantid.git","clone_url":"https://github.com/mantidproject/mantid.git","svn_url":"https://github.com/mantidproject/mantid","homepage":"www.mantidproject.org","size":450887,"stargazers_count":63,"watchers_count":63,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":45,"mirror_url":null,"archived":false,"open_issues_count":1691,"forks":45,"open_issues":1691,"watchers":63,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mantidproject/mantid/pulls/21131"},"html":{"href":"https://github.com/mantidproject/mantid/pull/21131"},"issue":{"href":"https://api.github.com/repos/mantidproject/mantid/issues/21131"},"comments":{"href":"https://api.github.com/repos/mantidproject/mantid/issues/21131/comments"},"review_comments":{"href":"https://api.github.com/repos/mantidproject/mantid/pulls/21131/comments"},"review_comment":{"href":"https://api.github.com/repos/mantidproject/mantid/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mantidproject/mantid/pulls/21131/commits"},"statuses":{"href":"https://api.github.com/repos/mantidproject/mantid/statuses/2e4cd46e581c072ab01fcdc820ddbca04387c071"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"SimonHeybrock"}}