From 3a54e3ea47ebd5e9a373b6de5cf848b4b7a67c4c Mon Sep 17 00:00:00 2001 From: Celeste-Melize Ferrus <68361708+cferrus@users.noreply.github.com> Date: Thu, 12 Feb 2026 16:23:31 +0200 Subject: [PATCH] Update independent.py Changed met so it could intake "zsun" as a parameter because the wording of the description made it seem like that was an option. Set metallicity to zsun after zsun is defined. --- src/cosmic/sample/sampler/independent.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/cosmic/sample/sampler/independent.py b/src/cosmic/sample/sampler/independent.py index c135d5fe..6734cc19 100644 --- a/src/cosmic/sample/sampler/independent.py +++ b/src/cosmic/sample/sampler/independent.py @@ -124,7 +124,8 @@ def get_independent_sampler( binfrac_model_msort : `str or float` Same as binfrac_model for M>msort - met : `float` + met : `str or float` + opt for str: "zsun" Sets the metallicity of the binary population where solar metallicity is zsun size : `int` @@ -298,7 +299,11 @@ def get_independent_sampler( mass1_singles = np.asarray(mass1_singles) zsun = kwargs.pop("zsun", 0.02) - + + #if user sets met to "zsun", this gives it zsun's default value or user-inputed value + if met == "zsun": + met = zsun + rad1 = initconditions.set_reff(mass1_binary, metallicity=met, zsun=zsun) rad2 = initconditions.set_reff(mass2_binary, metallicity=met, zsun=zsun)