Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1460 +/- ##
==========================================
+ Coverage 61.91% 61.92% +0.01%
==========================================
Files 208 208
Lines 22334 22365 +31
==========================================
+ Hits 13827 13850 +23
- Misses 8507 8515 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| return "{}/{}".format(".".join(self.__class__.__module__.split(".")[:2]), self.__class__.__name__) | ||
|
|
||
| @classmethod | ||
| def __cls_dtype__(cls): |
There was a problem hiding this comment.
__clstype__ or __ctype__ perhaps?
There was a problem hiding this comment.
ok clstype then, as ctype is a exiting function (C compatible data types)
|
|
||
|
|
||
| def cls_from_dtype(dtype): # type: (...) -> Type[Data] | ||
| def cls_from_dtype(dtype, mro=None): # type: (...) -> Type[Data] |
There was a problem hiding this comment.
i would not call this "mro". method resolution order refers to the mechanism that Python uses to determine which method should be called in a multiple inheritance scenario. but that is not what we do here...
There was a problem hiding this comment.
indeed, we use "inheritance" then
| self._aabb = None | ||
| self._obb = None | ||
|
|
||
| def __get_mro__(self): |
There was a problem hiding this comment.
__clstree__ or __inheritance__ or something like that?
There was a problem hiding this comment.
ok, __inheritance__ and as property
|
@tomvanmele how does this look now? |
|
Very cool change! Could you please revise the data serialization doc page, and add this information? https://compas.dev/compas/latest/userguide/advanced.serialisation.html |
This is to add the ability to deserializing a
datastructureimplementation likeMesh,Graph,Cellnetworketc. to its closest available parent class.For example we want to be able to serialize a
FormDiagramobject usingcompas_tnainto a json. And open same json in another environment withoutcompas_tnainstalled, while loading the same object as its closest available classMesh.An example behaviour:
This is done through inserting an
mro(method resolving order) field into the json dump state, so the decoder can later pickup and use as a backup ifdtypeis not directly found