Skip to content

Commit

Permalink
Fighting with black
Browse files Browse the repository at this point in the history
  • Loading branch information
aarchiba committed Feb 25, 2024
1 parent 63bf866 commit 8df8971
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
12 changes: 9 additions & 3 deletions src/pint/derived_quantities.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ def pferrs(porf, porferr, pdorfd=None, pdorfderr=None):
return [1.0 / porf, porferr / porf**2.0]
forperr = porferr / porf**2.0
fdorpderr = np.sqrt(
(4.0 * pdorfd**2.0 * porferr**2.0) / porf**6.0 + pdorfderr**2.0 / porf**4.0
(4.0 * pdorfd**2.0 * porferr**2.0) / porf**6.0
+ pdorfderr**2.0 / porf**4.0
)
[forp, fdorpd] = p_to_f(porf, pdorfd)
return [forp, forperr, fdorpd, fdorpderr]
Expand Down Expand Up @@ -514,12 +515,17 @@ def companion_mass(pb: u.d, x: u.cm, i=60.0 * u.deg, mp=1.4 * u.solMass):
# delta1 is always <0
# delta1 = 2 * b ** 3 - 9 * a * b * c + 27 * a ** 2 * d
delta1 = (
-2 * massfunct**3 - 18 * a * mp * massfunct**2 - 27 * a**2 * massfunct * mp**2
-2 * massfunct**3
- 18 * a * mp * massfunct**2
- 27 * a**2 * massfunct * mp**2
)
# Q**2 is always > 0, so this is never a problem
# in terms of complex numbers
# Q = np.sqrt(delta1**2 - 4*delta0**3)
Q = np.sqrt(108 * a**3 * mp**3 * massfunct**3 + 729 * a**4 * mp**4 * massfunct**2)
Q = np.sqrt(
108 * a**3 * mp**3 * massfunct**3
+ 729 * a**4 * mp**4 * massfunct**2
)
# this could be + or - Q
# pick the - branch since delta1 is <0 so that delta1 - Q is never near 0
Ccubed = 0.5 * (delta1 + Q)
Expand Down
4 changes: 3 additions & 1 deletion src/pint/models/stand_alone_psr_binaries/DDK_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,9 @@ def d_delta_omega_parallax_d_T0(self):
PX_kpc = self.PX.to(u.kpc, equivalencies=u.parallax())
kom_projection = self.delta_I0() * self.cos_KOM + self.delta_J0() * self.sin_KOM
d_kin_d_T0 = self.d_kin_d_par("T0")
d_delta_omega_d_T0 = cos_kin / sin_kin**2 / PX_kpc * d_kin_d_T0 * kom_projection
d_delta_omega_d_T0 = (
cos_kin / sin_kin**2 / PX_kpc * d_kin_d_T0 * kom_projection
)
return d_delta_omega_d_T0.to(
self.OM.unit / self.T0.unit, equivalencies=u.dimensionless_angles()
)
Expand Down

0 comments on commit 8df8971

Please sign in to comment.