{"action":"created","comment":{"url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/pulls/comments/37663375","id":37663375,"diff_hunk":"@@ -330,86 +345,96 @@ def check_ss_earnings_c(ppo, reform, ifactor):\n \n \n def test_create_parameters_from_file(paramsfile):\n-    p = Parameters.from_file(paramsfile.name)\n-    irates = Parameters._Parameters__rates\n-    inf_rates = [irates[2013 + i] for i in range(0, 12)]\n-\n-    assert_array_equal(p._almdep,\n-                       expand_array(np.array([7150, 7250, 7400]), inflate=True,\n-                                    inflation_rates=inf_rates, num_years=12))\n-    assert_array_equal(p._almsep,\n-                       expand_array(np.array([40400, 41050]), inflate=True,\n-                                    inflation_rates=inf_rates, num_years=12))\n-    assert_array_equal(p._rt5,\n-                       expand_array(np.array([0.33]), inflate=False,\n-                                    inflation_rates=inf_rates, num_years=12))\n-    assert_array_equal(p._rt7,\n-                       expand_array(np.array([0.396]), inflate=False,\n-                                    inflation_rates=inf_rates, num_years=12))\n-\n-\n-def test_parameters_get_default(paramsfile):\n-    paramdata = taxcalc.parameters.default_data()\n+    with open(paramsfile.name) as pfile:\n+        params = json.load(pfile)\n+    ppo = Parameters(parameter_dict=params)\n+    irates = Parameters.default_inflation_rates()\n+    inf_rates = [irates[ppo.start_year + i] for i in range(0, ppo.num_years)]\n+\n+    assert_array_equal(ppo._almdep,\n+                       expand_array(np.array([7150, 7250, 7400]),\n+                                    inflate=True, inflation_rates=inf_rates,\n+                                    num_years=ppo.num_years))\n+    assert_array_equal(ppo._almsep,\n+                       expand_array(np.array([40400, 41050]),\n+                                    inflate=True, inflation_rates=inf_rates,\n+                                    num_years=ppo.num_years))\n+    assert_array_equal(ppo._rt5,\n+                       expand_array(np.array([0.33]),\n+                                    inflate=False, inflation_rates=inf_rates,\n+                                    num_years=ppo.num_years))\n+    assert_array_equal(ppo._rt7,\n+                       expand_array(np.array([0.396]),\n+                                    inflate=False, inflation_rates=inf_rates,\n+                                    num_years=ppo.num_years))\n+\n+\n+def test_parameters_get_default():\n+    use_classmethod = True\n+    if use_classmethod:\n+        paramdata = Parameters.default_data()\n+    else:  # use legacy global default_data function\n+        paramdata = taxcalc.parameters.default_data()\n     assert paramdata['_CDCC_ps'] == [15000]\n \n \n-def test_update_Parameters_raises_on_no_year(paramsfile):\n-    p = Parameters.from_file(paramsfile.name)\n-    user_mods = {\"_STD_Aged\": [[1400, 1200]]}\n+def test_reform_with_no_year():\n+    reform = {\"_STD_Aged\": [[1400, 1200]]}\n+    ppo = Parameters()\n     with pytest.raises(ValueError):\n-        p.update(user_mods)\n+        ppo.implement_reform(reform)\n \n \n-def test_update_Parameters_update_current_year():\n-    p = Parameters(start_year=2013)\n-    user_mods = {2013: {\"_STD_Aged\": [[1400, 1100, 1100, 1400, 1400, 1199]]}}\n-    p.update(user_mods)\n-    assert_array_equal(p.STD_Aged,\n+def test_Parameters_reform_in_start_year():\n+    ppo = Parameters(start_year=2013)\n+    reform = {2013: {\"_STD_Aged\": [[1400, 1100, 1100, 1400, 1400, 1199]]}}\n+    ppo.implement_reform(reform)\n+    assert_array_equal(ppo.STD_Aged,\n                        np.array([1400, 1100, 1100, 1400, 1400, 1199]))\n \n \n-def test_update_Parameters_raises_on_future_year():\n-    p = Parameters(start_year=2013)\n+def test_Parameters_reform_before_start_year():","path":"taxcalc/tests/test_parameters.py","position":298,"original_position":298,"commit_id":"d5c796e62ae5bf9eebabb075f334e958b92d0fa5","original_commit_id":"d5c796e62ae5bf9eebabb075f334e958b92d0fa5","user":{"login":"talumbau","id":1891418,"avatar_url":"https://avatars.githubusercontent.com/u/1891418?v=3","gravatar_id":"","url":"https://api.github.com/users/talumbau","html_url":"https://github.com/talumbau","followers_url":"https://api.github.com/users/talumbau/followers","following_url":"https://api.github.com/users/talumbau/following{/other_user}","gists_url":"https://api.github.com/users/talumbau/gists{/gist_id}","starred_url":"https://api.github.com/users/talumbau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/talumbau/subscriptions","organizations_url":"https://api.github.com/users/talumbau/orgs","repos_url":"https://api.github.com/users/talumbau/repos","events_url":"https://api.github.com/users/talumbau/events{/privacy}","received_events_url":"https://api.github.com/users/talumbau/received_events","type":"User","site_admin":false},"body":"same comment as above here, regarding 'raises' in the test name.","created_at":"2015-08-21T18:28:51Z","updated_at":"2015-08-21T18:28:51Z","html_url":"https://github.com/OpenSourcePolicyCenter/Tax-Calculator/pull/343#discussion_r37663375","pull_request_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/pulls/343","_links":{"self":{"href":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/pulls/comments/37663375"},"html":{"href":"https://github.com/OpenSourcePolicyCenter/Tax-Calculator/pull/343#discussion_r37663375"},"pull_request":{"href":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/pulls/343"}}},"pull_request":{"url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/pulls/343","id":42503319,"html_url":"https://github.com/OpenSourcePolicyCenter/Tax-Calculator/pull/343","diff_url":"https://github.com/OpenSourcePolicyCenter/Tax-Calculator/pull/343.diff","patch_url":"https://github.com/OpenSourcePolicyCenter/Tax-Calculator/pull/343.patch","issue_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/issues/343","number":343,"state":"open","locked":false,"title":"Parameters class API redesign","user":{"login":"martinholmer","id":12170745,"avatar_url":"https://avatars.githubusercontent.com/u/12170745?v=3","gravatar_id":"","url":"https://api.github.com/users/martinholmer","html_url":"https://github.com/martinholmer","followers_url":"https://api.github.com/users/martinholmer/followers","following_url":"https://api.github.com/users/martinholmer/following{/other_user}","gists_url":"https://api.github.com/users/martinholmer/gists{/gist_id}","starred_url":"https://api.github.com/users/martinholmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinholmer/subscriptions","organizations_url":"https://api.github.com/users/martinholmer/orgs","repos_url":"https://api.github.com/users/martinholmer/repos","events_url":"https://api.github.com/users/martinholmer/events{/privacy}","received_events_url":"https://api.github.com/users/martinholmer/received_events","type":"User","site_admin":false},"body":"This pull request includes a redesign of the Parameters class API plus Sphinx-aware documentation.  The new API is as described in issue #336.  The old Parameters class had no documentation, but a combination of the source code, the tests in test_parameters.py and test_calculate.py, and the helpful discussion in issue #342, provided a basis for the redesign.  The redesign includes a replacement for the depreciated global default_data function, which passes all the tests and works as described in the issue #342 discussion.  It is anticipated that after the code has been switched over to calling this new default_data class method and it has been thoroughly tested, the old global function will be removed.","created_at":"2015-08-14T22:18:20Z","updated_at":"2015-08-21T18:28:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"101a7c3fa51773c610a08eac966d0644c81e95d0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/pulls/343/commits","review_comments_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/pulls/343/comments","review_comment_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/issues/343/comments","statuses_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/statuses/d5c796e62ae5bf9eebabb075f334e958b92d0fa5","head":{"label":"martinholmer:parameters-api-redesign","ref":"parameters-api-redesign","sha":"d5c796e62ae5bf9eebabb075f334e958b92d0fa5","user":{"login":"martinholmer","id":12170745,"avatar_url":"https://avatars.githubusercontent.com/u/12170745?v=3","gravatar_id":"","url":"https://api.github.com/users/martinholmer","html_url":"https://github.com/martinholmer","followers_url":"https://api.github.com/users/martinholmer/followers","following_url":"https://api.github.com/users/martinholmer/following{/other_user}","gists_url":"https://api.github.com/users/martinholmer/gists{/gist_id}","starred_url":"https://api.github.com/users/martinholmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinholmer/subscriptions","organizations_url":"https://api.github.com/users/martinholmer/orgs","repos_url":"https://api.github.com/users/martinholmer/repos","events_url":"https://api.github.com/users/martinholmer/events{/privacy}","received_events_url":"https://api.github.com/users/martinholmer/received_events","type":"User","site_admin":false},"repo":{"id":39093370,"name":"Tax-Calculator","full_name":"martinholmer/Tax-Calculator","owner":{"login":"martinholmer","id":12170745,"avatar_url":"https://avatars.githubusercontent.com/u/12170745?v=3","gravatar_id":"","url":"https://api.github.com/users/martinholmer","html_url":"https://github.com/martinholmer","followers_url":"https://api.github.com/users/martinholmer/followers","following_url":"https://api.github.com/users/martinholmer/following{/other_user}","gists_url":"https://api.github.com/users/martinholmer/gists{/gist_id}","starred_url":"https://api.github.com/users/martinholmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinholmer/subscriptions","organizations_url":"https://api.github.com/users/martinholmer/orgs","repos_url":"https://api.github.com/users/martinholmer/repos","events_url":"https://api.github.com/users/martinholmer/events{/privacy}","received_events_url":"https://api.github.com/users/martinholmer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/martinholmer/Tax-Calculator","description":"Federal Individual Income Tax Microsimulation Model","fork":true,"url":"https://api.github.com/repos/martinholmer/Tax-Calculator","forks_url":"https://api.github.com/repos/martinholmer/Tax-Calculator/forks","keys_url":"https://api.github.com/repos/martinholmer/Tax-Calculator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/martinholmer/Tax-Calculator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/martinholmer/Tax-Calculator/teams","hooks_url":"https://api.github.com/repos/martinholmer/Tax-Calculator/hooks","issue_events_url":"https://api.github.com/repos/martinholmer/Tax-Calculator/issues/events{/number}","events_url":"https://api.github.com/repos/martinholmer/Tax-Calculator/events","assignees_url":"https://api.github.com/repos/martinholmer/Tax-Calculator/assignees{/user}","branches_url":"https://api.github.com/repos/martinholmer/Tax-Calculator/branches{/branch}","tags_url":"https://api.github.com/repos/martinholmer/Tax-Calculator/tags","blobs_url":"https://api.github.com/repos/martinholmer/Tax-Calculator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/martinholmer/Tax-Calculator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/martinholmer/Tax-Calculator/git/refs{/sha}","trees_url":"https://api.github.com/repos/martinholmer/Tax-Calculator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/martinholmer/Tax-Calculator/statuses/{sha}","languages_url":"https://api.github.com/repos/martinholmer/Tax-Calculator/languages","stargazers_url":"https://api.github.com/repos/martinholmer/Tax-Calculator/stargazers","contributors_url":"https://api.github.com/repos/martinholmer/Tax-Calculator/contributors","subscribers_url":"https://api.github.com/repos/martinholmer/Tax-Calculator/subscribers","subscription_url":"https://api.github.com/repos/martinholmer/Tax-Calculator/subscription","commits_url":"https://api.github.com/repos/martinholmer/Tax-Calculator/commits{/sha}","git_commits_url":"https://api.github.com/repos/martinholmer/Tax-Calculator/git/commits{/sha}","comments_url":"https://api.github.com/repos/martinholmer/Tax-Calculator/comments{/number}","issue_comment_url":"https://api.github.com/repos/martinholmer/Tax-Calculator/issues/comments{/number}","contents_url":"https://api.github.com/repos/martinholmer/Tax-Calculator/contents/{+path}","compare_url":"https://api.github.com/repos/martinholmer/Tax-Calculator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/martinholmer/Tax-Calculator/merges","archive_url":"https://api.github.com/repos/martinholmer/Tax-Calculator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/martinholmer/Tax-Calculator/downloads","issues_url":"https://api.github.com/repos/martinholmer/Tax-Calculator/issues{/number}","pulls_url":"https://api.github.com/repos/martinholmer/Tax-Calculator/pulls{/number}","milestones_url":"https://api.github.com/repos/martinholmer/Tax-Calculator/milestones{/number}","notifications_url":"https://api.github.com/repos/martinholmer/Tax-Calculator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/martinholmer/Tax-Calculator/labels{/name}","releases_url":"https://api.github.com/repos/martinholmer/Tax-Calculator/releases{/id}","created_at":"2015-07-14T18:36:41Z","updated_at":"2015-07-14T18:36:41Z","pushed_at":"2015-08-14T22:24:51Z","git_url":"git://github.com/martinholmer/Tax-Calculator.git","ssh_url":"git@github.com:martinholmer/Tax-Calculator.git","clone_url":"https://github.com/martinholmer/Tax-Calculator.git","svn_url":"https://github.com/martinholmer/Tax-Calculator","homepage":"","size":24295,"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":"OpenSourcePolicyCenter:master","ref":"master","sha":"966e5da8f7220be5d54d6a55f6d500b61fb60850","user":{"login":"OpenSourcePolicyCenter","id":8301070,"avatar_url":"https://avatars.githubusercontent.com/u/8301070?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenSourcePolicyCenter","html_url":"https://github.com/OpenSourcePolicyCenter","followers_url":"https://api.github.com/users/OpenSourcePolicyCenter/followers","following_url":"https://api.github.com/users/OpenSourcePolicyCenter/following{/other_user}","gists_url":"https://api.github.com/users/OpenSourcePolicyCenter/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenSourcePolicyCenter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenSourcePolicyCenter/subscriptions","organizations_url":"https://api.github.com/users/OpenSourcePolicyCenter/orgs","repos_url":"https://api.github.com/users/OpenSourcePolicyCenter/repos","events_url":"https://api.github.com/users/OpenSourcePolicyCenter/events{/privacy}","received_events_url":"https://api.github.com/users/OpenSourcePolicyCenter/received_events","type":"Organization","site_admin":false},"repo":{"id":22389485,"name":"Tax-Calculator","full_name":"OpenSourcePolicyCenter/Tax-Calculator","owner":{"login":"OpenSourcePolicyCenter","id":8301070,"avatar_url":"https://avatars.githubusercontent.com/u/8301070?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenSourcePolicyCenter","html_url":"https://github.com/OpenSourcePolicyCenter","followers_url":"https://api.github.com/users/OpenSourcePolicyCenter/followers","following_url":"https://api.github.com/users/OpenSourcePolicyCenter/following{/other_user}","gists_url":"https://api.github.com/users/OpenSourcePolicyCenter/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenSourcePolicyCenter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenSourcePolicyCenter/subscriptions","organizations_url":"https://api.github.com/users/OpenSourcePolicyCenter/orgs","repos_url":"https://api.github.com/users/OpenSourcePolicyCenter/repos","events_url":"https://api.github.com/users/OpenSourcePolicyCenter/events{/privacy}","received_events_url":"https://api.github.com/users/OpenSourcePolicyCenter/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenSourcePolicyCenter/Tax-Calculator","description":"Federal Individual Income Tax Microsimulation Model","fork":false,"url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator","forks_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/forks","keys_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/teams","hooks_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/hooks","issue_events_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/issues/events{/number}","events_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/events","assignees_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/assignees{/user}","branches_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/branches{/branch}","tags_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/tags","blobs_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/languages","stargazers_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/stargazers","contributors_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/contributors","subscribers_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/subscribers","subscription_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/subscription","commits_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/contents/{+path}","compare_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/merges","archive_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/downloads","issues_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/issues{/number}","pulls_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/labels{/name}","releases_url":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/releases{/id}","created_at":"2014-07-29T17:49:09Z","updated_at":"2015-08-09T02:47:14Z","pushed_at":"2015-08-15T13:28:20Z","git_url":"git://github.com/OpenSourcePolicyCenter/Tax-Calculator.git","ssh_url":"git@github.com:OpenSourcePolicyCenter/Tax-Calculator.git","clone_url":"https://github.com/OpenSourcePolicyCenter/Tax-Calculator.git","svn_url":"https://github.com/OpenSourcePolicyCenter/Tax-Calculator","homepage":"","size":43799,"stargazers_count":7,"watchers_count":7,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":19,"mirror_url":null,"open_issues_count":62,"forks":19,"open_issues":62,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/pulls/343"},"html":{"href":"https://github.com/OpenSourcePolicyCenter/Tax-Calculator/pull/343"},"issue":{"href":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/issues/343"},"comments":{"href":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/issues/343/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/pulls/343/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/pulls/343/commits"},"statuses":{"href":"https://api.github.com/repos/OpenSourcePolicyCenter/Tax-Calculator/statuses/d5c796e62ae5bf9eebabb075f334e958b92d0fa5"}}}}