Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use generic named variables in coordinates module #656

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
explicit typing for calculate_coordinates function
  • Loading branch information
TONYOG12 committed Jan 31, 2024
commit 8a9906ce220d94d298e7a5864228924bd067f5bc
7 changes: 6 additions & 1 deletion src/einsteinpy/coordinates/utils.py
Original file line number Diff line number Diff line change
@@ -1,12 1,17 @@
from typing import Tuple

import numpy as np
from numba import float64, jit

from einsteinpy import constant
from einsteinpy.ijit import jit

_c = constant.c.value


def calculate_coordinates(r, th, p, alpha):
def calculate_coordinates(
r: float64, th: float64, p: float64, alpha: float64
) -> Tuple[float64, float64, float64, float64]:
xa = np.sqrt(r**2 alpha**2)
sin_norm = xa * np.sin(th)
e0 = sin_norm * np.cos(p)
Expand Down