deepmodeling / deepmd-kit

A deep learning package for many-body potential energy representation and molecular dynamics
https://docs.deepmodeling.com/projects/deepmd/
GNU Lesser General Public License v3.0
1.5k stars 512 forks source link

`tests.common.test_econf_embd.TestEConfEmbd.test_fe` failed #3743

Closed njzjz closed 5 months ago

njzjz commented 6 months ago

―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― TestEConfEmbd.test_fe ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

self = <tests.common.test_econf_embd.TestEConfEmbd testMethod=test_fe>

    def test_fe(self):
>       res = make_econf_embedding(["Fe"], flatten=False)["Fe"]

common/test_econf_embd.py:12:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../deepmd/utils/econf_embd.py:198: in make_econf_embedding
    ir = make_element_embedding_list_vec(ii)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

ename = 'Fe'

    def make_element_embedding_list_vec(
        ename: str,
    ) -> np.ndarray:
        """Compute the embedding of one element."""
        ret = make_empty_list_vec()
>       ele = element(ename)
E       NameError: name 'element' is not defined

../../deepmd/utils/econf_embd.py:183: NameError

 source/tests/common/test_econf_embd.py ⨯                                                                                              0% ▏

―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― TestEConfEmbd.test_fe_flatten ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

self = <tests.common.test_econf_embd.TestEConfEmbd testMethod=test_fe_flatten>

    def test_fe_flatten(self):
>       res = make_econf_embedding(["Fe"], flatten=True)["Fe"]

common/test_econf_embd.py:36:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../deepmd/utils/econf_embd.py:198: in make_econf_embedding
    ir = make_element_embedding_list_vec(ii)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

ename = 'Fe'

    def make_element_embedding_list_vec(
        ename: str,
    ) -> np.ndarray:
        """Compute the embedding of one element."""
        ret = make_empty_list_vec()
>       ele = element(ename)
E       NameError: name 'element' is not defined

../../deepmd/utils/econf_embd.py:183: NameError

 source/tests/common/test_econf_embd.py ⨯                                                                                              0% ▏
njzjz commented 6 months ago

It happens when mendeleev is not installed. (1) a user-friend message is required. (2) skip the test?

wanghan-iapcm commented 6 months ago

I agree to skip test and print warning message when mendeleev is not installed.

wanghan-iapcm commented 6 months ago

I may contribute later.