Skip to content

Commit

Permalink
Updated core.py, adding a wrapper function that takes args, while the…
Browse files Browse the repository at this point in the history
… underlying functions takes specific arguments (so they can be called from jupyter notebooks etc).
  • Loading branch information
Hjorthmedh committed Sep 21, 2023
1 parent 3b97119 commit 8a59e37
Show file tree
Hide file tree
Showing 3 changed files with 213 additions and 138 deletions.
20 changes: 9 additions & 11 deletions snudda/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def snudda_cli():
help="Path to neurons_dir, default is $DATA/neurons (DEPRECATED, use --snudda_data instead")
init_parser.add_argument("-overwrite", "--overwrite", help="Allow overwriting of old directory",
action="store_true")
init_parser.add_argument("-connectionFile", "--connectionFile", default=None,
init_parser.add_argument("-connectionFile", "--connectionFile", default=None, dest="connection_file",
help="Use connectivity from user specified JSON file")
init_parser.add_argument("-randomseed", "--randomseed", "--seed", default=None, help="Random seed", type=int)
init_parser.add_argument("--profile", help="Run python cProfile", action="store_true")
Expand Down Expand Up @@ -74,7 +74,6 @@ def snudda_cli():
detect_parser.add_argument("-parallel", "--parallel", action="store_true", default=False)
detect_parser.add_argument("-ipython_profile", "--ipython_profile", default=None)


prune_parser = sub_parsers.add_parser("prune")
prune_parser.add_argument("path", help="Location of network")
prune_parser.add_argument("-randomseed", "--randomseed", "--seed", default=None, help="Random seed", type=int)
Expand All @@ -90,7 +89,6 @@ def snudda_cli():
prune_parser.add_argument("-parallel", "--parallel", action="store_true", default=False)
prune_parser.add_argument("-ipython_profile", "--ipython_profile", default=None)


input_parser = sub_parsers.add_parser("input")
input_parser.add_argument("path", help="Location of network")
input_parser.add_argument("--input", help="Input json config file (for input setup)", default=None)
Expand Down Expand Up @@ -154,15 +152,15 @@ def snudda_cli():

snudda = Snudda(args.path)

actions = {"init": snudda.init_config,
"place": snudda.place_neurons,
"detect": snudda.touch_detection,
"prune": snudda.prune_synapses,
"input": snudda.setup_input,
"export": snudda.export_to_SONATA,
"convert": snudda.export_to_SONATA,
actions = {"init": snudda.init_config_wrapper,
"place": snudda.place_neurons_wrapper,
"detect": snudda.touch_detection_wrapper,
"prune": snudda.prune_synapses_wrapper,
"input": snudda.setup_input_wrapper,
"export": snudda.export_to_SONATA_wrapper,
"convert": snudda.export_to_SONATA_wrapper,
"analyse": snudda.analyse,
"simulate": snudda.simulate,
"simulate": snudda.simulate_wrapper,
"help": snudda.help_info}

if not hasattr(args, 'ipython_profile'):
Expand Down
Loading

0 comments on commit 8a59e37

Please sign in to comment.