Skip to content

Fix Legendre coefficients in AngleDistribution.from_endf - #4058

Merged
GuySten merged 1 commit into
openmc-dev:developfrom
paulromano:fix-angle-distribution-coefficients
Aug 8, 2026
Merged

Fix Legendre coefficients in AngleDistribution.from_endf#4058
GuySten merged 1 commit into
openmc-dev:developfrom
paulromano:fix-angle-distribution-coefficients

Conversation

@paulromano

Copy link
Copy Markdown
Contributor

Description

While working on another feature, I noticed that the Legendre coefficients read in AngleDistribution.from_endf are wrong. This happens because of the line [1.0] + al where al are the higher-order Legendre coefficients. It used to be a list so [1.0] + al made sense but when we switched to the endf module, al is now a numpy array so doing [1.0] + al adds 1 to every entry by array broadcasting. The updated code fixes that.

Checklist

  • I have performed a self-review of my own code
  • I have run clang-format (version 18) on any C++ source files (if applicable)
  • I have followed the style guidelines for Python source files (if applicable)
  • I have made corresponding changes to the documentation (if applicable)
  • I have added tests that prove my fix is effective or that my feature works (if applicable)

@GuySten GuySten added the Bugs label Aug 8, 2026

@GuySten GuySten left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@GuySten
GuySten enabled auto-merge (squash) August 8, 2026 17:41
@GuySten
GuySten merged commit 9a62e43 into openmc-dev:develop Aug 8, 2026
17 checks passed
@paulromano
paulromano deleted the fix-angle-distribution-coefficients branch August 8, 2026 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants