From c396f382b67afcb3d61be2bd12092257479e57b7 Mon Sep 17 00:00:00 2001 From: Jo Bovy Date: Sat, 21 Jul 2018 11:48:04 -0400 Subject: [PATCH] Avoid circular-ish import, which for some reason is sometimes an issue in Python 2.7, but not in python 3 (?) --- galpy/actionAngle/actionAngleAdiabatic_c.py | 3 ++- galpy/actionAngle/actionAngleStaeckel_c.py | 6 +++++- galpy/actionAngle/actionAngleTorus_c.py | 5 ++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/galpy/actionAngle/actionAngleAdiabatic_c.py b/galpy/actionAngle/actionAngleAdiabatic_c.py index f552288dc..8b3473e92 100644 --- a/galpy/actionAngle/actionAngleAdiabatic_c.py +++ b/galpy/actionAngle/actionAngleAdiabatic_c.py @@ -7,7 +7,6 @@ import numpy from numpy.ctypeslib import ndpointer from galpy.util import galpyWarning -from galpy.orbit.integrateFullOrbit import _parse_pot #Find and load the library _lib= None outerr= None @@ -54,6 +53,7 @@ def actionAngleAdiabatic_c(pot,gamma,R,vR,vT,z,vz): 2012-12-10 - Written - Bovy (IAS) """ #Parse the potential + from galpy.orbit.integrateFullOrbit import _parse_pot npot, pot_type, pot_args= _parse_pot(pot,potforactions=True) #Set up result arrays @@ -134,6 +134,7 @@ def actionAngleRperiRapZmaxAdiabatic_c(pot,gamma,R,vR,vT,z,vz): 2017-12-21 - Written - Bovy (UofT) """ #Parse the potential + from galpy.orbit.integrateFullOrbit import _parse_pot npot, pot_type, pot_args= _parse_pot(pot,potforactions=True) #Set up result arrays diff --git a/galpy/actionAngle/actionAngleStaeckel_c.py b/galpy/actionAngle/actionAngleStaeckel_c.py index a12c2a9c1..13cc58848 100644 --- a/galpy/actionAngle/actionAngleStaeckel_c.py +++ b/galpy/actionAngle/actionAngleStaeckel_c.py @@ -7,7 +7,6 @@ import numpy from numpy.ctypeslib import ndpointer from galpy.util import galpyWarning -from galpy.orbit.integrateFullOrbit import _parse_pot from galpy.util import bovy_coords #Find and load the library _lib= None @@ -59,6 +58,7 @@ def actionAngleStaeckel_c(pot,delta,R,vR,vT,z,vz,u0=None,order=10): if u0 is None: u0, dummy= bovy_coords.Rz_to_uv(R,z,delta=numpy.atleast_1d(delta)) #Parse the potential + from galpy.orbit.integrateFullOrbit import _parse_pot npot, pot_type, pot_args= _parse_pot(pot,potforactions=True) #Parse delta @@ -155,6 +155,7 @@ def actionAngleStaeckel_calcu0(E,Lz,pot,delta): 2012-12-03 - Written - Bovy (IAS) """ #Parse the potential + from galpy.orbit.integrateFullOrbit import _parse_pot npot, pot_type, pot_args= _parse_pot(pot,potforactions=True) #Set up result arrays @@ -230,6 +231,7 @@ def actionAngleFreqStaeckel_c(pot,delta,R,vR,vT,z,vz,u0=None,order=10): if u0 is None: u0, dummy= bovy_coords.Rz_to_uv(R,z,delta=numpy.atleast_1d(delta)) #Parse the potential + from galpy.orbit.integrateFullOrbit import _parse_pot npot, pot_type, pot_args= _parse_pot(pot,potforactions=True) #Parse delta @@ -345,6 +347,7 @@ def actionAngleFreqAngleStaeckel_c(pot,delta,R,vR,vT,z,vz,phi, if u0 is None: u0, dummy= bovy_coords.Rz_to_uv(R,z,delta=numpy.atleast_1d(delta)) #Parse the potential + from galpy.orbit.integrateFullOrbit import _parse_pot npot, pot_type, pot_args= _parse_pot(pot,potforactions=True) #Parse delta @@ -474,6 +477,7 @@ def actionAngleUminUmaxVminStaeckel_c(pot,delta,R,vR,vT,z,vz,u0=None): if u0 is None: u0, dummy= bovy_coords.Rz_to_uv(R,z,delta=numpy.atleast_1d(delta)) #Parse the potential + from galpy.orbit.integrateFullOrbit import _parse_pot npot, pot_type, pot_args= _parse_pot(pot,potforactions=True) #Parse delta diff --git a/galpy/actionAngle/actionAngleTorus_c.py b/galpy/actionAngle/actionAngleTorus_c.py index ef21feed2..2821028ff 100644 --- a/galpy/actionAngle/actionAngleTorus_c.py +++ b/galpy/actionAngle/actionAngleTorus_c.py @@ -7,7 +7,6 @@ import numpy from numpy.ctypeslib import ndpointer from galpy.util import galpyWarningVerbose -from galpy.orbit.integrateFullOrbit import _parse_pot #Find and load the library _lib= None outerr= None @@ -59,6 +58,7 @@ def actionAngleTorus_xvFreqs_c(pot,jr,jphi,jz, 2015-08-05/07 - Written - Bovy (UofT) """ #Parse the potential + from galpy.orbit.integrateFullOrbit import _parse_pot npot, pot_type, pot_args= _parse_pot(pot,potfortorus=True) #Set up result arrays @@ -158,6 +158,7 @@ def actionAngleTorus_Freqs_c(pot,jr,jphi,jz, 2015-08-05/07 - Written - Bovy (UofT) """ #Parse the potential + from galpy.orbit.integrateFullOrbit import _parse_pot npot, pot_type, pot_args= _parse_pot(pot,potfortorus=True) #Set up result @@ -221,6 +222,7 @@ def actionAngleTorus_hessian_c(pot,jr,jphi,jz, 2016-07-15 - Written - Bovy (UofT) """ #Parse the potential + from galpy.orbit.integrateFullOrbit import _parse_pot npot, pot_type, pot_args= _parse_pot(pot,potfortorus=True) #Set up result @@ -295,6 +297,7 @@ def actionAngleTorus_jacobian_c(pot,jr,jphi,jz,angler,anglephi,anglez, 2016-07-19 - Written - Bovy (UofT) """ #Parse the potential + from galpy.orbit.integrateFullOrbit import _parse_pot npot, pot_type, pot_args= _parse_pot(pot,potfortorus=True) #Set up result