Skip to content

Commit

Permalink
More specific use of seeds in generate_lems_file_for_neuroml()
Browse files Browse the repository at this point in the history
Update to v0.3.4
  • Loading branch information
pgleeson committed Nov 9, 2017
1 parent 93e216d commit ed135e5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
3 changes: 1 addition & 2 deletions examples/create_new_lems_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,4 @@
gen_saves_for_only_populations = [], # List of populations, all pops if = []
gen_saves_for_quantities = {}, # Dict with file names vs lists of quantity paths
gen_spike_saves_for_all_somas = True,
copy_neuroml = True,
seed=None)
copy_neuroml = True)
2 changes: 1 addition & 1 deletion pyneuroml/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@


__version__ = '0.3.3'
__version__ = '0.3.4'

JNEUROML_VERSION = '0.8.3'
3 changes: 1 addition & 2 deletions pyneuroml/analysis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,7 @@ def analyse_spiketime_vs_dt(nml2_file,
'.',
gen_plots_for_all_v = True,
gen_saves_for_all_v = True,
copy_neuroml = False,
seed=None)
copy_neuroml = False)

if simulator == 'jNeuroML':
results = pynml.run_lems_with_jneuroml(lems_file_name, nogui=True, load_saved_data=True, plot=False, verbose=verbose)
Expand Down
9 changes: 5 additions & 4 deletions pyneuroml/lems/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,18 @@ def generate_lems_file_for_neuroml(sim_id,
gen_spike_saves_for_cells = {}, # Dict with file names vs lists of quantity paths
spike_time_format='ID_TIME',
copy_neuroml = True,
seed=None):
lems_file_generate_seed=None,
simulation_seed=12345):


if seed:
random.seed(seed) # To ensure same LEMS file (e.g. colours of plots) are generated every time for the same input
if lems_file_generate_seed:
random.seed(lems_file_generate_seed) # To ensure same LEMS file (e.g. colours of plots) are generated every time for the same input

file_name_full = '%s/%s'%(target_dir,lems_file_name)

print_comment_v('Creating LEMS file at: %s for NeuroML 2 file: %s (copy: %s)'%(file_name_full,neuroml_file,copy_neuroml))

ls = LEMSSimulation(sim_id, duration, dt, target)
ls = LEMSSimulation(sim_id, duration, dt, target,lems_seed=simulation_seed)

if nml_doc == None:
nml_doc = read_neuroml2_file(neuroml_file, include_includes=True, verbose=True)
Expand Down

0 comments on commit ed135e5

Please sign in to comment.