%matplotlib inline

import pynucastro as pyrl

"""
Explanation: Interactive Network Exploration with pynucastro
This notebook shows off the interactive RateCollection network plot.
You must have widgets enabled.


Jupyter notebook:
  jupyter nbextension enable --py --user widgetsnbextension
  for a user install or
  jupyter nbextension enable --py --sys-prefix widgetsnbextension
  for a system-wide installation


Jupyter lab:
  jupyter labextension install @jupyter-widgets/jupyterlab-manager
End of explanation
"""


files = ["c12-pg-n13-ls09", 
         "c13-pg-n14-nacr",
         "n13--c13-wc12",
         "n13-pg-o14-lg06",
         "n14-pg-o15-im05",
         "n15-pa-c12-nacr",
         "o14--n14-wc12",
         "o15--n15-wc12",
         "o14-ap-f17-Ha96c",
         "f17-pg-ne18-cb09",
         "ne18--f18-wc12",
         "f18-pa-o15-il10"]
rc = pyrl.RateCollection(files)

"""
Explanation: This collection of rates has the main CNO rates plus a breakout rate into the hot CNO cycle
End of explanation
"""


comp = pyrl.Composition(rc.get_nuclei())
comp.set_solar_like()

"""
Explanation: To evaluate the rates, we need a composition.  This is defined using a list of Nuceli objects.
End of explanation
"""


re = pyrl.Explorer(rc, comp)
re.explore()

"""
Explanation: Interactive exploration is enabled through the Explorer class, which takes a RateCollection and a Composition
End of explanation
"""


