# Buggy code
def from_sbdb(cls, name, **kwargs):
    """Return osculating `Orbit` by using `SBDB` from Astroquery.

    Parameters
    ----------
    name: string
        Name of the body to make the request.

    Returns
    -------
    ss: poliastro.twobody.orbit.Orbit
        Orbit corresponding to body_name

    Examples
    --------
    >>> from poliastro.twobody.orbit import Orbit
    >>> apophis_orbit = Orbit.from_sbdb('apophis')  # doctest: +REMOTE_DATA

    """
    from poliastro.bodies import Sun

    obj = SBDB.query(name, full_precision=True, **kwargs)

    if "count" in obj:
        # no error till now ---> more than one object has been found
        # contains all the name of the objects
        objects_name = obj["list"]["name"]
        objects_name_in_str = ""  # used to store them in string form each in new line
        for i in objects_name:
            objects_name_in_str += i + "\n"

        raise ValueError(
            str(obj["count"]) + " different objects found: \n" + objects_name_in_str
        )

    if "object" not in obj.keys():
        raise ValueError("Object {} not found".format(name))

    a = obj["orbit"]["elements"]["a"].to(u.AU) * u.AU
    ecc = float(obj["orbit"]["elements"]["e"]) * u.one
    inc = obj["orbit"]["elements"]["i"].to(u.deg) * u.deg
    raan = obj["orbit"]["elements"]["om"].to(u.deg) * u.deg
    argp = obj["orbit"]["elements"]["w"].to(u.deg) * u.deg

    # Since JPL provides Mean Anomaly (M) we need to make
    # the conversion to the true anomaly (\nu)
    nu = M_to_nu_fast(obj["orbit"]["elements"]["ma"].to(u.rad), ecc.value) * u.rad

    epoch = time.Time(obj["orbit"]["epoch"].to(u.d), format="jd")

    ss = cls.from_classical(
        Sun,
        a,
        ecc,
        inc,
        raan,
        argp,
        nu,
        epoch=epoch.tdb,
        plane=Planes.EARTH_ECLIPTIC,
    )

    return ss


# Traceback (FloatingPointError)
$ NUMBA_DISABLE_JIT=1 ipython --no-banner

In [1]: import numpy as np

In [2]: np.seterr(all="raise")
Out[2]: {'divide': 'warn', 'over': 'warn', 'under': 'ignore', 'invalid': 'warn'}

In [3]: import numpy as np
...: import math
...: from astropy import units as u
...: from poliastro.bodies import Earth, Moon
...: from poliastro.twobody import Orbit
...:
...: r=[8.e3, 1.e3, 0.]*u.km
...: v=[-0.5, -0.5, 0.]*u.km/u.s
...: orbit1=Orbit.from_vectors(Earth,r,v)
...: orbit2=orbit1.propagate(1.*u.h)
...:
...:
---------------------------------------------------------------------------
FloatingPointError                        Traceback (most recent call last)
<ipython-input-3-08d7b74965c9> in <module>()
8 v=[-0.5, -0.5, 0.]*u.km/u.s
9 orbit1=Orbit.from_vectors(Earth,r,v)
---> 10 orbit2=orbit1.propagate(1.*u.h)

~/.miniconda36/envs/poliastro37/lib/python3.7/site-packages/poliastro/twobody/orbit.py in propagate(self, value, method, rtol, **kwargs)
403                 time_of_flight = time.TimeDelta(value)
404
--> 405             return propagate(self, time_of_flight, method=method, rtol=rtol, **kwargs)
406
407     def sample(self, values=None, method=mean_motion):

