Skip to content

Commit

Permalink
Also test whether C extension was loaded when determining fallback in…
Browse files Browse the repository at this point in the history
…tegration method
  • Loading branch information
jobovy committed Jun 25, 2018
1 parent d61c650 commit 7318d2a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions galpy/orbit_src/FullOrbit.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,12 +566,15 @@ def _integrateFullOrbit(vxvv,pot,t,method,dt):
"""
#First check that the potential has C
if '_c' in method:
if not _check_c(pot):
if not ext_loaded or not _check_c(pot):
if ('leapfrog' in method or 'symplec' in method):
method= 'leapfrog'
else:
method= 'odeint'
warnings.warn("Cannot use C integration because some of the potentials are not implemented in C (using %s instead)" % (method), galpyWarning)
if not ext_loaded: # pragma: no cover
warnings.warn("Cannot use C integration because C extension not loaded (using %s instead)" % (method), galpyWarning)
else:
warnings.warn("Cannot use C integration because some of the potentials are not implemented in C (using %s instead)" % (method), galpyWarning)
if method.lower() == 'leapfrog':
#go to the rectangular frame
this_vxvv= nu.array([vxvv[0]*nu.cos(vxvv[5]),
Expand Down

0 comments on commit 7318d2a

Please sign in to comment.