{"action":"created","issue":{"url":"https://api.github.com/repos/open-source-economics/B-Tax/issues/87","repository_url":"https://api.github.com/repos/open-source-economics/B-Tax","labels_url":"https://api.github.com/repos/open-source-economics/B-Tax/issues/87/labels{/name}","comments_url":"https://api.github.com/repos/open-source-economics/B-Tax/issues/87/comments","events_url":"https://api.github.com/repos/open-source-economics/B-Tax/issues/87/events","html_url":"https://github.com/open-source-economics/B-Tax/pull/87","id":177462141,"number":87,"title":"add test asserting correct number of columns in results","user":{"login":"PeterDSteinberg","id":1445602,"avatar_url":"https://avatars.githubusercontent.com/u/1445602?v=3","gravatar_id":"","url":"https://api.github.com/users/PeterDSteinberg","html_url":"https://github.com/PeterDSteinberg","followers_url":"https://api.github.com/users/PeterDSteinberg/followers","following_url":"https://api.github.com/users/PeterDSteinberg/following{/other_user}","gists_url":"https://api.github.com/users/PeterDSteinberg/gists{/gist_id}","starred_url":"https://api.github.com/users/PeterDSteinberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PeterDSteinberg/subscriptions","organizations_url":"https://api.github.com/users/PeterDSteinberg/orgs","repos_url":"https://api.github.com/users/PeterDSteinberg/repos","events_url":"https://api.github.com/users/PeterDSteinberg/events{/privacy}","received_events_url":"https://api.github.com/users/PeterDSteinberg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-16T16:03:40Z","updated_at":"2016-09-16T16:39:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/open-source-economics/B-Tax/pulls/87","html_url":"https://github.com/open-source-economics/B-Tax/pull/87","diff_url":"https://github.com/open-source-economics/B-Tax/pull/87.diff","patch_url":"https://github.com/open-source-economics/B-Tax/pull/87.patch"},"body":"This PR adds a test to assert we have the correct number of items in each row of each table and that the first item is a string on each row while others are float or int.\r\n\r\nHere's an example of failing test for METTR which apparently relates to the [webapp-public issue 337 of NA's](https://github.com/OpenSourcePolicyCenter/webapp-public/issues/337) (the UI doesn't have enough row items to render):\r\n```\r\n_________ test_correct_number_of_cols[industry_mettr-baseline-table19] _________\r\n\r\nindustry_or_asset = 'industry_mettr', changed_reform_base = 'baseline'\r\ntable = [['METTR, corporate typically financed investment', 'METTR, non-corporate typically financed investment', 'METTR, corp...mining', 0.3523797776249587, 0.090973254207698209, 0.42973967056296619, 0.14750994372353893, -0.1195836930034178], ...]\r\n\r\n    @pytest.mark.needs_puf\r\n    @pytest.mark.parametrize('industry_or_asset,changed_reform_base,table', pytest_args)\r\n    def test_correct_number_of_cols(industry_or_asset, changed_reform_base, table):\r\n        '''Test that each table row has 7 elements where the first is a string\r\n        and others are floats or ints'''\r\n        lens = set(map(len, table[1:]))\r\n        most_lens = tuple(lens)[0]\r\n>       assert len(lens) == 1 and most_lens == 7 and len(table[0]) == most_lens - 1\r\nE       assert (1 == 1 and 6 == 7)\r\nE        +  where 1 = len(set([6]))\r\n```\r\n\r\nBut note there are other failures, with some tables having too many columns.  \r\n\r\n@jdebacker Can you look into this with:\r\n`py.test btax/tests/test_correct_col_counts.py`"},"comment":{"url":"https://api.github.com/repos/open-source-economics/B-Tax/issues/comments/247648299","html_url":"https://github.com/open-source-economics/B-Tax/pull/87#issuecomment-247648299","issue_url":"https://api.github.com/repos/open-source-economics/B-Tax/issues/87","id":247648299,"user":{"login":"jdebacker","id":10715924,"avatar_url":"https://avatars.githubusercontent.com/u/10715924?v=3","gravatar_id":"","url":"https://api.github.com/users/jdebacker","html_url":"https://github.com/jdebacker","followers_url":"https://api.github.com/users/jdebacker/followers","following_url":"https://api.github.com/users/jdebacker/following{/other_user}","gists_url":"https://api.github.com/users/jdebacker/gists{/gist_id}","starred_url":"https://api.github.com/users/jdebacker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdebacker/subscriptions","organizations_url":"https://api.github.com/users/jdebacker/orgs","repos_url":"https://api.github.com/users/jdebacker/repos","events_url":"https://api.github.com/users/jdebacker/events{/privacy}","received_events_url":"https://api.github.com/users/jdebacker/received_events","type":"User","site_admin":false},"created_at":"2016-09-16T16:39:20Z","updated_at":"2016-09-16T16:39:20Z","body":"@PeterDSteinberg , I was able to run the test, but I don't know how to read the output to diagnose the issue.  There are some columns that are string variables (e.g. that contain asset or industry names).  But when I look at the csv files output from B-Tax, I don't see any non-numeric data in columns that should be numeric.\r\n"}}
{"actor":{"display_login":"jdebacker"}}