Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] DataError in reading ABACUS nspin 2 output #757

Closed
QuantumMisaka opened this issue Nov 23, 2024 · 1 comment · Fixed by #758
Closed

[BUG] DataError in reading ABACUS nspin 2 output #757

QuantumMisaka opened this issue Nov 23, 2024 · 1 comment · Fixed by #758
Assignees
Labels
bug Something isn't working

Comments

@QuantumMisaka
Copy link

Bug summary

When read ABACUS output calculated by spin-polarized (nspin=2) SCF, error occurs:

>>> dpdata.MultiSystems.from_dir(".","fe*c*/*", fmt='abacus/lcao/scf')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/data/softwares/miniconda3/envs/deepmd-3b4/lib/python3.11/site-packages/dpdata/system.py", line 1483, in from_dir
    LabeledSystem(file_name=target_file, fmt=fmt, type_map=type_map)
  File "/data/softwares/miniconda3/envs/deepmd-3b4/lib/python3.11/site-packages/dpdata/system.py", line 202, in __init__
    self.from_fmt(
  File "/data/softwares/miniconda3/envs/deepmd-3b4/lib/python3.11/site-packages/dpdata/system.py", line 239, in from_fmt
    return self.from_fmt_obj(load_format(fmt), file_name, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/softwares/miniconda3/envs/deepmd-3b4/lib/python3.11/site-packages/dpdata/system.py", line 1233, in from_fmt_obj
    self.check_data()
  File "/data/softwares/miniconda3/envs/deepmd-3b4/lib/python3.11/site-packages/dpdata/system.py", line 226, in check_data
    dd.check(self)
  File "/data/softwares/miniconda3/envs/deepmd-3b4/lib/python3.11/site-packages/dpdata/data_type.py", line 119, in check
    raise DataError(
dpdata.data_type.DataError: Shape of spins is (1, 396, 1), but expected (1, 396, 3)

dpdata Version

dpdata v0.2.21

Input Files, Running Commands, Error Log, etc.

fe2c-111-1.tar.gz

Steps to Reproduce

By using dpdata.MultiSystems.from_dir(".","fe*c*/*", fmt='abacus/lcao/scf') command or dpdata.LabeledSystem("fe2c/1", fmt='abacus/lcao/scf') command

Further Information, Files, and Links

This issue may related to #718

@QuantumMisaka QuantumMisaka added the bug Something isn't working label Nov 23, 2024
@QuantumMisaka
Copy link
Author

By using the dpdata behind #718, this error do not occur. @pxlxingliang may need to check

@njzjz njzjz linked a pull request Nov 25, 2024 that will close this issue
wanghan-iapcm pushed a commit that referenced this issue Nov 26, 2024
fix #757 

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Enhanced handling of magnetic moments and forces to ensure consistent
three-dimensional vector representation.
- Updated input parameters for calculation configuration to reflect
changes in naming conventions and spin configurations.

- **Tests**
- Introduced a new test method to validate behavior with the updated
input file, improving test coverage and ensuring accuracy in results.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: root <pxlxingliang>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@njzjz njzjz closed this as completed Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants