{"action":"created","comment":{"url":"https://api.github.com/repos/scgmlz/BornAgain/pulls/comments/91685953","pull_request_review_id":12196258,"id":91685953,"diff_hunk":"@@ -0,0 +1,88 @@\n+// ************************************************************************** //\n+//\n+//  BornAgain: simulate and fit scattering at grazing incidence\n+//\n+//! @file      Core/Parametrization/NodeUtils.cpp\n+//! @brief     Implements collection of utility functions for INode.\n+//!\n+//! @homepage  http://www.bornagainproject.org\n+//! @license   GNU General Public License v3 or higher (see COPYING)\n+//! @copyright Forschungszentrum Jülich GmbH 2015\n+//! @authors   Scientific Computing Group at MLZ Garching\n+//! @authors   C. Durniak, M. Ganeva, G. Pospelov, W. Van Herck, J. Wuttke\n+//\n+// ************************************************************************** //\n+\n+#include \"NodeUtils.h\"\n+#include \"SampleTreeIterator.h\"\n+#include \"ISampleIteratorStrategy.h\"\n+#include \"RealParameter.h\"\n+#include \"ParameterPool.h\"\n+#include \"INode.h\"\n+#include <functional>\n+#include <sstream>\n+\n+namespace {\n+\n+    // Returns string filled with '.'\n+    std::string s_indent(int depth) {\n+        const int multiplier = 4;\n+        return std::string(multiplier*depth, '.');\n+    }\n+\n+    // Returns multiline string representing pool parameters of given node.\n+    std::string poolToMultiString(const INode &node, int depth) {\n+        std::ostringstream result;\n+\n+        for(auto par : node.getParameterPool()->getParameters())\n+            result << s_indent(depth)\n+                   << \"'\" << par->getName() << \"':\" << par->getValue() << \"\\n\";\n+\n+        return result.str();\n+    }\n+\n+    // Returns single line string representing pool parameters of given node.\n+    std::string poolToString(const INode &node) {\n+        std::ostringstream result;\n+\n+        const std::vector<RealParameter*> pars = node.getParameterPool()->getParameters();\n+        if(pars.size())\n+            result << \" (\";","path":"Core/Parametrization/NodeUtils.cpp","position":50,"original_position":50,"commit_id":"5aedcc29ea390ff5d3f7ffd0a9b979215873da0b","original_commit_id":"5aedcc29ea390ff5d3f7ffd0a9b979215873da0b","user":{"login":"jwuttke","id":5262000,"avatar_url":"https://avatars.githubusercontent.com/u/5262000?v=3","gravatar_id":"","url":"https://api.github.com/users/jwuttke","html_url":"https://github.com/jwuttke","followers_url":"https://api.github.com/users/jwuttke/followers","following_url":"https://api.github.com/users/jwuttke/following{/other_user}","gists_url":"https://api.github.com/users/jwuttke/gists{/gist_id}","starred_url":"https://api.github.com/users/jwuttke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwuttke/subscriptions","organizations_url":"https://api.github.com/users/jwuttke/orgs","repos_url":"https://api.github.com/users/jwuttke/repos","events_url":"https://api.github.com/users/jwuttke/events{/privacy}","received_events_url":"https://api.github.com/users/jwuttke/received_events","type":"User","site_admin":false},"body":"Since the case pars.size()==0 needs special treatment, it would be easier to handle it once and for all at the beginning:\r\n<pre>\r\n    if (pars.size()==0)\r\n        return \"\";\r\n</pre>\r\n","created_at":"2016-12-09T09:50:21Z","updated_at":"2016-12-09T09:50:21Z","html_url":"https://github.com/scgmlz/BornAgain/pull/118#discussion_r91685953","pull_request_url":"https://api.github.com/repos/scgmlz/BornAgain/pulls/118","_links":{"self":{"href":"https://api.github.com/repos/scgmlz/BornAgain/pulls/comments/91685953"},"html":{"href":"https://github.com/scgmlz/BornAgain/pull/118#discussion_r91685953"},"pull_request":{"href":"https://api.github.com/repos/scgmlz/BornAgain/pulls/118"}}},"pull_request":{"url":"https://api.github.com/repos/scgmlz/BornAgain/pulls/118","id":97117470,"html_url":"https://github.com/scgmlz/BornAgain/pull/118","diff_url":"https://github.com/scgmlz/BornAgain/pull/118.diff","patch_url":"https://github.com/scgmlz/BornAgain/pull/118.patch","issue_url":"https://api.github.com/repos/scgmlz/BornAgain/issues/118","number":118,"state":"open","locked":false,"title":"New INode tree hierarchy","user":{"login":"gpospelov","id":15112484,"avatar_url":"https://avatars.githubusercontent.com/u/15112484?v=3","gravatar_id":"","url":"https://api.github.com/users/gpospelov","html_url":"https://github.com/gpospelov","followers_url":"https://api.github.com/users/gpospelov/followers","following_url":"https://api.github.com/users/gpospelov/following{/other_user}","gists_url":"https://api.github.com/users/gpospelov/gists{/gist_id}","starred_url":"https://api.github.com/users/gpospelov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gpospelov/subscriptions","organizations_url":"https://api.github.com/users/gpospelov/orgs","repos_url":"https://api.github.com/users/gpospelov/repos","events_url":"https://api.github.com/users/gpospelov/events{/privacy}","received_events_url":"https://api.github.com/users/gpospelov/received_events","type":"User","site_admin":false},"body":"* New class INode (name can be changed) is introduced between IParameterized and ISample.\r\n* All existing children bookkeeping activity is moved from ISample up to INode.\r\n* ISample::to_str is removed from everywhere in the favor of single INode::to_str()\r\n\r\nIn the following I'm going to make INode actually own its children, provide unit tests and make some renaming.","created_at":"2016-12-08T12:59:09Z","updated_at":"2016-12-09T09:50:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"11fe61651b1d807bb8bf79033162333569a7fa94","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/scgmlz/BornAgain/pulls/118/commits","review_comments_url":"https://api.github.com/repos/scgmlz/BornAgain/pulls/118/comments","review_comment_url":"https://api.github.com/repos/scgmlz/BornAgain/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scgmlz/BornAgain/issues/118/comments","statuses_url":"https://api.github.com/repos/scgmlz/BornAgain/statuses/5aedcc29ea390ff5d3f7ffd0a9b979215873da0b","head":{"label":"gpospelov:develop","ref":"develop","sha":"5aedcc29ea390ff5d3f7ffd0a9b979215873da0b","user":{"login":"gpospelov","id":15112484,"avatar_url":"https://avatars.githubusercontent.com/u/15112484?v=3","gravatar_id":"","url":"https://api.github.com/users/gpospelov","html_url":"https://github.com/gpospelov","followers_url":"https://api.github.com/users/gpospelov/followers","following_url":"https://api.github.com/users/gpospelov/following{/other_user}","gists_url":"https://api.github.com/users/gpospelov/gists{/gist_id}","starred_url":"https://api.github.com/users/gpospelov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gpospelov/subscriptions","organizations_url":"https://api.github.com/users/gpospelov/orgs","repos_url":"https://api.github.com/users/gpospelov/repos","events_url":"https://api.github.com/users/gpospelov/events{/privacy}","received_events_url":"https://api.github.com/users/gpospelov/received_events","type":"User","site_admin":false},"repo":{"id":67598939,"name":"BornAgain","full_name":"gpospelov/BornAgain","owner":{"login":"gpospelov","id":15112484,"avatar_url":"https://avatars.githubusercontent.com/u/15112484?v=3","gravatar_id":"","url":"https://api.github.com/users/gpospelov","html_url":"https://github.com/gpospelov","followers_url":"https://api.github.com/users/gpospelov/followers","following_url":"https://api.github.com/users/gpospelov/following{/other_user}","gists_url":"https://api.github.com/users/gpospelov/gists{/gist_id}","starred_url":"https://api.github.com/users/gpospelov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gpospelov/subscriptions","organizations_url":"https://api.github.com/users/gpospelov/orgs","repos_url":"https://api.github.com/users/gpospelov/repos","events_url":"https://api.github.com/users/gpospelov/events{/privacy}","received_events_url":"https://api.github.com/users/gpospelov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gpospelov/BornAgain","description":"A software to simulate and fit neutron and x-ray scattering at grazing incidence.","fork":true,"url":"https://api.github.com/repos/gpospelov/BornAgain","forks_url":"https://api.github.com/repos/gpospelov/BornAgain/forks","keys_url":"https://api.github.com/repos/gpospelov/BornAgain/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gpospelov/BornAgain/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gpospelov/BornAgain/teams","hooks_url":"https://api.github.com/repos/gpospelov/BornAgain/hooks","issue_events_url":"https://api.github.com/repos/gpospelov/BornAgain/issues/events{/number}","events_url":"https://api.github.com/repos/gpospelov/BornAgain/events","assignees_url":"https://api.github.com/repos/gpospelov/BornAgain/assignees{/user}","branches_url":"https://api.github.com/repos/gpospelov/BornAgain/branches{/branch}","tags_url":"https://api.github.com/repos/gpospelov/BornAgain/tags","blobs_url":"https://api.github.com/repos/gpospelov/BornAgain/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gpospelov/BornAgain/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gpospelov/BornAgain/git/refs{/sha}","trees_url":"https://api.github.com/repos/gpospelov/BornAgain/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gpospelov/BornAgain/statuses/{sha}","languages_url":"https://api.github.com/repos/gpospelov/BornAgain/languages","stargazers_url":"https://api.github.com/repos/gpospelov/BornAgain/stargazers","contributors_url":"https://api.github.com/repos/gpospelov/BornAgain/contributors","subscribers_url":"https://api.github.com/repos/gpospelov/BornAgain/subscribers","subscription_url":"https://api.github.com/repos/gpospelov/BornAgain/subscription","commits_url":"https://api.github.com/repos/gpospelov/BornAgain/commits{/sha}","git_commits_url":"https://api.github.com/repos/gpospelov/BornAgain/git/commits{/sha}","comments_url":"https://api.github.com/repos/gpospelov/BornAgain/comments{/number}","issue_comment_url":"https://api.github.com/repos/gpospelov/BornAgain/issues/comments{/number}","contents_url":"https://api.github.com/repos/gpospelov/BornAgain/contents/{+path}","compare_url":"https://api.github.com/repos/gpospelov/BornAgain/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gpospelov/BornAgain/merges","archive_url":"https://api.github.com/repos/gpospelov/BornAgain/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gpospelov/BornAgain/downloads","issues_url":"https://api.github.com/repos/gpospelov/BornAgain/issues{/number}","pulls_url":"https://api.github.com/repos/gpospelov/BornAgain/pulls{/number}","milestones_url":"https://api.github.com/repos/gpospelov/BornAgain/milestones{/number}","notifications_url":"https://api.github.com/repos/gpospelov/BornAgain/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gpospelov/BornAgain/labels{/name}","releases_url":"https://api.github.com/repos/gpospelov/BornAgain/releases{/id}","deployments_url":"https://api.github.com/repos/gpospelov/BornAgain/deployments","created_at":"2016-09-07T11:01:47Z","updated_at":"2016-09-07T11:02:19Z","pushed_at":"2016-12-09T08:26:05Z","git_url":"git://github.com/gpospelov/BornAgain.git","ssh_url":"git@github.com:gpospelov/BornAgain.git","clone_url":"https://github.com/gpospelov/BornAgain.git","svn_url":"https://github.com/gpospelov/BornAgain","homepage":"http://www.bornagainproject.org","size":416088,"stargazers_count":0,"watchers_count":0,"language":"C++","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":"develop"}},"base":{"label":"scgmlz:develop","ref":"develop","sha":"ad9067f748dca7100d4d73163cf1000c37f57806","user":{"login":"scgmlz","id":20665464,"avatar_url":"https://avatars.githubusercontent.com/u/20665464?v=3","gravatar_id":"","url":"https://api.github.com/users/scgmlz","html_url":"https://github.com/scgmlz","followers_url":"https://api.github.com/users/scgmlz/followers","following_url":"https://api.github.com/users/scgmlz/following{/other_user}","gists_url":"https://api.github.com/users/scgmlz/gists{/gist_id}","starred_url":"https://api.github.com/users/scgmlz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scgmlz/subscriptions","organizations_url":"https://api.github.com/users/scgmlz/orgs","repos_url":"https://api.github.com/users/scgmlz/repos","events_url":"https://api.github.com/users/scgmlz/events{/privacy}","received_events_url":"https://api.github.com/users/scgmlz/received_events","type":"Organization","site_admin":false},"repo":{"id":67490882,"name":"BornAgain","full_name":"scgmlz/BornAgain","owner":{"login":"scgmlz","id":20665464,"avatar_url":"https://avatars.githubusercontent.com/u/20665464?v=3","gravatar_id":"","url":"https://api.github.com/users/scgmlz","html_url":"https://github.com/scgmlz","followers_url":"https://api.github.com/users/scgmlz/followers","following_url":"https://api.github.com/users/scgmlz/following{/other_user}","gists_url":"https://api.github.com/users/scgmlz/gists{/gist_id}","starred_url":"https://api.github.com/users/scgmlz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scgmlz/subscriptions","organizations_url":"https://api.github.com/users/scgmlz/orgs","repos_url":"https://api.github.com/users/scgmlz/repos","events_url":"https://api.github.com/users/scgmlz/events{/privacy}","received_events_url":"https://api.github.com/users/scgmlz/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scgmlz/BornAgain","description":"A software to simulate and fit neutron and x-ray scattering at grazing incidence.","fork":false,"url":"https://api.github.com/repos/scgmlz/BornAgain","forks_url":"https://api.github.com/repos/scgmlz/BornAgain/forks","keys_url":"https://api.github.com/repos/scgmlz/BornAgain/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scgmlz/BornAgain/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scgmlz/BornAgain/teams","hooks_url":"https://api.github.com/repos/scgmlz/BornAgain/hooks","issue_events_url":"https://api.github.com/repos/scgmlz/BornAgain/issues/events{/number}","events_url":"https://api.github.com/repos/scgmlz/BornAgain/events","assignees_url":"https://api.github.com/repos/scgmlz/BornAgain/assignees{/user}","branches_url":"https://api.github.com/repos/scgmlz/BornAgain/branches{/branch}","tags_url":"https://api.github.com/repos/scgmlz/BornAgain/tags","blobs_url":"https://api.github.com/repos/scgmlz/BornAgain/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scgmlz/BornAgain/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scgmlz/BornAgain/git/refs{/sha}","trees_url":"https://api.github.com/repos/scgmlz/BornAgain/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scgmlz/BornAgain/statuses/{sha}","languages_url":"https://api.github.com/repos/scgmlz/BornAgain/languages","stargazers_url":"https://api.github.com/repos/scgmlz/BornAgain/stargazers","contributors_url":"https://api.github.com/repos/scgmlz/BornAgain/contributors","subscribers_url":"https://api.github.com/repos/scgmlz/BornAgain/subscribers","subscription_url":"https://api.github.com/repos/scgmlz/BornAgain/subscription","commits_url":"https://api.github.com/repos/scgmlz/BornAgain/commits{/sha}","git_commits_url":"https://api.github.com/repos/scgmlz/BornAgain/git/commits{/sha}","comments_url":"https://api.github.com/repos/scgmlz/BornAgain/comments{/number}","issue_comment_url":"https://api.github.com/repos/scgmlz/BornAgain/issues/comments{/number}","contents_url":"https://api.github.com/repos/scgmlz/BornAgain/contents/{+path}","compare_url":"https://api.github.com/repos/scgmlz/BornAgain/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scgmlz/BornAgain/merges","archive_url":"https://api.github.com/repos/scgmlz/BornAgain/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scgmlz/BornAgain/downloads","issues_url":"https://api.github.com/repos/scgmlz/BornAgain/issues{/number}","pulls_url":"https://api.github.com/repos/scgmlz/BornAgain/pulls{/number}","milestones_url":"https://api.github.com/repos/scgmlz/BornAgain/milestones{/number}","notifications_url":"https://api.github.com/repos/scgmlz/BornAgain/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scgmlz/BornAgain/labels{/name}","releases_url":"https://api.github.com/repos/scgmlz/BornAgain/releases{/id}","deployments_url":"https://api.github.com/repos/scgmlz/BornAgain/deployments","created_at":"2016-09-06T08:50:36Z","updated_at":"2016-11-14T18:17:47Z","pushed_at":"2016-12-08T12:59:09Z","git_url":"git://github.com/scgmlz/BornAgain.git","ssh_url":"git@github.com:scgmlz/BornAgain.git","clone_url":"https://github.com/scgmlz/BornAgain.git","svn_url":"https://github.com/scgmlz/BornAgain","homepage":"http://www.bornagainproject.org","size":417012,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":2,"forks":6,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scgmlz/BornAgain/pulls/118"},"html":{"href":"https://github.com/scgmlz/BornAgain/pull/118"},"issue":{"href":"https://api.github.com/repos/scgmlz/BornAgain/issues/118"},"comments":{"href":"https://api.github.com/repos/scgmlz/BornAgain/issues/118/comments"},"review_comments":{"href":"https://api.github.com/repos/scgmlz/BornAgain/pulls/118/comments"},"review_comment":{"href":"https://api.github.com/repos/scgmlz/BornAgain/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scgmlz/BornAgain/pulls/118/commits"},"statuses":{"href":"https://api.github.com/repos/scgmlz/BornAgain/statuses/5aedcc29ea390ff5d3f7ffd0a9b979215873da0b"}}}}
{"actor":{"display_login":"jwuttke"}}