diff options
author | pravindalve | 2020-06-23 20:17:20 +0530 |
---|---|---|
committer | GitHub | 2020-06-23 20:17:20 +0530 |
commit | d3bed1ef7150f8e493ebaed3b841b1fe781e974d (patch) | |
tree | f7da5c3e6437fb270a6cb6b5aedb3af1690fdbce /Simulator/Databases/Databases.py | |
parent | a80b6726f5f70d9a2ec1cbf361e7f607849343bf (diff) | |
parent | 781a2ca03807d166498c0d95ef8c62d9ef3404d6 (diff) | |
download | Chemical-Simulator-GUI-d3bed1ef7150f8e493ebaed3b841b1fe781e974d.tar.gz Chemical-Simulator-GUI-d3bed1ef7150f8e493ebaed3b841b1fe781e974d.tar.bz2 Chemical-Simulator-GUI-d3bed1ef7150f8e493ebaed3b841b1fe781e974d.zip |
Merge pull request #3 from pravindalve/master
Updates and some bug fixes
Diffstat (limited to 'Simulator/Databases/Databases.py')
-rw-r--r-- | Simulator/Databases/Databases.py | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/Simulator/Databases/Databases.py b/Simulator/Databases/Databases.py index d7dc797..4b3a4c6 100644 --- a/Simulator/Databases/Databases.py +++ b/Simulator/Databases/Databases.py @@ -17,16 +17,12 @@ class ChemsepDatabase(): self.name = 'chemsep' for comp in compound: self.compName=comp.getElementsByTagName('CompoundID')[0].getAttribute('value') - self.comp_name_list.append(self.compName+'(' + self.name + ')') - - self.comp_prop_list=list() - + self.comp_name_list.append(self.compName+'(' + self.name + ')') + self.comp_prop_list=list() def get_comp_name_list(self): return self.comp_name_list - - #attrib: #CAS fro CAS Number #CompoundID for Name @@ -35,9 +31,7 @@ class ChemsepDatabase(): #GETTING 'ATTRIBUTE''S VALUE OF THE COMPOUND 'COMPS' -#COMP IS AN ITERATING VALUE IN THE XML TAG COMPOUND - - +#COMP IS AN ITERATING VALUE IN THE XML TAG COMPOUND def get_value(self,comps,attrib): self.comps=comps self.x='' @@ -47,8 +41,7 @@ class ChemsepDatabase(): try: self.x=comp.getElementsByTagName(attrib)[0].getAttribute("value") except IndexError: - self.x = "-" - + self.x = "-" return (self.x) #CREATING comp_prop_list LIST OF THE COMPOUND SELECTED @@ -58,9 +51,7 @@ class ChemsepDatabase(): self.comps = comps for comp in compound: compName = comp.getElementsByTagName("CompoundID")[0].getAttribute("value") - if compName==self.comps: - - + if compName==self.comps: CompName = compName.replace(" ","") CompName = CompName.replace("-","") CompName = CompName.replace(",","") @@ -140,8 +131,7 @@ class ChemsepDatabase(): RacketParam = comp.getElementsByTagName("RacketParameter")[0].getAttribute("value") except IndexError: RacketParam = "0" - - + try: LiqDen = comp.getElementsByTagName("LiquidDensity")[0] LiqDenEqn = LiqDen.getElementsByTagName("eqno")[0].getAttribute("value") @@ -358,8 +348,6 @@ class ChemsepDatabase(): except IndexError: ChaoSeadLV = 0 - - #f.write('Package database') self.comp_prop_list.append('model '+CompName) #f.write('\n') @@ -440,7 +428,4 @@ class ChemsepDatabase(): #return self.comp_prop_list return self.comp_prop_list - - - -
\ No newline at end of file +
\ No newline at end of file |