{"action":"created","comment":{"url":"https://api.github.com/repos/openfisca/openfisca-core/pulls/comments/155681560","pull_request_review_id":82041369,"id":155681560,"diff_hunk":"@@ -251,6 +270,71 @@ def graph(self, edges, get_input_variables_and_parameters, nodes, visited):\n             return\n         formula.graph_parameters(edges, get_input_variables_and_parameters, nodes, visited)\n \n+    def get_memory_usage(self):\n+        \"\"\"\n+            Gets data about the virtual memory usage of the holder.\n+\n+            :returns: Memory usage data\n+            :rtype: dict\n+\n+            Exemple:\n+\n+            >>> holder.get_memory_usage()\n+            >>> {\n+            >>>    'nb_arrays': 12,  # The holder contains the variable values for 12 different periods\n+            >>>    'nb_cells_by_array': 100, # There are 100 entities (e.g. persons) in our simulation\n+            >>>    'cell_size': 8,  # Each value takes 8B of memory\n+            >>>    'dtype': dtype('float64')  # Each value is a float 64\n+            >>>    'total_nb_bytes': 10400  # The holder uses 10.4kB of virtual memory\n+            >>>    }\n+        \"\"\"\n+\n+        usage = dict(\n+            nb_cells_by_array = self.entity.count,\n+            dtype = self.variable.dtype,\n+            )\n+\n+        if self._array is not None:\n+            # Only used when definition period is ETERNITY","path":"openfisca_core/holders.py","position":90,"original_position":91,"commit_id":"e9013ca0ee4c38f60d867482cae2499b90e6999f","original_commit_id":"134b31a7138795dd75ec98caed6d823ac48f6893","user":{"login":"fpagnoux","id":11834997,"avatar_url":"https://avatars3.githubusercontent.com/u/11834997?v=4","gravatar_id":"","url":"https://api.github.com/users/fpagnoux","html_url":"https://github.com/fpagnoux","followers_url":"https://api.github.com/users/fpagnoux/followers","following_url":"https://api.github.com/users/fpagnoux/following{/other_user}","gists_url":"https://api.github.com/users/fpagnoux/gists{/gist_id}","starred_url":"https://api.github.com/users/fpagnoux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fpagnoux/subscriptions","organizations_url":"https://api.github.com/users/fpagnoux/orgs","repos_url":"https://api.github.com/users/fpagnoux/repos","events_url":"https://api.github.com/users/fpagnoux/events{/privacy}","received_events_url":"https://api.github.com/users/fpagnoux/received_events","type":"User","site_admin":false},"body":"The `_array` vs `_array_by_period` is ugly and annoying, and probably requires more than a renaming. I'll just improve the comment for this PR 🙂 ","created_at":"2017-12-08T00:52:01Z","updated_at":"2017-12-08T00:52:01Z","html_url":"https://github.com/openfisca/openfisca-core/pull/598#discussion_r155681560","pull_request_url":"https://api.github.com/repos/openfisca/openfisca-core/pulls/598","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/openfisca/openfisca-core/pulls/comments/155681560"},"html":{"href":"https://github.com/openfisca/openfisca-core/pull/598#discussion_r155681560"},"pull_request":{"href":"https://api.github.com/repos/openfisca/openfisca-core/pulls/598"}},"in_reply_to_id":154854157},"pull_request":{"url":"https://api.github.com/repos/openfisca/openfisca-core/pulls/598","id":156328896,"html_url":"https://github.com/openfisca/openfisca-core/pull/598","diff_url":"https://github.com/openfisca/openfisca-core/pull/598.diff","patch_url":"https://github.com/openfisca/openfisca-core/pull/598.patch","issue_url":"https://api.github.com/repos/openfisca/openfisca-core/issues/598","number":598,"state":"open","locked":false,"title":"Introduce new features to allow merge with taxipp","user":{"login":"fpagnoux","id":11834997,"avatar_url":"https://avatars3.githubusercontent.com/u/11834997?v=4","gravatar_id":"","url":"https://api.github.com/users/fpagnoux","html_url":"https://github.com/fpagnoux","followers_url":"https://api.github.com/users/fpagnoux/followers","following_url":"https://api.github.com/users/fpagnoux/following{/other_user}","gists_url":"https://api.github.com/users/fpagnoux/gists{/gist_id}","starred_url":"https://api.github.com/users/fpagnoux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fpagnoux/subscriptions","organizations_url":"https://api.github.com/users/fpagnoux/orgs","repos_url":"https://api.github.com/users/fpagnoux/repos","events_url":"https://api.github.com/users/fpagnoux/events{/privacy}","received_events_url":"https://api.github.com/users/fpagnoux/received_events","type":"User","site_admin":false},"body":"- Improve `Tracer`:\r\n\r\n  - Introduce an `aggregate` option in [`tracer.print_computation_log`](http://openfisca.readthedocs.io/en/latest/tracer.html#openfisca_core.tracers.Tracer.print_computation_log) to handle large population simulations.\r\n  - Introduce [`tracer.usage_stats`](http://openfisca.readthedocs.io/en/latest/tracer.html#openfisca_core.tracers.Tracer.usage_stats) to keep track of the number of times a variable is computed.\r\n\r\n- Introduce methods to keep track of memory usage:\r\n\r\n  - Introduce [`holder.get_memory_usage`](http://localhost:8000/holder.html#openfisca_core.holders.Holder.get_memory_usage)\r\n  - Introduce `entity.get_memory_usage`\r\n  - Introduce `simulation.get_memory_usage`\r\n\r\n- Improve `Holder` public interface:\r\n\r\n  - Enhance [`holder.delete_arrays`](http://openfisca.readthedocs.io/en/latest/holder.html#openfisca_core.holders.Holder.get_memory_usage) to be able to remove known values only for a specific period\r\n  - Introduce [`holder.get_known_periods`](http://openfisca.readthedocs.io/en/latest/holder.html#openfisca_core.holders.Holder.get_known_periods)\r\n\r\n- Re-introduce `taxscales.combine_tax_scales` to combine several tax scales.","created_at":"2017-12-04T22:56:45Z","updated_at":"2017-12-08T00:52:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e9bd0b117e9e4e9fb05e46ba7eaf9a2e2a1353e9","assignee":null,"assignees":[],"requested_reviewers":[{"login":"sandcha","id":6567910,"avatar_url":"https://avatars1.githubusercontent.com/u/6567910?v=4","gravatar_id":"","url":"https://api.github.com/users/sandcha","html_url":"https://github.com/sandcha","followers_url":"https://api.github.com/users/sandcha/followers","following_url":"https://api.github.com/users/sandcha/following{/other_user}","gists_url":"https://api.github.com/users/sandcha/gists{/gist_id}","starred_url":"https://api.github.com/users/sandcha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandcha/subscriptions","organizations_url":"https://api.github.com/users/sandcha/orgs","repos_url":"https://api.github.com/users/sandcha/repos","events_url":"https://api.github.com/users/sandcha/events{/privacy}","received_events_url":"https://api.github.com/users/sandcha/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/openfisca/openfisca-core/pulls/598/commits","review_comments_url":"https://api.github.com/repos/openfisca/openfisca-core/pulls/598/comments","review_comment_url":"https://api.github.com/repos/openfisca/openfisca-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openfisca/openfisca-core/issues/598/comments","statuses_url":"https://api.github.com/repos/openfisca/openfisca-core/statuses/e9013ca0ee4c38f60d867482cae2499b90e6999f","head":{"label":"openfisca:update-taxipp-v20","ref":"update-taxipp-v20","sha":"e9013ca0ee4c38f60d867482cae2499b90e6999f","user":{"login":"openfisca","id":1794404,"avatar_url":"https://avatars0.githubusercontent.com/u/1794404?v=4","gravatar_id":"","url":"https://api.github.com/users/openfisca","html_url":"https://github.com/openfisca","followers_url":"https://api.github.com/users/openfisca/followers","following_url":"https://api.github.com/users/openfisca/following{/other_user}","gists_url":"https://api.github.com/users/openfisca/gists{/gist_id}","starred_url":"https://api.github.com/users/openfisca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openfisca/subscriptions","organizations_url":"https://api.github.com/users/openfisca/orgs","repos_url":"https://api.github.com/users/openfisca/repos","events_url":"https://api.github.com/users/openfisca/events{/privacy}","received_events_url":"https://api.github.com/users/openfisca/received_events","type":"Organization","site_admin":false},"repo":{"id":15510254,"name":"openfisca-core","full_name":"openfisca/openfisca-core","owner":{"login":"openfisca","id":1794404,"avatar_url":"https://avatars0.githubusercontent.com/u/1794404?v=4","gravatar_id":"","url":"https://api.github.com/users/openfisca","html_url":"https://github.com/openfisca","followers_url":"https://api.github.com/users/openfisca/followers","following_url":"https://api.github.com/users/openfisca/following{/other_user}","gists_url":"https://api.github.com/users/openfisca/gists{/gist_id}","starred_url":"https://api.github.com/users/openfisca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openfisca/subscriptions","organizations_url":"https://api.github.com/users/openfisca/orgs","repos_url":"https://api.github.com/users/openfisca/repos","events_url":"https://api.github.com/users/openfisca/events{/privacy}","received_events_url":"https://api.github.com/users/openfisca/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openfisca/openfisca-core","description":"OpenFisca core engine, without UI nor countries-specific code & data","fork":false,"url":"https://api.github.com/repos/openfisca/openfisca-core","forks_url":"https://api.github.com/repos/openfisca/openfisca-core/forks","keys_url":"https://api.github.com/repos/openfisca/openfisca-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openfisca/openfisca-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openfisca/openfisca-core/teams","hooks_url":"https://api.github.com/repos/openfisca/openfisca-core/hooks","issue_events_url":"https://api.github.com/repos/openfisca/openfisca-core/issues/events{/number}","events_url":"https://api.github.com/repos/openfisca/openfisca-core/events","assignees_url":"https://api.github.com/repos/openfisca/openfisca-core/assignees{/user}","branches_url":"https://api.github.com/repos/openfisca/openfisca-core/branches{/branch}","tags_url":"https://api.github.com/repos/openfisca/openfisca-core/tags","blobs_url":"https://api.github.com/repos/openfisca/openfisca-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openfisca/openfisca-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openfisca/openfisca-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/openfisca/openfisca-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openfisca/openfisca-core/statuses/{sha}","languages_url":"https://api.github.com/repos/openfisca/openfisca-core/languages","stargazers_url":"https://api.github.com/repos/openfisca/openfisca-core/stargazers","contributors_url":"https://api.github.com/repos/openfisca/openfisca-core/contributors","subscribers_url":"https://api.github.com/repos/openfisca/openfisca-core/subscribers","subscription_url":"https://api.github.com/repos/openfisca/openfisca-core/subscription","commits_url":"https://api.github.com/repos/openfisca/openfisca-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/openfisca/openfisca-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/openfisca/openfisca-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/openfisca/openfisca-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/openfisca/openfisca-core/contents/{+path}","compare_url":"https://api.github.com/repos/openfisca/openfisca-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openfisca/openfisca-core/merges","archive_url":"https://api.github.com/repos/openfisca/openfisca-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openfisca/openfisca-core/downloads","issues_url":"https://api.github.com/repos/openfisca/openfisca-core/issues{/number}","pulls_url":"https://api.github.com/repos/openfisca/openfisca-core/pulls{/number}","milestones_url":"https://api.github.com/repos/openfisca/openfisca-core/milestones{/number}","notifications_url":"https://api.github.com/repos/openfisca/openfisca-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openfisca/openfisca-core/labels{/name}","releases_url":"https://api.github.com/repos/openfisca/openfisca-core/releases{/id}","deployments_url":"https://api.github.com/repos/openfisca/openfisca-core/deployments","created_at":"2013-12-29T15:17:04Z","updated_at":"2017-10-13T23:52:55Z","pushed_at":"2017-12-08T00:43:15Z","git_url":"git://github.com/openfisca/openfisca-core.git","ssh_url":"git@github.com:openfisca/openfisca-core.git","clone_url":"https://github.com/openfisca/openfisca-core.git","svn_url":"https://github.com/openfisca/openfisca-core","homepage":"https://doc.openfisca.fr","size":25936,"stargazers_count":38,"watchers_count":38,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":46,"mirror_url":null,"archived":false,"open_issues_count":32,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0"},"forks":46,"open_issues":32,"watchers":38,"default_branch":"master"}},"base":{"label":"openfisca:master","ref":"master","sha":"65905330a9a22e578bdcf77832f643ab099861d9","user":{"login":"openfisca","id":1794404,"avatar_url":"https://avatars0.githubusercontent.com/u/1794404?v=4","gravatar_id":"","url":"https://api.github.com/users/openfisca","html_url":"https://github.com/openfisca","followers_url":"https://api.github.com/users/openfisca/followers","following_url":"https://api.github.com/users/openfisca/following{/other_user}","gists_url":"https://api.github.com/users/openfisca/gists{/gist_id}","starred_url":"https://api.github.com/users/openfisca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openfisca/subscriptions","organizations_url":"https://api.github.com/users/openfisca/orgs","repos_url":"https://api.github.com/users/openfisca/repos","events_url":"https://api.github.com/users/openfisca/events{/privacy}","received_events_url":"https://api.github.com/users/openfisca/received_events","type":"Organization","site_admin":false},"repo":{"id":15510254,"name":"openfisca-core","full_name":"openfisca/openfisca-core","owner":{"login":"openfisca","id":1794404,"avatar_url":"https://avatars0.githubusercontent.com/u/1794404?v=4","gravatar_id":"","url":"https://api.github.com/users/openfisca","html_url":"https://github.com/openfisca","followers_url":"https://api.github.com/users/openfisca/followers","following_url":"https://api.github.com/users/openfisca/following{/other_user}","gists_url":"https://api.github.com/users/openfisca/gists{/gist_id}","starred_url":"https://api.github.com/users/openfisca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openfisca/subscriptions","organizations_url":"https://api.github.com/users/openfisca/orgs","repos_url":"https://api.github.com/users/openfisca/repos","events_url":"https://api.github.com/users/openfisca/events{/privacy}","received_events_url":"https://api.github.com/users/openfisca/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openfisca/openfisca-core","description":"OpenFisca core engine, without UI nor countries-specific code & data","fork":false,"url":"https://api.github.com/repos/openfisca/openfisca-core","forks_url":"https://api.github.com/repos/openfisca/openfisca-core/forks","keys_url":"https://api.github.com/repos/openfisca/openfisca-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openfisca/openfisca-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openfisca/openfisca-core/teams","hooks_url":"https://api.github.com/repos/openfisca/openfisca-core/hooks","issue_events_url":"https://api.github.com/repos/openfisca/openfisca-core/issues/events{/number}","events_url":"https://api.github.com/repos/openfisca/openfisca-core/events","assignees_url":"https://api.github.com/repos/openfisca/openfisca-core/assignees{/user}","branches_url":"https://api.github.com/repos/openfisca/openfisca-core/branches{/branch}","tags_url":"https://api.github.com/repos/openfisca/openfisca-core/tags","blobs_url":"https://api.github.com/repos/openfisca/openfisca-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openfisca/openfisca-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openfisca/openfisca-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/openfisca/openfisca-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openfisca/openfisca-core/statuses/{sha}","languages_url":"https://api.github.com/repos/openfisca/openfisca-core/languages","stargazers_url":"https://api.github.com/repos/openfisca/openfisca-core/stargazers","contributors_url":"https://api.github.com/repos/openfisca/openfisca-core/contributors","subscribers_url":"https://api.github.com/repos/openfisca/openfisca-core/subscribers","subscription_url":"https://api.github.com/repos/openfisca/openfisca-core/subscription","commits_url":"https://api.github.com/repos/openfisca/openfisca-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/openfisca/openfisca-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/openfisca/openfisca-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/openfisca/openfisca-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/openfisca/openfisca-core/contents/{+path}","compare_url":"https://api.github.com/repos/openfisca/openfisca-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openfisca/openfisca-core/merges","archive_url":"https://api.github.com/repos/openfisca/openfisca-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openfisca/openfisca-core/downloads","issues_url":"https://api.github.com/repos/openfisca/openfisca-core/issues{/number}","pulls_url":"https://api.github.com/repos/openfisca/openfisca-core/pulls{/number}","milestones_url":"https://api.github.com/repos/openfisca/openfisca-core/milestones{/number}","notifications_url":"https://api.github.com/repos/openfisca/openfisca-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openfisca/openfisca-core/labels{/name}","releases_url":"https://api.github.com/repos/openfisca/openfisca-core/releases{/id}","deployments_url":"https://api.github.com/repos/openfisca/openfisca-core/deployments","created_at":"2013-12-29T15:17:04Z","updated_at":"2017-10-13T23:52:55Z","pushed_at":"2017-12-08T00:43:15Z","git_url":"git://github.com/openfisca/openfisca-core.git","ssh_url":"git@github.com:openfisca/openfisca-core.git","clone_url":"https://github.com/openfisca/openfisca-core.git","svn_url":"https://github.com/openfisca/openfisca-core","homepage":"https://doc.openfisca.fr","size":25936,"stargazers_count":38,"watchers_count":38,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":46,"mirror_url":null,"archived":false,"open_issues_count":32,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0"},"forks":46,"open_issues":32,"watchers":38,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openfisca/openfisca-core/pulls/598"},"html":{"href":"https://github.com/openfisca/openfisca-core/pull/598"},"issue":{"href":"https://api.github.com/repos/openfisca/openfisca-core/issues/598"},"comments":{"href":"https://api.github.com/repos/openfisca/openfisca-core/issues/598/comments"},"review_comments":{"href":"https://api.github.com/repos/openfisca/openfisca-core/pulls/598/comments"},"review_comment":{"href":"https://api.github.com/repos/openfisca/openfisca-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openfisca/openfisca-core/pulls/598/commits"},"statuses":{"href":"https://api.github.com/repos/openfisca/openfisca-core/statuses/e9013ca0ee4c38f60d867482cae2499b90e6999f"}},"author_association":"OWNER"}}
{"actor":{"display_login":"fpagnoux"}}