Skip to content

Commit

Permalink
Merge pull request #50 from LucasGVerga/main
Browse files Browse the repository at this point in the history
Changed np.arange to np.linspace for the generation of egrid inside o…
  • Loading branch information
kavanase authored Sep 1, 2023
2 parents f6ac9b7 + 5b46c01 commit 6fcc468
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 4 additions & 4 deletions pytaser/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 6fcc468

Please sign in to comment.