This issue comes from a Codex global repository scan.
Problem
AtomicDataDict.with_env_vectors() and with_onsitenv_vectors() call np.linalg.norm(..., dim=-1), but dim is a Torch argument, not a NumPy argument:
|
data[_keys.ENV_VECTORS_KEY] = env_vec |
|
if with_lengths: |
|
data[_keys.ENV_LENGTH_KEY] = np.linalg.norm(env_vec, dim=-1) |
|
return data |
|
data[_keys.ONSITENV_VECTORS_KEY] = env_vec |
|
if with_lengths: |
|
data[_keys.ONSITENV_LENGTH_KEY] = np.linalg.norm(env_vec, dim=-1) |
|
return data |
This raises TypeError whenever lengths are requested.
Suggested fix
Use axis=-1 for NumPy:
np.linalg.norm(env_vec, axis=-1)
This issue comes from a Codex global repository scan.
Problem
AtomicDataDict.with_env_vectors()andwith_onsitenv_vectors()callnp.linalg.norm(..., dim=-1), butdimis a Torch argument, not a NumPy argument:dftio/dftio/data/AtomicDataDict.py
Lines 135 to 138 in c9d128f
dftio/dftio/data/AtomicDataDict.py
Lines 188 to 191 in c9d128f
This raises
TypeErrorwhenever lengths are requested.Suggested fix
Use
axis=-1for NumPy: