Skip to content

Commit

Permalink
Replace M_PI=np.arccos(-1) with M_PI=np.pi (tardis-sn#2870)
Browse files Browse the repository at this point in the history
* Replace np.arccos(-1) with np.pi

* added name and mail to .mailmap file

* Changed M_PI to PI
  • Loading branch information
Akash265 authored Nov 12, 2024
1 parent 763c11d commit 83282e3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -286,3 +286,5 @@ Israel Roldan <israel.alberto.rv@gmail.com> AirvZxf <israel.alberto.rv@gmail.com
Israel Roldan <israel.alberto.rv@gmail.com> airv_zxf <israel.alberto.rv@gmail.com>

Michael Zingale <michael.zingale@stonybrook.edu>

Akash Kaushik <akash265457k@gmail.com>
6 changes: 3 additions & 3 deletions tardis/spectrum/formal_integral.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
)

C_INV = 3.33564e-11
M_PI = np.arccos(-1)
PI = np.pi
KB_CGS = 1.3806488e-16
H_CGS = 6.62606957e-27

Expand Down Expand Up @@ -197,7 +197,7 @@ def numba_formal_integral(
pJred_lu += direction
pJblue_lu += direction
I_nu[p_idx] *= p
L[nu_idx] = 8 * M_PI * M_PI * trapezoid_integration(I_nu, R_max / N)
L[nu_idx] = 8 * PI * PI * trapezoid_integration(I_nu, R_max / N)

return L, I_nu_p

Expand Down Expand Up @@ -640,7 +640,7 @@ def formal_integral(self, nu, N):
I_nu = self.transport.I_nu_p * ps
L_test = np.array(
[
8 * M_PI * M_PI * trapezoid_integration((I_nu)[i, :], R_max / N)
8 * PI * PI * trapezoid_integration((I_nu)[i, :], R_max / N)
for i in range(nu.shape[0])
]
)
Expand Down
4 changes: 2 additions & 2 deletions tardis/spectrum/formal_integral_cuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from tardis.transport.montecarlo.configuration.constants import SIGMA_THOMSON

C_INV = 3.33564e-11
M_PI = np.arccos(-1)
PI = np.pi
KB_CGS = 1.3806488e-16
H_CGS = 6.62606957e-27

Expand All @@ -28,7 +28,7 @@ def cuda_vector_integrator(L, I_nu, N, R_max):
"""
nu_idx = cuda.grid(1)
L[nu_idx] = (
8 * M_PI * M_PI * trapezoid_integration_cuda(I_nu[nu_idx], R_max / N)
8 * PI * PI * trapezoid_integration_cuda(I_nu[nu_idx], R_max / N)
)


Expand Down

0 comments on commit 83282e3

Please sign in to comment.