Skip to content

Speed up time correction factors - #3592

Merged
paulromano merged 3 commits into
openmc-dev:developfrom
shimwell:speed-up-time_correction_factors
Oct 3, 2025
Merged

paulromano merged 3 commits into
openmc-dev:developfrom
shimwell:speed-up-time_correction_factors

Conversation

@shimwell

@shimwell shimwell commented Oct 2, 2025

Copy link
Copy Markdown
Member

Description

speeds up the time_correction_factors function by vectorizing more of the calculation.

Fixes # (issue)

Checklist

  • I have performed a self-review of my own code
  • I have followed the style guidelines for Python source files (if applicable)

@shimwell
shimwell requested a review from paulromano as a code owner October 2, 2025 12:36

@paulromano paulromano 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.

What is the motivation to speed this up? In my experience, computing these time correction factors takes a fraction of a second.

@shimwell

shimwell commented Oct 2, 2025

Copy link
Copy Markdown
Member Author

What is the motivation to speed this up? In my experience, computing these time correction factors takes a fraction of a second.

I was originally tring to speed up the apply_time_correction function. Unfortunatly I couldn't see any way to speed it up. I call it around 1000 times when running post processing on d1s results (tens of plasma shots with extra data points between and cooling dasta points). Speed up in this function would be helpful as the post processing time is not insignificant for this use case. Then i got distracted and tried to speed up the wrong function :-)

@paulromano
paulromano enabled auto-merge (squash) October 3, 2025 13:02
@paulromano
paulromano merged commit 50071aa into openmc-dev:develop Oct 3, 2025
14 checks passed
Grego01-biot pushed a commit to Grego01-biot/openmc that referenced this pull request Oct 27, 2025
Co-authored-by: Jon Shimwell <jon@proximafusion.com>
Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
apingegno pushed a commit to apingegno/openmc that referenced this pull request May 7, 2026
Co-authored-by: Jon Shimwell <jon@proximafusion.com>
Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
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.

3 participants