@@ -83,8 +83,7 @@ def dtype(self) -> str:
8383 attr_type = self .attribute_type
8484 if attr_type is None :
8585 raise NotImplementedError (
86- f"{ self .__class__ .__name__ } must define 'attribute_type' "
87- "(or migrate to AttributeType with 'dtype')"
86+ f"{ self .__class__ .__name__ } must define 'attribute_type' " "(or migrate to AttributeType with 'dtype')"
8887 )
8988 return attr_type
9089
@@ -109,9 +108,7 @@ def put(self, obj: Any) -> Any:
109108 Returns:
110109 Value to store in the database.
111110 """
112- raise NotImplementedError (
113- f"{ self .__class__ .__name__ } must implement put() or migrate to encode()"
114- )
111+ raise NotImplementedError (f"{ self .__class__ .__name__ } must implement put() or migrate to encode()" )
115112
116113 def get (self , value : Any ) -> Any :
117114 """
@@ -126,9 +123,7 @@ def get(self, value: Any) -> Any:
126123 Returns:
127124 Object of the adapted type.
128125 """
129- raise NotImplementedError (
130- f"{ self .__class__ .__name__ } must implement get() or migrate to decode()"
131- )
126+ raise NotImplementedError (f"{ self .__class__ .__name__ } must implement get() or migrate to decode()" )
132127
133128
134129def get_adapter (context : dict | None , adapter_name : str ) -> AttributeType :
@@ -158,8 +153,7 @@ def get_adapter(context: dict | None, adapter_name: str) -> AttributeType:
158153 # Fall back to context-based lookup (legacy system)
159154 if context is None :
160155 raise DataJointError (
161- f"Attribute type <{ adapter_name } > is not registered. "
162- "Use @dj.register_type to register custom types."
156+ f"Attribute type <{ adapter_name } > is not registered. " "Use @dj.register_type to register custom types."
163157 )
164158
165159 try :
@@ -184,8 +178,6 @@ def get_adapter(context: dict | None, adapter_name: str) -> AttributeType:
184178 # Validate the dtype/attribute_type
185179 dtype = adapter .dtype
186180 if not isinstance (dtype , str ) or not re .match (r"^\w" , dtype ):
187- raise DataJointError (
188- f"Invalid dtype '{ dtype } ' in attribute type <{ adapter_name } >"
189- )
181+ raise DataJointError (f"Invalid dtype '{ dtype } ' in attribute type <{ adapter_name } >" )
190182
191183 return adapter
0 commit comments