{"action":"created","comment":{"url":"https://api.github.com/repos/giampaolo/psutil/pulls/comments/226821230","pull_request_review_id":166743380,"id":226821230,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNjgyMTIzMA==","diff_hunk":"@@ -432,6 +432,22 @@ def sensors_battery():\n             secsleft = minsleft * 60\n         return _common.sbattery(percent, secsleft, power_plugged)\n \n+    def sensors_temperatures():\n+        \"\"\"Return systemp temperatures\"\"\"\n+        ret = dict()\n+        ret[\"coretemp\"] = list()\n+        num_cpus = cpu_count_logical()\n+        try:\n+            for cpu in range(num_cpus):\n+                current, tjmax = cext.sensors_temperatures(cpu)","path":"psutil/_psbsd.py","position":11,"original_position":11,"commit_id":"2d1bb43b7f8831fc92cb39afbbc78330254f692c","original_commit_id":"2d1bb43b7f8831fc92cb39afbbc78330254f692c","user":{"login":"giampaolo","id":681260,"node_id":"MDQ6VXNlcjY4MTI2MA==","avatar_url":"https://avatars2.githubusercontent.com/u/681260?v=4","gravatar_id":"","url":"https://api.github.com/users/giampaolo","html_url":"https://github.com/giampaolo","followers_url":"https://api.github.com/users/giampaolo/followers","following_url":"https://api.github.com/users/giampaolo/following{/other_user}","gists_url":"https://api.github.com/users/giampaolo/gists{/gist_id}","starred_url":"https://api.github.com/users/giampaolo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giampaolo/subscriptions","organizations_url":"https://api.github.com/users/giampaolo/orgs","repos_url":"https://api.github.com/users/giampaolo/repos","events_url":"https://api.github.com/users/giampaolo/events{/privacy}","received_events_url":"https://api.github.com/users/giampaolo/received_events","type":"User","site_admin":false},"body":"I think it's better to catch `NotImplementedError` here instead of against the whole `for` loop. That way if there are temperatures for certain CPUs only (instead of all of them) we can at least return a partial result.\r\n\r\nAlso `tmax` looks like a better name than `tjmax`.","created_at":"2018-10-20T09:06:31Z","updated_at":"2018-10-20T09:53:15Z","html_url":"https://github.com/giampaolo/psutil/pull/1350#discussion_r226821230","pull_request_url":"https://api.github.com/repos/giampaolo/psutil/pulls/1350","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/giampaolo/psutil/pulls/comments/226821230"},"html":{"href":"https://github.com/giampaolo/psutil/pull/1350#discussion_r226821230"},"pull_request":{"href":"https://api.github.com/repos/giampaolo/psutil/pulls/1350"}}},"pull_request":{"url":"https://api.github.com/repos/giampaolo/psutil/pulls/1350","id":224456545,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI0NDU2NTQ1","html_url":"https://github.com/giampaolo/psutil/pull/1350","diff_url":"https://github.com/giampaolo/psutil/pull/1350.diff","patch_url":"https://github.com/giampaolo/psutil/pull/1350.patch","issue_url":"https://api.github.com/repos/giampaolo/psutil/issues/1350","number":1350,"state":"open","locked":false,"title":"FreeBSD adding temperature sensors (WIP)","user":{"login":"amanusk","id":7280933,"node_id":"MDQ6VXNlcjcyODA5MzM=","avatar_url":"https://avatars0.githubusercontent.com/u/7280933?v=4","gravatar_id":"","url":"https://api.github.com/users/amanusk","html_url":"https://github.com/amanusk","followers_url":"https://api.github.com/users/amanusk/followers","following_url":"https://api.github.com/users/amanusk/following{/other_user}","gists_url":"https://api.github.com/users/amanusk/gists{/gist_id}","starred_url":"https://api.github.com/users/amanusk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amanusk/subscriptions","organizations_url":"https://api.github.com/users/amanusk/orgs","repos_url":"https://api.github.com/users/amanusk/repos","events_url":"https://api.github.com/users/amanusk/events{/privacy}","received_events_url":"https://api.github.com/users/amanusk/received_events","type":"User","site_admin":false},"body":"The pull requests adds `sensors_temperatures()` capability for FreeBSD. This requires `coretemp` kernel module. \r\n\r\nThis is a \"WIP\" pull request to make sure this is on the right track.\r\n\r\n@giampaolo, some questions: \r\n\r\n* In this implementation, the `C` code only returns a single tuple with `current` and `max`, while creating the dictionary is handled in `python`. This makes it easier to iterate over the number of cpus, although this can also be done in `C`. I believe the number of errors can be smaller this way, and the number of `sysctlbyname` calls does not change. \r\n\r\n* Should `psutil_sensors_temperatures` be named something else?\r\n\r\n* Is there a good open source tool to test pep7 compliance? \r\n\r\nCurrent implementation returns the following when running `scripts/temperatures.py`\r\n```\r\ncoretemp\r\n    Core 0               46 °C (high = 105 °C, critical = 105 °C)\r\n    Core 1               46 °C (high = 105 °C, critical = 105 °C)\r\n    Core 2               48 °C (high = 105 °C, critical = 105 °C)\r\n    Core 3               48 °C (high = 105 °C, critical = 105 °C)\r\n    Core 4               46 °C (high = 105 °C, critical = 105 °C)\r\n    Core 5               46 °C (high = 105 °C, critical = 105 °C)\r\n    Core 6               43 °C (high = 105 °C, critical = 105 °C)\r\n    Core 7               43 °C (high = 105 °C, critical = 105 °C)\r\n```","created_at":"2018-10-20T06:49:51Z","updated_at":"2018-10-20T09:53:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4a2824e444064f9b4ad05afcab743b7915e7515e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/giampaolo/psutil/pulls/1350/commits","review_comments_url":"https://api.github.com/repos/giampaolo/psutil/pulls/1350/comments","review_comment_url":"https://api.github.com/repos/giampaolo/psutil/pulls/comments{/number}","comments_url":"https://api.github.com/repos/giampaolo/psutil/issues/1350/comments","statuses_url":"https://api.github.com/repos/giampaolo/psutil/statuses/2d1bb43b7f8831fc92cb39afbbc78330254f692c","head":{"label":"amanusk:freebsd_temps","ref":"freebsd_temps","sha":"2d1bb43b7f8831fc92cb39afbbc78330254f692c","user":{"login":"amanusk","id":7280933,"node_id":"MDQ6VXNlcjcyODA5MzM=","avatar_url":"https://avatars0.githubusercontent.com/u/7280933?v=4","gravatar_id":"","url":"https://api.github.com/users/amanusk","html_url":"https://github.com/amanusk","followers_url":"https://api.github.com/users/amanusk/followers","following_url":"https://api.github.com/users/amanusk/following{/other_user}","gists_url":"https://api.github.com/users/amanusk/gists{/gist_id}","starred_url":"https://api.github.com/users/amanusk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amanusk/subscriptions","organizations_url":"https://api.github.com/users/amanusk/orgs","repos_url":"https://api.github.com/users/amanusk/repos","events_url":"https://api.github.com/users/amanusk/events{/privacy}","received_events_url":"https://api.github.com/users/amanusk/received_events","type":"User","site_admin":false},"repo":{"id":153733314,"node_id":"MDEwOlJlcG9zaXRvcnkxNTM3MzMzMTQ=","name":"psutil","full_name":"amanusk/psutil","private":false,"owner":{"login":"amanusk","id":7280933,"node_id":"MDQ6VXNlcjcyODA5MzM=","avatar_url":"https://avatars0.githubusercontent.com/u/7280933?v=4","gravatar_id":"","url":"https://api.github.com/users/amanusk","html_url":"https://github.com/amanusk","followers_url":"https://api.github.com/users/amanusk/followers","following_url":"https://api.github.com/users/amanusk/following{/other_user}","gists_url":"https://api.github.com/users/amanusk/gists{/gist_id}","starred_url":"https://api.github.com/users/amanusk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amanusk/subscriptions","organizations_url":"https://api.github.com/users/amanusk/orgs","repos_url":"https://api.github.com/users/amanusk/repos","events_url":"https://api.github.com/users/amanusk/events{/privacy}","received_events_url":"https://api.github.com/users/amanusk/received_events","type":"User","site_admin":false},"html_url":"https://github.com/amanusk/psutil","description":"Cross-platform lib for process and system monitoring in Python","fork":true,"url":"https://api.github.com/repos/amanusk/psutil","forks_url":"https://api.github.com/repos/amanusk/psutil/forks","keys_url":"https://api.github.com/repos/amanusk/psutil/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amanusk/psutil/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amanusk/psutil/teams","hooks_url":"https://api.github.com/repos/amanusk/psutil/hooks","issue_events_url":"https://api.github.com/repos/amanusk/psutil/issues/events{/number}","events_url":"https://api.github.com/repos/amanusk/psutil/events","assignees_url":"https://api.github.com/repos/amanusk/psutil/assignees{/user}","branches_url":"https://api.github.com/repos/amanusk/psutil/branches{/branch}","tags_url":"https://api.github.com/repos/amanusk/psutil/tags","blobs_url":"https://api.github.com/repos/amanusk/psutil/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amanusk/psutil/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amanusk/psutil/git/refs{/sha}","trees_url":"https://api.github.com/repos/amanusk/psutil/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amanusk/psutil/statuses/{sha}","languages_url":"https://api.github.com/repos/amanusk/psutil/languages","stargazers_url":"https://api.github.com/repos/amanusk/psutil/stargazers","contributors_url":"https://api.github.com/repos/amanusk/psutil/contributors","subscribers_url":"https://api.github.com/repos/amanusk/psutil/subscribers","subscription_url":"https://api.github.com/repos/amanusk/psutil/subscription","commits_url":"https://api.github.com/repos/amanusk/psutil/commits{/sha}","git_commits_url":"https://api.github.com/repos/amanusk/psutil/git/commits{/sha}","comments_url":"https://api.github.com/repos/amanusk/psutil/comments{/number}","issue_comment_url":"https://api.github.com/repos/amanusk/psutil/issues/comments{/number}","contents_url":"https://api.github.com/repos/amanusk/psutil/contents/{+path}","compare_url":"https://api.github.com/repos/amanusk/psutil/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amanusk/psutil/merges","archive_url":"https://api.github.com/repos/amanusk/psutil/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amanusk/psutil/downloads","issues_url":"https://api.github.com/repos/amanusk/psutil/issues{/number}","pulls_url":"https://api.github.com/repos/amanusk/psutil/pulls{/number}","milestones_url":"https://api.github.com/repos/amanusk/psutil/milestones{/number}","notifications_url":"https://api.github.com/repos/amanusk/psutil/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amanusk/psutil/labels{/name}","releases_url":"https://api.github.com/repos/amanusk/psutil/releases{/id}","deployments_url":"https://api.github.com/repos/amanusk/psutil/deployments","created_at":"2018-10-19T05:57:13Z","updated_at":"2018-10-19T05:57:16Z","pushed_at":"2018-10-19T19:18:00Z","git_url":"git://github.com/amanusk/psutil.git","ssh_url":"git@github.com:amanusk/psutil.git","clone_url":"https://github.com/amanusk/psutil.git","svn_url":"https://github.com/amanusk/psutil","homepage":"","size":31267,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"giampaolo:master","ref":"master","sha":"7300bd48b4ea6fd98309cc9da569d6015b1ac24a","user":{"login":"giampaolo","id":681260,"node_id":"MDQ6VXNlcjY4MTI2MA==","avatar_url":"https://avatars2.githubusercontent.com/u/681260?v=4","gravatar_id":"","url":"https://api.github.com/users/giampaolo","html_url":"https://github.com/giampaolo","followers_url":"https://api.github.com/users/giampaolo/followers","following_url":"https://api.github.com/users/giampaolo/following{/other_user}","gists_url":"https://api.github.com/users/giampaolo/gists{/gist_id}","starred_url":"https://api.github.com/users/giampaolo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giampaolo/subscriptions","organizations_url":"https://api.github.com/users/giampaolo/orgs","repos_url":"https://api.github.com/users/giampaolo/repos","events_url":"https://api.github.com/users/giampaolo/events{/privacy}","received_events_url":"https://api.github.com/users/giampaolo/received_events","type":"User","site_admin":false},"repo":{"id":20101515,"node_id":"MDEwOlJlcG9zaXRvcnkyMDEwMTUxNQ==","name":"psutil","full_name":"giampaolo/psutil","private":false,"owner":{"login":"giampaolo","id":681260,"node_id":"MDQ6VXNlcjY4MTI2MA==","avatar_url":"https://avatars2.githubusercontent.com/u/681260?v=4","gravatar_id":"","url":"https://api.github.com/users/giampaolo","html_url":"https://github.com/giampaolo","followers_url":"https://api.github.com/users/giampaolo/followers","following_url":"https://api.github.com/users/giampaolo/following{/other_user}","gists_url":"https://api.github.com/users/giampaolo/gists{/gist_id}","starred_url":"https://api.github.com/users/giampaolo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giampaolo/subscriptions","organizations_url":"https://api.github.com/users/giampaolo/orgs","repos_url":"https://api.github.com/users/giampaolo/repos","events_url":"https://api.github.com/users/giampaolo/events{/privacy}","received_events_url":"https://api.github.com/users/giampaolo/received_events","type":"User","site_admin":false},"html_url":"https://github.com/giampaolo/psutil","description":"Cross-platform lib for process and system monitoring in Python","fork":false,"url":"https://api.github.com/repos/giampaolo/psutil","forks_url":"https://api.github.com/repos/giampaolo/psutil/forks","keys_url":"https://api.github.com/repos/giampaolo/psutil/keys{/key_id}","collaborators_url":"https://api.github.com/repos/giampaolo/psutil/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/giampaolo/psutil/teams","hooks_url":"https://api.github.com/repos/giampaolo/psutil/hooks","issue_events_url":"https://api.github.com/repos/giampaolo/psutil/issues/events{/number}","events_url":"https://api.github.com/repos/giampaolo/psutil/events","assignees_url":"https://api.github.com/repos/giampaolo/psutil/assignees{/user}","branches_url":"https://api.github.com/repos/giampaolo/psutil/branches{/branch}","tags_url":"https://api.github.com/repos/giampaolo/psutil/tags","blobs_url":"https://api.github.com/repos/giampaolo/psutil/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/giampaolo/psutil/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/giampaolo/psutil/git/refs{/sha}","trees_url":"https://api.github.com/repos/giampaolo/psutil/git/trees{/sha}","statuses_url":"https://api.github.com/repos/giampaolo/psutil/statuses/{sha}","languages_url":"https://api.github.com/repos/giampaolo/psutil/languages","stargazers_url":"https://api.github.com/repos/giampaolo/psutil/stargazers","contributors_url":"https://api.github.com/repos/giampaolo/psutil/contributors","subscribers_url":"https://api.github.com/repos/giampaolo/psutil/subscribers","subscription_url":"https://api.github.com/repos/giampaolo/psutil/subscription","commits_url":"https://api.github.com/repos/giampaolo/psutil/commits{/sha}","git_commits_url":"https://api.github.com/repos/giampaolo/psutil/git/commits{/sha}","comments_url":"https://api.github.com/repos/giampaolo/psutil/comments{/number}","issue_comment_url":"https://api.github.com/repos/giampaolo/psutil/issues/comments{/number}","contents_url":"https://api.github.com/repos/giampaolo/psutil/contents/{+path}","compare_url":"https://api.github.com/repos/giampaolo/psutil/compare/{base}...{head}","merges_url":"https://api.github.com/repos/giampaolo/psutil/merges","archive_url":"https://api.github.com/repos/giampaolo/psutil/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/giampaolo/psutil/downloads","issues_url":"https://api.github.com/repos/giampaolo/psutil/issues{/number}","pulls_url":"https://api.github.com/repos/giampaolo/psutil/pulls{/number}","milestones_url":"https://api.github.com/repos/giampaolo/psutil/milestones{/number}","notifications_url":"https://api.github.com/repos/giampaolo/psutil/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/giampaolo/psutil/labels{/name}","releases_url":"https://api.github.com/repos/giampaolo/psutil/releases{/id}","deployments_url":"https://api.github.com/repos/giampaolo/psutil/deployments","created_at":"2014-05-23T14:01:48Z","updated_at":"2018-10-19T19:49:51Z","pushed_at":"2018-10-20T06:49:51Z","git_url":"git://github.com/giampaolo/psutil.git","ssh_url":"git@github.com:giampaolo/psutil.git","clone_url":"https://github.com/giampaolo/psutil.git","svn_url":"https://github.com/giampaolo/psutil","homepage":"","size":31346,"stargazers_count":4149,"watchers_count":4149,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":688,"mirror_url":null,"archived":false,"open_issues_count":122,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":688,"open_issues":122,"watchers":4149,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/giampaolo/psutil/pulls/1350"},"html":{"href":"https://github.com/giampaolo/psutil/pull/1350"},"issue":{"href":"https://api.github.com/repos/giampaolo/psutil/issues/1350"},"comments":{"href":"https://api.github.com/repos/giampaolo/psutil/issues/1350/comments"},"review_comments":{"href":"https://api.github.com/repos/giampaolo/psutil/pulls/1350/comments"},"review_comment":{"href":"https://api.github.com/repos/giampaolo/psutil/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/giampaolo/psutil/pulls/1350/commits"},"statuses":{"href":"https://api.github.com/repos/giampaolo/psutil/statuses/2d1bb43b7f8831fc92cb39afbbc78330254f692c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"giampaolo"}}