-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting warning/error with additional forces #126
Comments
Hi Ian, sorry this fell through the cracks. Are you at DDA? If so feel free to find me anytime. I think I might be able to help faster if we could try things out together on your laptop. |
No worries at all, that sounds great, I'll try to find you today. |
Hello, I am also running into this situation. I was running my code just fine on my local environment and then when I created a new environment and installed the packages on that computer, my simulations stop running when I try to add radiation forces but run just fine if I take that part out. Same error message, it complains that I "need to attach reboundx.Extras instance to simulation before setting params" even though I definitely have. How do you resolve this? Thanks, |
Hi Tammy, Sorry, we sorted this out in person and forgot to close the issue, but it would be good to have a solution here. Could you try making a new environment and doing pip install reboundx --no-binary :all: --no-cache-dir |
I tried doing that, still getting the same error. My environment is Python 3.9.7, rebound version 4.3.2, reboundx version 4.1.0. This is to match my local environment which is successfully running simulations. The code for adding the extra forces is below and the error I'm getting is "AttributeError: Need to attach reboundx.Extras instance to simulation before setting params." which makes no sense because I clearly have...
|
Hm, I just ran the command above with python 3.9.7 and I can't reproduce the error on my macbook pro. What commands did you run? Did you make a new environment? You didn't seem to install the latest versions of rebound and reboundx. Do you need those specific ones? |
I did make a new environment. The problem I have is when I install the latest versions for rebound/reboundx, I don't hit the "need to attach reboundx.Extras" error but it doesn't run my simulation (gets stuck on the first sim.integrate(time) run, doesn't throw error but gets held up forever) unless I remove the lines where I've added the radiation forces, in which case it runs just fine. The versions I mentioned earlier are the ones I have in the environment locally where everything works fine so I've been trying to duplicate that environment on this new computer. The commands I ran are below:
And here is the code I used for the test simulation: test_sim.txt |
Thanks for all the testing @tamidodo . I think the issue was compatibility issues with versions of REBOUND in the installation wheels. I think REBOUNDx 4.2.0 should resolve your issues. Could you let me know? |
Brilliant, that worked perfectly. Thank you for your time on this! |
I had to reinstall my reboundx (via pip install -e .) after editing an equation. Prior to this edit, everything was running fine and I am certain that my edit did not alter anything significant.
However, since I did that, I'm now getting this warning and the simulation is not running:
Warning (from warnings module):
File "/Users/ian/reboundian/rebound/rebound/simulation.py", line 254
warnings.warn(msg[1:], RuntimeWarning)
RuntimeWarning: REBOUNDx overwrites sim->additional_forces, sim->pre_timestep_modifications and sim->post_timestep_modifications whenever forces or operators that use them get added. If you want to use REBOUNDx together with your own custom functions that use these callbacks, you should add them through REBOUNDx. See https://github.com/dtamayo/reboundx/blob/master/ipython_examples/Custom_Effects.ipynb for a tutorial.
Warning (from warnings module):
File "/Users/ian/reboundian/rebound/rebound/simulation.py", line 254
warnings.warn(msg[1:], RuntimeWarning)
RuntimeWarning: REBOUNDx Warning: additional_forces was set and is being overwritten by REBOUNDx. To incorporate both, you can add your own custom effects through REBOUNDx. See https://github.com/dtamayo/reboundx/blob/master/ipython_examples/Custom_Effects.ipynb for a tutorial.
Here is the relevant part of the code:
The thing was working fine just last week, any advice would be greatly appreciated. Can offer more info if needed.
Python 3.12.2
macOS 14.4.1
Update/Edit: I also tried completely uninstalling, then reinstalling without adding in any of my custom effects, and I am still getting the same error when I attempt to add Type I Migration.
Thank you,
-Ian
The text was updated successfully, but these errors were encountered: