Skip to content

fix np.loadtxt DeprecationWarning#2802

Merged
wanghan-iapcm merged 1 commit intodeepmodeling:develfrom
njzjz:fix-loadtxt-warning
Sep 12, 2023
Merged

fix np.loadtxt DeprecationWarning#2802
wanghan-iapcm merged 1 commit intodeepmodeling:develfrom
njzjz:fix-loadtxt-warning

Conversation

@njzjz
Copy link
Member

@njzjz njzjz commented Sep 11, 2023

DeprecationWarning: loadtxt(): Parsing an integer via a float is deprecated.  To avoid this warning, you can:
    * make sure the original data is stored as integers.
    * use the `converters=` keyword argument.  If you only use
      NumPy 1.23 or later, `converters=float` will normally work.
    * Use `np.loadtxt(...).astype(np.int64)` parsing the file as
      floating point and then convert it.  (On all NumPy versions.)
  (Deprecated NumPy 1.23)
  return np.loadtxt(str(self.path), **kwargs)

```
DeprecationWarning: loadtxt(): Parsing an integer via a float is deprecated.  To avoid this warning, you can:
    * make sure the original data is stored as integers.
    * use the `converters=` keyword argument.  If you only use
      NumPy 1.23 or later, `converters=float` will normally work.
    * Use `np.loadtxt(...).astype(np.int64)` parsing the file as
      floating point and then convert it.  (On all NumPy versions.)
  (Deprecated NumPy 1.23)
  return np.loadtxt(str(self.path), **kwargs)
```

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
@njzjz njzjz changed the title fix np.loadtxt warning fix np.loadtxt DeprecationWarning Sep 11, 2023
@codecov
Copy link

codecov bot commented Sep 11, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (6e306fa) 79.37% compared to head (e1280c4) 79.38%.

Additional details and impacted files
@@           Coverage Diff           @@
##            devel    #2802   +/-   ##
=======================================
  Coverage   79.37%   79.38%           
=======================================
  Files         244      244           
  Lines       25875    25875           
  Branches     1533     1533           
=======================================
+ Hits        20539    20541    +2     
  Misses       4937     4937           
+ Partials      399      397    -2     
Files Changed Coverage Δ
deepmd/utils/data.py 93.81% <100.00%> (ø)

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wanghan-iapcm wanghan-iapcm merged commit c858030 into deepmodeling:devel Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants