yoshida-lab / XenonPy

XenonPy is a Python Software for Materials Informatics
http://xenonpy.readthedocs.io
BSD 3-Clause "New" or "Revised" License
135 stars 57 forks source link

(Bug Report)Calculated Orbital Frame Matrix is always 0. #260

Open Shunichirou-Watanabe opened 2 years ago

Shunichirou-Watanabe commented 2 years ago

Bug details

I calculate OFM by referring to the tutorial on the web page, all will be 0. https://xenonpy.readthedocs.io/en/latest/tutorials/2-descriptor.html (F14_f14 of mp-1017582 should be 0.3851, but it is 0)

The combination of v2020.10.9 for pymatgen and 0.6.5 for xenonpy is NG The combination of v2020.3.13 for pymatgen and 0.6.5 for xenonpy is OK

Environment

Windows10 21H2 Python 3.7.13 (default, Mar 28 2022, 08:03:21) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32

Verification program

import xenonpy import os from xenonpy.descriptor import Structures import pymatgen from xenonpy.datatools import preset from pymatgen.ext.matproj import MPRester import pandas as pd

print(f"xenonpy version = {xenonpy.version}") print(f"pymatgen version = {pymatgen.version}")

API_key = "use your own api key" preset.build('mp_samples',api_key=API_key) samples = preset.mp_samples

with MPRester(api_key=API_key) as m: model = m.query(criteria='mp-1017582',properties=list(samples.columns)) print(model) model_df = pd.DataFrame(model,columns=samples.columns)

cal = Structures() part_desc = cal.transform(model_df) print(f"f14_f14 = {part_desc.loc[0,'f14_f14']:1.4f}")

Probable cause

A method was added to the master branch of pymatgen to remove HTML tags in electronic_structure with the changes committed on May 13, 2020. https://github.com/materialsproject/pymatgen/commit/632a79a72e661438f4105d18988da5e4fcf8cee2

Therefore, the method on lines 214-215 of xenonpy's structure.py becomes superfluous.No matter which element is input, the output result is an empty list. https://github.com/yoshida-lab/XenonPy/blob/899c0bd4128c4a1d76358b8ff43566219bbabec5/xenonpy/descriptor/structure.py#L215