Skip to content

Commit

Permalink
Merge pull request #196 from jhnnsnk/review
Browse files Browse the repository at this point in the history
REVIEW:  ```mesocircuit_framework.py```
  • Loading branch information
jhnnsnk authored Sep 21, 2023
2 parents b4d718d + 3894858 commit 20e0790
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions mesocircuit/mesocircuit_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ class MesocircuitExperiment():
Parameters
----------
name_exp : str
name_exp
Name of the experiment. All corresponding data and scripts will be
written to a folder with this name.
custom_params : dict, optional
Dictionary with new parameters or parameter ranges to overwrite the
default ones.
data_dir : str, optional
data_dir
Absolute path to write data to.
load : bool , optional
load
If True, parameters are not newly evaluated and the earlier saved
parameterview and Mesocircuit(s) are loaded.
"""
Expand All @@ -63,9 +63,14 @@ def __init__(self, name_exp='base', custom_params=None, data_dir=None,
else:
self.data_dir = data_dir
self.data_dir_exp = os.path.join(self.data_dir, self.name_exp)

# check if data directory exists
if not os.path.isdir(self.data_dir_exp):
raise Exception(
f'Data directory does not exist: {self.data_dir_exp}')

print(f'Data directory: {self.data_dir_exp}')

# TODO add check if data exists
if not load:
self.parameterview, self.circuits = \
self._evaluate_parameters(custom_params)
Expand Down Expand Up @@ -155,7 +160,7 @@ def _evaluate_parameters(self, custom_params={}):
for sub_paramset in sub_paramspace.iter_inner():
ps_id = helpers.get_unique_id(sub_paramset)

# readd ana_dict and plot_dict to get full paramset
# add ana_dict and plot_dict to get full paramset
# (deep copy of sub_paramset is needed)
paramset = {
**copy.deepcopy(sub_paramset),
Expand Down Expand Up @@ -315,7 +320,7 @@ class Mesocircuit():
Name of the MesocircuitExperiment.
ps_id
Unique parameter set id.
load_parameters : bool
load_parameters
If True, load parameters from file. Sets class attributes for each
dictionary.
"""
Expand Down Expand Up @@ -571,6 +576,8 @@ def _write_jobscripts(self, paramset, path):
"""

if name == 'network':
# the allocator jemalloc is here used for improved
# performance (see Ippen et al., 2017):
# get path to jemalloc
# "which jemalloc" executed on the command line returns
# something like
Expand Down

0 comments on commit 20e0790

Please sign in to comment.