Skip to content
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

REBOUNDx error: Force 'type_I_migration' not found in REBOUNDx library. #89

Closed
fpazcorrea opened this issue Nov 18, 2022 · 5 comments
Closed

Comments

@fpazcorrea
Copy link

Hello,

I am having issues with implementing Type I Migration. I downloaded the ipython example and tried running it without any modifications and it showed me the following error

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-7-10ea43c03dd8> in <module>
      1 rebx = reboundx.Extras(sim)
----> 2 mig = rebx.load_force("type_I_migration")
      3 rebx.add_force(mig)
      4 
      5 mig.params["tIm_scale_height_1"] = 0.03

/usr/local/Cellar/jupyterlab/3.0.1/libexec/lib/python3.9/site-packages/reboundx/extras.py in load_force(self, name)
     81         clibreboundx.rebx_load_force.restype = POINTER(Force)
     82         ptr = clibreboundx.rebx_load_force(byref(self), c_char_p(name.encode('ascii')))
---> 83         self.process_messages()
     84         return ptr.contents
     85 

/usr/local/Cellar/jupyterlab/3.0.1/libexec/lib/python3.9/site-packages/reboundx/extras.py in process_messages(self)
    205     def process_messages(self):
    206         try:
--> 207             self._sim.contents.process_messages()
    208         except ValueError: # _sim is NULL
    209             raise AttributeError("REBOUNDx Error: The Simulation instance REBOUNDx was attached to no longer exists. This can happen if the Simulation instance goes out of scope or otherwise gets garbage collected.")

/usr/local/Cellar/jupyterlab/3.0.1/libexec/lib/python3.9/site-packages/rebound/simulation.py in process_messages(self)
    703                 warnings.warn(msg[1:], RuntimeWarning)
    704             elif msg[0]=='e':
--> 705                 raise RuntimeError(msg[1:])
    706 
    707 

RuntimeError: REBOUNDx error: Force 'type_I_migration' not found in REBOUNDx library.

I already tried uninstalling reboundx and installing it again with pip.

Thanks in advance

@dtamayo
Copy link
Owner

dtamayo commented Nov 22, 2022

Thank you for this bug report. I can reproduce your errors, and have narrowed it down to a bug in version 3.7.2. I will work on this tomorrow afternoon, but until then you could use version 3.7.1 (git hash 5df207c) instead.

@dtamayo
Copy link
Owner

dtamayo commented Nov 24, 2022

Hi, it sounds like you have the repository cloned on your computer. Could you navigate to the reboundx directory and run

git fetch origin
git merge origin/master
python setup.py clean --all
pip install -e .

If you still get the same error, can you give me the output of running this in the jupyter notebook?

reboundx.__version__, reboundx.__githash__

@fpazcorrea
Copy link
Author

Hi, thank you very much for your answer, the issue was solved by moving to version 3.7.1.

I installed it via pip (pip install https://github.com/dtamayo/reboundx/archive/5df207c.zip), so as far as I know I do not have the repository cloned, but the output of the last two commands are:
version: '3.7.1'
githash: '47ee9392ba633b93cebbfbf0a56b433df024811f'

Should I clone the repository anyway and run the rest of the commands you indicated or should I just keep using 3.7.1?

@dtamayo
Copy link
Owner

dtamayo commented Nov 29, 2022

Could you try pip install reboundx --upgrade? When you check the version it should say 3.8 for reboundx.version. Do you still get the same error with that?

@fpazcorrea
Copy link
Author

I successfully upgraded to version 3.8 and it does not show any errors now.

Thank you!

@dtamayo dtamayo closed this as completed Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants