patonlab / GoodVibes

Calculate quasi-harmonic free energies from Gaussian output files with temperature and other corrections
http://www.patonlab.colostate.edu
MIT License
132 stars 52 forks source link

Does not work well Python 3.6 #8

Closed NKUCodingCat closed 6 years ago

NKUCodingCat commented 6 years ago

Umm.... A issue again

Ln 436 - Ln 441

          if all_same(l_o_t) == True:
             for scal in scaling_data: # search through database of scaling factors
                if l_o_t[0].upper().find(scal['level'].upper()) > -1 or l_o_t[0].upper().find(scal['level'].replace("-","").upper()) > -1:
                   options.freq_scale_factor = scal['zpe_fac']; ref = scaling_refs[scal['zpe_ref']]
                   log.Write("\n\n   " + "Found vibrational scaling factor for " + l_o_t[0] + " level of theory" + "\n   REF: " + ref)
          elif all_same(l_o_t) == False: log.Write("\n   " + (textwrap.fill("CAUTION: different levels of theory found - " + '|'.join(l_o_t), 128, subsequent_indent='   ')))

scal['level'] would be in "Byte" type and l_o_t[0] is always string type. Thus, it will raise

if l_o_t[0].upper().find(scal['level'].upper()) > -1 or l_o_t[0].upper().find(scal['level'].replace("-","").upper()) > -1:
TypeError: must be str, not bytes

seems easy to fix, and I think I should use 2.7 to run these code.....

NKUCodingCat commented 6 years ago

Fixed in #9