-
Notifications
You must be signed in to change notification settings - Fork 197
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
Python: useful error when initialize_warpx
not called before creating ParticleContainerWrapper
#5412
Conversation
I would suggest handling this in a different way. Now, the issue is that the |
Got it, thanks for the feedback! |
for more information, see https://pre-commit.ci
Ok, I've modified the PR to now lazy initialize the particle container (and boundary buffers) only when they're first needed instead of in |
Changes made. That's definitely a lot cleaner. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This looks good to me.
Currently, WarpX is initialized when
sim.step
is called, or when the user callsinitialize_warpx
. However, if the user tries to create aParticleContainerWrapper
before this point, they get an error along the following lines:This is confusing. When I got this, I assumed I had maybe installed WarpX wrong. I added a catch for this exception that re-raises it with some additional context that should help direct the user to call
initialize_warpx