Closed flinky-ai closed 4 weeks ago
The recent update focuses on code quality improvements, reorganization, and minor functional enhancements across multiple files. Key changes include fixing import statements, reformatting code, and adding new functions to handle specific data in the abacus
module. Additionally, the .pre-commit-config.yaml
and .gitattributes
files have been updated for better code management and consistency in line endings.
File(s) | Change Summary |
---|---|
dpdata/plugins/3dmol.py |
Corrected import statement for py3Dmol and fixed indexing in types . |
dpdata/plugins/__init__.py |
Reordered and reformatted import statements. |
dpdata/plugins/abacus.py , dpdata/abacus/scf.py |
Reorganized imports, adjusted indentation, updated method calls, and added new functions for handling magnetic and spin data. |
dpdata/plugins/amber.py |
Adjusted method signatures in AmberMDFormat and from_labeled_system . |
dpdata/plugins/ase.py |
Removed from __future__ import annotations , adjusted type annotations, and reorganized imports. |
dpdata/plugins/cp2k.py , dpdata/plugins/dftbplus.py , dpdata/plugins/fhi_aims.py , dpdata/plugins/gaussian.py |
Made formatting and spacing adjustments. |
dpdata/plugins/deepmd.py |
Refactored code by removing redundant imports and adjusting method signatures. |
dpdata/deepmd/comp.py |
Added coords_deltaspin parameter and handling for force_deltaspin in the dump function. |
.pre-commit-config.yaml |
Updated URLs and revisions for repositories, adjusted comments, and reformatted file structure. |
.gitattributes |
Added *.py test eol=lf pattern for line endings. |
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
@amcadmus @chazeon I cloned the original dpdata code into my local space. But failed to pip install with these codes. Now, I add some function into the dpdata to deal with the deltaspin_scf abacus calculation results. And now, it failed with the PR process. I checked my code. It should be workable. Could you please help me with it?
Defaulting to user installation because normal site-packages is not writeable
Processing /mnt/d/AISI/dpdata
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: UNKNOWN
Building wheel for UNKNOWN (pyproject.toml) ... done
Created wheel for UNKNOWN: filename=UNKNOWN-0.2.19.dev20+ge1f02fd.d20240515-py3-none-any.whl size=4091 sha256=85056635321a8add11d86137b7469a82fa56dd77b985682e5def93568b00e9df
Stored in directory: /tmp/pip-ephem-wheel-cache-9kbvnwiy/wheels/00/6a/08/3bb0e14df3403c9233763f1104d7951eb1cd83c31155a6d7b0
Successfully built UNKNOWN
Installing collected packages: UNKNOWN
Attempting uninstall: UNKNOWN
Found existing installation: UNKNOWN 0.1.dev698+g658a511
Uninstalling UNKNOWN-0.1.dev698+g658a511:
Successfully uninstalled UNKNOWN-0.1.dev698+g658a511
Successfully installed UNKNOWN-0.2.19.dev20+ge1f02fd.d20240515
The failed CI build seems to come from readthedocs, due to Python 3.12:
The readthedocs build environment is recently updated; see #655.
You could try to rebase to the devel
branch first, then change the PR target to devel
.
For your local install, you need to clean up your workspace; it seems to be reading the package info from the PKG-INFO
you created in your earlier commits.
Finally, I would suggest you include a test example with spins in your PR.
Attention: Patch coverage is 28.94737%
with 54 lines
in your changes are missing coverage. Please review.
Project coverage is 83.47%. Comparing base (
1d87e82
) to head (361b293
).
Files | Patch % | Lines |
---|---|---|
dpdata/abacus/scf.py | 20.96% | 49 Missing :warning: |
dpdata/deepmd/comp.py | 64.28% | 5 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Comparing flinky-ai:my-fix-branch
(361b293) with devel
(1d87e82)
✅ 2
untouched benchmarks
The failed CI build seems to come from readthedocs, due to Python 3.12:
The readthedocs build environment is recently updated; see #655. You could try to rebase to the
devel
branch first, then change the PR target todevel
.For your local install, you need to clean up your workspace; it seems to be reading the package info from the
PKG-INFO
you created in your earlier commits.Finally, I would suggest you include a test example with spins in your PR.
I used the pip -vvv install .
and found the details of my installation while install the cloned dpdata locally. And it seems to be the reason that my setuptools
version is not replaced by the newly installed setputools-69.5.1
. The problem is solved by upgrading setuptools
manually.
Successfully installed packaging-24.0 setuptools-69.5.1 setuptools_scm-8.1.0 tomli-2.0.1
Installing build dependencies ... done
Running command Getting requirements to build wheel
/tmp/pip-build-env-nvbne_99/overlay/local/lib/python3.10/dist-packages/setuptools_scm/_integration/setuptools.py:31: RuntimeWarning:
ERROR: setuptools==59.6.0 is used in combination with setuptools_scm>=8.x
Your build configuration is incomplete and previously worked by accident!
setuptools_scm requires setuptools>=61
:/mnt/d/AISI/dpdata$ pip3 install --upgrade pip setuptools
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pip in /usr/lib/python3/dist-packages (22.0.2)
Collecting pip
Downloading pip-24.0-py3-none-any.whl (2.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 15.1 kB/s eta 0:00:00
Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (59.6.0)
Collecting setuptools
Using cached setuptools-69.5.1-py3-none-any.whl (894 kB)
Installing collected packages: setuptools, pip
Successfully installed pip-24.0 setuptools-69.5.1
It looks like you changed the line ending of each file from LF to CRLF, which should be reverted
I don't know in what step led me to make this mistake. I will change the format and resubmit again.
Adding a new function, two files were changed.
I add three parameters in the data when reading data from the OUT.ABACUS/running_scf.log.
When we use the deltaspin module during the scf calculation, the dpdata could grep the magnetic force and spin to the system and print the modified coords.npy and forces.npy.
Summary by CodeRabbit
Bug Fixes
py3Dmol
to ensure proper functionality.Refactor
Chores
.pre-commit-config.yaml
with new URLs and revisions for repositories..gitattributes
to enforce line endings for Python test files.