Mentions légales du service

Skip to content
Snippets Groups Projects
Commit c2da34ac authored by NADAL Morgane's avatar NADAL Morgane
Browse files

changed __slots__ initialization

parent 15c95e8f
No related branches found
No related tags found
No related merge requests found
...@@ -55,10 +55,12 @@ class extension_t(glial_cmp_t): ...@@ -55,10 +55,12 @@ class extension_t(glial_cmp_t):
def __init__(self): def __init__(self):
# #
super().__init__() super().__init__()
self.end_points = None for slot in self.__class__.__slots__:
self.scales = None setattr(self, slot, None)
self.soma_uid = None # self.end_points = None
self.__cache__ = None # self.scales = None
# self.soma_uid = None
# self.__cache__ = None
@classmethod @classmethod
def FromMap(cls, lmp: array_t, scales: array_t, uid: int) -> extension_t: def FromMap(cls, lmp: array_t, scales: array_t, uid: int) -> extension_t:
......
...@@ -45,11 +45,13 @@ class glial_cmp_t: ...@@ -45,11 +45,13 @@ class glial_cmp_t:
def __init__(self): def __init__(self):
# #
self.uid = None # type: Optional[int] for slot in self.__class__.__slots__:
self.sites = None # type: Optional[np_array_picker_h] setattr(self, slot, None)
self.connection_path = None # type: Optional[Dict[int, py_array_picker_h]] # self.uid = None # type: Optional[int]
self.extensions = None # type: Optional[List[glial_cmp_t]] # self.sites = None # type: Optional[np_array_picker_h]
self.img_shape = None # type: Optional[Tuple[int, ...]] # self.connection_path = None # type: Optional[Dict[int, py_array_picker_h]]
# self.extensions = None # type: Optional[List[glial_cmp_t]]
# self.img_shape = None # type: Optional[Tuple[int, ...]]
def InitializeFromMap(self, bmp: array_t, uid: int) -> None: def InitializeFromMap(self, bmp: array_t, uid: int) -> None:
# #
......
...@@ -53,14 +53,16 @@ class soma_t(glial_cmp_t): ...@@ -53,14 +53,16 @@ class soma_t(glial_cmp_t):
# #
__slots__ = ("contour_points", "centroid", "skl_graph", "ext_roots", "graph_roots") __slots__ = ("contour_points", "centroid", "skl_graph", "ext_roots", "graph_roots")
def __init__(self): # TODO: Initialize with a for def __init__(self):
# #
super().__init__() super().__init__()
self.contour_points = None for slot in self.__class__.__slots__:
self.centroid = None setattr(self, slot, None)
self.skl_graph = None # self.contour_points = None
# self.centroid = None
# self.skl_graph = None
self.ext_roots = [] self.ext_roots = []
self.graph_roots = None # self.graph_roots = None
@classmethod @classmethod
def FromMap(cls, lmp: array_t, uid: int) -> soma_t: def FromMap(cls, lmp: array_t, uid: int) -> soma_t:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment