mirror of
https://github.com/LCPQ/EMSL_Basis_Set_Exchange_Local
synced 2024-10-31 19:23:42 +01:00
pep 8
This commit is contained in:
parent
2245fc2a0f
commit
4f8c21368e
@ -24,7 +24,8 @@ def install_with_pip(name):
|
||||
import pip
|
||||
pip.main(['install', name])
|
||||
except:
|
||||
print "You need pip, (http://pip.readthedocs.org/en/latest/installing.html)"
|
||||
print "You need pip"
|
||||
print "(http://pip.readthedocs.org/en/latest/installing.html)"
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
@ -87,13 +88,13 @@ class EMSL_dump:
|
||||
return dict_ele
|
||||
|
||||
def dwl_basis_list_raw(self):
|
||||
"""Return the source code of the iframe who contains the list of the basis set available"""
|
||||
"""Return the source code of the iframe
|
||||
who contains the list of the basis set available"""
|
||||
|
||||
print "Download all the name available in EMSL. It can take some time.",
|
||||
print "Download all the name available in EMSL."
|
||||
print "It can take some time.",
|
||||
sys.stdout.flush()
|
||||
|
||||
"""Download the source code of the iframe who contains the list of the basis set available"""
|
||||
|
||||
url = "https://bse.pnl.gov/bse/portal/user/anon/js_peid/11535052407933/panel/Main/template/content"
|
||||
if self.debug:
|
||||
import cPickle as pickle
|
||||
@ -114,8 +115,10 @@ class EMSL_dump:
|
||||
return page
|
||||
|
||||
def basis_list_raw_to_array(self, data_raw):
|
||||
"""Parse the raw html basis set to create a dict will all the information for dowloanding the database :
|
||||
Return d[name] = [name, xml_path, description, lits of the elements available]
|
||||
"""Parse the raw html basis set to create a dict
|
||||
will all the information for dowloanding the database :
|
||||
Return d[name] = [name, xml_path, description,
|
||||
lits of the elements available]
|
||||
|
||||
Explanation of tuple data from 'tup' by index:
|
||||
|
||||
@ -249,7 +252,8 @@ class EMSL_dump:
|
||||
q_out = Queue.Queue(num_worker_threads)
|
||||
|
||||
def worker():
|
||||
"""get a Job from the q_in, do stuff, when finish put it in the q_out"""
|
||||
"""get a Job from the q_in, do stuff,
|
||||
when finish put it in the q_out"""
|
||||
while True:
|
||||
name, path_xml, des, elts = q_in.get()
|
||||
|
||||
@ -265,8 +269,11 @@ class EMSL_dump:
|
||||
while attemps < attemps_max:
|
||||
text = self.requests.get(url, params=params).text
|
||||
try:
|
||||
basis_data = self.parse_basis_data_gamess_us(text,
|
||||
name, des, elts)
|
||||
basis_data = self.parse_basis_data_gamess_us(
|
||||
text,
|
||||
name,
|
||||
des,
|
||||
elts)
|
||||
except:
|
||||
time.sleep(0.1)
|
||||
attemps += 1
|
||||
@ -297,7 +304,7 @@ class EMSL_dump:
|
||||
t.daemon = True
|
||||
t.start()
|
||||
|
||||
nb_basis = len(list_basis_array)
|
||||
nb_basis = len(dict_basis_list)
|
||||
|
||||
for i in range(nb_basis):
|
||||
name, des, basis_data = q_out.get()
|
||||
|
Loading…
Reference in New Issue
Block a user