{"action":"closed","number":71,"pull_request":{"url":"https://api.github.com/repos/CitrineInformatics/pif-dft/pulls/71","id":166560367,"html_url":"https://github.com/CitrineInformatics/pif-dft/pull/71","diff_url":"https://github.com/CitrineInformatics/pif-dft/pull/71.diff","patch_url":"https://github.com/CitrineInformatics/pif-dft/pull/71.patch","issue_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/issues/71","number":71,"state":"closed","locked":false,"title":"Change API for 'If From' Method of Parsers","user":{"login":"WardLT","id":7003149,"avatar_url":"https://avatars0.githubusercontent.com/u/7003149?v=4","gravatar_id":"","url":"https://api.github.com/users/WardLT","html_url":"https://github.com/WardLT","followers_url":"https://api.github.com/users/WardLT/followers","following_url":"https://api.github.com/users/WardLT/following{/other_user}","gists_url":"https://api.github.com/users/WardLT/gists{/gist_id}","starred_url":"https://api.github.com/users/WardLT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WardLT/subscriptions","organizations_url":"https://api.github.com/users/WardLT/orgs","repos_url":"https://api.github.com/users/WardLT/repos","events_url":"https://api.github.com/users/WardLT/events{/privacy}","received_events_url":"https://api.github.com/users/WardLT/received_events","type":"User","site_admin":false},"body":"Turns out that `test_if_from` is not used by the driver directly. It is called after instantiating the parser class, and the constructor raises an exception if `test_if_from` fails. So, there really isn't a point in having `test_if_from` as a separate operation. It never gets called by classes that use this parser because the parser fails to instantiate before you call this function.\r\n\r\nI had originally designed this method as a static operation to check whether a directory of files was likely generated by a certain code, but it seems now that just having the constructor for a parser fail if the files are not as expected serves the same purpose. Even if we implemented `test_if_from` as static methods (only the VASP parser has a static method), I doubt we gain much. We have to do complicated logic to determine whether a directory contains data of a certain type (see PWSCF). It seems then we'd have to call that logic twice: once for checking if you can make a parser, and again when making the parser (as you'll have to determine which files are the inputs/outputs to both check if a directory contains these files and extracting metadata from those classes).\r\n\r\nConsequently, I've moved the logic from `test_if_from` inside the constructors and simplified the driver.\r\n\r\nSorry for the long PR message. Do you agree?","created_at":"2018-02-01T14:59:26Z","updated_at":"2018-02-01T17:48:09Z","closed_at":"2018-02-01T17:48:09Z","merged_at":"2018-02-01T17:48:09Z","merge_commit_sha":"be9e0ec6b43727c890e94941eb202eb6e9df9208","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/pulls/71/commits","review_comments_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/pulls/71/comments","review_comment_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/issues/71/comments","statuses_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/statuses/fa222488dbae487371d54fcee10fae7ce18247f2","head":{"label":"WardLT:if_from_api_change","ref":"if_from_api_change","sha":"fa222488dbae487371d54fcee10fae7ce18247f2","user":{"login":"WardLT","id":7003149,"avatar_url":"https://avatars0.githubusercontent.com/u/7003149?v=4","gravatar_id":"","url":"https://api.github.com/users/WardLT","html_url":"https://github.com/WardLT","followers_url":"https://api.github.com/users/WardLT/followers","following_url":"https://api.github.com/users/WardLT/following{/other_user}","gists_url":"https://api.github.com/users/WardLT/gists{/gist_id}","starred_url":"https://api.github.com/users/WardLT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WardLT/subscriptions","organizations_url":"https://api.github.com/users/WardLT/orgs","repos_url":"https://api.github.com/users/WardLT/repos","events_url":"https://api.github.com/users/WardLT/events{/privacy}","received_events_url":"https://api.github.com/users/WardLT/received_events","type":"User","site_admin":false},"repo":{"id":101339148,"name":"pif-dft","full_name":"WardLT/pif-dft","owner":{"login":"WardLT","id":7003149,"avatar_url":"https://avatars0.githubusercontent.com/u/7003149?v=4","gravatar_id":"","url":"https://api.github.com/users/WardLT","html_url":"https://github.com/WardLT","followers_url":"https://api.github.com/users/WardLT/followers","following_url":"https://api.github.com/users/WardLT/following{/other_user}","gists_url":"https://api.github.com/users/WardLT/gists{/gist_id}","starred_url":"https://api.github.com/users/WardLT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WardLT/subscriptions","organizations_url":"https://api.github.com/users/WardLT/orgs","repos_url":"https://api.github.com/users/WardLT/repos","events_url":"https://api.github.com/users/WardLT/events{/privacy}","received_events_url":"https://api.github.com/users/WardLT/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/WardLT/pif-dft","description":"Tools for converting from DFT codes into PIF objects","fork":true,"url":"https://api.github.com/repos/WardLT/pif-dft","forks_url":"https://api.github.com/repos/WardLT/pif-dft/forks","keys_url":"https://api.github.com/repos/WardLT/pif-dft/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WardLT/pif-dft/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WardLT/pif-dft/teams","hooks_url":"https://api.github.com/repos/WardLT/pif-dft/hooks","issue_events_url":"https://api.github.com/repos/WardLT/pif-dft/issues/events{/number}","events_url":"https://api.github.com/repos/WardLT/pif-dft/events","assignees_url":"https://api.github.com/repos/WardLT/pif-dft/assignees{/user}","branches_url":"https://api.github.com/repos/WardLT/pif-dft/branches{/branch}","tags_url":"https://api.github.com/repos/WardLT/pif-dft/tags","blobs_url":"https://api.github.com/repos/WardLT/pif-dft/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WardLT/pif-dft/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WardLT/pif-dft/git/refs{/sha}","trees_url":"https://api.github.com/repos/WardLT/pif-dft/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WardLT/pif-dft/statuses/{sha}","languages_url":"https://api.github.com/repos/WardLT/pif-dft/languages","stargazers_url":"https://api.github.com/repos/WardLT/pif-dft/stargazers","contributors_url":"https://api.github.com/repos/WardLT/pif-dft/contributors","subscribers_url":"https://api.github.com/repos/WardLT/pif-dft/subscribers","subscription_url":"https://api.github.com/repos/WardLT/pif-dft/subscription","commits_url":"https://api.github.com/repos/WardLT/pif-dft/commits{/sha}","git_commits_url":"https://api.github.com/repos/WardLT/pif-dft/git/commits{/sha}","comments_url":"https://api.github.com/repos/WardLT/pif-dft/comments{/number}","issue_comment_url":"https://api.github.com/repos/WardLT/pif-dft/issues/comments{/number}","contents_url":"https://api.github.com/repos/WardLT/pif-dft/contents/{+path}","compare_url":"https://api.github.com/repos/WardLT/pif-dft/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WardLT/pif-dft/merges","archive_url":"https://api.github.com/repos/WardLT/pif-dft/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WardLT/pif-dft/downloads","issues_url":"https://api.github.com/repos/WardLT/pif-dft/issues{/number}","pulls_url":"https://api.github.com/repos/WardLT/pif-dft/pulls{/number}","milestones_url":"https://api.github.com/repos/WardLT/pif-dft/milestones{/number}","notifications_url":"https://api.github.com/repos/WardLT/pif-dft/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WardLT/pif-dft/labels{/name}","releases_url":"https://api.github.com/repos/WardLT/pif-dft/releases{/id}","deployments_url":"https://api.github.com/repos/WardLT/pif-dft/deployments","created_at":"2017-08-24T21:29:09Z","updated_at":"2017-08-24T21:29:10Z","pushed_at":"2018-02-01T17:43:46Z","git_url":"git://github.com/WardLT/pif-dft.git","ssh_url":"git@github.com:WardLT/pif-dft.git","clone_url":"https://github.com/WardLT/pif-dft.git","svn_url":"https://github.com/WardLT/pif-dft","homepage":null,"size":5138,"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":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"CitrineInformatics:develop","ref":"develop","sha":"87e24cbb559554c7b00a3df5455486bbb754c1c8","user":{"login":"CitrineInformatics","id":10031337,"avatar_url":"https://avatars3.githubusercontent.com/u/10031337?v=4","gravatar_id":"","url":"https://api.github.com/users/CitrineInformatics","html_url":"https://github.com/CitrineInformatics","followers_url":"https://api.github.com/users/CitrineInformatics/followers","following_url":"https://api.github.com/users/CitrineInformatics/following{/other_user}","gists_url":"https://api.github.com/users/CitrineInformatics/gists{/gist_id}","starred_url":"https://api.github.com/users/CitrineInformatics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CitrineInformatics/subscriptions","organizations_url":"https://api.github.com/users/CitrineInformatics/orgs","repos_url":"https://api.github.com/users/CitrineInformatics/repos","events_url":"https://api.github.com/users/CitrineInformatics/events{/privacy}","received_events_url":"https://api.github.com/users/CitrineInformatics/received_events","type":"Organization","site_admin":false},"repo":{"id":52636499,"name":"pif-dft","full_name":"CitrineInformatics/pif-dft","owner":{"login":"CitrineInformatics","id":10031337,"avatar_url":"https://avatars3.githubusercontent.com/u/10031337?v=4","gravatar_id":"","url":"https://api.github.com/users/CitrineInformatics","html_url":"https://github.com/CitrineInformatics","followers_url":"https://api.github.com/users/CitrineInformatics/followers","following_url":"https://api.github.com/users/CitrineInformatics/following{/other_user}","gists_url":"https://api.github.com/users/CitrineInformatics/gists{/gist_id}","starred_url":"https://api.github.com/users/CitrineInformatics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CitrineInformatics/subscriptions","organizations_url":"https://api.github.com/users/CitrineInformatics/orgs","repos_url":"https://api.github.com/users/CitrineInformatics/repos","events_url":"https://api.github.com/users/CitrineInformatics/events{/privacy}","received_events_url":"https://api.github.com/users/CitrineInformatics/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CitrineInformatics/pif-dft","description":"Tools for converting from DFT codes into PIF objects","fork":false,"url":"https://api.github.com/repos/CitrineInformatics/pif-dft","forks_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/forks","keys_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/teams","hooks_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/hooks","issue_events_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/issues/events{/number}","events_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/events","assignees_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/assignees{/user}","branches_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/branches{/branch}","tags_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/tags","blobs_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/git/refs{/sha}","trees_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/statuses/{sha}","languages_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/languages","stargazers_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/stargazers","contributors_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/contributors","subscribers_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/subscribers","subscription_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/subscription","commits_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/commits{/sha}","git_commits_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/git/commits{/sha}","comments_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/comments{/number}","issue_comment_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/issues/comments{/number}","contents_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/contents/{+path}","compare_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/merges","archive_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/downloads","issues_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/issues{/number}","pulls_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/pulls{/number}","milestones_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/milestones{/number}","notifications_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/labels{/name}","releases_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/releases{/id}","deployments_url":"https://api.github.com/repos/CitrineInformatics/pif-dft/deployments","created_at":"2016-02-26T22:18:33Z","updated_at":"2018-01-04T18:17:45Z","pushed_at":"2018-02-01T17:48:09Z","git_url":"git://github.com/CitrineInformatics/pif-dft.git","ssh_url":"git@github.com:CitrineInformatics/pif-dft.git","clone_url":"https://github.com/CitrineInformatics/pif-dft.git","svn_url":"https://github.com/CitrineInformatics/pif-dft","homepage":null,"size":5246,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":7,"open_issues":7,"watchers":2,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/CitrineInformatics/pif-dft/pulls/71"},"html":{"href":"https://github.com/CitrineInformatics/pif-dft/pull/71"},"issue":{"href":"https://api.github.com/repos/CitrineInformatics/pif-dft/issues/71"},"comments":{"href":"https://api.github.com/repos/CitrineInformatics/pif-dft/issues/71/comments"},"review_comments":{"href":"https://api.github.com/repos/CitrineInformatics/pif-dft/pulls/71/comments"},"review_comment":{"href":"https://api.github.com/repos/CitrineInformatics/pif-dft/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CitrineInformatics/pif-dft/pulls/71/commits"},"statuses":{"href":"https://api.github.com/repos/CitrineInformatics/pif-dft/statuses/fa222488dbae487371d54fcee10fae7ce18247f2"}},"author_association":"CONTRIBUTOR","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"maxhutch","id":1538980,"avatar_url":"https://avatars1.githubusercontent.com/u/1538980?v=4","gravatar_id":"","url":"https://api.github.com/users/maxhutch","html_url":"https://github.com/maxhutch","followers_url":"https://api.github.com/users/maxhutch/followers","following_url":"https://api.github.com/users/maxhutch/following{/other_user}","gists_url":"https://api.github.com/users/maxhutch/gists{/gist_id}","starred_url":"https://api.github.com/users/maxhutch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxhutch/subscriptions","organizations_url":"https://api.github.com/users/maxhutch/orgs","repos_url":"https://api.github.com/users/maxhutch/repos","events_url":"https://api.github.com/users/maxhutch/events{/privacy}","received_events_url":"https://api.github.com/users/maxhutch/received_events","type":"User","site_admin":false},"comments":3,"review_comments":13,"maintainer_can_modify":false,"commits":5,"additions":57,"deletions":52,"changed_files":5}}
{"actor":{"display_login":"maxhutch"}}