From 60ddf1d64606dc07ec89dff37b01fa498ecedc41 Mon Sep 17 00:00:00 2001 From: Melissa Rasmussen Date: Sun, 11 Oct 2026 17:58:13 -0700 Subject: [PATCH 1/2] Add massive star medium network to initial model creation routine, and update it to current pynucastro API --- massive_star/convert_large_to_small.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/massive_star/convert_large_to_small.py b/massive_star/convert_large_to_small.py index 1e66b95..d6f6856 100644 --- a/massive_star/convert_large_to_small.py +++ b/massive_star/convert_large_to_small.py @@ -1,13 +1,24 @@ import numpy as np -from pynucastro.networks.rate_collection import Composition +from pynucastro.nucdata import Composition import argparse implemented_networks = { "aprox19": ['h1', 'he3', 'he4', 'c12', 'n14', 'o16', 'ne20', 'mg24', 'si28', 's32', 'ar36', 'ca40', 'ti44', 'cr48', 'fe52', 'fe54', 'ni56', 'n'], + "massive-star-medium": ["n", "h1", "he4", "c12", "o16", + "ne20", "na23", "mg23", "mg24", "al27", + "si27", "si28", "si30", "p29", "p31", + "s30", "s32", "s34", "cl33", "cl35", + "ar34", "ar36", "ar38", "k37", "k39", + "ca38", "ca40", "c42", "sc41", "sc43", + "ti42", "ti44", "ti46", "v45", "v47", "v49", + "cr46", "cr48", "cr50", "cr52", + "mn49", "mn51", "mn53", + "fe50", "fe52", "fe54", "fe56", + "co53", "co55", "co57", "ni56", "ni58", "cu59", "zn60"], } -# the aprox19 nuclei list excludes p_nse. We'll deal with that split by later setting 'p' to 0 +# both typically include p_nse. We'll deal with that split by later setting 'p' to 0 def main(file_name, new_file_name, network): @@ -39,9 +50,8 @@ def main(file_name, new_file_name, network): network_col_names = [] network_col_bulk = [] - c = Composition(large_network) for row in bulk_data: - c.set_array(list(row)[start:end+1]) + c = Composition(dict(zip(large_network, list(row)[start:end+1]))) new_c = c.bin_as(small_network) dictionary = new_c.data dictionary['p'] = 0 From 0cebdc350fd485d949b5d0079ee4a7f9fd5f6f05 Mon Sep 17 00:00:00 2001 From: Melissa Rasmussen Date: Sun, 11 Oct 2026 18:09:29 -0700 Subject: [PATCH 2/2] Composition doesn't support initialization from dictionary --- massive_star/convert_large_to_small.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/massive_star/convert_large_to_small.py b/massive_star/convert_large_to_small.py index d6f6856..19f7f54 100644 --- a/massive_star/convert_large_to_small.py +++ b/massive_star/convert_large_to_small.py @@ -50,8 +50,9 @@ def main(file_name, new_file_name, network): network_col_names = [] network_col_bulk = [] + c = Composition(large_network) for row in bulk_data: - c = Composition(dict(zip(large_network, list(row)[start:end+1]))) + c.set_array(list(row)[start:end+1]) new_c = c.bin_as(small_network) dictionary = new_c.data dictionary['p'] = 0