{"action":"created","comment":{"url":"https://api.github.com/repos/ni/nimi-python/pulls/comments/169384439","pull_request_review_id":97884876,"id":169384439,"diff_hunk":"@@ -13,9 +13,9 @@ def example(resource_name, channels, options, length, voltage):\n         session.configure_vertical(range=voltage, coupling=niscope.VerticalCoupling.AC)\n         session.configure_horizontal_timing(min_sample_rate=50000000, min_num_pts=length, ref_position=50.0, num_records=1, enforce_realtime=True)\n         with session.initiate():\n-            wfm, wfm_infos = session.channels[channels].fetch(num_samples=length)\n-        print('Number of samples acquired: {:,}\\n'.format(len(wfm)))\n+            wfm_infos = session.channels[channels].fetch(num_samples=length)","path":"src/niscope/examples/niscope_fetch.py","position":null,"original_position":6,"commit_id":"d89f38f60586cc73a7a5f4d935676b28922f959f","original_commit_id":"11e2f4be8ef179eb1f2d8ebd110fed4606dc9d10","user":{"login":"texasaggie97","id":11483903,"avatar_url":"https://avatars1.githubusercontent.com/u/11483903?v=4","gravatar_id":"","url":"https://api.github.com/users/texasaggie97","html_url":"https://github.com/texasaggie97","followers_url":"https://api.github.com/users/texasaggie97/followers","following_url":"https://api.github.com/users/texasaggie97/following{/other_user}","gists_url":"https://api.github.com/users/texasaggie97/gists{/gist_id}","starred_url":"https://api.github.com/users/texasaggie97/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/texasaggie97/subscriptions","organizations_url":"https://api.github.com/users/texasaggie97/orgs","repos_url":"https://api.github.com/users/texasaggie97/repos","events_url":"https://api.github.com/users/texasaggie97/events{/privacy}","received_events_url":"https://api.github.com/users/texasaggie97/received_events","type":"User","site_admin":false},"body":"Changed","created_at":"2018-02-20T16:49:00Z","updated_at":"2018-02-20T17:03:33Z","html_url":"https://github.com/ni/nimi-python/pull/742#discussion_r169384439","pull_request_url":"https://api.github.com/repos/ni/nimi-python/pulls/742","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/ni/nimi-python/pulls/comments/169384439"},"html":{"href":"https://github.com/ni/nimi-python/pull/742#discussion_r169384439"},"pull_request":{"href":"https://api.github.com/repos/ni/nimi-python/pulls/742"}},"in_reply_to_id":169190509},"pull_request":{"url":"https://api.github.com/repos/ni/nimi-python/pulls/742","id":169507871,"html_url":"https://github.com/ni/nimi-python/pull/742","diff_url":"https://github.com/ni/nimi-python/pull/742.diff","patch_url":"https://github.com/ni/nimi-python/pull/742.patch","issue_url":"https://api.github.com/repos/ni/nimi-python/issues/742","number":742,"state":"open","locked":false,"title":"Create \"Fancy Fetch\" for niscope","user":{"login":"texasaggie97","id":11483903,"avatar_url":"https://avatars1.githubusercontent.com/u/11483903?v=4","gravatar_id":"","url":"https://api.github.com/users/texasaggie97","html_url":"https://github.com/texasaggie97","followers_url":"https://api.github.com/users/texasaggie97/followers","following_url":"https://api.github.com/users/texasaggie97/following{/other_user}","gists_url":"https://api.github.com/users/texasaggie97/gists{/gist_id}","starred_url":"https://api.github.com/users/texasaggie97/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/texasaggie97/subscriptions","organizations_url":"https://api.github.com/users/texasaggie97/orgs","repos_url":"https://api.github.com/users/texasaggie97/repos","events_url":"https://api.github.com/users/texasaggie97/events{/privacy}","received_events_url":"https://api.github.com/users/texasaggie97/received_events","type":"User","site_admin":false},"body":"- [X] This contribution adheres to [CONTRIBUTING.md](https://github.com/ni/nimi-python/blob/master/CONTRIBUTING.md).\r\n- [X] I've updated [CHANGELOG.md](https://github.com/ni/nimi-python/blob/master/CHANGELOG.md) if applicable.\r\n- [X] I've added tests applicable for this pull request\r\n### What does this Pull Request accomplish?\r\n* Change `fetch()` to be more user friendly\r\n  * `fetch(timeout=5.0, num_samples=None, fetch_relative_to=None, fetch_offet=None, fetch_record_number=None, fetch_num_records=None, wfm=None)`\r\n  * `fetch_relative_to`, `fetch_offet`, `fetch_record_number`, & `fetch_num_records`: If not `None` will set the corresponding attribute\r\n  * If wfm is not `None` calls the appropriate `fetch_into()` function\r\n  * In Python 3, a memoryview of each record is created and added to the corresponding `wfm_info`\r\n  * In Python 2, an array.array is created and the points are copied.  `memoryview` in Python 2 only supports string and bytearray, not array.array or numpy.ndarray of arbitrary types. :(\r\n* Additional documentation requires #722 \r\n* Instead of returning all of the captured data in a single 1D array that the user has to then correlate different parts to each record, the waveform for a given record is put into the corresponding wfm_info\r\n  before:\r\n  ``` python\r\n  # Assume num records = 2\r\n  wfm, wfm_info = session.channel[[0,1]].fetch(num_samples=1000)\r\n  # Channel 0, record 0\r\n  # wfm_info[0].<absoluteX, etc.> and wfm[0:999]\r\n  # Channel 1, record 0\r\n  # wfm_info[1].<absoluteX, etc.> and wfm[1000:1999]\r\n  # Channel 0, record 1\r\n  # wfm_info[2].<absoluteX, etc.> and wfm[2000:2999]\r\n  # Channel 1, record 1\r\n  # wfm_info[3].<absoluteX, etc.> and wfm[3000:3999]\r\n  ```\r\n  after:\r\n  ``` python\r\n  wfm_info = session.channel[[0,1]].fetch(num_samples=1000, fetch_num_records=2)\r\n  # Channel 0, record 0\r\n  # wfm_info[0].<absoluteX, etc.> and wfm_info[0].wfm\r\n  # Channel 1, record 0\r\n  # wfm_info[1].<absoluteX, etc.> and wfm_info[1].wfm\r\n  # Channel 0, record 1\r\n  # wfm_info[2].<absoluteX, etc.> and wfm_info[1].wfm\r\n  # Channel 1, record 1\r\n  # wfm_info[3].<absoluteX, etc.> and wfm_info[1].wfm\r\n  # Basically, the waveform becomes just one more attribute on the waveform info object\r\n  ```\r\n\r\n### ~~List issues fixed by this Pull Request below, if any.~~\r\n\r\n### What testing has been done?\r\n* Unit\r\n* System","created_at":"2018-02-15T22:52:06Z","updated_at":"2018-02-20T17:03:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4cd5c91074f1020a2a8a650a3ae22cd3369bc164","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ni/nimi-python/pulls/742/commits","review_comments_url":"https://api.github.com/repos/ni/nimi-python/pulls/742/comments","review_comment_url":"https://api.github.com/repos/ni/nimi-python/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ni/nimi-python/issues/742/comments","statuses_url":"https://api.github.com/repos/ni/nimi-python/statuses/d89f38f60586cc73a7a5f4d935676b28922f959f","head":{"label":"ni:api/fancy_fetch","ref":"api/fancy_fetch","sha":"d89f38f60586cc73a7a5f4d935676b28922f959f","user":{"login":"ni","id":5598284,"avatar_url":"https://avatars3.githubusercontent.com/u/5598284?v=4","gravatar_id":"","url":"https://api.github.com/users/ni","html_url":"https://github.com/ni","followers_url":"https://api.github.com/users/ni/followers","following_url":"https://api.github.com/users/ni/following{/other_user}","gists_url":"https://api.github.com/users/ni/gists{/gist_id}","starred_url":"https://api.github.com/users/ni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ni/subscriptions","organizations_url":"https://api.github.com/users/ni/orgs","repos_url":"https://api.github.com/users/ni/repos","events_url":"https://api.github.com/users/ni/events{/privacy}","received_events_url":"https://api.github.com/users/ni/received_events","type":"Organization","site_admin":false},"repo":{"id":91020334,"name":"nimi-python","full_name":"ni/nimi-python","owner":{"login":"ni","id":5598284,"avatar_url":"https://avatars3.githubusercontent.com/u/5598284?v=4","gravatar_id":"","url":"https://api.github.com/users/ni","html_url":"https://github.com/ni","followers_url":"https://api.github.com/users/ni/followers","following_url":"https://api.github.com/users/ni/following{/other_user}","gists_url":"https://api.github.com/users/ni/gists{/gist_id}","starred_url":"https://api.github.com/users/ni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ni/subscriptions","organizations_url":"https://api.github.com/users/ni/orgs","repos_url":"https://api.github.com/users/ni/repos","events_url":"https://api.github.com/users/ni/events{/privacy}","received_events_url":"https://api.github.com/users/ni/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ni/nimi-python","description":"Python bindings for NI Modular Instrument drivers.","fork":false,"url":"https://api.github.com/repos/ni/nimi-python","forks_url":"https://api.github.com/repos/ni/nimi-python/forks","keys_url":"https://api.github.com/repos/ni/nimi-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ni/nimi-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ni/nimi-python/teams","hooks_url":"https://api.github.com/repos/ni/nimi-python/hooks","issue_events_url":"https://api.github.com/repos/ni/nimi-python/issues/events{/number}","events_url":"https://api.github.com/repos/ni/nimi-python/events","assignees_url":"https://api.github.com/repos/ni/nimi-python/assignees{/user}","branches_url":"https://api.github.com/repos/ni/nimi-python/branches{/branch}","tags_url":"https://api.github.com/repos/ni/nimi-python/tags","blobs_url":"https://api.github.com/repos/ni/nimi-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ni/nimi-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ni/nimi-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/ni/nimi-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ni/nimi-python/statuses/{sha}","languages_url":"https://api.github.com/repos/ni/nimi-python/languages","stargazers_url":"https://api.github.com/repos/ni/nimi-python/stargazers","contributors_url":"https://api.github.com/repos/ni/nimi-python/contributors","subscribers_url":"https://api.github.com/repos/ni/nimi-python/subscribers","subscription_url":"https://api.github.com/repos/ni/nimi-python/subscription","commits_url":"https://api.github.com/repos/ni/nimi-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/ni/nimi-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/ni/nimi-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/ni/nimi-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/ni/nimi-python/contents/{+path}","compare_url":"https://api.github.com/repos/ni/nimi-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ni/nimi-python/merges","archive_url":"https://api.github.com/repos/ni/nimi-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ni/nimi-python/downloads","issues_url":"https://api.github.com/repos/ni/nimi-python/issues{/number}","pulls_url":"https://api.github.com/repos/ni/nimi-python/pulls{/number}","milestones_url":"https://api.github.com/repos/ni/nimi-python/milestones{/number}","notifications_url":"https://api.github.com/repos/ni/nimi-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ni/nimi-python/labels{/name}","releases_url":"https://api.github.com/repos/ni/nimi-python/releases{/id}","deployments_url":"https://api.github.com/repos/ni/nimi-python/deployments","created_at":"2017-05-11T20:24:33Z","updated_at":"2018-01-31T08:34:02Z","pushed_at":"2018-02-20T17:02:02Z","git_url":"git://github.com/ni/nimi-python.git","ssh_url":"git@github.com:ni/nimi-python.git","clone_url":"https://github.com/ni/nimi-python.git","svn_url":"https://github.com/ni/nimi-python","homepage":"","size":4737,"stargazers_count":15,"watchers_count":15,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":60,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":4,"open_issues":60,"watchers":15,"default_branch":"master"}},"base":{"label":"ni:master","ref":"master","sha":"5ae9243552537cbf5b36fd5c914bc8e1bb2b9295","user":{"login":"ni","id":5598284,"avatar_url":"https://avatars3.githubusercontent.com/u/5598284?v=4","gravatar_id":"","url":"https://api.github.com/users/ni","html_url":"https://github.com/ni","followers_url":"https://api.github.com/users/ni/followers","following_url":"https://api.github.com/users/ni/following{/other_user}","gists_url":"https://api.github.com/users/ni/gists{/gist_id}","starred_url":"https://api.github.com/users/ni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ni/subscriptions","organizations_url":"https://api.github.com/users/ni/orgs","repos_url":"https://api.github.com/users/ni/repos","events_url":"https://api.github.com/users/ni/events{/privacy}","received_events_url":"https://api.github.com/users/ni/received_events","type":"Organization","site_admin":false},"repo":{"id":91020334,"name":"nimi-python","full_name":"ni/nimi-python","owner":{"login":"ni","id":5598284,"avatar_url":"https://avatars3.githubusercontent.com/u/5598284?v=4","gravatar_id":"","url":"https://api.github.com/users/ni","html_url":"https://github.com/ni","followers_url":"https://api.github.com/users/ni/followers","following_url":"https://api.github.com/users/ni/following{/other_user}","gists_url":"https://api.github.com/users/ni/gists{/gist_id}","starred_url":"https://api.github.com/users/ni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ni/subscriptions","organizations_url":"https://api.github.com/users/ni/orgs","repos_url":"https://api.github.com/users/ni/repos","events_url":"https://api.github.com/users/ni/events{/privacy}","received_events_url":"https://api.github.com/users/ni/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ni/nimi-python","description":"Python bindings for NI Modular Instrument drivers.","fork":false,"url":"https://api.github.com/repos/ni/nimi-python","forks_url":"https://api.github.com/repos/ni/nimi-python/forks","keys_url":"https://api.github.com/repos/ni/nimi-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ni/nimi-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ni/nimi-python/teams","hooks_url":"https://api.github.com/repos/ni/nimi-python/hooks","issue_events_url":"https://api.github.com/repos/ni/nimi-python/issues/events{/number}","events_url":"https://api.github.com/repos/ni/nimi-python/events","assignees_url":"https://api.github.com/repos/ni/nimi-python/assignees{/user}","branches_url":"https://api.github.com/repos/ni/nimi-python/branches{/branch}","tags_url":"https://api.github.com/repos/ni/nimi-python/tags","blobs_url":"https://api.github.com/repos/ni/nimi-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ni/nimi-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ni/nimi-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/ni/nimi-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ni/nimi-python/statuses/{sha}","languages_url":"https://api.github.com/repos/ni/nimi-python/languages","stargazers_url":"https://api.github.com/repos/ni/nimi-python/stargazers","contributors_url":"https://api.github.com/repos/ni/nimi-python/contributors","subscribers_url":"https://api.github.com/repos/ni/nimi-python/subscribers","subscription_url":"https://api.github.com/repos/ni/nimi-python/subscription","commits_url":"https://api.github.com/repos/ni/nimi-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/ni/nimi-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/ni/nimi-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/ni/nimi-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/ni/nimi-python/contents/{+path}","compare_url":"https://api.github.com/repos/ni/nimi-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ni/nimi-python/merges","archive_url":"https://api.github.com/repos/ni/nimi-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ni/nimi-python/downloads","issues_url":"https://api.github.com/repos/ni/nimi-python/issues{/number}","pulls_url":"https://api.github.com/repos/ni/nimi-python/pulls{/number}","milestones_url":"https://api.github.com/repos/ni/nimi-python/milestones{/number}","notifications_url":"https://api.github.com/repos/ni/nimi-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ni/nimi-python/labels{/name}","releases_url":"https://api.github.com/repos/ni/nimi-python/releases{/id}","deployments_url":"https://api.github.com/repos/ni/nimi-python/deployments","created_at":"2017-05-11T20:24:33Z","updated_at":"2018-01-31T08:34:02Z","pushed_at":"2018-02-20T17:02:02Z","git_url":"git://github.com/ni/nimi-python.git","ssh_url":"git@github.com:ni/nimi-python.git","clone_url":"https://github.com/ni/nimi-python.git","svn_url":"https://github.com/ni/nimi-python","homepage":"","size":4737,"stargazers_count":15,"watchers_count":15,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":60,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":4,"open_issues":60,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ni/nimi-python/pulls/742"},"html":{"href":"https://github.com/ni/nimi-python/pull/742"},"issue":{"href":"https://api.github.com/repos/ni/nimi-python/issues/742"},"comments":{"href":"https://api.github.com/repos/ni/nimi-python/issues/742/comments"},"review_comments":{"href":"https://api.github.com/repos/ni/nimi-python/pulls/742/comments"},"review_comment":{"href":"https://api.github.com/repos/ni/nimi-python/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ni/nimi-python/pulls/742/commits"},"statuses":{"href":"https://api.github.com/repos/ni/nimi-python/statuses/d89f38f60586cc73a7a5f4d935676b28922f959f"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"texasaggie97"}}