Skip to content

Commit

Permalink
Use numpy.frombuffer (clear a deprecation warning)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajjackson committed Oct 8, 2024
1 parent e6577b3 commit ecdb78e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Versioning <http://semver.org/>`__. The changelog format is inspired by
- Update packaging: replace setup.py with pyproject.toml
- Use `tox` as testing entrypoint, manage multiple Python versions
- Stop using pkg_resources
- Replace deprecated numpy.fromstring (of binary str) with numpy.frombuffer

`[0.9.2] <https://github.com/smtg-bham/galore/compare/0.9.1...0.9.2>`__
-------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions galore/cross_sections.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


import sqlite3
from numpy import fromstring as np_fromstr
from numpy import frombuffer
from numpy import exp, log, polyval


Expand Down Expand Up @@ -276,6 +276,6 @@ def _eval_fit(energy, coeffs):
orbitals_fits = cur.fetchall()

el_cross_sections.update({element: {
orb: _eval_fit(energy, np_fromstr(coeffs))
orb: _eval_fit(energy, frombuffer(coeffs))
for orb, coeffs in orbitals_fits}})
return el_cross_sections

0 comments on commit ecdb78e

Please sign in to comment.