hannorein / rebound

💫 An open-source multi-purpose N-body code.
https://rebound.readthedocs.io/
GNU General Public License v3.0
817 stars 216 forks source link

'Simulation' object has no attribute 'automateSimulationArchive' #751

Closed Anit5577 closed 4 months ago

Anit5577 commented 4 months ago

Environment Which version of REBOUND are you using and on what operating system?

Describe the bug I have upgraded my Rebound to the latest version and am running a simple script saving snapshots to a Simulationarchive. Using the automateSimulationArchive command as suggested in the documentation:

sim.automateSimulationArchive("archive.bin", interval=10.)

now gives me an AttributeError (full error message), which I have never encountered before (used 3.26.0 up to now):

Traceback (most recent call last):

File "/home/cschoett/.local/lib/python3.10/site-packages/spyder_kernels/py3compat.py", line 356, in compat_exec exec(code, globals, locals)

File "/home/cschoett/Documents/Kepler_dichotomy_rebound/Test_sim_archive_090224.py", line 27, in sim.automateSimulationArchive('test_090224.bin', interval=1e3*365.25)

To Reproduce

import rebound import numpy as np sim = rebound.Simulation() sim.G = 6.6743e-11 # m^3 / kg s^2 sim.units = ('days', 'AU', 'Msun')

sim.add(m=1.0, r = 4.65e-3, hash=0) sim.add(primary=sim.particles[0], m = 4.8e-03, e =0, a=5, r = 4.8e-4, hash=5) sim.move_to_com()

sim.add(m=0.1, x=7200, y=3700, z=2200,vx=-0.002, vy=-0.0010, vz=-0.0006,r = 7.37e-4, hash='Pert')

sim.integrator = "ias15" sim.automateSimulationArchive('test_090224.bin', interval=1e3365.25) sim.integrate(1e5365.25)

Has the spelling changed in the latest version and wasn't updated in the documentation?

hannorein commented 4 months ago

Yes. The function is now called sim.save_to_file("filename", interval=interval).

Anit5577 commented 4 months ago

Awesome, thanks.