Skip to content

Bugs in CompactObject/Test_Case/test_EOSgenerators.ipynb #135

Description

@ThibeauWouters

While working on the JOSS review and looking into the CompactObject/Test_Case/test_EOSgenerators.ipynb example notebook, I encountered several issues preventing me from running the notebook

  • from TOVsolver.maxium_central_density import maxium_central_density in the very first import code block throws an error
  • The "Test_Case/Tolos_crust_out.txt" filename path is not found, it should be "Tolos_crust_out.txt" relative to the notebook filepath
  • The first TOV solution that is shown in the documentation page here cannot be reproduced, below is the solution that I obtained after running the code. Similarly, the other TOV solutions looked different on my end compared to the solutions shown on the GitHub.
Image
  • In the DDH EOS section, the equations are not written in math mode.
  • After following the installation instructions, a few packages are missing to run this example notebook: pandas, sympy, and NumbaMinpack are missing. I failed to install NumbaMinpack: please provide installation instructions in your documentation
  • The code to benchmark the EOS generation runtime throws the following error:
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[30], line 4
      1 ### Normal RMF ####
      2 
      3 first_run_time_normal = time.time()
----> 4 eps_fast, pres_fast = RMF.compute_EOS(eps_com, pres_com, theta)
      5 first_run_time_normal = time.time() - first_run_time_normal
      6 
      7 time_for_20_runs_normal = time.time()

File ~/Documents/Code/projects/joss_compactobject/CompactObject/lib/python3.11/site-packages/EOSgenerators/RMF_EOS.py:359, in compute_EOS(eps_crust, pres_crust, theta, return_tag)
    356 dt = 0.05
    357 rho_0 = 0.1505
--> 359 x_init = np.array(initial_values(0.1 * rho_0, theta))
    361 if return_tag:
    362     EoS = [[] for i in range(124)]

File ~/Documents/Code/projects/joss_compactobject/CompactObject/lib/python3.11/site-packages/EOSgenerators/RMF_EOS.py:57, in initial_values(rho, theta)
     53 m_p = 4.7583690772
     55 rho_0 = 0.1505
---> 57 sigma = g_sigma * rho / (m_sig**2)
     58 rho_03 = -g_rho * rho / (2.0 * (m_rho**2))
     59 omega = rho * (
     60     (((m_w**2) / g_omega) + (2.0 * Lambda_w * ((g_rho * rho_03) ** 2) * g_omega))
     61     ** (-1.0)
     62 )

TypeError: unsupported operand type(s) for *: 'function' and 'float'

Lastly, I would recommend an automated action in the GitHub CI/CD to execute such example notebooks, to verify whether they execute fine after installing the required packages and have correct code which is up to date with the code in the package.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions