Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix off by 1
  • Loading branch information
lewisgross1296 committed Mar 4, 2025
commit 4fdf333f2b26649daffe133e07e23e3108da1d9f
4 changes: 2 additions & 2 deletions openmc/deplete/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,8 @@ def get_source_rates(self) -> np.ndarray:
source_rates = np.fromiter(
(r.source_rate for r in self),
dtype=self[0].source_rate.dtype,
count=len(self),
)
count=len(self)-1,
) # Results duplicates the final source rate at the final simulation time

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.

Let's move this comment above the code.

Suggested change
) # Results duplicates the final source rate at the final simulation time
) # Results duplicate the final source rate at the final simulation time


return source_rates
Comment on lines +466 to +485

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It seems like when I print out the result of this function, it duplicates the final source rate (no matter the integrator chosen). When I change to count=len(self) -1, it prints what I would expect for the source_rates ndarray.

Thinking about this more, it kind of makes sense since get_times() returns an ndarray containing 0 as the first element. If there are N timesteps and N source rates given to the integrator, then in this case, count = len(self) -1 is the correct choice for this function.

Not sure if this is intended, but the final simulation "time" duplicates the system final source rate.


Expand Down