Fix the bug when type_map has only one element#1196
Merged
wanghan-iapcm merged 2 commits intodeepmodeling:masterfrom Oct 13, 2021
Merged
Fix the bug when type_map has only one element#1196wanghan-iapcm merged 2 commits intodeepmodeling:masterfrom
wanghan-iapcm merged 2 commits intodeepmodeling:masterfrom
Conversation
Numpy has a bit odd behavior I ran into. The method `ndarray.loadtxt()` when loading from array file of length 1 outputs only the array element, not array of length=1.
```python
import numpy as np
np.__version__
"1.20.3"
!cat array.raw
A
np.loadtxt("array.raw").tolist()
"A"
```
Codecov Report
@@ Coverage Diff @@
## master #1196 +/- ##
=======================================
Coverage 76.04% 76.04%
=======================================
Files 91 91
Lines 7258 7258
=======================================
Hits 5519 5519
Misses 1739 1739
Continue to review full report at Codecov.
|
njzjz
reviewed
Oct 8, 2021
njzjz
approved these changes
Oct 12, 2021
wanghan-iapcm
approved these changes
Oct 13, 2021
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Numpy has a bit odd behavior I ran into. The method
ndarray.loadtxt()when loading from array file of length 1 outputs only the array element, not array of length=1.This breaks code in this place:
deepmd-kit/deepmd/utils/data.py
Line 62 in 5a84796