Try to fix regression in PWN _radius_free_expansion
@@ -67,7 +67,12 @@ class PWN(object):
def time_coll(t):
t = Quantity(t, 'yr')
- return (self._radius_free_expansion(t) - self.snr.radius_reverse_shock(t)).value
+ r_pwn = self._radius_free_expansion(t).to('cm').value
+ r_shock = self.snr.radius_reverse_shock(t).to('cm').value
+ # Calling float here is an attempt to fix
+ # https://travis-ci.org/gammapy/gammapy/jobs/358305453#L3824
+ # by forcing a scalar return value in this function
+ return float(r_pwn - r_shock)
# 4e3 years is a typical value that works for fsolve
return Quantity(fsolve(time_coll, 4e3), 'yr')
