Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fixed calculate_distance_line showing nu_diff < 0 #1317

Merged
merged 2 commits into from
Oct 10, 2020

Conversation

Rodot-
Copy link
Contributor

@Rodot- Rodot- commented Oct 9, 2020

Description

When running calculate_distance_line, once in a while nu_diff would be computed as a negative number. In the C version, when computing the distance to a line, there is first a check to see if we're at the last line in the list. If we are, we return MISS_DISTANCE instead. The numba code had a check that returned MISS_DISTANCE but it checked if nu_line was 0 instead of checking if we were at the last line.

How Has This Been Tested?

I've run an example tardis config with both the numba and C versions. The numba version no longer complains about negative nu_diff values and the spectra seem consistent between eachother.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have assigned/requested two reviewers for this pull request.

Rodot- added 2 commits October 9, 2020 12:51
…the last line and if so return MISS_DISTANCE. This resolved the negative nu_diff issues
@wkerzendorf wkerzendorf merged commit 0feb68e into tardis-sn:numba_montecarlo Oct 10, 2020
atharva-2001 pushed a commit to atharva-2001/tardis that referenced this pull request Oct 1, 2021
* Added fix for computing distances to line where we check if we're at the last line and if so return MISS_DISTANCE.  This resolved the negative nu_diff issues

* I forgot to actually modiify the conditional
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants