pynucastro.networks.network_compare module

pynucastro.networks.network_compare module#

Helper functions for comparing the output of different backends (python, C++) for the same network. This will build and run each net and return the ydots.

class pynucastro.networks.network_compare.NetworkCompare(lib, *, use_screening=False, include_amrex=False, include_simple_cxx=True, python_module_name='compare_net.py', amrex_test_path=None, cxx_test_path=None)[source]#

Bases: object

A simple class to manage building a network with different backends to facilitate comparisons.

Parameters:
  • lib (Library) – pynucastro Library containing the rates

  • use_screening (bool) – do we include screening in the comparison (Chugunov 2007)

  • include_amrex (bool) – do we build and evaluate an AmrexAstroCxxNetwork?

  • include_simple_cxx (bool) – do we build and evaluate a SimpleCxxNetwork?

  • python_module_name (str) – the name of the module file to output the python net to

  • amrex_test_path (pathlib.Path) – the Path to output the AMReX C++ source files and build in

  • cxx_test_path (pathlib.Path) – the Path to output the C++ source files and build in

evaluate(rho=200000000.0, T=1000000000.0)[source]#

Evaluate the ydots from all the backends we are considering

Parameters:
  • rho (float) – density to evaluate rates at (CGS)

  • T (float) – temperature to evaluate rates at (K)