-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* functions depend on psp * musigma just rescales * analytic standalone * linear analytic in python * non-linear almost decoupled * rescaling factorized * extricated linear * bcm factorized * nonlinear extricated, correlations generalized * flaked * test implemented, measure time on GHA * typo * actual timing * sigma_M generalized and sped up * mac is slow * started calculator creator * flaked * sigmaM splining wasn't good enough * bg and grth unit-tested * linear done * nonlinear implemented * precision * outdated test * bug kNL * tests removed * bcm simplified * core tests * pk2dtests * tests power * calculator types * growth normalization * outdated stuff * outdated * outdated * C cleanup * proper parsing * cleaned up C-level error messages * docstrings + power * classmethod to subclass * missing tests * memleak * easy PR comments * simplified api * get_power methods * simpler rescaling * test unnorm * missing rescaling * default name * nonlinear model * x to : * flake * catch warning
- Loading branch information
Showing
56 changed files
with
2,305 additions
and
1,719 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import numpy as np | ||
import pyccl as ccl | ||
import time | ||
|
||
|
||
def test_timing(): | ||
ls = np.unique(np.geomspace(2, 2000, 128).astype(int)).astype(float) | ||
nl = len(ls) | ||
b_g = np.array([1.376695, 1.451179, 1.528404, | ||
1.607983, 1.689579, 1.772899, | ||
1.857700, 1.943754, 2.030887, | ||
2.118943]) | ||
dNdz_file = np.load('benchmarks/data/dNdzs.npz') | ||
z_s = dNdz_file['z_sh'] | ||
dNdz_s = dNdz_file['dNdz_sh'].T | ||
z_g = dNdz_file['z_cl'] | ||
dNdz_g = dNdz_file['dNdz_cl'].T | ||
nt = len(dNdz_s) + len(dNdz_g) | ||
nx = (nt*(nt+1))//2 | ||
|
||
cosmo = ccl.CosmologyVanillaLCDM(transfer_function='boltzmann_class') | ||
cosmo.compute_nonlin_power() | ||
|
||
start = time.time() | ||
t_g = [ccl.NumberCountsTracer(cosmo, True, | ||
(z_g, ng), | ||
bias=(z_g, np.full(len(z_g), b))) | ||
for ng, b in zip(dNdz_g, b_g)] | ||
t_s = [ccl.WeakLensingTracer(cosmo, (z_s, ns)) for ns in dNdz_s] | ||
t_all = t_g + t_s | ||
|
||
cls = np.zeros([nx, nl]) | ||
ind1, ind2 = np.triu_indices(nt) | ||
for ix, (i1, i2) in enumerate(zip(ind1, ind2)): | ||
cls[ix, :] = ccl.angular_cl(cosmo, t_all[i1], t_all[i2], ls) | ||
end = time.time() | ||
t_seconds = end - start | ||
print(end-start) | ||
assert t_seconds < 3. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.