How to use set_valueOf_ method in autotest

Best Python code snippet using autotest_python

csxwriter.py

Source:csxwriter.py Github

copy

Full Screen

...88 orbitalOccupancies=orbOccString)89 if hasOrbSym:90 wfn1.set_orbitalSymmetry(orbSymString)91 orbe1 = api.stringArrayType(unit='u:ElectronVolt')92 orbe1.set_valueOf_(orbEString)93 orbs1 = api.orbitalsType()94 for orbArray in data.mocoeffs:95 for iorb in range(orbNum):96 orbCaString = ' '.join(str(x) for x in orbArray[iorb])97 orb1 = api.stringArrayType(id=iorb+1)98 orb1.set_valueOf_(orbCaString)99 orbs1.add_orbital(orb1)100 wfn1.set_orbitals(orbs1)101 wfn1.set_orbitalEnergies(orbe1)102 else:103 orbNum = data.nmo104 orbCaEne = data.moenergies[0][:]105 orbCaEString = ' '.join(str(x) for x in orbCaEne)106 orbCbEne = data.moenergies[1][:]107 orbCbEString = ' '.join(str(x) for x in orbCbEne)108 orbCaOcc = []109 orbCbOcc = []110 for iorb in range (orbNum):111 elecCa = 1 if orbCaEne[iorb] < 0.0 else 0112 orbCaOcc.append(elecCa)113 elecCb = 1 if orbCbEne[iorb] < 0.0 else 0114 orbCbOcc.append(elecCb)115 orbCaOccString = ' '.join(str(x) for x in sorted(orbCaOcc,reverse=True))116 orbCbOccString = ' '.join(str(x) for x in sorted(orbCbOcc,reverse=True))117 orbCaSym = data.mosyms[0][:]118 orbCaSymString = ' '.join( x for x in orbCaSym)119 orbCbSym = data.mosyms[1][:]120 orbCbSymString = ' '.join( x for x in orbCbSym)121 wfn1 = api.waveFunctionType(orbitalCount=orbNum)122 orbe1 = api.stringArrayType(unit='u:ElectronVolt')123 orbe1.set_valueOf_(orbCaEString)124 orbs1 = api.orbitalsType()125 alphaOrb = data.mocoeffs[0][:]126 for iorb in range(orbNum):127 orbCaString = ' '.join(str(x) for x in alphaOrb[iorb])128 orb1 = api.stringArrayType(id=iorb+1)129 orb1.set_valueOf_(orbCaString)130 orbs1.add_orbital(orb1)131 wfn1.set_alphaOrbitals(orbs1)132 wfn1.set_alphaOrbitalEnergies(orbe1)133 wfn1.set_alphaOrbitalOccupancies(orbCaOccString)134 wfn1.set_alphaOrbitalSymmetry(orbCaSymString)135 orbe2 = api.stringArrayType(unit='u:ElectronVolt')136 orbe2.set_valueOf_(orbCbEString)137 orbs2 = api.orbitalsType()138 betaOrb = data.mocoeffs[1][:]139 for iorb in range(orbNum):140 orbCbString = ' '.join(str(x) for x in betaOrb[iorb])141 orb2 = api.stringArrayType(id=iorb+1)142 orb2.set_valueOf_(orbCbString)143 orbs2.add_orbital(orb2)144 wfn1.set_betaOrbitals(orbs2)145 wfn1.set_betaOrbitalEnergies(orbe2)146 wfn1.set_betaOrbitalOccupancies(orbCbOccString)147 wfn1.set_betaOrbitalSymmetry(orbCbSymString)148 #vibrational frequency149 if hasFreq:150 molFreqNum = len(data.vibfreqs)151 frqString = ' '.join(str(x) for x in data.vibfreqs)152 if hasattr(data, 'vibirs'):153 intString = ' '.join(str(x) for x in data.vibirs)154 else:155 intString = ' '.join(str(x) for x in [1.0]*molFreqNum)156 vib1 = api.vibAnalysisType(vibrationCount=molFreqNum)157 freq1 = api.stringArrayType(unit="gc:RecipricalCentimeter")158 freq1.set_valueOf_(frqString)159 vib1.set_frequencies(freq1)160 irint1 = api.stringArrayType()161 irint1.set_valueOf_(intString)162 vib1.set_irIntensities(irint1)163 norms1 = api.normalModesType()164 normMdString = []165 for ifrq in range(molFreqNum):166 normM = []167 for iatm in range(atomNum):168 for ixyz in range(3):169 normM.append(data.vibdisps[ifrq][iatm][ixyz])170 normMdString.append(' '.join(str(x) for x in normM))171 norm1 = api.normalModeType(id=ifrq+1)172 norm1.set_valueOf_(normMdString[ifrq])173 norms1.add_normalMode(norm1)174 vib1.set_normalModes(norms1)175 if hasProp or hasPolar:176 prop1 = api.propertiesType()177 #dipole moments information178 if hasProp:179 # au2db = 2.541766180 if len(data.moments) > 1:181 molDipoleX = data.moments[1][0]182 molDipoleY = data.moments[1][1]183 molDipoleZ = data.moments[1][2]184 molDipoleTot = math.sqrt(molDipoleX*molDipoleX+molDipoleY*molDipoleY+molDipoleZ*molDipoleZ)185 sprop1 = api.propertyType(name='dipoleMomentX',unit='u:Debye',moleculeId='m1')186 sprop1.set_valueOf_(molDipoleX)187 sprop2 = api.propertyType(name='dipoleMomentY',unit='u:Debye',moleculeId='m1')188 sprop2.set_valueOf_(molDipoleY)189 sprop3 = api.propertyType(name='dipoleMomentZ',unit='u:Debye',moleculeId='m1')190 sprop3.set_valueOf_(molDipoleZ)191 sprop4 = api.propertyType(name='dipoleMomentAverage',unit='u:Debye',moleculeId='m1')192 sprop4.set_valueOf_(molDipoleTot)193 prop1.add_systemProperty(sprop1)194 prop1.add_systemProperty(sprop2)195 prop1.add_systemProperty(sprop3)196 prop1.add_systemProperty(sprop4)197 #polarizability information198 if hasPolar:199 polarXX = data.polar[0][0]200 polarYY = data.polar[0][1]201 polarZZ = data.polar[0][2]202 polarAvg = (polarXX+polarYY+polarZZ)/3.0203 sprop5 = api.propertyType(name='polarizabilityXX',unit='u:Angstrom3',moleculeId='m1')204 sprop5.set_valueOf_(polarXX)205 sprop6 = api.propertyType(name='polarizabilityYY',unit='u:Angstrom3',moleculeId='m1')206 sprop6.set_valueOf_(polarYY)207 sprop7 = api.propertyType(name='polarizabilityZZ',unit='u:Angstrom3',moleculeId='m1')208 sprop7.set_valueOf_(polarZZ)209 sprop8 = api.propertyType(name='polarizabilityAverage',unit='u:Angstrom3')210 sprop8.set_valueOf_(polarAvg)211 prop1.add_systemProperty(sprop5)212 prop1.add_systemProperty(sprop6)213 prop1.add_systemProperty(sprop7)214 prop1.add_systemProperty(sprop8)215 #NMR chemical shielding information216 if hasNMR:217 prop2 = api.propertiesType()218 for iatm in range(atomNum):219 aprop1 = api.propertyType(atomId='a'+str(iatm+1), moleculeId='m1', \220 name='nmrShieldingIsotropic',unit='gc:PartsPerMillion')221 aprop1.set_valueOf_(data.nmriso[iatm])222 aprop2 = api.propertyType(atomId='a'+str(iatm+1), moleculeId='m1', \223 name='nmrShieldingAnisotropy',unit='gc:PartsPerMillion')224 aprop2.set_valueOf_(data.nmranis[iatm])225 prop2.add_atomProperty(aprop1)226 prop2.add_atomProperty(aprop2)227 #Electronic transition information228 if hasElec:229 transStr = ' '.join(str(x) for x in data.etenergies)230 oscilStr = ' '.join(str(x) for x in data.etoscs)231 elec1 = api.elecSpectraType(transitionCount=len(data.etenergies))232 trans1 = api.stringArrayType(unit="gc:RecipricalCentimeter")233 trans1.set_valueOf_(transStr)234 oscil1 = api.stringArrayType()235 oscil1.set_valueOf_(oscilStr)236 elec1.set_electronicTransitions(trans1)237 elec1.set_oscillatorStrength(oscil1)238 #Start to generate CSX elements239 cs1 = api.csType(version='2.0')240 #molecular publication section241 mp1 = api.mpubType(title='default title', \242 abstract='default abstract', \243 publisher='default publisher', \244 status='default status', \245 category=1, \246 visibility=0, \247 tag=data.package, \248 key=1 )249 source1 = api.sourcePackageType(name=data.package, version=data.version)250 mp1.set_sourcePackage(source1)251 ath1 = api.authorType(creator='Wang', \252 type_='gc:CorrespondingAuthor', \253 organization='default organization', \254 email='name@organization.com')255 mp1.add_author(ath1)256 cs1.set_molecularPublication(mp1)257 if hasCollection:258 mc1 = api.mcolType(type_='IRC', description='Internal Reaction Coordinates')259 ircpnt = int(data.ircpnt)260 if ( ircpnt != len(data.ircenergies) ):261 ircpnt = len(data.ircenergies)-1262 for ipnt in range(ircpnt):263 entry1 = api.entryType(id='pnt'+str(ipnt+1))264 param1 = api.propertyType(id='pnt'+str(ipnt+1)+'prm1', name='reaction coordinates')265 param1.set_valueOf_(data.irccoords[ipnt])266 entry1.add_parameter(param1)267 sys1 = api.itemType(ref='s'+str(ipnt+1))268 calc1 = api.itemType(ref='c'+str(ipnt+1))269 res1 = api.resType(id='pnt'+str(ipnt+1)+'r1', \270 name='total electronic energy for point '+str(ipnt+1))271 val1 = api.valType(ref='e'+str(ipnt+1)+'_'+'total_energy')272 res1.add_value(val1)273 entry1.add_result(res1)274 entry1.set_system(sys1)275 entry1.set_calculation(calc1)276 mc1.add_entry(entry1)277 cs1.add_molecularCollection(mc1)278 for ipnt in range(ircpnt+1):279 #molecular system section280 msys = api.msysType(systemCharge=molCharge, \281 systemMultiplicity=molMulti, id='s'+str(ipnt))282 temp1 = api.dataWithUnitsType(unit='u:Kelvin')283 temp1.set_valueOf_(0.0)284 msys.set_systemTemperature(temp1)285 if ipnt == 0:286 mol = api.moleculeType(id='m1',atomCount=atomNum)287 else:288 mol = api.moleculeType(ref='m1',atomCount=atomNum)289 if hasattr(data, "atomcharges"):290 atmCharge = data.atomcharges["mulliken"]291 else:292 atmCharge = [0]*atomNum293 for iatm in range(atomNum):294 # xCoord = float(data.atomcoords[iatm,0])295 xCoord = data.atomcoords[ipnt,iatm,0]296 yCoord = data.atomcoords[ipnt,iatm,1]297 zCoord = data.atomcoords[ipnt,iatm,2]298 xCoord1 = api.dataWithUnitsType(unit='u:Angstrom')299 xCoord1.set_valueOf_(xCoord)300 yCoord1 = api.dataWithUnitsType(unit='u:Angstrom')301 yCoord1.set_valueOf_(yCoord)302 zCoord1 = api.dataWithUnitsType(unit='u:Angstrom')303 zCoord1.set_valueOf_(zCoord)304 atomicNum = data.atomnos[iatm]305 if ipnt == 0:306 atm = api.atomType(id='a'+str(iatm+1), elementSymbol=chemElement.z2elm[atomicNum], \307 atomMass=chemElement.z2mass[atomicNum], \308 xCoord3D=xCoord1, \309 yCoord3D=yCoord1, \310 zCoord3D=zCoord1, \311 basisSet='bse:'+basisName, \312 calculatedAtomCharge=atmCharge[iatm], \313 formalAtomCharge=0)314 else:315 atm = api.atomType(ref='a'+str(iatm+1), elementSymbol=chemElement.z2elm[atomicNum], \316 atomMass=chemElement.z2mass[atomicNum], \317 xCoord3D=xCoord1, \318 yCoord3D=yCoord1, \319 zCoord3D=zCoord1, \320 basisSet='bse:'+basisName, \321 calculatedAtomCharge=atmCharge[iatm], \322 formalAtomCharge=0)323 mol.add_atom(atm)324 msys.add_molecule(mol)325 cs1.add_molecularSystem(msys)326 for ipnt in range(ircpnt):327 #molCalculation section328 sd_wfn_method = ['HF', 'DFT', 'MP2', 'MP3', 'MP4', 'AM1', 'PM3', 'PM6']329 md_wfn_method = ['CCD', 'CCSD', 'CCSD-T', 'CIS', 'CISD', 'FCI', 'QCISD', 'QCISD-T']330 mr_wfn_method = ['CASSCF', 'CASPT2', 'RASSCF', 'RASPT2', 'GVB', 'MCSCF', 'MRCC', 'MRCI']331 mc1 = api.mcalType(id='c'+str(ipnt+1), inputsystem='s'+str(ipnt), \332 outputsystem='s'+str(ipnt+1))333 qm1 = api.qmCalcType()334 if calcType in mr_wfn_method:335 mrs1 = api.mrsMethodType()336 mrsmd1 = api.mrsmdMethodType()337 if calcType == 'GVB':338 gvb1 = api.resultType(methodology='gc:normal', spinType='gc:'+molSpin, \339 basisSet='bse:'+basisName, pairCount='2')340 ene1 = api.energiesType(unit='u:ElectronVolt')341 ee_ene1 = api.energyType(type_='gc:totalPotential')342 ee_ene1.set_valueOf_(float(molEE))343 ene1.add_energy(ee_ene1)344 gvb1.set_energies(ene1)345 mrsmd1.set_gvb(gvb1)346 elif calcType == 'CASSCF':347 casscf1 = api.resultType(methodology='gc:normal', spinType='gc:'+molSpin, \348 basisSet='bse:'+basisName)349 ene1 = api.energiesType(unit='u:ElectronVolt')350 ee_ene1 = api.energyType(type_='gc:totalPotential')351 ee_ene1.set_valueOf_(float(molEE))352 ene1.add_energy(ee_ene1)353 casscf1.set_energies(ene1)354 mrsmd1.set_casscf(casscf1)355 mrs1.set_multipleDeterminant(mrsmd1)356 qm1.set_multipleReferenceState(mrs1)357 else:358 srs1 = api.srsMethodType()359 if calcType in sd_wfn_method:360 sdm1 = api.srssdMethodType()361 #SCF362 if (calcType == 'HF'):363 scf1 = api.resultType(methodology='gc:normal',spinType='gc:'+molSpin, \364 basisSet='bse:'+basisName)365 ene1 = api.energiesType(unit='u:ElectronVolt')366 ee_ene1 = api.energyType(id='e'+str(ipnt+1)+'_'+'total_energy', \367 type_='gc:totalPotential')368 ee_ene1.set_valueOf_(data.ircenergies[ipnt])369 ene1.add_energy(ee_ene1)370 scf1.set_energies(ene1)371 sdm1.set_abinitioScf(scf1)372 #DFT373 elif (calcType == 'DFT'):374 if hasElec:375 dft1 = api.resultType(methodology='gc:tddft',spinType='gc:'+molSpin, \376 basisSet='bse:'+basisName, dftFunctional='gc:'+data.functional)377 else:378 dft1 = api.resultType(methodology='gc:normal',spinType='gc:'+molSpin, \379 basisSet='bse:'+basisName, dftFunctional='gc:'+data.functional)380 ene1 = api.energiesType(unit='u:ElectronVolt')381 ee_ene1 = api.energyType(id='e'+str(ipnt+1)+'_'+'total_energy', \382 type_='gc:totalPotential')383 ee_ene1.set_valueOf_(data.ircenergies[ipnt])384 ene1.add_energy(ee_ene1)385 dft1.set_energies(ene1)386 sdm1.set_dft(dft1)387 #MP2388 elif (calcType == 'MP2'):389 mp21 = api.resultType(methodology='gc:normal',spinType='gc:'+molSpin, \390 basisSet='bse:'+basisName)391 ene1 = api.energiesType(unit='u:ElectronVolt')392 ee_ene1 = api.energyType(id='e'+str(ipnt+1)+'_'+'total_energy', \393 type_='gc:totalPotential')394 ee_ene1.set_valueOf_(data.ircenergies[ipnt])395 ene1.add_energy(ee_ene1)396 mp21.set_energies(ene1)397 sdm1.set_mp2(mp21)398 #Semiempirical methods399 elif (calcType == 'AM1' or calcType == 'PM3' or calcType == 'PM6'):400 sem1 = api.resultType(methodology=calcType,spinType='gc:'+molSpin)401 ene1 = api.energiesType(unit='u:ElectronVolt')402 ee_ene1 = api.energyType(type_='gc:totalPotential')403 ee_ene1.set_valueOf_(float(molEE))404 hof_ene1 = api.energyType(type_='gc:heatofformation')405 hof_ene1.set_valueOf_(float(data.hofenergies[-1]))406 ene1.add_energy(ee_ene1)407 ene1.add_energy(hof_ene1)408 sem1.set_energies(ene1)409 sdm1.set_semiEmpiricalScf(sem1)410 else:411 print ('The current CSX does not support this method')412 srs1.set_singleDeterminant(sdm1)413 if calcType in md_wfn_method:414 mdm1 = api.srsmdMethodType()415 if (calcType == 'CCSD'):416 ccsd1 = api.resultType(methodology='gc:normal',spinType='gc:'+molSpin, \417 basisSet='bse:'+basisName)418 ene1 = api.energiesType(unit='u:ElectronVolt')419 ee_ene1 = api.energyType(type_='gc:totalPotential')420 ee_ene1.set_valueOf_(float(data.ccenergies[0]))421 ce_ene1 = api.energyType(type_='gc:correlation')422 ce_ene1.set_valueOf_(float(data.ccenergies[-1])-float(molEE))423 ene1.add_energy(ee_ene1)424 ene1.add_energy(ce_ene1)425 ccsd1.set_energies(ene1)426 mdm1.set_ccsd(ccsd1)427 elif (calcType == 'CCSD-T'):428 ccsd_t1 = api.resultType(methodology='gc:normal',spinType='gc:'+molSpin, \429 basisSet='bse:'+basisName)430 ene1 = api.energiesType(unit='u:ElectronVolt')431 ee_ene1 = api.energyType(type_='gc:totalPotential')432 ee_ene1.set_valueOf_(float(data.ccenergies[-1]))433 ce_ene1 = api.energyType(type_='gc:correlation')434 ce_ene1.set_valueOf_(float(data.ccenergies[-1])-float(molEE))435 ene1.add_energy(ee_ene1)436 ene1.add_energy(ce_ene1)437 ccsd_t1.set_energies(ene1)438 mdm1.set_ccsd_t(ccsd_t1)439 else:440 print ('The current CSX does not support this method')441 srs1.set_multipleDeterminant(mdm1)442 qm1.set_singleReferenceState(srs1)443 mc1.set_quantumMechanics(qm1)444 cs1.add_molecularCalculation(mc1)445 else:446 #molecular system section447 ms1 = api.msysType(systemCharge=molCharge, \448 systemMultiplicity=molMulti, id='s1')449 temp1 = api.dataWithUnitsType(unit='u:Kelvin')450 temp1.set_valueOf_(0.0)451 ms1.set_systemTemperature(temp1)452 mol1 = api.moleculeType(id='m1',atomCount=atomNum)453 if hasattr(data, "atomcharges"):454 atmCharge = data.atomcharges["mulliken"]455 else:456 atmCharge = [0]*atomNum457 #obmol1 = openbabel.OBMol()458 for iatm in range(atomNum):459 # xCoord = float(data.atomcoords[iatm,0])460 xCoord = data.atomcoords[-1,iatm,0]461 yCoord = data.atomcoords[-1,iatm,1]462 zCoord = data.atomcoords[-1,iatm,2]463 xCoord1 = api.floatWithUnitType(unit='u:Angstrom')464 xCoord1.set_valueOf_(xCoord)465 yCoord1 = api.floatWithUnitType(unit='u:Angstrom')466 yCoord1.set_valueOf_(yCoord)467 zCoord1 = api.floatWithUnitType(unit='u:Angstrom')468 zCoord1.set_valueOf_(zCoord)469 atomicNum = data.atomnos[iatm]470 atm = api.atomType(id='a'+str(iatm+1), elementSymbol=chemElement.z2elm[atomicNum], \471 atomMass=chemElement.z2mass[atomicNum], \472 xCoord3D=xCoord1, \473 yCoord3D=yCoord1, \474 zCoord3D=zCoord1, \475 basisSet='bse:'+basisName, \476 calculatedAtomCharge=atmCharge[iatm], \477 formalAtomCharge=0)478 mol1.add_atom(atm)479 ms1.add_molecule(mol1)480 cs1.add_molecularSystem(ms1)481 #molCalculation section482 sd_wfn_method = ['HF', 'DFT', 'MP2', 'MP3', 'MP4', 'AM1', 'PM3', 'PM6']483 md_wfn_method = ['CCD', 'CCSD', 'CCSD-T', 'CIS', 'CISD', 'FCI', 'G2', 'QCISD', 'QCISD-T']484 mr_wfn_method = ['CASSCF', 'CASPT2', 'RASSCF', 'RASPT2', 'GVB', 'MCSCF', 'MRCC', 'MRCI']485 mc1 = api.mcalType(id='c1', inputsystem='s1')486 qm1 = api.qmCalcType()487 if calcType in mr_wfn_method:488 mrs1 = api.mrsMethodType()489 mrsmd1 = api.mrsmdMethodType()490 if calcType == 'GVB':491 gvb1 = api.resultType(methodology='gc:normal', spinType='gc:'+molSpin, \492 basisSet='bse:'+basisName, pairCount='2')493 ene1 = api.energiesType(unit='u:ElectronVolt')494 ee_ene1 = api.energyType(type_='gc:totalPotential')495 ee_ene1.set_valueOf_(float(molEE))496 ene1.add_energy(ee_ene1)497 gvb1.set_energies(ene1)498 mrsmd1.set_gvb(gvb1)499 elif calcType == 'CASSCF':500 casscf1 = api.resultType(methodology='gc:normal', spinType='gc:'+molSpin, \501 basisSet='bse:'+basisName)502 ene1 = api.energiesType(unit='u:ElectronVolt')503 ee_ene1 = api.energyType(type_='gc:totalPotential')504 ee_ene1.set_valueOf_(float(molEE))505 ene1.add_energy(ee_ene1)506 casscf1.set_energies(ene1)507 mrsmd1.set_casscf(casscf1)508 elif calcType == 'MCSCF':509 mcscf1 = api.resultType(methodology='gc:normal', spinType='gc:'+molSpin, \510 basisSet='bse:'+basisName)511 ene1 = api.energiesType(unit='u:ElectronVolt')512 ee_ene1 = api.energyType(type_='gc:totalPotential')513 ee_ene1.set_valueOf_(float(molEE))514 ene1.add_energy(ee_ene1)515 mcscf1.set_energies(ene1)516 mrsmd1.set_mcscf(mcscf1)517 mrs1.set_multipleDeterminant(mrsmd1)518 qm1.set_multipleReferenceState(mrs1)519 else:520 srs1 = api.srsMethodType()521 if calcType in sd_wfn_method:522 sdm1 = api.srssdMethodType()523 #SCF524 if (calcType == 'HF'):525 scf1 = api.resultType(methodology='gc:normal',spinType='gc:'+molSpin, \526 basisSet='bse:'+basisName)527 ene1 = api.energiesType(unit='u:ElectronVolt')528 ee_ene1 = api.energyType(type_='gc:totalPotential')529 ee_ene1.set_valueOf_(float(molEE))530 nn_ene1 = api.energyType(type_='gc:nuclearRepulsion')531 nn_ene1.set_valueOf_(data.nnenergies[-1])532 ene1.add_energy(ee_ene1)533 ene1.add_energy(nn_ene1)534 scf1.set_energies(ene1)535 if hasOrb:536 scf1.set_waveFunction(wfn1)537 if hasProp or hasPolar:538 scf1.set_properties(prop1)539 if hasNMR:540 scf1.set_properties(prop2)541 if hasFreq:542 scf1.set_vibrationalAnalysis(vib1)543 if hasElec:544 scf1.set_electronicSpectra(elec1)545 sdm1.set_abinitioScf(scf1)546 #DFT547 elif (calcType == 'DFT'):548 if hasElec:549 dft1 = api.resultType(methodology='gc:tddft',spinType='gc:'+molSpin, \550 basisSet='bse:'+basisName, dftFunctional='gc:'+data.functional)551 else:552 if hasCfunctional:553 dft1 = api.resultType(methodology='gc:normal',spinType='gc:'+molSpin, \554 basisSet='bse:'+basisName, \555 exchangeFunctional='gc:'+data.xfunctional, \556 correlationFunctional='gc:'+data.cfunctional)557 else:558 dft1 = api.resultType(methodology='gc:normal',spinType='gc:'+molSpin, \559 basisSet='bse:'+basisName, dftFunctional='gc:'+data.functional)560 ene1 = api.energiesType(unit='u:ElectronVolt')561 ee_ene1 = api.energyType(type_='gc:totalPotential')562 ee_ene1.set_valueOf_(float(molEE))563 nn_ene1 = api.energyType(type_='gc:nuclearRepulsion')564 nn_ene1.set_valueOf_(data.nnenergies[-1])565 ene1.add_energy(ee_ene1)566 ene1.add_energy(nn_ene1)567 dft1.set_energies(ene1)568 if hasOrb:569 dft1.set_waveFunction(wfn1)570 if hasProp:571 dft1.set_properties(prop1)572 if hasNMR:573 dft1.set_properties(prop2)574 if hasFreq:575 dft1.set_vibrationalAnalysis(vib1)576 if hasElec:577 dft1.set_electronicSpectra(elec1)578 sdm1.set_dft(dft1)579 #MP2580 elif (calcType == 'MP2'):581 mp21 = api.resultType(methodology='gc:normal',spinType='gc:'+molSpin, \582 basisSet='bse:'+basisName)583 ene1 = api.energiesType(unit='u:ElectronVolt')584 ee_ene1 = api.energyType(type_='gc:totalPotential')585 ee_ene1.set_valueOf_(float(data.mpenergies[-1]))586 ce_ene1 = api.energyType(type_='gc:correlation')587 ce_ene1.set_valueOf_(float(data.mpenergies[-1])-float(molEE))588 nn_ene1 = api.energyType(type_='gc:nuclearRepulsion')589 nn_ene1.set_valueOf_(data.nnenergies[-1])590 ene1.add_energy(ee_ene1)591 ene1.add_energy(ce_ene1)592 ene1.add_energy(nn_ene1)593 mp21.set_energies(ene1)594 if hasOrb:595 mp21.set_waveFunction(wfn1)596 if hasProp:597 mp21.set_properties(prop1)598 if hasNMR:599 mp21.set_properties(prop2)600 if hasFreq:601 mp21.set_vibrationalAnalysis(vib1)602 sdm1.set_mp2(mp21)603 #Semiempirical methods604 elif (calcType == 'AM1' or calcType == 'PM3' or calcType == 'PM6'):605 sem1 = api.resultType(methodology=calcType,spinType='gc:'+molSpin)606 ene1 = api.energiesType(unit='u:ElectronVolt')607 ee_ene1 = api.energyType(type_='gc:totalPotential')608 ee_ene1.set_valueOf_(float(molEE))609 hof_ene1 = api.energyType(type_='gc:heatofformation')610 hof_ene1.set_valueOf_(float(data.hofenergies[-1]))611 ene1.add_energy(ee_ene1)612 ene1.add_energy(hof_ene1)613 sem1.set_energies(ene1)614 if hasOrb:615 sem1.set_waveFunction(wfn1)616 if hasProp:617 sem1.set_properties(prop1)618 if hasNMR:619 sem1.set_properties(prop2)620 if hasFreq:621 sem1.set_vibrationalAnalysis(vib1)622 sdm1.set_semiEmpiricalScf(sem1)623 else:624 print ('The current CSX does not support this method')625 srs1.set_singleDeterminant(sdm1)626 if calcType in md_wfn_method:627 mdm1 = api.srsmdMethodType()628 if (calcType == 'CCSD'):629 ccsd1 = api.resultType(methodology='gc:normal',spinType='gc:'+molSpin, \630 basisSet='bse:'+basisName)631 ene1 = api.energiesType(unit='u:ElectronVolt')632 ee_ene1 = api.energyType(type_='gc:totalPotential')633 ee_ene1.set_valueOf_(float(data.ccenergies[0]))634 ce_ene1 = api.energyType(type_='gc:correlation')635 ce_ene1.set_valueOf_(float(data.ccenergies[-1])-float(molEE))636 nn_ene1 = api.energyType(type_='gc:nuclearRepulsion')637 nn_ene1.set_valueOf_(data.nnenergies[-1])638 ene1.add_energy(ee_ene1)639 ene1.add_energy(ce_ene1)640 ene1.add_energy(nn_ene1)641 ccsd1.set_energies(ene1)642 if hasOrb:643 ccsd1.set_waveFunction(wfn1)644 if hasProp:645 ccsd1.set_properties(prop1)646 if hasNMR:647 ccsd1.set_properties(prop2)648 if hasFreq:649 ccsd1.set_vibrationalAnalysis(vib1)650 mdm1.set_ccsd(ccsd1)651 elif (calcType == 'CCD'):652 ccd1 = api.resultType(methodology='gc:normal',spinType='gc:'+molSpin, \653 basisSet='bse:'+basisName)654 ene1 = api.energiesType(unit='u:ElectronVolt')655 ee_ene1 = api.energyType(type_='gc:totalPotential')656 ee_ene1.set_valueOf_(float(data.ccenergies[-1]))657 ce_ene1 = api.energyType(type_='gc:correlation')658 ce_ene1.set_valueOf_(float(data.ccenergies[-1])-float(molEE))659 nn_ene1 = api.energyType(type_='gc:nuclearRepulsion')660 nn_ene1.set_valueOf_(data.nnenergies[-1])661 ene1.add_energy(ee_ene1)662 ene1.add_energy(ce_ene1)663 ene1.add_energy(nn_ene1)664 ccd1.set_energies(ene1)665 if hasOrb:666 ccd1.set_waveFunction(wfn1)667 if hasProp:668 ccd1.set_properties(prop1)669 if hasNMR:670 ccd1.set_properties(prop2)671 if hasFreq:672 ccd1.set_vibrationalAnalysis(vib1)673 mdm1.set_ccd(ccd1)674 elif (calcType == 'CCSD-T'):675 ccsd_t1 = api.resultType(methodology='gc:normal',spinType='gc:'+molSpin, \676 basisSet='bse:'+basisName)677 ene1 = api.energiesType(unit='u:ElectronVolt')678 ee_ene1 = api.energyType(type_='gc:totalPotential')679 ee_ene1.set_valueOf_(float(data.ccenergies[-1]))680 ce_ene1 = api.energyType(type_='gc:correlation')681 ce_ene1.set_valueOf_(float(data.ccenergies[-1])-float(molEE))682 nn_ene1 = api.energyType(type_='gc:nuclearRepulsion')683 nn_ene1.set_valueOf_(data.nnenergies[-1])684 ene1.add_energy(ee_ene1)685 ene1.add_energy(ce_ene1)686 ene1.add_energy(nn_ene1)687 ccsd_t1.set_energies(ene1)688 if hasOrb:689 ccsd_t1.set_waveFunction(wfn1)690 if hasProp:691 ccsd_t1.set_properties(prop1)692 if hasNMR:693 ccsd_t1.set_properties(prop2)694 if hasFreq:695 ccsd_t1.set_vibrationalAnalysis(vib1)696 mdm1.set_ccsd_t(ccsd_t1)697 elif (calcType == 'CID'):698 cid1 = api.resultType(methodology='gc:normal',spinType='gc:'+molSpin, \699 basisSet='bse:'+basisName)700 ene1 = api.energiesType(unit='u:ElectronVolt')701 ee_ene1 = api.energyType(type_='gc:totalPotential')702 ee_ene1.set_valueOf_(float(data.cienergies[-1]))703 ce_ene1 = api.energyType(type_='gc:correlation')704 ce_ene1.set_valueOf_(float(data.cienergies[-1])-float(molEE))705 nn_ene1 = api.energyType(type_='gc:nuclearRepulsion')706 nn_ene1.set_valueOf_(data.nnenergies[-1])707 ene1.add_energy(ee_ene1)708 ene1.add_energy(ce_ene1)709 ene1.add_energy(nn_ene1)710 cid1.set_energies(ene1)711 if hasOrb:712 cid1.set_waveFunction(wfn1)713 if hasProp:714 cid1.set_properties(prop1)715 if hasNMR:716 cid1.set_properties(prop2)717 if hasFreq:718 cid1.set_vibrationalAnalysis(vib1)719 mdm1.set_cid(cid1)720 elif (calcType == 'CISD'):721 cisd1 = api.resultType(methodology='gc:normal',spinType='gc:'+molSpin, \722 basisSet='bse:'+basisName)723 ene1 = api.energiesType(unit='u:ElectronVolt')724 ee_ene1 = api.energyType(type_='gc:totalPotential')725 ee_ene1.set_valueOf_(float(data.cienergies[-1]))726 ce_ene1 = api.energyType(type_='gc:correlation')727 ce_ene1.set_valueOf_(float(data.cienergies[-1])-float(molEE))728 nn_ene1 = api.energyType(type_='gc:nuclearRepulsion')729 nn_ene1.set_valueOf_(data.nnenergies[-1])730 ene1.add_energy(ee_ene1)731 ene1.add_energy(ce_ene1)732 ene1.add_energy(nn_ene1)733 cisd1.set_energies(ene1)734 if hasOrb:735 cisd1.set_waveFunction(wfn1)736 if hasProp:737 cisd1.set_properties(prop1)738 if hasNMR:739 cisd1.set_properties(prop2)740 if hasFreq:741 cisd1.set_vibrationalAnalysis(vib1)742 mdm1.set_cisd(cisd1)743 elif (calcType == 'QCISD'):744 qcisd1 = api.resultType(methodology='gc:normal',spinType='gc:'+molSpin, \745 basisSet='bse:'+basisName)746 ene1 = api.energiesType(unit='u:ElectronVolt')747 ee_ene1 = api.energyType(type_='gc:totalPotential')748 ee_ene1.set_valueOf_(float(data.ccenergies[-1]))749 ce_ene1 = api.energyType(type_='gc:correlation')750 ce_ene1.set_valueOf_(float(data.ccenergies[-1])-float(molEE))751 nn_ene1 = api.energyType(type_='gc:nuclearRepulsion')752 nn_ene1.set_valueOf_(data.nnenergies[-1])753 ene1.add_energy(ee_ene1)754 ene1.add_energy(ce_ene1)755 ene1.add_energy(nn_ene1)756 qcisd1.set_energies(ene1)757 if hasOrb:758 qcisd1.set_waveFunction(wfn1)759 if hasProp:760 qcisd1.set_properties(prop1)761 if hasNMR:762 qcisd1.set_properties(prop2)763 if hasFreq:764 qcisd1.set_vibrationalAnalysis(vib1)765 mdm1.set_qcisd(qcisd1)766 elif (calcType == 'G2'):767 g21 = api.resultType(methodology='gc:normal',spinType='gc:'+molSpin, \768 basisSet='bse:'+basisName)769 ene1 = api.energiesType(unit='u:Hartree')770 ee_ene1 = api.energyType(type_='gc:Ethalpy')771 ee_ene1.set_valueOf_(float(data.enthalpy))772 ce_ene1 = api.energyType(type_='gc:FreeEnergy')773 ce_ene1.set_valueOf_(float(data.freeenergy))774 ene1.add_energy(ee_ene1)775 ene1.add_energy(ce_ene1)776 g21.set_energies(ene1)777 if hasOrb:778 g21.set_waveFunction(wfn1)779 if hasProp:780 g21.set_properties(prop1)781 if hasNMR:782 g21.set_properties(prop2)783 if hasFreq:784 g21.set_vibrationalAnalysis(vib1)785 mdm1.set_g2(g21)786 else:787 print ('The current CSX does not support this method')...

Full Screen

Full Screen

qt_yaml.py

Source:qt_yaml.py Github

copy

Full Screen

...156 label_wdget = UI.Widget(class__attr="QLabel", name="setting")157 label_property = UI.Property()158 label_property.set_name("text")159 text_label = UI.String()160 text_label.set_valueOf_(label)161 label_property.set_string(text_label)162 label_wdget.add_property(label_property)163 text_edit = UI.Widget(class__attr="QLineEdit", name="edit_setting_" + label)164 grid_layout.add_item(UI.LayoutItem(row=row, column=0, widget=label_wdget))165 grid_layout.add_item(UI.LayoutItem(row=row, column=1, widget=text_edit))166def __add_form_boolean_row(label: str, grid_layout: UI.Layout, row, checked: bool = False):167 """168 Adds a label and a QLineEdit on the same row of grid_layout169 :param label:170 :param grid_layout:171 :param row:172 :return:173 """174 label_wdget = UI.Widget(class__attr="QLabel", name="setting")175 label_property = UI.Property()176 label_property.set_name("text")177 text_label = UI.String()178 text_label.set_valueOf_(label)179 label_property.set_string(text_label)180 label_wdget.add_property(label_property)181 checkbox_text_label = UI.String()182 checkbox_text_label.set_valueOf_(label + "_check")183 checkbox_label_property = UI.Property()184 checkbox_label_property.set_name("text")185 checkbox_label_property.set_string(checkbox_text_label)186 check_box = UI.Widget(class__attr="QCheckBox", name="edit_setting_" + label)187 checked_property = UI.Property(bool=str(checked).lower(), name="checked")188 check_box.add_property(checked_property)189 check_box.add_property(checkbox_label_property)190 grid_layout.add_item(UI.LayoutItem(row=row, column=0, widget=label_wdget))191 grid_layout.add_item(UI.LayoutItem(row=row, column=1, widget=check_box))192# FIXME: Fiinish this function193def __add_form_dropdown_row(label: str, grid_layout: UI.Layout, row, checked: bool = False):194 """195 Adds a label and a QLineEdit on the same row of grid_layout196 :param label:197 :param grid_layout:198 :param row:199 :return:200 """201 label_wdget = UI.Widget(class__attr="QComboBox", name="setting")202 label_property = UI.Property()203 label_property.set_name("text")204 text_label = UI.String()205 text_label.set_valueOf_(label)206 label_property.set_string(text_label)207 label_wdget.add_property(label_property)208 dropdown_text_label = UI.String()209 dropdown_text_label.set_valueOf_(label + "_check")210 checkbox_label_property = UI.Property()211 checkbox_label_property.set_name("text")212 checkbox_label_property.set_string(dropdown_text_label)213 check_box = UI.Widget(class__attr="QCheckBox", name="edit_setting_" + label)214 checked_property = UI.Property(bool=str(checked).lower(), name="checked")215 check_box.add_property(checked_property)216 check_box.add_property(checkbox_label_property)217 grid_layout.add_item(UI.LayoutItem(row=row, column=0, widget=label_wdget))218 grid_layout.add_item(UI.LayoutItem(row=row, column=1, widget=check_box))219def from_schema_to_widget(schema: dict):220 widget_container = UI.Widget(class__attr="QWidget", name="YAMLForm")221 rect_property = UI.Property()222 rect_property.set_name("geometry")223 rect_property.set_rect(UI.Rect(width=400, height=400, x=0, y=0))...

Full Screen

Full Screen

mixins.py

Source:mixins.py Github

copy

Full Screen

...45 value: Any) -> None:46 result_type = self.Results[attr_name]47 if hasattr(result_type, 'set_valueOf_'):48 wrapper_object = result_type()49 wrapper_object.set_valueOf_(value)50 value = wrapper_object51 result_dict[attr_name] = value52 def implements_scalar_result(self):53 "Действие должно возвращать единственное значение"...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run autotest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful