Skip to content

Commit d59f835

Browse files
committed
adding docstring
1 parent ad9c62e commit d59f835

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

pipeline/translator.py

+17-1
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,23 @@ def get_edges(self):
263263
return embedded, linked
264264

265265
def get_module_dict(self,class_module_dict):
266-
266+
"""
267+
Updates a dictionary with the class name and its corresponding module based on the schemas.
268+
269+
This method extracts the class name and module from the `_schema_payload` attribute
270+
and updates the provided dictionary (`class_module_dict`) with a mapping of
271+
the class name to its module. If the `_module` key exists in `_schema_payload`
272+
(which was introduced in version 4 of openMINDS), its value is used as the module.
273+
Otherwise, the module is derived from the second-to-last component of the `_type`
274+
field in `_schema_payload`.
275+
276+
Args:
277+
class_module_dict (dict): A dictionary where keys are class names and values
278+
are their corresponding modules.
279+
280+
Returns:
281+
dict: The updated dictionary with the class name and module mapping.
282+
"""
267283
schema_type=self._schema_payload["_type"]
268284
class_name=schema_type.split("/")[-1]
269285
if "_module" in self._schema_payload:

0 commit comments

Comments
 (0)