mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Consistency check in Discrete.merge method
This commit is contained in:
parent
cf665d076f
commit
178adb0843
1 changed files with 3 additions and 0 deletions
|
|
@ -174,6 +174,9 @@ class Discrete(Univariate):
|
|||
Combined discrete distribution
|
||||
|
||||
"""
|
||||
if len(dists) != len(probs):
|
||||
raise ValueError("Number of distributions and probabilities must match.")
|
||||
|
||||
# Combine distributions accounting for duplicate x values
|
||||
x_merged = set()
|
||||
p_merged = defaultdict(float)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue