From e466c3ec87c7750afce09a35ab243b7a8dd95d5f Mon Sep 17 00:00:00 2001 From: Lucas Garcia Verga Date: Fri, 1 Sep 2023 17:25:45 +0100 Subject: [PATCH 1/2] Changed np.arange to np.linspace for the generation of egrid inside occ_dependent_alpha and generate_tas from generator.py --- pytaser/generator.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pytaser/generator.py b/pytaser/generator.py index 292eec8..2e673d2 100644 --- a/pytaser/generator.py +++ b/pytaser/generator.py @@ -291,7 +291,7 @@ def occ_dependent_alpha( sigma = dfc.sigma if cshift is None: cshift = dfc.cshift - egrid = np.arange(0, dfc.nedos * dfc.deltae, dfc.deltae) + egrid = np.linspace(0, dfc.nedos * dfc.deltae, dfc.nedos, endpoint=False) dielectric_dict = { key: np.zeros_like(egrid, dtype=np.complex128) for key in ["absorption", "emission", "both"] @@ -667,9 +667,9 @@ def generate_tas( jdos_light_total = np.zeros(len(energy_mesh_ev)) if self.dfc is not None: - egrid = np.arange( - 0, self.dfc.nedos * self.dfc.deltae, self.dfc.deltae - ) + egrid = np.linspace( + 0, self.dfc.nedos * self.dfc.deltae, self.dfc.nedos,endpoint=False + ) alpha_dark = np.zeros_like(egrid, dtype=np.complex128) alpha_light_dict = { key: np.zeros_like(egrid, dtype=np.complex128) From 5b46c0195b6fa432ba9316f861203bac7eac26f9 Mon Sep 17 00:00:00 2001 From: Lucas Garcia Verga Date: Fri, 1 Sep 2023 18:07:24 +0100 Subject: [PATCH 2/2] updated CHANGELOG.rst and setup.py --- CHANGELOG.rst | 4 ++++ setup.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index dcd6a71..bfe12a0 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,10 @@ Change log ========== +v2.1.3 +~~~~~~ +- Change of np.arange to np.linspace to avoid e_grid arrays with sizes different from NEDOS. (see the warning on numpy.arange documentation) + v2.1.2 ~~~~~~ - Remove broken links from docs diff --git a/setup.py b/setup.py index edca5b5..15d4c25 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ long_description = pathlib.Path("README.md").read_text() setup( name="pytaser", - version="2.1.2", + version="2.1.3", description="TAS prediction tool", url="https://pytaser.readthedocs.io/en/latest/", author="Savyasanchi Aggarwal",