{"action":"created","comment":{"url":"https://api.github.com/repos/simphony/simphony-espresso-dft/pulls/comments/41980156","id":41980156,"diff_hunk":"@@ -0,0 +1,787 @@\n+from enum import Enum\n+from simphony.core.cuba import CUBA\n+from simphony.core.data_container import DataContainer\n+from simphony.cuds.particles import Particle, Particles\n+from simphony.cuds.lattice import Lattice\n+import numpy as np\n+import subprocess\n+#from simphony.cuds.abstractparticles import ABCParticles\n+\n+import uuid\n+import logging\n+\n+import os.path\n+\n+logging.basicConfig(level=logging.DEBUG)\n+\n+\n+\n+class qe_functions(object):\n+    '''\n+    functions for reading and writing quantum espresso input and output files\n+    '''\n+\n+    def __init__(self):\n+        self.SP = DataContainer()   #System Parameters and Conditions\n+#        SP = self.data_container\n+        self.pc =  Particles('quantum_espresso_particles')\n+\n+\n+\n+    def ReadEspressoOutputFile(self,file_name):\n+        '''\n+        This function parses  Espresso output files which usually will have a name like 'name.charge'.\n+        This file has the structure shown at http://phycomp.technion.ac.il/~sbgrosso/QE_charge_density/node18.html\n+        The first line has 8 numbers, the three first numbers are the size of the grid in the three spatial directions,\n+        the three following are the same repeated.\n+        The seventh number corresponds to the number of atoms and the last one to the number of different type of atoms.\n+        Second line - the first number is the type of Bravais lattice,\n+        and the three following numbers are the celldimensions defined in the input file of pw.x.\n+        The charge density is defined for each point of the grid starting after the atom definitions.\n+        :param file_name: name of the espresso output file\n+        :return:\n+        '''\n+\n+        if not(os.path.exists(file_name)):\n+            logging.debug(\"file \"+str(file_name)+\" not found\")\n+            return(1)","path":"simespresso/io_QE/espresso_class.py","position":47,"original_position":47,"commit_id":"bf1948b7f786f72f348a7b79922ddcda230db1e8","original_commit_id":"bf1948b7f786f72f348a7b79922ddcda230db1e8","user":{"login":"nathanfranklin","id":8287580,"avatar_url":"https://avatars.githubusercontent.com/u/8287580?v=3","gravatar_id":"","url":"https://api.github.com/users/nathanfranklin","html_url":"https://github.com/nathanfranklin","followers_url":"https://api.github.com/users/nathanfranklin/followers","following_url":"https://api.github.com/users/nathanfranklin/following{/other_user}","gists_url":"https://api.github.com/users/nathanfranklin/gists{/gist_id}","starred_url":"https://api.github.com/users/nathanfranklin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathanfranklin/subscriptions","organizations_url":"https://api.github.com/users/nathanfranklin/orgs","repos_url":"https://api.github.com/users/nathanfranklin/repos","events_url":"https://api.github.com/users/nathanfranklin/events{/privacy}","received_events_url":"https://api.github.com/users/nathanfranklin/received_events","type":"User","site_admin":false},"body":"I think raising an exception should be performed.   Especially when this return code isn't checked anywhere","created_at":"2015-10-14T11:03:12Z","updated_at":"2015-10-14T11:03:12Z","html_url":"https://github.com/simphony/simphony-espresso-dft/pull/7#discussion_r41980156","pull_request_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/simphony/simphony-espresso-dft/pulls/comments/41980156"},"html":{"href":"https://github.com/simphony/simphony-espresso-dft/pull/7#discussion_r41980156"},"pull_request":{"href":"https://api.github.com/repos/simphony/simphony-espresso-dft/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/simphony/simphony-espresso-dft/pulls/7","id":46858344,"html_url":"https://github.com/simphony/simphony-espresso-dft/pull/7","diff_url":"https://github.com/simphony/simphony-espresso-dft/pull/7.diff","patch_url":"https://github.com/simphony/simphony-espresso-dft/pull/7.patch","issue_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/issues/7","number":7,"state":"open","locked":false,"title":"Io4","user":{"login":"jeremy-rutman","id":3863744,"avatar_url":"https://avatars.githubusercontent.com/u/3863744?v=3","gravatar_id":"","url":"https://api.github.com/users/jeremy-rutman","html_url":"https://github.com/jeremy-rutman","followers_url":"https://api.github.com/users/jeremy-rutman/followers","following_url":"https://api.github.com/users/jeremy-rutman/following{/other_user}","gists_url":"https://api.github.com/users/jeremy-rutman/gists{/gist_id}","starred_url":"https://api.github.com/users/jeremy-rutman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeremy-rutman/subscriptions","organizations_url":"https://api.github.com/users/jeremy-rutman/orgs","repos_url":"https://api.github.com/users/jeremy-rutman/repos","events_url":"https://api.github.com/users/jeremy-rutman/events{/privacy}","received_events_url":"https://api.github.com/users/jeremy-rutman/received_events","type":"User","site_admin":false},"body":"WIP - reading, writing QE input/output files","created_at":"2015-10-06T03:06:39Z","updated_at":"2015-10-14T11:03:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b8c6964c81d5e5ee7ef5c0846cbd6feab5f9b683","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/pulls/7/commits","review_comments_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/pulls/7/comments","review_comment_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/pulls/comments{/number}","comments_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/issues/7/comments","statuses_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/statuses/bf1948b7f786f72f348a7b79922ddcda230db1e8","head":{"label":"simphony:io4","ref":"io4","sha":"bf1948b7f786f72f348a7b79922ddcda230db1e8","user":{"login":"simphony","id":8048249,"avatar_url":"https://avatars.githubusercontent.com/u/8048249?v=3","gravatar_id":"","url":"https://api.github.com/users/simphony","html_url":"https://github.com/simphony","followers_url":"https://api.github.com/users/simphony/followers","following_url":"https://api.github.com/users/simphony/following{/other_user}","gists_url":"https://api.github.com/users/simphony/gists{/gist_id}","starred_url":"https://api.github.com/users/simphony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simphony/subscriptions","organizations_url":"https://api.github.com/users/simphony/orgs","repos_url":"https://api.github.com/users/simphony/repos","events_url":"https://api.github.com/users/simphony/events{/privacy}","received_events_url":"https://api.github.com/users/simphony/received_events","type":"Organization","site_admin":false},"repo":{"id":30707341,"name":"simphony-espresso-dft","full_name":"simphony/simphony-espresso-dft","owner":{"login":"simphony","id":8048249,"avatar_url":"https://avatars.githubusercontent.com/u/8048249?v=3","gravatar_id":"","url":"https://api.github.com/users/simphony","html_url":"https://github.com/simphony","followers_url":"https://api.github.com/users/simphony/followers","following_url":"https://api.github.com/users/simphony/following{/other_user}","gists_url":"https://api.github.com/users/simphony/gists{/gist_id}","starred_url":"https://api.github.com/users/simphony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simphony/subscriptions","organizations_url":"https://api.github.com/users/simphony/orgs","repos_url":"https://api.github.com/users/simphony/repos","events_url":"https://api.github.com/users/simphony/events{/privacy}","received_events_url":"https://api.github.com/users/simphony/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/simphony/simphony-espresso-dft","description":"","fork":false,"url":"https://api.github.com/repos/simphony/simphony-espresso-dft","forks_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/forks","keys_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/keys{/key_id}","collaborators_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/teams","hooks_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/hooks","issue_events_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/issues/events{/number}","events_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/events","assignees_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/assignees{/user}","branches_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/branches{/branch}","tags_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/tags","blobs_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/git/refs{/sha}","trees_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/git/trees{/sha}","statuses_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/statuses/{sha}","languages_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/languages","stargazers_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/stargazers","contributors_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/contributors","subscribers_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/subscribers","subscription_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/subscription","commits_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/commits{/sha}","git_commits_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/git/commits{/sha}","comments_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/comments{/number}","issue_comment_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/issues/comments{/number}","contents_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/contents/{+path}","compare_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/compare/{base}...{head}","merges_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/merges","archive_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/downloads","issues_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/issues{/number}","pulls_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/pulls{/number}","milestones_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/milestones{/number}","notifications_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/labels{/name}","releases_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/releases{/id}","created_at":"2015-02-12T14:57:49Z","updated_at":"2015-09-22T13:37:05Z","pushed_at":"2015-10-11T13:15:07Z","git_url":"git://github.com/simphony/simphony-espresso-dft.git","ssh_url":"git@github.com:simphony/simphony-espresso-dft.git","clone_url":"https://github.com/simphony/simphony-espresso-dft.git","svn_url":"https://github.com/simphony/simphony-espresso-dft","homepage":null,"size":10652,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"simphony:master","ref":"master","sha":"c82eaa4c0f31b02e2f074a9fbc4ed2db582e41e1","user":{"login":"simphony","id":8048249,"avatar_url":"https://avatars.githubusercontent.com/u/8048249?v=3","gravatar_id":"","url":"https://api.github.com/users/simphony","html_url":"https://github.com/simphony","followers_url":"https://api.github.com/users/simphony/followers","following_url":"https://api.github.com/users/simphony/following{/other_user}","gists_url":"https://api.github.com/users/simphony/gists{/gist_id}","starred_url":"https://api.github.com/users/simphony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simphony/subscriptions","organizations_url":"https://api.github.com/users/simphony/orgs","repos_url":"https://api.github.com/users/simphony/repos","events_url":"https://api.github.com/users/simphony/events{/privacy}","received_events_url":"https://api.github.com/users/simphony/received_events","type":"Organization","site_admin":false},"repo":{"id":30707341,"name":"simphony-espresso-dft","full_name":"simphony/simphony-espresso-dft","owner":{"login":"simphony","id":8048249,"avatar_url":"https://avatars.githubusercontent.com/u/8048249?v=3","gravatar_id":"","url":"https://api.github.com/users/simphony","html_url":"https://github.com/simphony","followers_url":"https://api.github.com/users/simphony/followers","following_url":"https://api.github.com/users/simphony/following{/other_user}","gists_url":"https://api.github.com/users/simphony/gists{/gist_id}","starred_url":"https://api.github.com/users/simphony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simphony/subscriptions","organizations_url":"https://api.github.com/users/simphony/orgs","repos_url":"https://api.github.com/users/simphony/repos","events_url":"https://api.github.com/users/simphony/events{/privacy}","received_events_url":"https://api.github.com/users/simphony/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/simphony/simphony-espresso-dft","description":"","fork":false,"url":"https://api.github.com/repos/simphony/simphony-espresso-dft","forks_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/forks","keys_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/keys{/key_id}","collaborators_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/teams","hooks_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/hooks","issue_events_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/issues/events{/number}","events_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/events","assignees_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/assignees{/user}","branches_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/branches{/branch}","tags_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/tags","blobs_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/git/refs{/sha}","trees_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/git/trees{/sha}","statuses_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/statuses/{sha}","languages_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/languages","stargazers_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/stargazers","contributors_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/contributors","subscribers_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/subscribers","subscription_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/subscription","commits_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/commits{/sha}","git_commits_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/git/commits{/sha}","comments_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/comments{/number}","issue_comment_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/issues/comments{/number}","contents_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/contents/{+path}","compare_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/compare/{base}...{head}","merges_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/merges","archive_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/downloads","issues_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/issues{/number}","pulls_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/pulls{/number}","milestones_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/milestones{/number}","notifications_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/labels{/name}","releases_url":"https://api.github.com/repos/simphony/simphony-espresso-dft/releases{/id}","created_at":"2015-02-12T14:57:49Z","updated_at":"2015-09-22T13:37:05Z","pushed_at":"2015-10-11T13:15:07Z","git_url":"git://github.com/simphony/simphony-espresso-dft.git","ssh_url":"git@github.com:simphony/simphony-espresso-dft.git","clone_url":"https://github.com/simphony/simphony-espresso-dft.git","svn_url":"https://github.com/simphony/simphony-espresso-dft","homepage":null,"size":10652,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/simphony/simphony-espresso-dft/pulls/7"},"html":{"href":"https://github.com/simphony/simphony-espresso-dft/pull/7"},"issue":{"href":"https://api.github.com/repos/simphony/simphony-espresso-dft/issues/7"},"comments":{"href":"https://api.github.com/repos/simphony/simphony-espresso-dft/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/simphony/simphony-espresso-dft/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/simphony/simphony-espresso-dft/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/simphony/simphony-espresso-dft/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/simphony/simphony-espresso-dft/statuses/bf1948b7f786f72f348a7b79922ddcda230db1e8"}}}}