~/.miniconda36/envs/poliastro37/lib/python3.7/site-packages/poliastro/twobody/propagation.py in propagate(orbit, time_of_flight, method, rtol, **kwargs)
177
178     """
--> 179     r, v = method(orbit, time_of_flight.to(u.s).value, rtol=rtol, **kwargs)
180     return orbit.from_vectors(orbit.attractor, r * u.km, v * u.km / u.s, orbit.epoch + time_of_flight, orbit.plane)

~/.miniconda36/envs/poliastro37/lib/python3.7/site-packages/poliastro/twobody/propagation.py in mean_motion(orbit, tofs, **kwargs)
118
119     if not hasattr(tofs, '__len__'):
--> 120         return mean_motion_fast(k, r0, v0, tofs)
121
122     results = [mean_motion_fast(k, r0, v0, tof) for tof in tofs]

~/.miniconda36/envs/poliastro37/lib/python3.7/site-packages/poliastro/core/propagation.py in mean_motion(k, r0, v0, tof)
33
34     # get the initial mean anomaly
---> 35     M0 = nu_to_M(nu0, ecc)
36     # strong elliptic or strong hyperbolic orbits
37     if np.abs(ecc - 1.0) > 1e-2:

~/.miniconda36/envs/poliastro37/lib/python3.7/site-packages/poliastro/core/angles.py in nu_to_M(nu, ecc, delta)
183     else:
184         D = nu_to_D(nu)
--> 185         M = D_to_M(D, ecc)
186     return M
187

~/.miniconda36/envs/poliastro37/lib/python3.7/site-packages/poliastro/core/angles.py in D_to_M(D, ecc)
155 @jit
156 def D_to_M(D, ecc):
--> 157     M = _kepler_equation_parabolic(D, 0.0, ecc)
158     return M
159

~/.miniconda36/envs/poliastro37/lib/python3.7/site-packages/poliastro/core/angles.py in _kepler_equation_parabolic(D, M, ecc)
26 @jit
27 def _kepler_equation_parabolic(D, M, ecc):
---> 28     return M_parabolic(ecc, D) - M
29
30

~/.miniconda36/envs/poliastro37/lib/python3.7/site-packages/poliastro/core/angles.py in M_parabolic(ecc, D, tolerance)
41     k = 0
42     while not small_term:
---> 43         term = (ecc - 1.0 / (2.0 * k + 3.0)) * (x ** k)
44         small_term = np.abs(term) < tolerance
45         S += term

FloatingPointError: overflow encountered in double_scalars

# Fixed code
def from_sbdb(cls, name, **kwargs):
    """Return osculating `Orbit` by using `SBDB` from Astroquery.

    Parameters
    ----------
    name: string
        Name of the body to make the request.

    Returns
    -------
    ss: poliastro.twobody.orbit.Orbit
        Orbit corresponding to body_name

    Examples
    --------
    >>> from poliastro.twobody.orbit import Orbit
    >>> apophis_orbit = Orbit.from_sbdb('apophis')  # doctest: +REMOTE_DATA

    """
    from poliastro.bodies import Sun

    obj = SBDB.query(name, full_precision=True, **kwargs)

    if "count" in obj:
        # no error till now ---> more than one object has been found
        # contains all the name of the objects
        objects_name = obj["list"]["name"]
        objects_name_in_str = ""  # used to store them in string form each in new line
        for i in objects_name:
            objects_name_in_str += i + "\n"

        raise ValueError(
            str(obj["count"]) + " different objects found: \n" + objects_name_in_str
        )

    if "object" not in obj.keys():
        raise ValueError("Object {} not found".format(name))

    a = obj["orbit"]["elements"]["a"].to(u.AU) * u.AU
    ecc = float(obj["orbit"]["elements"]["e"]) * u.one
    inc = obj["orbit"]["elements"]["i"].to(u.deg) * u.deg
    raan = obj["orbit"]["elements"]["om"].to(u.deg) * u.deg
    argp = obj["orbit"]["elements"]["w"].to(u.deg) * u.deg

    # Since JPL provides Mean Anomaly (M) we need to make
    # the conversion to the true anomaly (nu)
    M = obj["orbit"]["elements"]["ma"].to(u.rad) * u.rad
    # NOTE: It is unclear how this conversion should happen,
    # see https://ssd-api.jpl.nasa.gov/doc/sbdb.html
    if ecc < 1:
        M = (M + np.pi * u.rad) % (2 * np.pi * u.rad) - np.pi * u.rad
        nu = E_to_nu(M_to_E(M, ecc), ecc)
    elif ecc == 1:
        nu = D_to_nu(M_to_D(M))
    else:
        nu = F_to_nu(M_to_F(M, ecc), ecc)

    epoch = time.Time(obj["orbit"]["epoch"].to(u.d), format="jd")

    ss = cls.from_classical(
        Sun,
        a,
        ecc,
        inc,
        raan,
        argp,
        nu,
        epoch=epoch.tdb,
        plane=Planes.EARTH_ECLIPTIC,
    )

    return ss