Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix: mass_prior_weights uninitialized #172

Merged
merged 1 commit into from
Feb 14, 2018

Conversation

drvdputt
Copy link

@drvdputt drvdputt commented Feb 9, 2018

I was playing around a bit and came across this bug.

mass_prior_weights is not initialized in the 'else' section of the 'if' block. It is then used in the for loop below it. If the 'else' section is entered the first time the 'if' block is evaluated, this leaves mass_prior_weights uninitialized, crashing the program with an error.

Fix suggested: Set to np.zeros(1), just like mass_grid_weights. Would this produce correct behaviour?

mass_prior_weights was not initialized in the 'else' section, en then
used in the for loop below this part of code. Set to np.zeros(1) as a
fix.
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.004%) to 38.676% when pulling 939a653 on drvdputt:bugfix into b68e569 on BEAST-Fitting:master.

@karllark
Copy link
Member

Good catch.

@karllark karllark merged commit 777632b into BEAST-Fitting:master Feb 14, 2018
galaxyumi pushed a commit to galaxyumi/beast that referenced this pull request Jun 7, 2020
Fix: mass_prior_weights uninitialized
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants