{"action":"created","comment":{"url":"https://api.github.com/repos/blue-yonder/tsfresh/pulls/comments/92123527","pull_request_review_id":12631610,"id":92123527,"diff_hunk":"@@ -0,0 +1,417 @@\n+import sys\n+import os\n+from time import time, sleep\n+import shutil\n+import datetime\n+import csv\n+import json\n+import errno\n+import tempfile\n+\n+import unittest\n+from mock import Mock, patch\n+import numpy as np\n+import pandas as pd\n+from tsfresh import extract_features, extract_relevant_features, select_features\n+from tsfresh.examples.test_tsfresh_baseline_dataset import download_json_dataset\n+\n+from tsfresh_feature_names import TSFRESH_FEATURES, TSFRESH_BASELINE_VERSION\n+\n+python_version = int(sys.version_info[0])\n+baseline_dir = os.path.dirname(os.path.realpath(__file__))\n+tests_dir = os.path.dirname(baseline_dir)\n+tsfresh_dir = os.path.dirname(tests_dir)\n+baseline_ts_json_file = 'data.json'\n+baseline_ts_json_baseline = '%s/tsfresh-%s.py%s.%s.features.transposed.csv' % (\n+    baseline_dir, TSFRESH_BASELINE_VERSION, str(python_version),\n+    baseline_ts_json_file)\n+t_fname_out_fail = '%s/tsfresh/examples/data/test_tsfresh_baseline_dataset/tsfresh-unknown-version.py%s.data.json.features.transposed.csv' % (tsfresh_dir, str(python_version))\n+test_path = tempfile.mkdtemp()","path":"tests/baseline/tsfresh_features_test.py","position":29,"original_position":29,"commit_id":"cc44a23d3e778d686780f5a44f1bd78328608532","original_commit_id":"cc44a23d3e778d686780f5a44f1bd78328608532","user":{"login":"earthgecko","id":96679,"avatar_url":"https://avatars.githubusercontent.com/u/96679?v=3","gravatar_id":"","url":"https://api.github.com/users/earthgecko","html_url":"https://github.com/earthgecko","followers_url":"https://api.github.com/users/earthgecko/followers","following_url":"https://api.github.com/users/earthgecko/following{/other_user}","gists_url":"https://api.github.com/users/earthgecko/gists{/gist_id}","starred_url":"https://api.github.com/users/earthgecko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/earthgecko/subscriptions","organizations_url":"https://api.github.com/users/earthgecko/orgs","repos_url":"https://api.github.com/users/earthgecko/repos","events_url":"https://api.github.com/users/earthgecko/events{/privacy}","received_events_url":"https://api.github.com/users/earthgecko/received_events","type":"User","site_admin":false},"body":"I will given it a try, although seeing as getting unittest and tempfile.mkdtemp() was an absolute pain, I am somewhat scared by the prospect of changing it :)\r\n\r\nI only used tempfile.mkdtemp() as I looked at how tsfresh structures other tests and tried to do it the same.  I just using /tmp/test_tsfresh and managing that, which eluded me to the fact that unittest run without any particular order and adhoc, which was messing with the csv via the 'a' write context.  Adopting the tempfile.mkdtemp() method fixed that, but I was also horrified when I added logging to see exactly what the hell it was doing.  Personally I am not sure this \"test\" matches what unittest is meant to do a script could do it just as well and is probably better suited, but I figured maybe I could hack it into unittest.  I know it is not pretty.","created_at":"2016-12-13T09:06:55Z","updated_at":"2016-12-13T09:06:55Z","html_url":"https://github.com/blue-yonder/tsfresh/pull/106#discussion_r92123527","pull_request_url":"https://api.github.com/repos/blue-yonder/tsfresh/pulls/106","_links":{"self":{"href":"https://api.github.com/repos/blue-yonder/tsfresh/pulls/comments/92123527"},"html":{"href":"https://github.com/blue-yonder/tsfresh/pull/106#discussion_r92123527"},"pull_request":{"href":"https://api.github.com/repos/blue-yonder/tsfresh/pulls/106"}}},"pull_request":{"url":"https://api.github.com/repos/blue-yonder/tsfresh/pulls/106","id":97583887,"html_url":"https://github.com/blue-yonder/tsfresh/pull/106","diff_url":"https://github.com/blue-yonder/tsfresh/pull/106.diff","patch_url":"https://github.com/blue-yonder/tsfresh/pull/106.patch","issue_url":"https://api.github.com/repos/blue-yonder/tsfresh/issues/106","number":106,"state":"open","locked":false,"title":"tsfresh_features_test unittest #105","user":{"login":"earthgecko","id":96679,"avatar_url":"https://avatars.githubusercontent.com/u/96679?v=3","gravatar_id":"","url":"https://api.github.com/users/earthgecko","html_url":"https://github.com/earthgecko","followers_url":"https://api.github.com/users/earthgecko/followers","following_url":"https://api.github.com/users/earthgecko/following{/other_user}","gists_url":"https://api.github.com/users/earthgecko/gists{/gist_id}","starred_url":"https://api.github.com/users/earthgecko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/earthgecko/subscriptions","organizations_url":"https://api.github.com/users/earthgecko/orgs","repos_url":"https://api.github.com/users/earthgecko/repos","events_url":"https://api.github.com/users/earthgecko/events{/privacy}","received_events_url":"https://api.github.com/users/earthgecko/received_events","type":"User","site_admin":false},"body":"As per https://github.com/blue-yonder/tsfresh/issues/105\r\n\r\n- Added examples script to pull down the data set\r\n- Added tsfresh-0.1.2 and tsfresh-0.3.0 py2 and py3 baselines\r\n- Added tests\r\n\r\nAdded:\r\ntests/baseline/tsfresh-0.1.2.py2.data.json.features.transposed.csv\r\ntests/baseline/tsfresh-0.3.0.py2.data.json.features.transposed.csv\r\ntests/baseline/tsfresh-0.3.0.py3.data.json.features.transposed.csv\r\ntests/baseline/tsfresh_feature_names.py\r\ntests/baseline/tsfresh_features_test.py\r\ntsfresh/examples/test_tsfresh_baseline_dataset.py","created_at":"2016-12-12T16:20:31Z","updated_at":"2016-12-13T09:06:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f971273e6d7213fb0f4fcc5497ebeddfafe594bd","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/blue-yonder/tsfresh/pulls/106/commits","review_comments_url":"https://api.github.com/repos/blue-yonder/tsfresh/pulls/106/comments","review_comment_url":"https://api.github.com/repos/blue-yonder/tsfresh/pulls/comments{/number}","comments_url":"https://api.github.com/repos/blue-yonder/tsfresh/issues/106/comments","statuses_url":"https://api.github.com/repos/blue-yonder/tsfresh/statuses/cc44a23d3e778d686780f5a44f1bd78328608532","head":{"label":"earthgecko:test_tsfresh","ref":"test_tsfresh","sha":"cc44a23d3e778d686780f5a44f1bd78328608532","user":{"login":"earthgecko","id":96679,"avatar_url":"https://avatars.githubusercontent.com/u/96679?v=3","gravatar_id":"","url":"https://api.github.com/users/earthgecko","html_url":"https://github.com/earthgecko","followers_url":"https://api.github.com/users/earthgecko/followers","following_url":"https://api.github.com/users/earthgecko/following{/other_user}","gists_url":"https://api.github.com/users/earthgecko/gists{/gist_id}","starred_url":"https://api.github.com/users/earthgecko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/earthgecko/subscriptions","organizations_url":"https://api.github.com/users/earthgecko/orgs","repos_url":"https://api.github.com/users/earthgecko/repos","events_url":"https://api.github.com/users/earthgecko/events{/privacy}","received_events_url":"https://api.github.com/users/earthgecko/received_events","type":"User","site_admin":false},"repo":{"id":72466100,"name":"tsfresh","full_name":"earthgecko/tsfresh","owner":{"login":"earthgecko","id":96679,"avatar_url":"https://avatars.githubusercontent.com/u/96679?v=3","gravatar_id":"","url":"https://api.github.com/users/earthgecko","html_url":"https://github.com/earthgecko","followers_url":"https://api.github.com/users/earthgecko/followers","following_url":"https://api.github.com/users/earthgecko/following{/other_user}","gists_url":"https://api.github.com/users/earthgecko/gists{/gist_id}","starred_url":"https://api.github.com/users/earthgecko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/earthgecko/subscriptions","organizations_url":"https://api.github.com/users/earthgecko/orgs","repos_url":"https://api.github.com/users/earthgecko/repos","events_url":"https://api.github.com/users/earthgecko/events{/privacy}","received_events_url":"https://api.github.com/users/earthgecko/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/earthgecko/tsfresh","description":"Automatic extraction of relevant features from time series:","fork":true,"url":"https://api.github.com/repos/earthgecko/tsfresh","forks_url":"https://api.github.com/repos/earthgecko/tsfresh/forks","keys_url":"https://api.github.com/repos/earthgecko/tsfresh/keys{/key_id}","collaborators_url":"https://api.github.com/repos/earthgecko/tsfresh/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/earthgecko/tsfresh/teams","hooks_url":"https://api.github.com/repos/earthgecko/tsfresh/hooks","issue_events_url":"https://api.github.com/repos/earthgecko/tsfresh/issues/events{/number}","events_url":"https://api.github.com/repos/earthgecko/tsfresh/events","assignees_url":"https://api.github.com/repos/earthgecko/tsfresh/assignees{/user}","branches_url":"https://api.github.com/repos/earthgecko/tsfresh/branches{/branch}","tags_url":"https://api.github.com/repos/earthgecko/tsfresh/tags","blobs_url":"https://api.github.com/repos/earthgecko/tsfresh/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/earthgecko/tsfresh/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/earthgecko/tsfresh/git/refs{/sha}","trees_url":"https://api.github.com/repos/earthgecko/tsfresh/git/trees{/sha}","statuses_url":"https://api.github.com/repos/earthgecko/tsfresh/statuses/{sha}","languages_url":"https://api.github.com/repos/earthgecko/tsfresh/languages","stargazers_url":"https://api.github.com/repos/earthgecko/tsfresh/stargazers","contributors_url":"https://api.github.com/repos/earthgecko/tsfresh/contributors","subscribers_url":"https://api.github.com/repos/earthgecko/tsfresh/subscribers","subscription_url":"https://api.github.com/repos/earthgecko/tsfresh/subscription","commits_url":"https://api.github.com/repos/earthgecko/tsfresh/commits{/sha}","git_commits_url":"https://api.github.com/repos/earthgecko/tsfresh/git/commits{/sha}","comments_url":"https://api.github.com/repos/earthgecko/tsfresh/comments{/number}","issue_comment_url":"https://api.github.com/repos/earthgecko/tsfresh/issues/comments{/number}","contents_url":"https://api.github.com/repos/earthgecko/tsfresh/contents/{+path}","compare_url":"https://api.github.com/repos/earthgecko/tsfresh/compare/{base}...{head}","merges_url":"https://api.github.com/repos/earthgecko/tsfresh/merges","archive_url":"https://api.github.com/repos/earthgecko/tsfresh/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/earthgecko/tsfresh/downloads","issues_url":"https://api.github.com/repos/earthgecko/tsfresh/issues{/number}","pulls_url":"https://api.github.com/repos/earthgecko/tsfresh/pulls{/number}","milestones_url":"https://api.github.com/repos/earthgecko/tsfresh/milestones{/number}","notifications_url":"https://api.github.com/repos/earthgecko/tsfresh/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/earthgecko/tsfresh/labels{/name}","releases_url":"https://api.github.com/repos/earthgecko/tsfresh/releases{/id}","deployments_url":"https://api.github.com/repos/earthgecko/tsfresh/deployments","created_at":"2016-10-31T18:28:42Z","updated_at":"2016-10-31T18:28:44Z","pushed_at":"2016-12-12T16:17:41Z","git_url":"git://github.com/earthgecko/tsfresh.git","ssh_url":"git@github.com:earthgecko/tsfresh.git","clone_url":"https://github.com/earthgecko/tsfresh.git","svn_url":"https://github.com/earthgecko/tsfresh","homepage":"http://tsfresh.readthedocs.io.","size":1685,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"blue-yonder:master","ref":"master","sha":"0f1b4c738c8a17ec254e1fc077b7dad4ecf270e6","user":{"login":"blue-yonder","id":6234170,"avatar_url":"https://avatars.githubusercontent.com/u/6234170?v=3","gravatar_id":"","url":"https://api.github.com/users/blue-yonder","html_url":"https://github.com/blue-yonder","followers_url":"https://api.github.com/users/blue-yonder/followers","following_url":"https://api.github.com/users/blue-yonder/following{/other_user}","gists_url":"https://api.github.com/users/blue-yonder/gists{/gist_id}","starred_url":"https://api.github.com/users/blue-yonder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blue-yonder/subscriptions","organizations_url":"https://api.github.com/users/blue-yonder/orgs","repos_url":"https://api.github.com/users/blue-yonder/repos","events_url":"https://api.github.com/users/blue-yonder/events{/privacy}","received_events_url":"https://api.github.com/users/blue-yonder/received_events","type":"Organization","site_admin":false},"repo":{"id":71996613,"name":"tsfresh","full_name":"blue-yonder/tsfresh","owner":{"login":"blue-yonder","id":6234170,"avatar_url":"https://avatars.githubusercontent.com/u/6234170?v=3","gravatar_id":"","url":"https://api.github.com/users/blue-yonder","html_url":"https://github.com/blue-yonder","followers_url":"https://api.github.com/users/blue-yonder/followers","following_url":"https://api.github.com/users/blue-yonder/following{/other_user}","gists_url":"https://api.github.com/users/blue-yonder/gists{/gist_id}","starred_url":"https://api.github.com/users/blue-yonder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blue-yonder/subscriptions","organizations_url":"https://api.github.com/users/blue-yonder/orgs","repos_url":"https://api.github.com/users/blue-yonder/repos","events_url":"https://api.github.com/users/blue-yonder/events{/privacy}","received_events_url":"https://api.github.com/users/blue-yonder/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/blue-yonder/tsfresh","description":"Automatic extraction of relevant features from time series:","fork":false,"url":"https://api.github.com/repos/blue-yonder/tsfresh","forks_url":"https://api.github.com/repos/blue-yonder/tsfresh/forks","keys_url":"https://api.github.com/repos/blue-yonder/tsfresh/keys{/key_id}","collaborators_url":"https://api.github.com/repos/blue-yonder/tsfresh/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/blue-yonder/tsfresh/teams","hooks_url":"https://api.github.com/repos/blue-yonder/tsfresh/hooks","issue_events_url":"https://api.github.com/repos/blue-yonder/tsfresh/issues/events{/number}","events_url":"https://api.github.com/repos/blue-yonder/tsfresh/events","assignees_url":"https://api.github.com/repos/blue-yonder/tsfresh/assignees{/user}","branches_url":"https://api.github.com/repos/blue-yonder/tsfresh/branches{/branch}","tags_url":"https://api.github.com/repos/blue-yonder/tsfresh/tags","blobs_url":"https://api.github.com/repos/blue-yonder/tsfresh/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/blue-yonder/tsfresh/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/blue-yonder/tsfresh/git/refs{/sha}","trees_url":"https://api.github.com/repos/blue-yonder/tsfresh/git/trees{/sha}","statuses_url":"https://api.github.com/repos/blue-yonder/tsfresh/statuses/{sha}","languages_url":"https://api.github.com/repos/blue-yonder/tsfresh/languages","stargazers_url":"https://api.github.com/repos/blue-yonder/tsfresh/stargazers","contributors_url":"https://api.github.com/repos/blue-yonder/tsfresh/contributors","subscribers_url":"https://api.github.com/repos/blue-yonder/tsfresh/subscribers","subscription_url":"https://api.github.com/repos/blue-yonder/tsfresh/subscription","commits_url":"https://api.github.com/repos/blue-yonder/tsfresh/commits{/sha}","git_commits_url":"https://api.github.com/repos/blue-yonder/tsfresh/git/commits{/sha}","comments_url":"https://api.github.com/repos/blue-yonder/tsfresh/comments{/number}","issue_comment_url":"https://api.github.com/repos/blue-yonder/tsfresh/issues/comments{/number}","contents_url":"https://api.github.com/repos/blue-yonder/tsfresh/contents/{+path}","compare_url":"https://api.github.com/repos/blue-yonder/tsfresh/compare/{base}...{head}","merges_url":"https://api.github.com/repos/blue-yonder/tsfresh/merges","archive_url":"https://api.github.com/repos/blue-yonder/tsfresh/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/blue-yonder/tsfresh/downloads","issues_url":"https://api.github.com/repos/blue-yonder/tsfresh/issues{/number}","pulls_url":"https://api.github.com/repos/blue-yonder/tsfresh/pulls{/number}","milestones_url":"https://api.github.com/repos/blue-yonder/tsfresh/milestones{/number}","notifications_url":"https://api.github.com/repos/blue-yonder/tsfresh/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/blue-yonder/tsfresh/labels{/name}","releases_url":"https://api.github.com/repos/blue-yonder/tsfresh/releases{/id}","deployments_url":"https://api.github.com/repos/blue-yonder/tsfresh/deployments","created_at":"2016-10-26T11:29:17Z","updated_at":"2016-12-12T18:25:03Z","pushed_at":"2016-12-12T18:04:47Z","git_url":"git://github.com/blue-yonder/tsfresh.git","ssh_url":"git@github.com:blue-yonder/tsfresh.git","clone_url":"https://github.com/blue-yonder/tsfresh.git","svn_url":"https://github.com/blue-yonder/tsfresh","homepage":"http://tsfresh.readthedocs.io","size":4721,"stargazers_count":1712,"watchers_count":1712,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":115,"mirror_url":null,"open_issues_count":30,"forks":115,"open_issues":30,"watchers":1712,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/blue-yonder/tsfresh/pulls/106"},"html":{"href":"https://github.com/blue-yonder/tsfresh/pull/106"},"issue":{"href":"https://api.github.com/repos/blue-yonder/tsfresh/issues/106"},"comments":{"href":"https://api.github.com/repos/blue-yonder/tsfresh/issues/106/comments"},"review_comments":{"href":"https://api.github.com/repos/blue-yonder/tsfresh/pulls/106/comments"},"review_comment":{"href":"https://api.github.com/repos/blue-yonder/tsfresh/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/blue-yonder/tsfresh/pulls/106/commits"},"statuses":{"href":"https://api.github.com/repos/blue-yonder/tsfresh/statuses/cc44a23d3e778d686780f5a44f1bd78328608532"}}}}
{"actor":{"display_login":"earthgecko"}}