-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
subconn with KeyError raise that is slightly more descriptive batch and netParams supporting '.' traversal updated the secList to not break when a section (generally axon) without pt3d exists
- Loading branch information
Showing
3 changed files
with
14 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -192,6 +192,8 @@ def save(self, filename): | |
sim.saveJSON(filename, dataSave) | ||
|
||
def setCfgNestedParam(self, paramLabel, paramVal): | ||
if '.' in paramLabel: #TODO [email protected] 195196 replace with my crawler code? | ||
paramLabel = paramLabel.split('.') | ||
if isinstance(paramLabel, tuple): | ||
container = self.cfg | ||
for ip in range(len(paramLabel) - 1): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -238,7 +238,13 @@ def subcellularConn(self, allCellTags, allPopTags): | |
|
||
gridY = subConnParam['density']['gridY'] | ||
gridSigma = subConnParam['density']['gridValues'] | ||
somaX, somaY, _ = posFromLoc(postCell.secs['soma'], 0.5) # get cell pos move method to Cell! | ||
#TODO [email protected] 241247 'soma' is not always the name of the soma section | ||
try: | ||
somaX, somaY, _ = posFromLoc(postCell.secs['soma'], 0.5) # get cell pos move method to Cell! | ||
except KeyError: | ||
raise KeyError( | ||
"Error in subcellularConn: there is no section named soma in cell {}".format(postCell.gid) | ||
) | ||
if 'fixedSomaY' in subConnParam['density']: # is fixed cell soma y, adjust y grid accordingly | ||
fixedSomaY = subConnParam['density'].get('fixedSomaY') | ||
gridY = [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -694,7 +694,7 @@ def addCellParamsSecList(self, label, secListName, somaDist=None, somaDistY=None | |
return | ||
|
||
secList = [] | ||
for secName, sec in cellRule.secs.items(): | ||
for secName, sec in cellRule['secs'].items(): | ||
if 'pt3d' in sec['geom']: | ||
pt3d = sec['geom']['pt3d'] | ||
midpoint = int(len(pt3d) / 2) | ||
|
@@ -708,8 +708,8 @@ def addCellParamsSecList(self, label, secListName, somaDist=None, somaDistY=None | |
secList.append(secName) | ||
|
||
else: | ||
print('Error adding secList: Sections do not contain 3d points') | ||
return | ||
#TODO [email protected] 711713 more descriptive message, don't break on axon. | ||
print("Error adding {} to {}: {} does not contain 3d points".format(secName, secListName, secName)) | ||
|
||
cellRule.secLists[secListName] = list(secList) | ||
|
||
|
@@ -832,6 +832,8 @@ def todict(self): | |
return replaceDictODict(self.__dict__) | ||
|
||
def setNestedParam(self, paramLabel, paramVal): | ||
if '.' in paramLabel: #TODO [email protected] 835836 replace with my crawler code? | ||
paramLabel = paramLabel.split('.') | ||
if isinstance(paramLabel, list): | ||
container = self | ||
for ip in range(len(paramLabel) - 1): | ||
|