From ecdb78ed9d0f9a735e6866323b2c4c93ac20ca47 Mon Sep 17 00:00:00 2001 From: "Adam J. Jackson" Date: Tue, 8 Oct 2024 17:05:02 +0100 Subject: [PATCH] Use numpy.frombuffer (clear a deprecation warning) --- CHANGELOG.rst | 1 + galore/cross_sections.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 2b0a686..9b9068c 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -14,6 +14,7 @@ Versioning `__. 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] `__ ------------------------------------------------------------------------- diff --git a/galore/cross_sections.py b/galore/cross_sections.py index 0fa7cd5..462375f 100644 --- a/galore/cross_sections.py +++ b/galore/cross_sections.py @@ -5,7 +5,7 @@ import sqlite3 -from numpy import fromstring as np_fromstr +from numpy import frombuffer from numpy import exp, log, polyval @@ -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