MineralsCloud / qha

A Python package for calculating thermodynamic properties under quasi-harmonic approximation, using data from ab-initio calculations
https://mineralscloud.github.io/qha/
GNU General Public License v3.0
27 stars 13 forks source link

['0' '300'] not in index #39

Closed chazeon closed 6 years ago

chazeon commented 6 years ago

Expected Behavior

qha-plot produce a bunch of plots

Actual Behavior

Error raised:

Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\Scripts\mc-qha-script.py", line 11, in <module>
    load_entry_point('qha==1.0.10', 'console_scripts', 'mc-qha')()
  File "C:\ProgramData\Anaconda3\lib\site-packages\qha\cli\__init__.py", line 18, in main
    namespace = parser.parse_args()
  File "C:\ProgramData\Anaconda3\lib\site-packages\qha\cli\parser.py", line 27, in parse_args
    program.run(namespace)
  File "C:\ProgramData\Anaconda3\lib\site-packages\qha\cli\plotter.py", line 67, in run
    plotter.fv_pv()
  File "C:\ProgramData\Anaconda3\lib\site-packages\qha\plotting.py", line 163, in fv_pv
    volume_t = volume[temperature_sample]
  File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\frame.py", line 2056, in __getitem__
    return self._getitem_array(key)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\frame.py", line 2100, in _getitem_array
    indexer = self.loc._convert_to_indexer(key, axis=1)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\indexing.py", line 1231, in _convert_to_indexer
    raise KeyError('%s not in index' % objarr[mask])
KeyError: "['0' '300'] not in index"

Steps to Reproduce the Problem

Run qha-plot.

Specifications

singularitti commented 6 years ago

If I remember correctly, this happens after the option T_MIN is added to settings.yaml. So you have a temperature starting from T_MIN, not 0 any more (as before). Here it seems that you have your T_MIN higher than 300, so pandas cannot get the data at 0 and 300 Kelvin. You can add T4FV: ['<some T higher than T_MIN>'] in settings.yaml.

singularitti commented 6 years ago

This error should be handled by us, if you have time, please make a pr. Thanks!

singularitti commented 6 years ago

Does this problem fix? I guess it should be fixed up to develop head.

chazeon commented 6 years ago

This is fixed.