3333
3434# 3rd party
3535import attr
36- import lxml . etree # type: ignore
36+ import lxml # type: ignore
3737import pandas # type: ignore
3838from attr_utils .docstrings import add_attrs_doc
3939from attr_utils .serialise import serde
40- from domdf_python_tools .bases import Dictable
4140from domdf_python_tools .doctools import prettify_docstrings
4241
4342# this package
43+ from mh_utils import Dictable
4444from mh_utils .utils import element_to_bool , strip_string
4545from mh_utils .worklist_parser .columns import Column , columns
4646from mh_utils .worklist_parser .enums import AttributeType
@@ -70,8 +70,6 @@ def __init__(
7070 sample_info : Optional [dict ] = None ,
7171 ):
7272
73- super ().__init__ ()
74-
7573 if isinstance (id , UUID ):
7674 self .id = id
7775 else :
@@ -112,8 +110,7 @@ def from_xml(
112110 sample_info = parse_sample_info (element .SampleInfo , user_columns ),
113111 )
114112
115- @property
116- def __dict__ (self ):
113+ def to_dict (self ):
117114 data = {}
118115 for key in self .__slots__ :
119116 if key == "id" :
@@ -153,8 +150,6 @@ def __init__(
153150 checksum : "Checksum" ,
154151 ):
155152
156- super ().__init__ ()
157-
158153 self .version = float (version )
159154 self .locked_run_mode = bool (locked_run_mode )
160155 self .instrument_name = str (instrument_name )
@@ -165,8 +160,7 @@ def __init__(
165160
166161 __slots__ = ["version" , "user_columns" , "jobs" , "checksum" , "locked_run_mode" , "instrument_name" , "params" ]
167162
168- @property
169- def __dict__ (self ):
163+ def to_dict (self ):
170164 data = {}
171165 for key in self .__slots__ :
172166 data [key ] = getattr (self , key )
@@ -332,7 +326,7 @@ def __repr__(self) -> str:
332326 if self .undefined :
333327 return f"{ self .__class__ .__name__ } (Undefined)"
334328 else :
335- slots = self .__slots__ # type: ignore[attr-defined] # attrs adds __slots__ but mypy doesn't know
329+ slots = self .__slots__
336330 values = ", " .join (f"{ x } ={ getattr (self , x )!r} " for x in slots if x != "__weakref__" )
337331 return f"{ self .__class__ .__name__ } ({ values } )"
338332
0 commit comments