-
Notifications
You must be signed in to change notification settings - Fork 220
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
Read simulationarchives version < 3.18 #778
Conversation
@dtamayo I did not expect that this small change breaks anything for REBOUNDx (it should only change something when reading in very old simulation archives). Could it be that there is an issue with CI or REBOUNDx? |
The REBOUNDx CI has some old binaries that it reads in to test for reproducibility, which I'm guessing are the problem. I can update them. Thanks for letting me know |
…e_with_messages (is freed later)
Perhaps this is already what this pull request is fixing, but I noticed when running the SavingAndLoadingSimulations.ipynb example in REBOUNDx (after making a new environment and installing the latest REBOUND from pypi, latest REBOUNDx locally from source with pip install -e .) that when I save a REBOUND binary and reload it sim.save_to_file("reb.bin") I get these warnings /Users/dtamayo/opt/miniconda3/envs/rebtest/lib/python3.12/site-packages/rebound/simulation.py:148: RuntimeWarning: Binary file was saved with a different version of REBOUND. Binary format might have changed. I also checked that it isn't anything REBOUNDx is doing with the function pointers (if I don't add reboundx or any forces I still get the same warnings) |
I'm confused.
as you wrote works for me.
|
|
Ok. So I think the tests passed by accident before this PR:
|
<Thanks! It looks like the issue causing the warnings are the particle hashes. If I take them out of sim.add, I get no warnings. With hashes, I get the above warnings> Never mind, need to do some tests to narrow down what's happening. Need to meet wiht a student and will check right after |
Yeah, I can't reproduce that either. No rush. I also won't have much time this afternoon... |
If I run the same commands you sent in a jupyter notebook I get the warnings, but not on the command line... |
sigh |
(works for me in a jupyter notebook also) |
I tried getting python 3.12.3 in conda just in case, but got the same warnings: I also tried using virtualenv instead, both installing the latest pypi version, and checking out the sa16 branch and installing that from source locally (both gave identical outputs) I didn't have exactly the same version of python with virtualenv, but can't see how that would matter...I guess we have different versions of Clang (??) |
Sigh I forgot that every time you save it appends to the binary. So I think the issue was that I'd run this with an old version of rebound, creating reb.bin, and every time I ran it with a new version, it was appending and on load (correctly) said it was saved with a previous version of rebound. If I remove the binary and then run it, the warnings disappear |
Ah. Of course! I hadn't thought of that... So I'll merge this in even though the REBOUNDx machine independence test fails. We can either create a new binary file for the test, or investigate what changed and breaks the test. I think the former is the wiser choice... |
That makes sense. I've updated REBOUNDx to remove wheels for now, and fixed all the simulationarchive unit tests to regenerate each time. Everything works fine now. There's a bunch of different updates bundled in, so I want to spend a few minutes writing some release notes and I'll push a new version to PyPI tomorrow. Thanks a lot! |
This allows current versions of REBOUND to read old Simulationarchives (version < 3.18).