{"action":"created","comment":{"url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/pulls/comments/199600832","pull_request_review_id":133752935,"id":199600832,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5OTYwMDgzMg==","diff_hunk":"@@ -0,0 +1,236 @@\n+import qcodes as qc\n+import numpy as np\n+from os.path import sep\n+from qcodes.dataset.data_export import get_data_by_id\n+from qcodes.dataset.sqlite_base import connect\n+from qdev_wrappers.file_setup import CURRENT_EXPERIMENT\n+from qdev_wrappers.show_num import check_experiment_is_initialized\n+\n+\n+def data_to_dict(id, samplefolder=None, datatype='SQL'):\n+    if datatype == 'qcodes_legacy':\n+        converter = Legacy_Converter()\n+\n+    if datatype == 'SQL':\n+        converter = SQL_Converter()\n+\n+    return converter.convert(id, samplefolder)\n+\n+\n+class DataConverter():\n+    \n+    def convert(self, id, samplefolder = None):\n+        \n+        data = self.find_data(id, samplefolder) \n+        data_dict = self.make_data_dictionary(data)\n+\n+        exp_id = self.find_experiment(id)\n+        dependencies = self.find_dependencies(id, data)  #SQL needs only id number to find dependencies, Legacy needs only data\n+        all_variables = self.find_variables(data)\n+\n+        data_dict['exp_id'] = exp_id\n+        data_dict['run_id'] = id\n+        data_dict['dependencies'] = dependencies\n+        data_dict['variables'] = all_variables\n+        \n+        return data_dict\n+    \n+\n+\n+class SQL_Converter(DataConverter):\n+    \n+    def find_data(self, id, samplefolder):  \n+        \n+            '''sample folder does nothing except act as placeholder.                    \n+            This function currently proceeds under the assumption that the experiment is set up, and doesn't\n+            check anything to confirm that. Also, I think this doesn't return any error if it can't find \n+            the dataset with that id number.'''\n+          \n+            data = get_data_by_id(id)                   ","path":"qdev_wrappers/fitting/Converter.py","position":49,"original_position":49,"commit_id":"720040b30e4e916ca7e16baa0edbbba719482c86","original_commit_id":"720040b30e4e916ca7e16baa0edbbba719482c86","user":{"login":"nataliejpg","id":4841569,"node_id":"MDQ6VXNlcjQ4NDE1Njk=","avatar_url":"https://avatars0.githubusercontent.com/u/4841569?v=4","gravatar_id":"","url":"https://api.github.com/users/nataliejpg","html_url":"https://github.com/nataliejpg","followers_url":"https://api.github.com/users/nataliejpg/followers","following_url":"https://api.github.com/users/nataliejpg/following{/other_user}","gists_url":"https://api.github.com/users/nataliejpg/gists{/gist_id}","starred_url":"https://api.github.com/users/nataliejpg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nataliejpg/subscriptions","organizations_url":"https://api.github.com/users/nataliejpg/orgs","repos_url":"https://api.github.com/users/nataliejpg/repos","events_url":"https://api.github.com/users/nataliejpg/events{/privacy}","received_events_url":"https://api.github.com/users/nataliejpg/received_events","type":"User","site_admin":false},"body":"does this assume that the database is stored directly in the samplefolder? I can test this if you don't get a chance :)","created_at":"2018-07-02T19:42:53Z","updated_at":"2018-07-02T19:42:53Z","html_url":"https://github.com/qdev-dk/qdev-wrappers/pull/107#discussion_r199600832","pull_request_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/pulls/107","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/qdev-dk/qdev-wrappers/pulls/comments/199600832"},"html":{"href":"https://github.com/qdev-dk/qdev-wrappers/pull/107#discussion_r199600832"},"pull_request":{"href":"https://api.github.com/repos/qdev-dk/qdev-wrappers/pulls/107"}}},"pull_request":{"url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/pulls/107","id":191088074,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkxMDg4MDc0","html_url":"https://github.com/qdev-dk/qdev-wrappers/pull/107","diff_url":"https://github.com/qdev-dk/qdev-wrappers/pull/107.diff","patch_url":"https://github.com/qdev-dk/qdev-wrappers/pull/107.patch","issue_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/issues/107","number":107,"state":"open","locked":false,"title":"new fitter for wrappers","user":{"login":"lillian542","id":38584660,"node_id":"MDQ6VXNlcjM4NTg0NjYw","avatar_url":"https://avatars0.githubusercontent.com/u/38584660?v=4","gravatar_id":"","url":"https://api.github.com/users/lillian542","html_url":"https://github.com/lillian542","followers_url":"https://api.github.com/users/lillian542/followers","following_url":"https://api.github.com/users/lillian542/following{/other_user}","gists_url":"https://api.github.com/users/lillian542/gists{/gist_id}","starred_url":"https://api.github.com/users/lillian542/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lillian542/subscriptions","organizations_url":"https://api.github.com/users/lillian542/orgs","repos_url":"https://api.github.com/users/lillian542/repos","events_url":"https://api.github.com/users/lillian542/events{/privacy}","received_events_url":"https://api.github.com/users/lillian542/received_events","type":"User","site_admin":false},"body":"In progress extension to fitting compatible with new dataset.\r\nincludes\r\n- [ ] dataconverter (from dataset to dict for both old and new datasets)\r\n- [ ] fitter (based on @ThorvaldLarsen qdev_fitter.py) to fit to dict spat out of dataconverter which itself spits out dict of fit params\r\n- [ ] plotting for fits based on dict spat out by fitter (and doesn't use any qcodes or qdev wrappers)\r\n- [ ] dataconverter (from dict spat out by fitter into new dataset which refs initial dataset and stores fit params and fit function etc)\r\n- [ ] plotter which can plot data from a dataset created by the step above, uses same plotting as qcodes\r\n\r\nworks for 1d and 2d data, takes cuts or fits to whole 2d\r\n \r\n@Dominik-Vogel @nataliejpg @ThorvaldLarsen ","created_at":"2018-05-29T09:42:47Z","updated_at":"2018-07-02T19:42:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"710918b044ac1aebc4691a8f17adc900a687888a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/pulls/107/commits","review_comments_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/pulls/107/comments","review_comment_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/pulls/comments{/number}","comments_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/issues/107/comments","statuses_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/statuses/720040b30e4e916ca7e16baa0edbbba719482c86","head":{"label":"lillian542:fitter_extension","ref":"fitter_extension","sha":"720040b30e4e916ca7e16baa0edbbba719482c86","user":{"login":"lillian542","id":38584660,"node_id":"MDQ6VXNlcjM4NTg0NjYw","avatar_url":"https://avatars0.githubusercontent.com/u/38584660?v=4","gravatar_id":"","url":"https://api.github.com/users/lillian542","html_url":"https://github.com/lillian542","followers_url":"https://api.github.com/users/lillian542/followers","following_url":"https://api.github.com/users/lillian542/following{/other_user}","gists_url":"https://api.github.com/users/lillian542/gists{/gist_id}","starred_url":"https://api.github.com/users/lillian542/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lillian542/subscriptions","organizations_url":"https://api.github.com/users/lillian542/orgs","repos_url":"https://api.github.com/users/lillian542/repos","events_url":"https://api.github.com/users/lillian542/events{/privacy}","received_events_url":"https://api.github.com/users/lillian542/received_events","type":"User","site_admin":false},"repo":{"id":135272635,"node_id":"MDEwOlJlcG9zaXRvcnkxMzUyNzI2MzU=","name":"qdev-wrappers","full_name":"lillian542/qdev-wrappers","owner":{"login":"lillian542","id":38584660,"node_id":"MDQ6VXNlcjM4NTg0NjYw","avatar_url":"https://avatars0.githubusercontent.com/u/38584660?v=4","gravatar_id":"","url":"https://api.github.com/users/lillian542","html_url":"https://github.com/lillian542","followers_url":"https://api.github.com/users/lillian542/followers","following_url":"https://api.github.com/users/lillian542/following{/other_user}","gists_url":"https://api.github.com/users/lillian542/gists{/gist_id}","starred_url":"https://api.github.com/users/lillian542/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lillian542/subscriptions","organizations_url":"https://api.github.com/users/lillian542/orgs","repos_url":"https://api.github.com/users/lillian542/repos","events_url":"https://api.github.com/users/lillian542/events{/privacy}","received_events_url":"https://api.github.com/users/lillian542/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lillian542/qdev-wrappers","description":null,"fork":true,"url":"https://api.github.com/repos/lillian542/qdev-wrappers","forks_url":"https://api.github.com/repos/lillian542/qdev-wrappers/forks","keys_url":"https://api.github.com/repos/lillian542/qdev-wrappers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lillian542/qdev-wrappers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lillian542/qdev-wrappers/teams","hooks_url":"https://api.github.com/repos/lillian542/qdev-wrappers/hooks","issue_events_url":"https://api.github.com/repos/lillian542/qdev-wrappers/issues/events{/number}","events_url":"https://api.github.com/repos/lillian542/qdev-wrappers/events","assignees_url":"https://api.github.com/repos/lillian542/qdev-wrappers/assignees{/user}","branches_url":"https://api.github.com/repos/lillian542/qdev-wrappers/branches{/branch}","tags_url":"https://api.github.com/repos/lillian542/qdev-wrappers/tags","blobs_url":"https://api.github.com/repos/lillian542/qdev-wrappers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lillian542/qdev-wrappers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lillian542/qdev-wrappers/git/refs{/sha}","trees_url":"https://api.github.com/repos/lillian542/qdev-wrappers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lillian542/qdev-wrappers/statuses/{sha}","languages_url":"https://api.github.com/repos/lillian542/qdev-wrappers/languages","stargazers_url":"https://api.github.com/repos/lillian542/qdev-wrappers/stargazers","contributors_url":"https://api.github.com/repos/lillian542/qdev-wrappers/contributors","subscribers_url":"https://api.github.com/repos/lillian542/qdev-wrappers/subscribers","subscription_url":"https://api.github.com/repos/lillian542/qdev-wrappers/subscription","commits_url":"https://api.github.com/repos/lillian542/qdev-wrappers/commits{/sha}","git_commits_url":"https://api.github.com/repos/lillian542/qdev-wrappers/git/commits{/sha}","comments_url":"https://api.github.com/repos/lillian542/qdev-wrappers/comments{/number}","issue_comment_url":"https://api.github.com/repos/lillian542/qdev-wrappers/issues/comments{/number}","contents_url":"https://api.github.com/repos/lillian542/qdev-wrappers/contents/{+path}","compare_url":"https://api.github.com/repos/lillian542/qdev-wrappers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lillian542/qdev-wrappers/merges","archive_url":"https://api.github.com/repos/lillian542/qdev-wrappers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lillian542/qdev-wrappers/downloads","issues_url":"https://api.github.com/repos/lillian542/qdev-wrappers/issues{/number}","pulls_url":"https://api.github.com/repos/lillian542/qdev-wrappers/pulls{/number}","milestones_url":"https://api.github.com/repos/lillian542/qdev-wrappers/milestones{/number}","notifications_url":"https://api.github.com/repos/lillian542/qdev-wrappers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lillian542/qdev-wrappers/labels{/name}","releases_url":"https://api.github.com/repos/lillian542/qdev-wrappers/releases{/id}","deployments_url":"https://api.github.com/repos/lillian542/qdev-wrappers/deployments","created_at":"2018-05-29T09:26:01Z","updated_at":"2018-05-29T09:26:03Z","pushed_at":"2018-06-30T19:33:09Z","git_url":"git://github.com/lillian542/qdev-wrappers.git","ssh_url":"git@github.com:lillian542/qdev-wrappers.git","clone_url":"https://github.com/lillian542/qdev-wrappers.git","svn_url":"https://github.com/lillian542/qdev-wrappers","homepage":null,"size":3712,"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":"qdev-dk:master","ref":"master","sha":"a9920b06aee4b0f9ebfff209925d0644738d0ab1","user":{"login":"qdev-dk","id":8748755,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg3NDg3NTU=","avatar_url":"https://avatars3.githubusercontent.com/u/8748755?v=4","gravatar_id":"","url":"https://api.github.com/users/qdev-dk","html_url":"https://github.com/qdev-dk","followers_url":"https://api.github.com/users/qdev-dk/followers","following_url":"https://api.github.com/users/qdev-dk/following{/other_user}","gists_url":"https://api.github.com/users/qdev-dk/gists{/gist_id}","starred_url":"https://api.github.com/users/qdev-dk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qdev-dk/subscriptions","organizations_url":"https://api.github.com/users/qdev-dk/orgs","repos_url":"https://api.github.com/users/qdev-dk/repos","events_url":"https://api.github.com/users/qdev-dk/events{/privacy}","received_events_url":"https://api.github.com/users/qdev-dk/received_events","type":"Organization","site_admin":false},"repo":{"id":101863732,"node_id":"MDEwOlJlcG9zaXRvcnkxMDE4NjM3MzI=","name":"qdev-wrappers","full_name":"qdev-dk/qdev-wrappers","owner":{"login":"qdev-dk","id":8748755,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg3NDg3NTU=","avatar_url":"https://avatars3.githubusercontent.com/u/8748755?v=4","gravatar_id":"","url":"https://api.github.com/users/qdev-dk","html_url":"https://github.com/qdev-dk","followers_url":"https://api.github.com/users/qdev-dk/followers","following_url":"https://api.github.com/users/qdev-dk/following{/other_user}","gists_url":"https://api.github.com/users/qdev-dk/gists{/gist_id}","starred_url":"https://api.github.com/users/qdev-dk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qdev-dk/subscriptions","organizations_url":"https://api.github.com/users/qdev-dk/orgs","repos_url":"https://api.github.com/users/qdev-dk/repos","events_url":"https://api.github.com/users/qdev-dk/events{/privacy}","received_events_url":"https://api.github.com/users/qdev-dk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/qdev-dk/qdev-wrappers","description":null,"fork":false,"url":"https://api.github.com/repos/qdev-dk/qdev-wrappers","forks_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/forks","keys_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/teams","hooks_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/hooks","issue_events_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/issues/events{/number}","events_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/events","assignees_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/assignees{/user}","branches_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/branches{/branch}","tags_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/tags","blobs_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/git/refs{/sha}","trees_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/statuses/{sha}","languages_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/languages","stargazers_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/stargazers","contributors_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/contributors","subscribers_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/subscribers","subscription_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/subscription","commits_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/commits{/sha}","git_commits_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/git/commits{/sha}","comments_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/comments{/number}","issue_comment_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/issues/comments{/number}","contents_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/contents/{+path}","compare_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/merges","archive_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/downloads","issues_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/issues{/number}","pulls_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/pulls{/number}","milestones_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/milestones{/number}","notifications_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/labels{/name}","releases_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/releases{/id}","deployments_url":"https://api.github.com/repos/qdev-dk/qdev-wrappers/deployments","created_at":"2017-08-30T09:33:34Z","updated_at":"2018-07-02T08:41:02Z","pushed_at":"2018-07-02T17:01:33Z","git_url":"git://github.com/qdev-dk/qdev-wrappers.git","ssh_url":"git@github.com:qdev-dk/qdev-wrappers.git","clone_url":"https://github.com/qdev-dk/qdev-wrappers.git","svn_url":"https://github.com/qdev-dk/qdev-wrappers","homepage":null,"size":3463,"stargazers_count":7,"watchers_count":7,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"archived":false,"open_issues_count":18,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":12,"open_issues":18,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/qdev-dk/qdev-wrappers/pulls/107"},"html":{"href":"https://github.com/qdev-dk/qdev-wrappers/pull/107"},"issue":{"href":"https://api.github.com/repos/qdev-dk/qdev-wrappers/issues/107"},"comments":{"href":"https://api.github.com/repos/qdev-dk/qdev-wrappers/issues/107/comments"},"review_comments":{"href":"https://api.github.com/repos/qdev-dk/qdev-wrappers/pulls/107/comments"},"review_comment":{"href":"https://api.github.com/repos/qdev-dk/qdev-wrappers/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/qdev-dk/qdev-wrappers/pulls/107/commits"},"statuses":{"href":"https://api.github.com/repos/qdev-dk/qdev-wrappers/statuses/720040b30e4e916ca7e16baa0edbbba719482c86"}},"author_association":"NONE"}}
{"actor":{"display_login":"nataliejpg"}}