VlachosGroup / pMuTT

Python Multiscale Thermochemistry Toolbox (pMuTT)
https://vlachosgroup.github.io/pMuTT/
40 stars 23 forks source link

VASP_to_thermdat_example1 #29

Closed SidraFirdous closed 5 years ago

SidraFirdous commented 5 years ago

Dear developers, I have successfully installed this package and I am trying to run the example in the folder: pMuTT/examples/VASP_to_thermdat/example1

When I issue the command "python VASP_to_thermdat_example1.py", I get the following error: Traceback (most recent call last): File "VASP_to_thermdat_example1.py", line 36, in <module> refs_input = read_excel(io=refs_path) File "/home/sidra/.local/lib/python3.6/site-packages/pMuTT/io_/excel.py", line 66, in read_excel header=header, **kwargs) File "/home/sidra/anaconda3/lib/python3.6/site-packages/pandas/util/_decorators.py", line 178, in wrapper return func(*args, **kwargs) File "/home/sidra/anaconda3/lib/python3.6/site-packages/pandas/util/_decorators.py", line 178, in wrapper return func(*args, **kwargs) File "/home/sidra/anaconda3/lib/python3.6/site-packages/pandas/io/excel.py", line 307, in read_excel io = ExcelFile(io, engine=engine) File "/home/sidra/anaconda3/lib/python3.6/site-packages/pandas/io/excel.py", line 394, in __init__ self.book = xlrd.open_workbook(self._io) File "/home/sidra/anaconda3/lib/python3.6/site-packages/xlrd/__init__.py", line 116, in open_workbook with open(filename, "rb") as f: FileNotFoundError: [Errno 2] No such file or directory: '/references.xlsx' Please help to overcome this error.

Thanks.

jonlym commented 5 years ago

Thank you for your interest in pMuTT.

It looks like it was unable to find your references file. This script requires several files in the same folder, such as:

Please let me know if this resolved your issue.

SidraFirdous commented 5 years ago

Dear Jonathan,

Thank you so mech for your reply.

My file/folder structure is exactly as it is when i CLONE YOUR GITHUB folder. Both of these xslx files are present in the current folder.

One of the first things that I am trying to do after downloading this github repository is to try to run this example.

Could you please confirm if this exact file and folder arrangement is working for you to run the examples.

Thanks.

jonlym commented 5 years ago

I am able to run the example without problems. Perhaps you can replace the paths to your spreadsheets (line 18 for references, line 21 for input species) with absolute paths?

SidraFirdous commented 5 years ago

Dear Jonathan,

I did replace the paths for references and input species in your shown line numbers with absolute file paths. During the program run now, it is running beyond this point, but it is giving a different error now.

.\H2\CONTCAR

Traceback (most recent call last): File "/home/sidra/.local/lib/python3.6/site-packages/pMuTT/io_/excel.py", line 179, in set_atoms output_structure['atoms'] = read(path) File "/home/sidra/anaconda3/lib/python3.6/site-packages/ase/io/formats.py", line 469, in read parallel=parallel, **kwargs)) File "/home/sidra/anaconda3/lib/python3.6/site-packages/ase/io/formats.py", line 517, in _iread fd = open_with_compression(filename, mode) File "/home/sidra/anaconda3/lib/python3.6/site-packages/ase/io/formats.py", line 308, in open_with_compression return open(filename, mode) FileNotFoundError: [Errno 2] No such file or directory: '.\H2\CONTCAR'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/sidra/.local/lib/python3.6/site-packages/pMuTT/io_/excel.py", line 182, in set_atoms output_structure['atoms'] = read(os.path.join(excel_path, path)) File "/home/sidra/anaconda3/lib/python3.6/site-packages/ase/io/formats.py", line 469, in read parallel=parallel, **kwargs)) File "/home/sidra/anaconda3/lib/python3.6/site-packages/ase/io/formats.py", line 517, in _iread fd = open_with_compression(filename, mode) File "/home/sidra/anaconda3/lib/python3.6/site-packages/ase/io/formats.py", line 308, in open_with_compression return open(filename, mode) FileNotFoundError: [Errno 2] No such file or directory: '/home/sidra/Downloads/pMuTT/examples/VASP_to_thermdat/example1/.\H2\CONTCAR'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "VASP_to_thermdat_example1.py", line 38, in refs_input = read_excel(io=refspath) File "/home/sidra/.local/lib/python3.6/site-packages/pMuTT/io/excel.py", line 84, in read_excel output_structure=thermodata) File "/home/sidra/.local/lib/python3.6/site-packages/pMuTT/io/excel.py", line 187, in set_atoms 'spreadsheet imported.', path) FileNotFoundError: [Errno If using relative references for atoms files, use a path relative to the spreadsheet imported.] .\H2\CONTCAR

SidraFirdous commented 5 years ago

sorry, closed by mistake!

jonlym commented 5 years ago

Since it seems the relative paths were the problem, you can change the ‘atoms’ field in references.xlsx to absolute paths to the gas-phase CONTCAR files.

SidraFirdous commented 5 years ago

Dear Jonathan,

I not only had to modify the atoms field in references.xlsx to the absolute paths, but also to the absolute paths in thermdat_input.xlsx.

But now, it is writing the species info, but is giving me errors in trying to write thernmdat file.

[{'HoRT_ref': 0.0, 'T_ref': 298, 'atoms': Atoms(symbols='H2', pbc=True, cell=[20.0, 21.0, 22.0]), 'elec_model': <class 'pMuTT.models.statmech.elec.IdealElec'>, 'elements': {'H': 2, 'O': 0}, 'geometry': 'linear', 'n_degrees': 3, 'name': 'H2', 'optional': 'atoms', 'phase': 'G', 'potentialenergy': -6.7598, 'required': ('molecular_weight', 'vib_wavenumbers', 'potentialenergy', 'spin', 'geometry', 'rot_temperatures', 'symmetrynumber'), 'rot_model': <class 'pMuTT.models.statmech.rot.RigidRotor'>, 'spin': 0, 'statmech_model': <class 'pMuTT.models.statmech.StatMech'>, 'symmetrynumber': 2, 'trans_model': <class 'pMuTT.models.statmech.trans.IdealTrans'>, 'vib_model': <class 'pMuTT.models.statmech.vib.HarmonicVib'>, 'vib_wavenumbers': [4306.1793]}, {'HoRT_ref': -97.6060433359757, 'T_ref': 298, 'atoms': Atoms(symbols='OH2', pbc=True, cell=[20.0, 21.0, 22.0]), 'elec_model': <class 'pMuTT.models.statmech.elec.IdealElec'>, 'elements': {'H': 2, 'O': 1}, 'geometry': 'nonlinear', 'n_degrees': 3, 'name': 'H2O', 'optional': 'atoms', 'phase': 'G', 'potentialenergy': -14.2209, 'required': ('molecular_weight', 'vib_wavenumbers', 'potentialenergy', 'spin', 'geometry', 'rot_temperatures', 'symmetrynumber'), 'rot_model': <class 'pMuTT.models.statmech.rot.RigidRotor'>, 'spin': 0, 'statmech_model': <class 'pMuTT.models.statmech.StatMech'>, 'symmetrynumber': 2, 'trans_model': <class 'pMuTT.models.statmech.trans.IdealTrans'>, 'vib_model': <class 'pMuTT.models.statmech.vib.HarmonicVib'>, 'vib_wavenumbers': [3825.434, 3710.2642, 1582.432]}] Reference Input: [{'HoRT_ref': 0.0, 'T_ref': 298, 'atoms': Atoms(symbols='H2', pbc=True, cell=[20.0, 21.0, 22.0]), 'elec_model': <class 'pMuTT.models.statmech.elec.IdealElec'>, 'elements': {'H': 2, 'O': 0}, 'geometry': 'linear', 'n_degrees': 3, 'name': 'H2', 'optional': 'atoms', 'phase': 'G', 'potentialenergy': -6.7598, 'required': ('molecular_weight', 'vib_wavenumbers', 'potentialenergy', 'spin', 'geometry', 'rot_temperatures', 'symmetrynumber'), 'rot_model': <class 'pMuTT.models.statmech.rot.RigidRotor'>, 'spin': 0, 'statmech_model': <class 'pMuTT.models.statmech.StatMech'>, 'symmetrynumber': 2, 'trans_model': <class 'pMuTT.models.statmech.trans.IdealTrans'>, 'vib_model': <class 'pMuTT.models.statmech.vib.HarmonicVib'>, 'vib_wavenumbers': [4306.1793]}, {'HoRT_ref': -97.6060433359757, 'T_ref': 298, 'atoms': Atoms(symbols='OH2', pbc=True, cell=[20.0, 21.0, 22.0]), 'elec_model': <class 'pMuTT.models.statmech.elec.IdealElec'>, 'elements': {'H': 2, 'O': 1}, 'geometry': 'nonlinear', 'n_degrees': 3, 'name': 'H2O', 'optional': 'atoms', 'phase': 'G', 'potentialenergy': -14.2209, 'required': ('molecular_weight', 'vib_wavenumbers', 'potentialenergy', 'spin', 'geometry', 'rot_temperatures', 'symmetrynumber'), 'rot_model': <class 'pMuTT.models.statmech.rot.RigidRotor'>, 'spin': 0, 'statmech_model': <class 'pMuTT.models.statmech.StatMech'>, 'symmetrynumber': 2, 'trans_model': <class 'pMuTT.models.statmech.trans.IdealTrans'>, 'vib_model': <class 'pMuTT.models.statmech.vib.HarmonicVib'>, 'vib_wavenumbers': [3825.434, 3710.2642, 1582.432]}] Reference Data: Reference object for Name: H2 phase: G elements: {'H': 2, 'O': 0} references: None notes: None statmech_model: <pMuTT.models.statmech.StatMech object at 0x7fc4a7c8e828> T_ref: 298 HoRT_ref: 0.0 /home/sidra/.local/lib/python3.6/site-packages/pMuTT/models/empirical/references.py:231: RuntimeWarning: References does not have offset value for the element: Pt. 'element: {}.'.format(element), RuntimeWarning) /home/sidra/anaconda3/lib/python3.6/site-packages/scipy/stats/stats.py:999: RuntimeWarning: invalid value encountered in double_scalars return a.std(axis) / a.mean(axis) Species Input: [Nasa object for Name: H2O phase: G elements: {'H': 2, 'O': 1, 'Pt': 0} references: <pMuTT.models.empirical.references.References object at 0x7fc4c9c8cfd0> notes: None statmech_model: <pMuTT.models.statmech.StatMech object at 0x7fc4a7c98550> T_low: 200.0 T_mid: 475.51020408163265 T_high: 1100.0 a_low: [ 3.99524710e+00 5.18551391e-04 -5.53026339e-06 1.85895535e-08 -1.55138450e-11 -3.02807840e+04 -7.87852571e-02] a_high: [ 3.65264072e+00 1.06108517e-03 3.83455274e-08 3.84923694e-10 -2.13953978e-13 -3.02204912e+04 1.60251908e+00], Nasa object for Name: H2 phase: G elements: {'H': 2, 'O': 0, 'Pt': 0} references: <pMuTT.models.empirical.references.References object at 0x7fc4c9c8cfd0> notes: None statmech_model: <pMuTT.models.statmech.StatMech object at 0x7fc4a7c98e48> T_low: 200.0 T_mid: 457.14285714285717 T_high: 1100.0 a_low: [ 3.50160640e+00 -2.36911831e-05 1.29266916e-07 -3.09799438e-10 2.75756658e-13 -1.04308589e+03 -4.25851927e+00] a_high: [ 3.40314913e+00 6.66875856e-04 -1.65216699e-06 1.67300824e-09 -5.12284474e-13 -1.03200712e+03 -3.83955260e+00], Nasa object for Name: O2 phase: G elements: {'H': 0, 'O': 2, 'Pt': 0} references: <pMuTT.models.empirical.references.References object at 0x7fc4c9c8cfd0> notes: None statmech_model: <pMuTT.models.statmech.StatMech object at 0x7fc4a7c98cc0> T_low: 200.0 T_mid: 420.40816326530614 T_high: 1100.0 a_low: [ 3.45235499e+00 6.79381058e-04 -3.38325193e-06 6.46727720e-09 -2.89472893e-12 -5.06349214e+03 4.91903245e+00] a_high: [ 3.95523331e+00 -3.12933908e-03 7.01187124e-06 -5.28296070e-09 1.40446679e-12 -5.11531936e+03 2.82107116e+00], Nasa object for Name: MO(S) phase: S elements: {'H': 0, 'O': 1, 'Pt': 1} references: <pMuTT.models.empirical.references.References object at 0x7fc4c9c8cfd0> notes: None statmech_model: <pMuTT.models.statmech.StatMech object at 0x7fc4a7c98b00> T_low: 200.0 T_mid: 585.7142857142858 T_high: 1100.0 a_low: [-1.85092759e+00 2.48466947e-02 -5.62021005e-05 6.17887357e-08 -2.68761448e-11 5.49823404e+04 6.44810332e+00] a_high: [ 7.58148278e-01 6.93537685e-03 -9.09332493e-06 5.64388222e-09 -1.36222296e-12 5.46714102e+04 -4.75896647e+00], Nasa object for Name: MO(B) phase: S elements: {'H': 0, 'O': 0, 'Pt': 1} references: <pMuTT.models.empirical.references.References object at 0x7fc4c9c8cfd0> notes: None statmech_model: <pMuTT.models.statmech.StatMech object at 0x7fc4a7c985f8> T_low: 200.0 T_mid: 585.7142857142858 T_high: 1100.0 a_low: [-1.85092759e+00 2.48466947e-02 -5.62021005e-05 6.17887357e-08 -2.68761448e-11 1.09819961e+03 6.44810332e+00] a_high: [ 7.58148278e-01 6.93537685e-03 -9.09332493e-06 5.64388222e-09 -1.36222296e-12 7.87269404e+02 -4.75896647e+00], Nasa object for Name: V-MO(S) phase: S elements: {'H': 0, 'O': 0, 'Pt': 1} references: <pMuTT.models.empirical.references.References object at 0x7fc4c9c8cfd0> notes: None statmech_model: <pMuTT.models.statmech.StatMech object at 0x7fc4a7ee1400> T_low: 200.0 T_mid: 659.1836734693878 T_high: 1100.0 a_low: [ 0. 0. 0. 0.

  1. 81231.65477364 0. ] a_high: [ 0. 0. 0. 0.
  2. 81231.65477364 0. ], Nasa object for Name: MO_bulk(S) phase: S elements: {'H': 0, 'O': 1, 'Pt': 1} references: <pMuTT.models.empirical.references.References object at 0x7fc4c9c8cfd0> notes: None statmech_model: <pMuTT.models.statmech.StatMech object at 0x7fc4a77f1908> T_low: 200.0 T_mid: 585.7142857142858 T_high: 1100.0 a_low: [-1.85092759e+00 2.48466947e-02 -5.62021005e-05 6.17887357e-08 -2.68761448e-11 5.49823404e+04 6.44810332e+00] a_high: [ 7.58148278e-01 6.93537685e-03 -9.09332493e-06 5.64388222e-09 -1.36222296e-12 5.46714102e+04 -4.75896647e+00], Nasa object for Name: MO_bulk(B) phase: S elements: {'H': 0, 'O': 0, 'Pt': 1} references: <pMuTT.models.empirical.references.References object at 0x7fc4c9c8cfd0> notes: None statmech_model: <pMuTT.models.statmech.StatMech object at 0x7fc4a77f1860> T_low: 200.0 T_mid: 585.7142857142858 T_high: 1100.0 a_low: [-1.85092759e+00 2.48466947e-02 -5.62021005e-05 6.17887357e-08 -2.68761448e-11 1.09819961e+03 6.44810332e+00] a_high: [ 7.58148278e-01 6.93537685e-03 -9.09332493e-06 5.64388222e-09 -1.36222296e-12 7.87269404e+02 -4.75896647e+00], Nasa object for Name: V-MO_bulk(S) phase: S elements: {'H': 0, 'O': 0, 'Pt': 1} references: <pMuTT.models.empirical.references.References object at 0x7fc4c9c8cfd0> notes: None statmech_model: <pMuTT.models.statmech.StatMech object at 0x7fc4a77f1780> T_low: 200.0 T_mid: 659.1836734693878 T_high: 1100.0 a_low: [ 0. 0. 0. 0.
  3. 81231.65477364 0. ] a_high: [ 0. 0. 0. 0.
  4. 81231.65477364 0. ]] Traceback (most recent call last): File "VASP_to_thermdat_example1.py", line 65, in write_date=writedate) File "/home/sidra/.local/lib/python3.6/site-packages/pMuTT/io/thermdat.py", line 302, in write_thermdat with open(filename, 'w', newline=newline) as f_ptr: PermissionError: [Errno 13] Permission denied: '/thermdat'
jonlym commented 5 years ago

Great! You can change the path to the output file in line 26

SidraFirdous commented 5 years ago

Dear Jonathan,

Thank you for your advises. I could finally write thermdat in this example. However, I have a few questions:

/home/sidra/anaconda3/lib/python3.6/site-packages/pMuTT-1.0.0-py3.6.egg/pMuTT/models/empirical/references.py:231: RuntimeWarning: References does not have offset value for the element: Pt. /home/sidra/anaconda3/lib/python3.6/site-packages/scipy/stats/stats.py:999: RuntimeWarning: invalid value encountered in double_scalars

Thanks.

jonlym commented 5 years ago

These warnings shouldn't affect the results.

This system was arbitrarily made for an oxide forming a vacancy. The example is just a proof-of-concept and the results are not very physical.