You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Orbit instances should be able to be indexed by times after integration, as long as the time is within the integration range. This fails for non-array arguments. The error is of slightly different origin depending on whether astropy units are used.
Example for astropy units
from galpy import potential, orbit
import numpy as np
from astropy import units as apu
pot = potential.MWPotential2014
o = orbit.Orbit()
times = np.array([0,1,2])*apu.Gyr
o.integrate(times,pot)
o(times[-1])
Throws an error on line 4236 when calling len(t).
Example for no astropy units
from galpy import potential, orbit
import numpy as np
pot = potential.MWPotential2014
o = orbit.Orbit()
times = np.array([0,1,2])
o.integrate(times,pot)
o(times[-1])
Throws an error on line 4261 because isinstance(t,(int,float)) returns False for numpy dtypes, then len(t) is evaluated.
The text was updated successfully, but these errors were encountered:
I think this can be fixed by just calling t= np.atleast_1d(out[0]) right away after the first if/elif/else statement in _call_internal to make it an array, and then refactoring the remaining conditional statements
Orbit instances should be able to be indexed by times after integration, as long as the time is within the integration range. This fails for non-array arguments. The error is of slightly different origin depending on whether astropy units are used.
Example for astropy units
Throws an error on line 4236 when calling
len(t)
.Example for no astropy units
Throws an error on line 4261 because
isinstance(t,(int,float))
returns False for numpy dtypes, then len(t) is evaluated.The text was updated successfully, but these errors were encountered: