adrn / gala

Galactic and gravitational dynamics in Python
http://gala.adrian.pw
MIT License
131 stars 56 forks source link

Passing `store_all` to `integrate_orbit` causes TypeError #306

Closed TomWagg closed 2 years ago

TomWagg commented 2 years ago

Hey @adrn 🙂 I tried setting store_all=False in integrate_orbit as you mentioned last week but it seems that passing it causes a TypeError.

From what I can see, it seems that the function is passing store_all as part of **time_specs and then parse_time_specification is getting mad about it...but I can't honestly tell why it is getting passed haha 🤷🏻 This appears to occur independently of what I choose as the Integrator.

Here's how you can reproduce it:

import gala.potential as gp
import gala.dynamics as gd
import astropy.units as u

w0 = gd.PhaseSpacePosition(pos=[10.,0,0] * u.kpc,
                           vel=[0.,75,0] * u.km/u.s)
mw = gp.MilkyWayPotential()

# this works fine
w = mw.integrate_orbit(w0, t1=0, t2=100, dt=1)

# these crash
w = mw.integrate_orbit(w0, t1=0, t2=100, dt=1, store_all=False)
w = mw.integrate_orbit(w0, t1=0, t2=100, dt=1, store_all=True)

The error that comes out is:

TypeError: parse_time_specification() got an unexpected keyword argument 'store_all'
adrn commented 2 years ago

Are you using the latest dev version of gala? It sounds like the argument isn't being recognized, and I think I added it since v1.5, so make sure you have the dev version installed:

pip install git+https://github.com/adrn/gala

I should really release a new version v1.6...

TomWagg commented 2 years ago

Ack sorry - you're right! I hadn't realised the docs showed the latest stuff. I'm still using v1.5 so no small wonder it didn't work haha