Skip to content

Commit

Permalink
Formatted ept.py
Browse files Browse the repository at this point in the history
  • Loading branch information
CarterDW authored Nov 29, 2023
1 parent ee1c8ed commit 69dbb5f
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions pyccl/nl_pt/ept.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
'bs:cdelta': 'zero', 'bk2:bk2': 'zero', 'bk2:c1': 'zero',
'bk2:c2': 'zero', 'bk2:cdelta': 'zero', 'c1:c1': 'm:m',
'c1:c2': 'm:c2', 'c1:cdelta': 'm:cdelta', 'c1:ck': 'm:ck',
'c2:c2': 'c2:c2','c2:cdelta': 'c2:cdelta',
'c2:c2': 'c2:c2', 'c2:cdelta': 'c2:cdelta',
'cdelta:cdelta': 'cdelta:cdelta', 'ck:ck': 'zero'}


Expand Down Expand Up @@ -190,17 +190,21 @@ def __init__(self, *, with_NC=False, with_IA=False,
import fastpt as fpt
except Exception:
raise ImportError("Your attempted import of FAST-PT has failed. "
"You either dont have fast-pt installed, or have the wrong version. "
"Try running pip install fast-pt or conda install fast-pt, then try again")
"You either dont have fast-pt installed, "
"or have the wrong version. Try running "
"pip install fast-pt or conda "
"install fast-pt, then try again")

if (not hasattr(fpt, "IA_ta")):
raise ValueError("Your FAST-PT version lacks a required attribute. "
"You may have the wrong fast-pt install. "
"Try running pip install fast-pt or conda install fast-pt, then try again")
raise ValueError("Your FAST-PT version lacks a required function. "
"You may have the wrong fast-pt install. "
"Try running pip install "
"fast-pt or conda install fast-pt, "
"then try again")

if (not hasattr(fpt, "IA_der") and self.ufpt):
raise ValueError("You need a newer version of "
"FAST-PT to use fpt for k2 term")
raise ValueError("You need a newer version of "
"FAST-PT to use fpt for k2 term")
n_pad = int(self.fastpt_par['pad_factor'] * len(self.k_s))
self.pt = fpt.FASTPT(self.k_s, to_do=to_do,
low_extrap=self.fastpt_par['low_extrap'],
Expand Down Expand Up @@ -320,8 +324,8 @@ def reshape_fastpt(tupl):
if 'linear' in pksa:
pka = pksa['linear']
else:
pka = np.array([cosmo.linear_matter_power(self.k_s, a)
for a in self.a_s]) #Shorten
pka = np.array([cosmo.linear_matter_power(self.k_s, a)
for a in self.a_s])
pka += self._g4T*self.one_loop_dd[0]
pksa['pt'] = pka
self.pk_ak = pksa[self.ak2_pk_kind]
Expand Down

0 comments on commit 69dbb5f

Please sign in to comment.