Skip to content

Commit ed7c4d5

Browse files
authored
Merge pull request #339 from upibhalla/master
Fix to CaConc to factor in valence of 2. Update to rdesigneur to hand…
2 parents 3aa66d4 + 1b48ce7 commit ed7c4d5

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

biophysics/CaConcBase.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
#include "../basecode/ElementValueFinfo.h"
1313
#include "CaConcBase.h"
1414

15+
#define VALENCE 2
16+
1517
///////////////////////////////////////////////////////
1618
// MsgSrc definitions
1719
///////////////////////////////////////////////////////
@@ -76,7 +78,7 @@ const Cinfo* CaConcBase::initCinfo()
7678
"Volume scaling factor. "
7779
"Deprecated. This is a legacy field from GENESIS and exposes "
7880
"internal calculations. Please do not use. \n"
79-
"B = 1/(vol * F) so that it obeys:\n"
81+
"B = 1/(vol * F* VALENCE) so that it obeys:\n"
8082
"dC/dt = B*I_Ca - C/tau",
8183
&CaConcBase::setB,
8284
&CaConcBase::getB
@@ -260,7 +262,7 @@ void CaConcBase::updateDimensions( const Eref& e )
260262
double coreRadius = diameter_ / 2.0 - thickness_;
261263
vol -= PI * coreRadius * coreRadius * length_;
262264
}
263-
double B = 1.0 / ( FaradayConst * vol );
265+
double B = 1.0 / ( VALENCE* FaradayConst * vol );
264266
vSetB( e, B );
265267
}
266268

python/rdesigneur/rdesigneur.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,7 +1249,6 @@ def _assignComptNamesFromKkit( self ):
12491249
comptList[0].name = 'dend'
12501250
return comptList
12511251
if not self._isModelFromKkit():
1252-
print( "Not isModelfromKkit" )
12531252
return comptList
12541253
sortedComptList = sorted( comptList, key=lambda x: -x.volume )
12551254
if self.addSomaChemCompt:
@@ -1393,7 +1392,11 @@ def _configureSolvers( self ) :
13931392

13941393
def _loadChem( self, fname, chemName ):
13951394
chem = moose.Neutral( '/library/' + chemName )
1396-
modelId = moose.loadModel( fname, chem.path, 'ee' )
1395+
pre, ext = os.path.splitext( fname )
1396+
if ext == '.xml' or ext == '.sbml':
1397+
modelId = moose.mooseReadSBML( fname, chem.path )
1398+
else:
1399+
modelId = moose.loadModel( fname, chem.path, 'ee' )
13971400
comptlist = moose.wildcardFind( chem.path + '/#[ISA=ChemCompt]' )
13981401
if len( comptlist ) == 0:
13991402
print("loadChem: No compartment found in file: ", fname)

0 commit comments

Comments
 (0)