# Buggy code
def _generate_time_values(self, nu_vals):
    M_vals = nu_to_M(nu_vals, self.ecc)
    time_values = self.epoch + (M_vals / self.n).decompose()
    return time_values


# Traceback (ValueError)
/usr/local/lib/python3.6/site-packages/astropy/units/quantity.py:639: RuntimeWarning:

invalid value encountered in log

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
/usr/local/lib/python3.6/site-packages/astropy/time/core.py in __add__(self, other)
1369             try:
-> 1370                 other = TimeDelta(other)
1371             except Exception:

/usr/local/lib/python3.6/site-packages/astropy/time/core.py in __init__(self, val, val2, format, scale, copy)
1539
-> 1540             self._init_from_vals(val, val2, format, scale, copy)
1541

/usr/local/lib/python3.6/site-packages/astropy/time/core.py in _init_from_vals(self, val, val2, format, scale, copy, precision, in_subfmt, out_subfmt)
329         self._time = self._get_time_fmt(val, val2, format, scale,
--> 330                                         precision, in_subfmt, out_subfmt)
331         self._format = self._time.name

/usr/local/lib/python3.6/site-packages/astropy/time/core.py in _get_time_fmt(self, val, val2, format, scale, precision, in_subfmt, out_subfmt)
373         else:
--> 374             raise ValueError('Input values did not match {0}'.format(err_msg))
375

ValueError: Input values did not match the format class jd

During handling of the above exception, another exception occurred:

OperandTypeError                          Traceback (most recent call last)
<ipython-input-5-f1d654cf6abc> in <module>()
2
3 op.plot(parking)
----> 4 op.plot(exit)
5
6 plt.xlim(-8000, 8000)

/usr/local/lib/python3.6/site-packages/poliastro-0.9.dev0-py3.6.egg/poliastro/plotting.py in plot(self, orbit, label, color)
152         lines = []
153
--> 154         _, positions = orbit.sample(self.num_points)
155         rr = positions.get_xyz().transpose()
156

/usr/local/lib/python3.6/site-packages/poliastro-0.9.dev0-py3.6.egg/poliastro/twobody/orbit.py in sample(self, values, function)
308                 nu_values = np.insert(nu_values, 0, self.ecc)
309
--> 310             return self.sample(nu_values, function)
311
312         elif hasattr(values, "unit") and values.unit in ('rad', 'deg'):

/usr/local/lib/python3.6/site-packages/poliastro-0.9.dev0-py3.6.egg/poliastro/twobody/orbit.py in sample(self, values, function)
311
312         elif hasattr(values, "unit") and values.unit in ('rad', 'deg'):
--> 313             values = self._generate_time_values(values)
314         return (values, self._sample(values, function))
315

/usr/local/lib/python3.6/site-packages/poliastro-0.9.dev0-py3.6.egg/poliastro/twobody/orbit.py in _generate_time_values(self, nu_vals)
324     def _generate_time_values(self, nu_vals):
325         M_vals = nu_to_M(nu_vals, self.ecc)
--> 326         time_values = self.epoch + (M_vals / self.n).decompose()
327         return time_values
328

/usr/local/lib/python3.6/site-packages/astropy/time/core.py in __add__(self, other)
1370                 other = TimeDelta(other)
1371             except Exception:
-> 1372                 raise OperandTypeError(self, other, '+')
1373
1374         # Tdelta + something is dealt with in TimeDelta, so we have

OperandTypeError: Unsupported operand type(s) for +: 'Time' and 'Quantity'

# Fixed code
def _generate_time_values(self, nu_vals):
    # Subtract current anomaly to start from the desired point
    M_vals = nu_to_M(nu_vals, self.ecc) - nu_to_M(self.nu, self.ecc)
    time_values = self.epoch + (M_vals / self.n).decompose()
    return time_values