{"action":"created","comment":{"url":"https://api.github.com/repos/rwiturralde/numpy-lambda/pulls/comments/175991349","pull_request_review_id":105611588,"id":175991349,"diff_hunk":"@@ -0,0 +1,190 @@\n+# TODO validate type is in valid set of values for all below\n+\n+fv_schema = {\n+    \"type\": \"object\",\n+    \"properties\": {\n+        \"rate\": {\n+            \"type\": \"number\"\n+        },\n+        \"nper\": {\n+            \"type\": \"number\"\n+        },\n+        \"pmt\": {\n+            \"type\": \"number\"\n+        },\n+        \"pv\": {\n+            \"type\": \"number\"\n+        },\n+        \"type\": {\n+            \"type\": \"number\"\n+        }\n+    },\n+    \"required\": [\"rate\", \"nper\", \"pmt\", \"pv\"]\n+}\n+\n+pv_schema = {\n+    \"type\": \"object\",\n+    \"properties\": {\n+        \"rate\": {\n+            \"type\": \"number\"\n+        },\n+        \"nper\": {\n+            \"type\": \"number\"\n+        },\n+        \"pmt\": {\n+            \"type\": \"number\"\n+        },\n+        \"fv\": {\n+            \"type\": \"number\"\n+        },\n+        \"type\": {\n+            \"type\": \"number\"\n+        }\n+    },\n+    \"required\": [\"rate\", \"nper\", \"pmt\", \"fv\"]\n+}\n+\n+npv_schema = {\n+    \"type\": \"object\",\n+    \"properties\": {\n+        \"rate\": {\n+            \"type\": \"number\"\n+        },\n+        \"values\": {\n+            \"type\": \"array\",\n+            \"items\": {\n+                \"type\": \"number\",\n+                \"minItems\": 1\n+            }\n+        }\n+    },\n+    \"required\": [\"rate\", \"values\"]\n+}\n+\n+pmt_schema = {\n+    \"type\": \"object\",\n+    \"properties\": {\n+        \"rate\": {\n+            \"type\": \"number\"\n+        },\n+        \"nper\": {\n+            \"type\": \"number\"\n+        },\n+        \"pv\": {\n+            \"type\": \"number\"\n+        },\n+        \"fv\": {\n+            \"type\": \"number\"\n+        },\n+        \"type\": {\n+            \"type\": \"number\"\n+        }\n+    },\n+    \"required\": [\"rate\", \"nper\", \"pv\"]\n+}\n+\n+ppmt_schema = {\n+    \"type\": \"object\",\n+    \"properties\": {\n+        \"rate\": {\n+            \"type\": \"number\"\n+        },\n+        \"per\": {\n+            \"type\": \"number\"\n+        },\n+        \"nper\": {\n+            \"type\": \"number\"\n+        },\n+        \"pv\": {\n+            \"type\": \"number\"\n+        },\n+        \"fv\": {\n+            \"type\": \"number\"\n+        },\n+        \"type\": {\n+            \"type\": \"number\"\n+        }\n+    },\n+    \"required\": [\"rate\", \"per\", \"nper\", \"pv\"]\n+}\n+\n+irr_schema = {\n+    \"type\": \"object\",\n+    \"properties\": {\n+        \"values\": {\n+            \"type\": \"array\",\n+            \"items\": {\n+                \"type\": \"number\",\n+                \"minItems\": 1\n+            }\n+        }\n+    },\n+    \"required\": [\"values\"]\n+}\n+\n+mirr_schema = {\n+    \"type\": \"object\",\n+    \"properties\": {\n+        \"values\": {\n+            \"type\": \"array\",\n+            \"items\": {\n+                \"type\": \"number\",\n+                \"minItems\": 1","path":"code/validation_json_schemas.py","position":57,"original_position":132,"commit_id":"55f45d0e37278f3c483475a6cffe548fd2df98e0","original_commit_id":"55f45d0e37278f3c483475a6cffe548fd2df98e0","user":{"login":"jlhood","id":1444420,"avatar_url":"https://avatars3.githubusercontent.com/u/1444420?v=4","gravatar_id":"","url":"https://api.github.com/users/jlhood","html_url":"https://github.com/jlhood","followers_url":"https://api.github.com/users/jlhood/followers","following_url":"https://api.github.com/users/jlhood/following{/other_user}","gists_url":"https://api.github.com/users/jlhood/gists{/gist_id}","starred_url":"https://api.github.com/users/jlhood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlhood/subscriptions","organizations_url":"https://api.github.com/users/jlhood/orgs","repos_url":"https://api.github.com/users/jlhood/repos","events_url":"https://api.github.com/users/jlhood/events{/privacy}","received_events_url":"https://api.github.com/users/jlhood/received_events","type":"User","site_admin":false},"body":"According to Excel docs, you need at least two values (one positive, one negative). numpy docs say the same thing or else it'll return nan.","created_at":"2018-03-21T06:20:12Z","updated_at":"2018-03-21T06:34:31Z","html_url":"https://github.com/rwiturralde/numpy-lambda/pull/4#discussion_r175991349","pull_request_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/pulls/4","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/rwiturralde/numpy-lambda/pulls/comments/175991349"},"html":{"href":"https://github.com/rwiturralde/numpy-lambda/pull/4#discussion_r175991349"},"pull_request":{"href":"https://api.github.com/repos/rwiturralde/numpy-lambda/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/rwiturralde/numpy-lambda/pulls/4","id":176371523,"html_url":"https://github.com/rwiturralde/numpy-lambda/pull/4","diff_url":"https://github.com/rwiturralde/numpy-lambda/pull/4.diff","patch_url":"https://github.com/rwiturralde/numpy-lambda/pull/4.patch","issue_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/issues/4","number":4,"state":"open","locked":false,"title":"NumPy supported financial functions","user":{"login":"rwiturralde","id":7671008,"avatar_url":"https://avatars1.githubusercontent.com/u/7671008?v=4","gravatar_id":"","url":"https://api.github.com/users/rwiturralde","html_url":"https://github.com/rwiturralde","followers_url":"https://api.github.com/users/rwiturralde/followers","following_url":"https://api.github.com/users/rwiturralde/following{/other_user}","gists_url":"https://api.github.com/users/rwiturralde/gists{/gist_id}","starred_url":"https://api.github.com/users/rwiturralde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwiturralde/subscriptions","organizations_url":"https://api.github.com/users/rwiturralde/orgs","repos_url":"https://api.github.com/users/rwiturralde/repos","events_url":"https://api.github.com/users/rwiturralde/events{/privacy}","received_events_url":"https://api.github.com/users/rwiturralde/received_events","type":"User","site_admin":false},"body":"* Added support for NumPy supported financial functions\r\n* Support for Lambda input validation using jsonschema\r\n* Updated buildspec.yaml to build all the functions\r\n\r\nStill TODO:\r\n* More positive unit tests\r\n* More input validation with jsonschema\r\n* Given the single lambda_handler.py, a change to any function needs a redeploy of them all.\r\n\r\nTest results:\r\nunit git:(separate_financial_functions) ✗ pytest -v test_lambda.py\r\n===================================================================================== test session starts =====================================================================================\r\nplatform darwin -- Python 2.7.13, pytest-3.4.2, py-1.5.2, pluggy-0.6.0 -- /usr/local/opt/python/bin/python2.7\r\ncachedir: .pytest_cache\r\nrootdir: /Users/iturrar/Code/numpy-wrapper/test/unit, inifile:\r\ncollected 9 items\r\n\r\ntest_lambda.py::test_fv_handler PASSED  [ 11%]\r\ntest_lambda.py::test_pv_handler PASSED [ 22%]\r\ntest_lambda.py::test_irr_handler PASSED [ 33%]\r\ntest_lambda.py::test_mirr_handler PASSED [ 44%]\r\ntest_lambda.py::test_nper_handler PASSED [ 55%]\r\ntest_lambda.py::test_npv_handler PASSED [ 66%]\r\ntest_lambda.py::test_pmt_handler PASSED [ 77%]\r\ntest_lambda.py::test_ppmt_handler PASSED [ 88%]\r\ntest_lambda.py::test_rate_handler PASSED [ 100%]","created_at":"2018-03-21T02:49:40Z","updated_at":"2018-03-21T06:34:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b68f4f63b024b25bc0e3096ad5cac2f851fa84b0","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/pulls/4/commits","review_comments_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/pulls/4/comments","review_comment_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/issues/4/comments","statuses_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/statuses/55f45d0e37278f3c483475a6cffe548fd2df98e0","head":{"label":"rwiturralde:separate_financial_functions","ref":"separate_financial_functions","sha":"55f45d0e37278f3c483475a6cffe548fd2df98e0","user":{"login":"rwiturralde","id":7671008,"avatar_url":"https://avatars1.githubusercontent.com/u/7671008?v=4","gravatar_id":"","url":"https://api.github.com/users/rwiturralde","html_url":"https://github.com/rwiturralde","followers_url":"https://api.github.com/users/rwiturralde/followers","following_url":"https://api.github.com/users/rwiturralde/following{/other_user}","gists_url":"https://api.github.com/users/rwiturralde/gists{/gist_id}","starred_url":"https://api.github.com/users/rwiturralde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwiturralde/subscriptions","organizations_url":"https://api.github.com/users/rwiturralde/orgs","repos_url":"https://api.github.com/users/rwiturralde/repos","events_url":"https://api.github.com/users/rwiturralde/events{/privacy}","received_events_url":"https://api.github.com/users/rwiturralde/received_events","type":"User","site_admin":false},"repo":{"id":123475194,"name":"numpy-lambda","full_name":"rwiturralde/numpy-lambda","owner":{"login":"rwiturralde","id":7671008,"avatar_url":"https://avatars1.githubusercontent.com/u/7671008?v=4","gravatar_id":"","url":"https://api.github.com/users/rwiturralde","html_url":"https://github.com/rwiturralde","followers_url":"https://api.github.com/users/rwiturralde/followers","following_url":"https://api.github.com/users/rwiturralde/following{/other_user}","gists_url":"https://api.github.com/users/rwiturralde/gists{/gist_id}","starred_url":"https://api.github.com/users/rwiturralde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwiturralde/subscriptions","organizations_url":"https://api.github.com/users/rwiturralde/orgs","repos_url":"https://api.github.com/users/rwiturralde/repos","events_url":"https://api.github.com/users/rwiturralde/events{/privacy}","received_events_url":"https://api.github.com/users/rwiturralde/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rwiturralde/numpy-lambda","description":"Wrapper to run NumPy in an AWS Lambda Function","fork":false,"url":"https://api.github.com/repos/rwiturralde/numpy-lambda","forks_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/forks","keys_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/teams","hooks_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/hooks","issue_events_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/issues/events{/number}","events_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/events","assignees_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/assignees{/user}","branches_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/branches{/branch}","tags_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/tags","blobs_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/git/refs{/sha}","trees_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/statuses/{sha}","languages_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/languages","stargazers_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/stargazers","contributors_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/contributors","subscribers_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/subscribers","subscription_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/subscription","commits_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/commits{/sha}","git_commits_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/git/commits{/sha}","comments_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/comments{/number}","issue_comment_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/issues/comments{/number}","contents_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/contents/{+path}","compare_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/merges","archive_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/downloads","issues_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/issues{/number}","pulls_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/pulls{/number}","milestones_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/milestones{/number}","notifications_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/labels{/name}","releases_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/releases{/id}","deployments_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/deployments","created_at":"2018-03-01T18:22:13Z","updated_at":"2018-03-20T20:36:44Z","pushed_at":"2018-03-21T05:48:05Z","git_url":"git://github.com/rwiturralde/numpy-lambda.git","ssh_url":"git@github.com:rwiturralde/numpy-lambda.git","clone_url":"https://github.com/rwiturralde/numpy-lambda.git","svn_url":"https://github.com/rwiturralde/numpy-lambda","homepage":null,"size":31,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"rwiturralde:master","ref":"master","sha":"eb0b9f788688fbe7240c6f13a13fe37a889358f8","user":{"login":"rwiturralde","id":7671008,"avatar_url":"https://avatars1.githubusercontent.com/u/7671008?v=4","gravatar_id":"","url":"https://api.github.com/users/rwiturralde","html_url":"https://github.com/rwiturralde","followers_url":"https://api.github.com/users/rwiturralde/followers","following_url":"https://api.github.com/users/rwiturralde/following{/other_user}","gists_url":"https://api.github.com/users/rwiturralde/gists{/gist_id}","starred_url":"https://api.github.com/users/rwiturralde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwiturralde/subscriptions","organizations_url":"https://api.github.com/users/rwiturralde/orgs","repos_url":"https://api.github.com/users/rwiturralde/repos","events_url":"https://api.github.com/users/rwiturralde/events{/privacy}","received_events_url":"https://api.github.com/users/rwiturralde/received_events","type":"User","site_admin":false},"repo":{"id":123475194,"name":"numpy-lambda","full_name":"rwiturralde/numpy-lambda","owner":{"login":"rwiturralde","id":7671008,"avatar_url":"https://avatars1.githubusercontent.com/u/7671008?v=4","gravatar_id":"","url":"https://api.github.com/users/rwiturralde","html_url":"https://github.com/rwiturralde","followers_url":"https://api.github.com/users/rwiturralde/followers","following_url":"https://api.github.com/users/rwiturralde/following{/other_user}","gists_url":"https://api.github.com/users/rwiturralde/gists{/gist_id}","starred_url":"https://api.github.com/users/rwiturralde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwiturralde/subscriptions","organizations_url":"https://api.github.com/users/rwiturralde/orgs","repos_url":"https://api.github.com/users/rwiturralde/repos","events_url":"https://api.github.com/users/rwiturralde/events{/privacy}","received_events_url":"https://api.github.com/users/rwiturralde/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rwiturralde/numpy-lambda","description":"Wrapper to run NumPy in an AWS Lambda Function","fork":false,"url":"https://api.github.com/repos/rwiturralde/numpy-lambda","forks_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/forks","keys_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/teams","hooks_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/hooks","issue_events_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/issues/events{/number}","events_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/events","assignees_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/assignees{/user}","branches_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/branches{/branch}","tags_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/tags","blobs_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/git/refs{/sha}","trees_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/statuses/{sha}","languages_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/languages","stargazers_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/stargazers","contributors_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/contributors","subscribers_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/subscribers","subscription_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/subscription","commits_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/commits{/sha}","git_commits_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/git/commits{/sha}","comments_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/comments{/number}","issue_comment_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/issues/comments{/number}","contents_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/contents/{+path}","compare_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/merges","archive_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/downloads","issues_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/issues{/number}","pulls_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/pulls{/number}","milestones_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/milestones{/number}","notifications_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/labels{/name}","releases_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/releases{/id}","deployments_url":"https://api.github.com/repos/rwiturralde/numpy-lambda/deployments","created_at":"2018-03-01T18:22:13Z","updated_at":"2018-03-20T20:36:44Z","pushed_at":"2018-03-21T05:48:05Z","git_url":"git://github.com/rwiturralde/numpy-lambda.git","ssh_url":"git@github.com:rwiturralde/numpy-lambda.git","clone_url":"https://github.com/rwiturralde/numpy-lambda.git","svn_url":"https://github.com/rwiturralde/numpy-lambda","homepage":null,"size":31,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rwiturralde/numpy-lambda/pulls/4"},"html":{"href":"https://github.com/rwiturralde/numpy-lambda/pull/4"},"issue":{"href":"https://api.github.com/repos/rwiturralde/numpy-lambda/issues/4"},"comments":{"href":"https://api.github.com/repos/rwiturralde/numpy-lambda/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/rwiturralde/numpy-lambda/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/rwiturralde/numpy-lambda/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rwiturralde/numpy-lambda/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/rwiturralde/numpy-lambda/statuses/55f45d0e37278f3c483475a6cffe548fd2df98e0"}},"author_association":"OWNER"}}
{"actor":{"display_login":"jlhood"}}