Skip to content

Commit

Permalink
set seed=None in sim() by default and reset it to int(time.time()) in…
Browse files Browse the repository at this point in the history
… function's body, as default arg in python func is fixed when func is defined
  • Loading branch information
Vladislav BALAGURA committed Mar 5, 2020
1 parent 50ca0e9 commit abba6cb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion BxB.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@ def sim(n_points = 5000, n_turns = [1000, 1000, 0, 5000], kick_model = "precise"
n_sigma_cut = 5,
density_and_field_interpolators_n_cells_along_grid_side = [500, 500],
n_random_points_to_check_interpolation = 10000,
select_one_turn_out_of = 1000, seed = int(time.time()), output_dir = "tmp",
select_one_turn_out_of = 1000, seed = None, output_dir = "tmp",
output = "integrals_per_turn avr_xy_per_turn integrals_per_particle avr_xy_per_particle points"):
'''
Helper function returning "Sim" structure with the parameters of the simulation to be used
in the "beam_beam()" function. Not specified parameters are filled with the default values.
'''
if seed is None:
seed = int(time.time())
return Sim(n_points = n_points, n_turns = n_turns, kick_model = kick_model,
n_sigma_cut = n_sigma_cut,
density_and_field_interpolators_n_cells_along_grid_side =
Expand Down

0 comments on commit abba6cb

Please sign in to comment.