Skip to content

Commit fbd5d91

Browse files
committed
BUGFIX: fix default distance
1 parent 2f1e3af commit fbd5d91

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

gwmemory/angles.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def analytic_gamma(lm1, lm2, ell):
6262
m2 = -m2
6363
m3 = m1 + m2
6464
return (
65-
(-1)**(ell1 + ell2 + ell + m3 + m2)
65+
(-1.0) ** (ell1 + ell2 + ell + m3 + m2)
6666
* (2 * ell1 + 1)**0.5 * (2 * ell2 + 1)**0.5 * (2 * ell + 1)**0.5
6767
* float(wigner_3j(ell1, ell2, ell, s1, s2, -s3) * wigner_3j(ell1, ell2, ell, m1, m2, -m3))
6868
* np.pi**0.5 / 2
@@ -374,6 +374,11 @@ def load_gamma(data_dir=None):
374374
gamma_lmlm: dict
375375
Dictionary of gamma_lmlm.
376376
"""
377+
from warnings import warn
378+
warn(
379+
f"The load_gamma function is deprecated and will be removed in v0.4.0."
380+
"Use gwmemory.angles.analytic_gamma to compute the terms on the fly."
381+
)
377382
if data_dir is None:
378383
data_dir = str(Path(__file__).parent / "data")
379384
data_files = glob.glob(f"{data_dir}/gamma*.dat")

gwmemory/waveforms/base.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def __init__(self, name, h_lm, times):
1616

1717
@property
1818
def distance(self):
19-
return getattr(self, "_distance", "None")
19+
return getattr(self, "_distance", None)
2020

2121
@distance.setter
2222
def distance(self, distance):
@@ -38,11 +38,10 @@ def time_domain_memory(self, inc=None, phase=None, gamma_lmlm=None):
3838
will be returned.
3939
phase: float, optional
4040
Reference phase of the source, if None, the spherical harmonic
41-
modes will be returned. For CBCs this is the phase at coalesence.
42-
gamma_lmlm: dict
41+
modes will be returned. For CBCs this is the phase at coalescence.
42+
gamma_lmlm: dict, deprecated
4343
Dictionary of arrays defining the angular dependence of the
44-
different memory modes, default=None if None the function will
45-
attempt to load them.
44+
different memory modes, these are now computed/cached on the fly.
4645
4746
Return
4847
------
@@ -65,7 +64,7 @@ def time_domain_memory(self, inc=None, phase=None, gamma_lmlm=None):
6564
index = (lm, lmp)
6665
dhlm_dt_sq[index] = dhlm_dt[lm] * np.conjugate(dhlm_dt[lmp])
6766
except KeyError:
68-
None
67+
pass
6968

7069
if gamma_lmlm is None:
7170
gamma_lmlm = load_gamma()

0 commit comments

Comments
 (0)