Skip to content
Snippets Groups Projects
Commit d74e3ed3 authored by Izzard, Robert Dr (Maths & Physics)'s avatar Izzard, Robert Dr (Maths & Physics)
Browse files

Merge branch 'development_0.9.3/2.2.1' into feature/HPC

add diskcache memoizing to const_dt so that multiple calls to
const_dt with the same arguments just return the correct result
parents 495803e3 89e5575e
No related branches found
No related tags found
No related merge requests found
...@@ -314,17 +314,16 @@ def three_part_powerlaw( ...@@ -314,17 +314,16 @@ def three_part_powerlaw(
m0, m1, m2, m_max, p1, p2, p3 m0, m1, m2, m_max, p1, p2, p3
) )
#
if m < m0: if m < m0:
prob = 0 # Below lower bound TODO: make this clear. prob = 0.0 # Below lower bound
elif m0 < m <= m1: elif m <= m1:
prob = three_part_powerlaw_constants[0] * (m ** p1) # Between M0 and M1 prob = three_part_powerlaw_constants[0] * (m ** p1) # Between m0 and m1
elif m1 < m <= m2: elif m <= m2:
prob = three_part_powerlaw_constants[1] * (m ** p2) # Between M1 and M2 prob = three_part_powerlaw_constants[1] * (m ** p2) # Between m1 and m2
elif m2 < m <= m_max: elif m <= m_max:
prob = three_part_powerlaw_constants[2] * (m ** p3) # Between M2 and M_MAX prob = three_part_powerlaw_constants[2] * (m ** p3) # Between m2 and m_max
else: else:
prob = 0 # Above M_MAX prob = 0 # Above m_max
return prob return prob
......
This diff is collapsed.
This diff is collapsed.
...@@ -265,6 +265,7 @@ setup( ...@@ -265,6 +265,7 @@ setup(
"colorama", "colorama",
"compress_pickle", "compress_pickle",
"datasize", "datasize",
"diskcache",
"h5py", "h5py",
"halo", "halo",
"humanize", "humanize",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment