{"action":"created","comment":{"url":"https://api.github.com/repos/pvlib/pvlib-python/pulls/comments/194772039","pull_request_review_id":128005856,"id":194772039,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NDc3MjAzOQ==","diff_hunk":"@@ -342,18 +318,23 @@ def test_sapm_effective_irradiance(sapm_module_params, test_input, expected):\n         assert_allclose(out, expected, atol=1e-4)\n \n \n-def test_PVSystem_sapm_effective_irradiance(sapm_module_params):\n+def test_PVSystem_sapm_effective_irradiance(sapm_module_params, mocker):\n     system = pvsystem.PVSystem(module_parameters=sapm_module_params)\n+    mocker.spy(pvsystem, 'sapm_effective_irradiance')\n \n-    poa_direct = np.array([np.nan, 1000, 1000])\n-    poa_diffuse = np.array([100, np.nan, 100])\n-    airmass_absolute = np.array([1.1, 1.1, 1.1])\n-    aoi = np.array([10, 10, 10])\n-    reference_irradiance = 1000\n+    poa_direct = 1000\n+    poa_diffuse = 100\n+    airmass_absolute = 1.1\n+    aoi = 10\n+    reference_irradiance = 1100\n \n     out = system.sapm_effective_irradiance(\n         poa_direct, poa_diffuse, airmass_absolute,\n         aoi, reference_irradiance=reference_irradiance)\n+    pvsystem.sapm_effective_irradiance.assert_called_once_with(\n+        poa_direct, poa_diffuse, airmass_absolute, aoi, sapm_module_params,\n+        reference_irradiance=reference_irradiance)\n+    assert_allclose(out, 1, atol=0.1)","path":"pvlib/test/test_pvsystem.py","position":233,"original_position":210,"commit_id":"c5b8f678b07ab0f7ff74f3582991d04adda0e92a","original_commit_id":"b80a1e402c62ac3ac0197ecefd58f1a37012f652","user":{"login":"cwhanse","id":5393711,"node_id":"MDQ6VXNlcjUzOTM3MTE=","avatar_url":"https://avatars1.githubusercontent.com/u/5393711?v=4","gravatar_id":"","url":"https://api.github.com/users/cwhanse","html_url":"https://github.com/cwhanse","followers_url":"https://api.github.com/users/cwhanse/followers","following_url":"https://api.github.com/users/cwhanse/following{/other_user}","gists_url":"https://api.github.com/users/cwhanse/gists{/gist_id}","starred_url":"https://api.github.com/users/cwhanse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cwhanse/subscriptions","organizations_url":"https://api.github.com/users/cwhanse/orgs","repos_url":"https://api.github.com/users/cwhanse/repos","events_url":"https://api.github.com/users/cwhanse/events{/privacy}","received_events_url":"https://api.github.com/users/cwhanse/received_events","type":"User","site_admin":false},"body":"Here, we are testing that `pvsystem.sapm_effective_irradiance` is called and returns a reasonable value, correct?  If so, then I would change `airmass_absolute = 1.5`, `aoi = 0` and `poa_direct = 900`.  We should keep `reference_irradiance = 1000`. With these inputs the method call should return 1.0 exactly.  At least until we act on #472 ","created_at":"2018-06-12T14:57:53Z","updated_at":"2018-06-12T14:58:53Z","html_url":"https://github.com/pvlib/pvlib-python/pull/468#discussion_r194772039","pull_request_url":"https://api.github.com/repos/pvlib/pvlib-python/pulls/468","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/pvlib/pvlib-python/pulls/comments/194772039"},"html":{"href":"https://github.com/pvlib/pvlib-python/pull/468#discussion_r194772039"},"pull_request":{"href":"https://api.github.com/repos/pvlib/pvlib-python/pulls/468"}},"in_reply_to_id":194477810},"pull_request":{"url":"https://api.github.com/repos/pvlib/pvlib-python/pulls/468","id":191608225,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkxNjA4MjI1","html_url":"https://github.com/pvlib/pvlib-python/pull/468","diff_url":"https://github.com/pvlib/pvlib-python/pull/468.diff","patch_url":"https://github.com/pvlib/pvlib-python/pull/468.patch","issue_url":"https://api.github.com/repos/pvlib/pvlib-python/issues/468","number":468,"state":"open","locked":false,"title":"use pytest-mock to simplify and improve tests, improve test docs","user":{"login":"wholmgren","id":4383303,"node_id":"MDQ6VXNlcjQzODMzMDM=","avatar_url":"https://avatars0.githubusercontent.com/u/4383303?v=4","gravatar_id":"","url":"https://api.github.com/users/wholmgren","html_url":"https://github.com/wholmgren","followers_url":"https://api.github.com/users/wholmgren/followers","following_url":"https://api.github.com/users/wholmgren/following{/other_user}","gists_url":"https://api.github.com/users/wholmgren/gists{/gist_id}","starred_url":"https://api.github.com/users/wholmgren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wholmgren/subscriptions","organizations_url":"https://api.github.com/users/wholmgren/orgs","repos_url":"https://api.github.com/users/wholmgren/repos","events_url":"https://api.github.com/users/wholmgren/events{/privacy}","received_events_url":"https://api.github.com/users/wholmgren/received_events","type":"User","site_admin":false},"body":"Rewrites PVSystem tests using ``pytest-mock`` and adds a new ModelChain test. Please see the whatsnew diff and the new documentation for more details on how and why. \r\n\r\nThe changes to ``test_pvsystem.py`` are complete (I think). I don't currently have time to go through the entire ``test_modelchain.py`` module and improve the tests to use the new methods. I suggest calling it good enough for this pull request. It at least provides an example for people working with the modelchain code in the future.\r\n\r\nSee discussion in #466 in [this comment](https://github.com/pvlib/pvlib-python/pull/466#issuecomment-392558404) and below for more context.\r\n\r\n - [x] Closes issue #xxxx N/A\r\n - [ ] Fully tested. Added and/or modified tests to ensure correct behavior for all reasonable inputs. Tests must pass on the TravisCI and Appveyor testing services.\r\n - [x] Code quality and style is sufficient. Passes ``git diff upstream/master -u -- \"*.py\" | flake8 --diff`` and/or landscape.io linting service.\r\n - [x] New code is fully documented. Includes sphinx/numpydoc compliant docstrings and comments in the code where necessary.\r\n - [x] Updates entries to `docs/sphinx/source/api.rst` for API changes.\r\n - [x] Adds description and name entries in the appropriate `docs/sphinx/source/whatsnew` file for all changes.\r\n","created_at":"2018-05-30T23:34:32Z","updated_at":"2018-06-12T14:58:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c10774dc273ccece111673884909629611a9b7fd","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/pvlib/pvlib-python/pulls/468/commits","review_comments_url":"https://api.github.com/repos/pvlib/pvlib-python/pulls/468/comments","review_comment_url":"https://api.github.com/repos/pvlib/pvlib-python/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pvlib/pvlib-python/issues/468/comments","statuses_url":"https://api.github.com/repos/pvlib/pvlib-python/statuses/c5b8f678b07ab0f7ff74f3582991d04adda0e92a","head":{"label":"wholmgren:mock","ref":"mock","sha":"c5b8f678b07ab0f7ff74f3582991d04adda0e92a","user":{"login":"wholmgren","id":4383303,"node_id":"MDQ6VXNlcjQzODMzMDM=","avatar_url":"https://avatars0.githubusercontent.com/u/4383303?v=4","gravatar_id":"","url":"https://api.github.com/users/wholmgren","html_url":"https://github.com/wholmgren","followers_url":"https://api.github.com/users/wholmgren/followers","following_url":"https://api.github.com/users/wholmgren/following{/other_user}","gists_url":"https://api.github.com/users/wholmgren/gists{/gist_id}","starred_url":"https://api.github.com/users/wholmgren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wholmgren/subscriptions","organizations_url":"https://api.github.com/users/wholmgren/orgs","repos_url":"https://api.github.com/users/wholmgren/repos","events_url":"https://api.github.com/users/wholmgren/events{/privacy}","received_events_url":"https://api.github.com/users/wholmgren/received_events","type":"User","site_admin":false},"repo":{"id":30896535,"node_id":"MDEwOlJlcG9zaXRvcnkzMDg5NjUzNQ==","name":"pvlib-python","full_name":"wholmgren/pvlib-python","owner":{"login":"wholmgren","id":4383303,"node_id":"MDQ6VXNlcjQzODMzMDM=","avatar_url":"https://avatars0.githubusercontent.com/u/4383303?v=4","gravatar_id":"","url":"https://api.github.com/users/wholmgren","html_url":"https://github.com/wholmgren","followers_url":"https://api.github.com/users/wholmgren/followers","following_url":"https://api.github.com/users/wholmgren/following{/other_user}","gists_url":"https://api.github.com/users/wholmgren/gists{/gist_id}","starred_url":"https://api.github.com/users/wholmgren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wholmgren/subscriptions","organizations_url":"https://api.github.com/users/wholmgren/orgs","repos_url":"https://api.github.com/users/wholmgren/repos","events_url":"https://api.github.com/users/wholmgren/events{/privacy}","received_events_url":"https://api.github.com/users/wholmgren/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wholmgren/pvlib-python","description":"The PV_LIB Toolbox provides a set of well-documented functions for simulating the performance of photovoltaic energy systems. The toolbox was developed at Sandia National Laboratories and it implements many of the models and methods developed at the Labs.","fork":true,"url":"https://api.github.com/repos/wholmgren/pvlib-python","forks_url":"https://api.github.com/repos/wholmgren/pvlib-python/forks","keys_url":"https://api.github.com/repos/wholmgren/pvlib-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wholmgren/pvlib-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wholmgren/pvlib-python/teams","hooks_url":"https://api.github.com/repos/wholmgren/pvlib-python/hooks","issue_events_url":"https://api.github.com/repos/wholmgren/pvlib-python/issues/events{/number}","events_url":"https://api.github.com/repos/wholmgren/pvlib-python/events","assignees_url":"https://api.github.com/repos/wholmgren/pvlib-python/assignees{/user}","branches_url":"https://api.github.com/repos/wholmgren/pvlib-python/branches{/branch}","tags_url":"https://api.github.com/repos/wholmgren/pvlib-python/tags","blobs_url":"https://api.github.com/repos/wholmgren/pvlib-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wholmgren/pvlib-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wholmgren/pvlib-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/wholmgren/pvlib-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wholmgren/pvlib-python/statuses/{sha}","languages_url":"https://api.github.com/repos/wholmgren/pvlib-python/languages","stargazers_url":"https://api.github.com/repos/wholmgren/pvlib-python/stargazers","contributors_url":"https://api.github.com/repos/wholmgren/pvlib-python/contributors","subscribers_url":"https://api.github.com/repos/wholmgren/pvlib-python/subscribers","subscription_url":"https://api.github.com/repos/wholmgren/pvlib-python/subscription","commits_url":"https://api.github.com/repos/wholmgren/pvlib-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/wholmgren/pvlib-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/wholmgren/pvlib-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/wholmgren/pvlib-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/wholmgren/pvlib-python/contents/{+path}","compare_url":"https://api.github.com/repos/wholmgren/pvlib-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wholmgren/pvlib-python/merges","archive_url":"https://api.github.com/repos/wholmgren/pvlib-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wholmgren/pvlib-python/downloads","issues_url":"https://api.github.com/repos/wholmgren/pvlib-python/issues{/number}","pulls_url":"https://api.github.com/repos/wholmgren/pvlib-python/pulls{/number}","milestones_url":"https://api.github.com/repos/wholmgren/pvlib-python/milestones{/number}","notifications_url":"https://api.github.com/repos/wholmgren/pvlib-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wholmgren/pvlib-python/labels{/name}","releases_url":"https://api.github.com/repos/wholmgren/pvlib-python/releases{/id}","deployments_url":"https://api.github.com/repos/wholmgren/pvlib-python/deployments","created_at":"2015-02-17T00:55:18Z","updated_at":"2018-06-01T02:18:47Z","pushed_at":"2018-06-11T17:59:08Z","git_url":"git://github.com/wholmgren/pvlib-python.git","ssh_url":"git@github.com:wholmgren/pvlib-python.git","clone_url":"https://github.com/wholmgren/pvlib-python.git","svn_url":"https://github.com/wholmgren/pvlib-python","homepage":"","size":92645,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pvlib:master","ref":"master","sha":"8aec267601339c6e1c03434c1211814dd40e8426","user":{"login":"pvlib","id":11037261,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExMDM3MjYx","avatar_url":"https://avatars3.githubusercontent.com/u/11037261?v=4","gravatar_id":"","url":"https://api.github.com/users/pvlib","html_url":"https://github.com/pvlib","followers_url":"https://api.github.com/users/pvlib/followers","following_url":"https://api.github.com/users/pvlib/following{/other_user}","gists_url":"https://api.github.com/users/pvlib/gists{/gist_id}","starred_url":"https://api.github.com/users/pvlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pvlib/subscriptions","organizations_url":"https://api.github.com/users/pvlib/orgs","repos_url":"https://api.github.com/users/pvlib/repos","events_url":"https://api.github.com/users/pvlib/events{/privacy}","received_events_url":"https://api.github.com/users/pvlib/received_events","type":"Organization","site_admin":false},"repo":{"id":30895522,"node_id":"MDEwOlJlcG9zaXRvcnkzMDg5NTUyMg==","name":"pvlib-python","full_name":"pvlib/pvlib-python","owner":{"login":"pvlib","id":11037261,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExMDM3MjYx","avatar_url":"https://avatars3.githubusercontent.com/u/11037261?v=4","gravatar_id":"","url":"https://api.github.com/users/pvlib","html_url":"https://github.com/pvlib","followers_url":"https://api.github.com/users/pvlib/followers","following_url":"https://api.github.com/users/pvlib/following{/other_user}","gists_url":"https://api.github.com/users/pvlib/gists{/gist_id}","starred_url":"https://api.github.com/users/pvlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pvlib/subscriptions","organizations_url":"https://api.github.com/users/pvlib/orgs","repos_url":"https://api.github.com/users/pvlib/repos","events_url":"https://api.github.com/users/pvlib/events{/privacy}","received_events_url":"https://api.github.com/users/pvlib/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pvlib/pvlib-python","description":"A set of documented functions for simulating the performance of photovoltaic energy systems.","fork":false,"url":"https://api.github.com/repos/pvlib/pvlib-python","forks_url":"https://api.github.com/repos/pvlib/pvlib-python/forks","keys_url":"https://api.github.com/repos/pvlib/pvlib-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pvlib/pvlib-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pvlib/pvlib-python/teams","hooks_url":"https://api.github.com/repos/pvlib/pvlib-python/hooks","issue_events_url":"https://api.github.com/repos/pvlib/pvlib-python/issues/events{/number}","events_url":"https://api.github.com/repos/pvlib/pvlib-python/events","assignees_url":"https://api.github.com/repos/pvlib/pvlib-python/assignees{/user}","branches_url":"https://api.github.com/repos/pvlib/pvlib-python/branches{/branch}","tags_url":"https://api.github.com/repos/pvlib/pvlib-python/tags","blobs_url":"https://api.github.com/repos/pvlib/pvlib-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pvlib/pvlib-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pvlib/pvlib-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/pvlib/pvlib-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pvlib/pvlib-python/statuses/{sha}","languages_url":"https://api.github.com/repos/pvlib/pvlib-python/languages","stargazers_url":"https://api.github.com/repos/pvlib/pvlib-python/stargazers","contributors_url":"https://api.github.com/repos/pvlib/pvlib-python/contributors","subscribers_url":"https://api.github.com/repos/pvlib/pvlib-python/subscribers","subscription_url":"https://api.github.com/repos/pvlib/pvlib-python/subscription","commits_url":"https://api.github.com/repos/pvlib/pvlib-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/pvlib/pvlib-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/pvlib/pvlib-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/pvlib/pvlib-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/pvlib/pvlib-python/contents/{+path}","compare_url":"https://api.github.com/repos/pvlib/pvlib-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pvlib/pvlib-python/merges","archive_url":"https://api.github.com/repos/pvlib/pvlib-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pvlib/pvlib-python/downloads","issues_url":"https://api.github.com/repos/pvlib/pvlib-python/issues{/number}","pulls_url":"https://api.github.com/repos/pvlib/pvlib-python/pulls{/number}","milestones_url":"https://api.github.com/repos/pvlib/pvlib-python/milestones{/number}","notifications_url":"https://api.github.com/repos/pvlib/pvlib-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pvlib/pvlib-python/labels{/name}","releases_url":"https://api.github.com/repos/pvlib/pvlib-python/releases{/id}","deployments_url":"https://api.github.com/repos/pvlib/pvlib-python/deployments","created_at":"2015-02-17T00:21:33Z","updated_at":"2018-06-12T01:02:28Z","pushed_at":"2018-06-11T17:59:10Z","git_url":"git://github.com/pvlib/pvlib-python.git","ssh_url":"git@github.com:pvlib/pvlib-python.git","clone_url":"https://github.com/pvlib/pvlib-python.git","svn_url":"https://github.com/pvlib/pvlib-python","homepage":"","size":90925,"stargazers_count":154,"watchers_count":154,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":185,"mirror_url":null,"archived":false,"open_issues_count":79,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":185,"open_issues":79,"watchers":154,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pvlib/pvlib-python/pulls/468"},"html":{"href":"https://github.com/pvlib/pvlib-python/pull/468"},"issue":{"href":"https://api.github.com/repos/pvlib/pvlib-python/issues/468"},"comments":{"href":"https://api.github.com/repos/pvlib/pvlib-python/issues/468/comments"},"review_comments":{"href":"https://api.github.com/repos/pvlib/pvlib-python/pulls/468/comments"},"review_comment":{"href":"https://api.github.com/repos/pvlib/pvlib-python/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pvlib/pvlib-python/pulls/468/commits"},"statuses":{"href":"https://api.github.com/repos/pvlib/pvlib-python/statuses/c5b8f678b07ab0f7ff74f3582991d04adda0e92a"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"cwhanse"}}