Skip to content

Commit

Permalink
Fix new integration method for single objects
Browse files Browse the repository at this point in the history
  • Loading branch information
jobovy committed May 22, 2019
1 parent d66d6f4 commit 1afd8b6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion galpy/orbit/integrateFullOrbit.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ def integrate_for_map(vxvv):
return integrateFullOrbit_c(pot,nu.copy(vxvv),
t,int_method,dt=dt)[0]
if len(yo) == 1: # Can't map a single value...
out= integrate_for_map(yo)
out= nu.atleast_3d(integrate_for_map(yo[0]).T).T
else:
out= nu.array((parallel_map(integrate_for_map,yo,numcores=numcores)))
if nophi:
Expand Down
2 changes: 1 addition & 1 deletion galpy/orbit/integrateLinearOrbit.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def integrate_for_map(vxvv):
return integrateLinearOrbit_c(pot,nu.copy(vxvv),
t,int_method,dt=dt)[0]
if len(yo) == 1: # Can't map a single value...
return integrate_for_map(yo), 0
return nu.atleast_3d(integrate_for_map(yo[0]).T).T, 0
else:
return (nu.array((parallel_map(integrate_for_map,yo,numcores=numcores))),
nu.zeros(len(yo)))
Expand Down
4 changes: 2 additions & 2 deletions galpy/orbit/integratePlanarOrbit.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ def integrate_for_map(vxvv):
return integratePlanarOrbit_c(pot,nu.copy(vxvv),
t,int_method,dt=dt)[0]
if len(yo) == 1: # Can't map a single value...
out= integrate_for_map(yo)
out= nu.atleast_3d(integrate_for_map(yo[0]).T).T
else:
out= nu.array((parallel_map(integrate_for_map,yo,numcores=numcores)))
if nophi:
Expand Down Expand Up @@ -687,7 +687,7 @@ def integrate_for_map(vxvv):
t,int_method,dt=dt,
rtol=rtol,atol=atol)[0]
if len(this_yo) == 1: # Can't map a single value...
out= integrate_for_map(this_yo)
out= nu.atleast_3d(integrate_for_map(this_yo[0]).T).T
else:
out= nu.array((parallel_map(integrate_for_map,this_yo,
numcores=numcores)))
Expand Down

0 comments on commit 1afd8b6

Please sign in to comment.