Skip to content

Commit 727855e

Browse files
committed
math.tau for clarity
1 parent 358415d commit 727855e

File tree

2 files changed

+5
-18
lines changed

2 files changed

+5
-18
lines changed

src/pymap3d/ecef.py

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,11 @@
33
import typing
44

55
try:
6-
from numpy import (
7-
radians,
8-
sin,
9-
cos,
10-
tan,
11-
arctan as atan,
12-
hypot,
13-
degrees,
14-
arctan2 as atan2,
15-
sqrt,
16-
pi,
17-
)
6+
from numpy import radians, sin, cos, tan, arctan as atan, hypot, degrees, arctan2 as atan2, sqrt
187
except ImportError:
19-
from math import radians, sin, cos, tan, atan, hypot, degrees, atan2, sqrt, pi # type: ignore
8+
from math import radians, sin, cos, tan, atan, hypot, degrees, atan2, sqrt # type: ignore
209

10+
from math import pi
2111
from datetime import datetime
2212

2313
from .ellipsoid import Ellipsoid
@@ -31,9 +21,6 @@
3121
if typing.TYPE_CHECKING:
3222
from numpy import ndarray
3323

34-
# py < 3.6 compatible
35-
tau = 2 * pi
36-
3724

3825
__all__ = [
3926
"geodetic2ecef",

src/pymap3d/sidereal.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Copyright (c) 2014-2018 Michael Hirsch, Ph.D.
22
""" manipulations of sidereal time """
3-
from math import pi
3+
from math import tau
44
from datetime import datetime
55

66
from .timeconv import str2dt
@@ -128,4 +128,4 @@ def greenwichsrt(Jdate: float) -> float:
128128
)
129129

130130
# 1/86400 and %(2*pi) implied by units of radians
131-
return gmst_sec * (2 * pi) / 86400.0 % (2 * pi)
131+
return gmst_sec * tau / 86400.0 % tau

0 commit comments

Comments
 (0)