Skip to content

Commit

Permalink
updates needed for regression test file creation
Browse files Browse the repository at this point in the history
  • Loading branch information
karllark committed Aug 16, 2024
1 parent de8c8ae commit 31df919
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion beast/observationmodel/ast/make_ast_input_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def pick_models_toothpick_style(
else:
# ... do not include this model again, since we will reject it
# anyway.
include_mask[idxs == rand_idx] = False
include_mask[idxs == rand_idx[r]] = False

Check warning on line 188 in beast/observationmodel/ast/make_ast_input_list.py

View check run for this annotation

Codecov / codecov/patch

beast/observationmodel/ast/make_ast_input_list.py#L188

Added line #L188 was not covered by tests

# Add the approved models
chosen_idxs.extend(rand_idx[add_these])
Expand Down
6 changes: 5 additions & 1 deletion beast/physicsmodel/grid_and_prior_weights.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def compute_distance_age_mass_metallicity_weights(
dist_prior_weights /= np.sum(dist_prior_weights)
dist_weights = dist_grid_weights * dist_prior_weights

# correct for any non-unformity in the number size of the
# correct for any non-uniformity in the number size of the
# age-mass grids between metallicity points
total_dist_grid_weight /= np.sum(total_dist_grid_weight)
total_dist_prior_weight /= np.sum(total_dist_prior_weight)
Expand Down Expand Up @@ -180,6 +180,10 @@ def compute_age_mass_metallicity_weights(
mass_prior = mass_prior_model

Check warning on line 180 in beast/physicsmodel/grid_and_prior_weights.py

View check run for this annotation

Codecov / codecov/patch

beast/physicsmodel/grid_and_prior_weights.py#L180

Added line #L180 was not covered by tests

# deal with repeat masses - happens for MegaBEAST
# and have discovred this can happen even for a standard BEAST run
# as sometimes two masses in an isochrone are exactly the same
# new code for MegaBEAST is more correct as then the grid weight
# will be correctly set for any repeated masses
cur_masses = np.unique(_tgrid_single_age["M_ini"])
n_masses = len(_tgrid_single_age["M_ini"])
if len(cur_masses) < n_masses:
Expand Down

0 comments on commit 31df919

Please sign in to comment.