@@ -541,7 +541,14 @@ def acc_label(self):
541541class ArbLocation (Location ):
542542 """Arbor Location"""
543543
544- pass
544+ def instantiate (self , sim = None , icell = None ): # pylint: disable=W0613
545+ """Find the instantiate compartment (default implementation)"""
546+ raise EPhysLocInstantiateException (
547+ '%s not supported in NEURON.' % type (self ).__name__ )
548+
549+ def __str__ (self ):
550+ """String representation"""
551+ return '%s \' %s\' ' % (type (self ).__name__ , self .acc_label ().defn )
545552
546553
547554class ArbSegmentLocation (ArbLocation ):
@@ -552,19 +559,10 @@ def __init__(self, name, segment, comment=''):
552559 super ().__init__ (name , comment )
553560 self .segment = segment
554561
555- def instantiate (self , sim = None , icell = None ): # pylint: disable=W0613
556- """Find the instantiate compartment"""
557- raise EPhysLocInstantiateException (
558- '%s not supported in NEURON.' % type (self ).__name__ )
559-
560562 def acc_label (self ):
561563 """Arbor label"""
562564 return ArbLabel ('region' , self .name , '(segment %s)' % (self .segment ))
563565
564- def __str__ (self ):
565- """String representation"""
566- return '%s \' %s\' ' % (type (self ).__name__ , self .acc_label ().defn )
567-
568566
569567class ArbBranchLocation (ArbLocation ):
570568 """Branch in an Arbor morphology.
@@ -576,19 +574,10 @@ def __init__(self, name, branch, comment=''):
576574 super ().__init__ (name , comment )
577575 self .branch = branch
578576
579- def instantiate (self , sim = None , icell = None ): # pylint: disable=W0613
580- """Find the instantiate compartment"""
581- raise EPhysLocInstantiateException (
582- '%s not supported in NEURON.' % type (self ).__name__ )
583-
584577 def acc_label (self ):
585578 """Arbor label"""
586579 return ArbLabel ('region' , self .name , '(branch %s)' % (self .branch ))
587580
588- def __str__ (self ):
589- """String representation"""
590- return '%s \' %s\' ' % (type (self ).__name__ , self .acc_label ().defn )
591-
592581
593582class ArbSegmentRelLocation (ArbLocation ):
594583 """Relative position on a segment in an Arbor morphology.
@@ -599,21 +588,12 @@ def __init__(self, name, segment, pos, comment=''):
599588 self .segment = segment
600589 self .pos = pos
601590
602- def instantiate (self , sim = None , icell = None ): # pylint: disable=W0613
603- """Find the instantiate compartment"""
604- raise EPhysLocInstantiateException (
605- '%s not supported in NEURON.' % type (self ).__name__ )
606-
607591 def acc_label (self ):
608592 """Arbor label"""
609593 return ArbLabel ('locset' , self .name ,
610594 '(on-components %s (segment %s))' %
611595 (format_float (self .pos ), self .segment ))
612596
613- def __str__ (self ):
614- """String representation"""
615- return '%s \' %s\' ' % (type (self ).__name__ , self .acc_label ().defn )
616-
617597
618598class ArbBranchRelLocation (ArbLocation ):
619599 """Relative position on a branch in an Arbor morphology.
@@ -626,21 +606,12 @@ def __init__(self, name, branch, pos, comment=''):
626606 self .branch = branch
627607 self .pos = pos
628608
629- def instantiate (self , sim = None , icell = None ): # pylint: disable=W0613
630- """Find the instantiate compartment"""
631- raise EPhysLocInstantiateException (
632- '%s not supported in NEURON.' % type (self ).__name__ )
633-
634609 def acc_label (self ):
635610 """Arbor label"""
636611 return ArbLabel ('locset' , self .name ,
637612 '(location %s %s)' %
638613 (self .branch , format_float (self .pos )))
639614
640- def __str__ (self ):
641- """String representation"""
642- return '%s \' %s\' ' % (type (self ).__name__ , self .acc_label ().defn )
643-
644615
645616class ArbLocsetLocation (ArbLocation ):
646617 """Arbor location set defined by a user-supplied string (S-expression).
@@ -650,19 +621,10 @@ def __init__(self, name, locset, comment=''):
650621 super ().__init__ (name , comment )
651622 self .locset = locset
652623
653- def instantiate (self , sim = None , icell = None ): # pylint: disable=W0613
654- """Find the instantiate compartment"""
655- raise EPhysLocInstantiateException (
656- '%s not supported in NEURON.' % type (self ).__name__ )
657-
658624 def acc_label (self ):
659625 """Arbor label"""
660626 return ArbLabel ('locset' , self .name , self .locset )
661627
662- def __str__ (self ):
663- """String representation"""
664- return '%s %s' % (type (self ).__name__ , self .acc_label ().defn )
665-
666628
667629class ArbRegionLocation (ArbLocation ):
668630 """Arbor region defined by a user-supplied string (S-expression).
@@ -672,19 +634,10 @@ def __init__(self, name, region, comment=''):
672634 super ().__init__ (name , comment )
673635 self .region = region
674636
675- def instantiate (self , sim = None , icell = None ): # pylint: disable=W0613
676- """Find the instantiate compartment"""
677- raise EPhysLocInstantiateException (
678- '%s not supported in NEURON.' % type (self ).__name__ )
679-
680637 def acc_label (self ):
681638 """Arbor label"""
682639 return ArbLabel ('region' , self .name , self .region )
683640
684- def __str__ (self ):
685- """String representation"""
686- return '%s %s' % (type (self ).__name__ , self .acc_label ().defn )
687-
688641
689642class EPhysLocInstantiateException (Exception ):
690643
0 commit comments