Skip to content
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

Add the option to fix the random seed #599

Merged
merged 6 commits into from Jul 11, 2023
Merged

Conversation

RemiLehe
Copy link
Member

@RemiLehe RemiLehe commented Jul 6, 2022

This addresses #48.

Note that this will affect the following parts of FBPIC which rely on random numbers:

@RemiLehe RemiLehe changed the title [WIP] Add the option to fix the random seed Add the option to fix the random seed Jul 7, 2022
@RemiLehe RemiLehe requested a review from MKirchen July 7, 2022 14:08
@@ -87,7 +87,7 @@ def run_simulation( gamma_boost, show ):
zmax, zmin = boost.copropag_length( [zmax_lab, zmin_lab], beta_object=1. )
sim = Simulation( Nz, zmax, Nr, rmax, Nm, dt,
dens_func=None, zmin=zmin, boundaries={'z':'periodic', 'r':'reflective'},
use_cuda=use_cuda )
use_cuda=use_cuda, random_seed=0 )
Copy link
Member Author

Choose a reason for hiding this comment

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

This ensures that the new feature is being used in at least one automated test.

@RemiLehe
Copy link
Member Author

RemiLehe commented Oct 6, 2022

Let us actually create a separate free function, that can be called at the beginning of the script, and include it in some of the examples.

@@ -75,7 +75,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = 'en'
Copy link
Member Author

Choose a reason for hiding this comment

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

This is unrelated to the rest of the PR, but I took advantage of this PR to quickly clean up conf.py.

Copy link
Contributor

@MKirchen MKirchen left a comment

Choose a reason for hiding this comment

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

Thanks for this PR!

@MKirchen MKirchen merged commit c28a619 into fbpic:dev Jul 11, 2023
1 check passed
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.

None yet

2 participants