Closed younesdessia closed 10 months ago
I cannot reproduce without using volmdlr objects
yes, me too I can't do it. maybe it's problem with compiled class (I'm not sur !). I will investigate this
Repro case without using volmdlr :
class Point:
def to_dict(self):
return {}
class Vector:
def to_dict(self):
return {}
def __eq__(self, other):
return True
def __hash__(self):
return 0
class Module(DessiaObject):
_standalone_in_db = True
def __init__(self, direction: Vector, origin: Point, name: str = ''):
self.origin = origin
self.direction = direction
DessiaObject.__init__(self, name=name)
class Vessel(DessiaObject):
_standalone_in_db = True
def __init__(self, module: List[Module], name: str = ''):
self.module = module
DessiaObject.__init__(self, name=name)
class Layout(DessiaObject):
_standalone_in_db = True
def __init__(self, vessel: Vessel, name: str = ''):
self.vessel = vessel
DessiaObject.__init__(self, name=name)
vectors = [Vector(), Vector()]
points = [Point(), Point()]
vessel = Vessel(module=[Module(origin=p, direction=v) for p, v in zip(points, vectors)])
dict_ = Layout(vessel=vessel).to_dict()
obj = Layout.dict_to_object(dict_)
**Note: for support questions, please use https://nextcloud.dessia.tech/call/hr9z9bif
I'm submitting a ...
What is the current behavior? error when reading the json saved with version 0.13.8 or master, we have error
Cycles in jsonpointers when check_platform
which can be reproduced with a check_platformIf the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem Avoid reference to other packages
from dessia_common.core import DessiaObject import volmdlr as vm
class Module(DessiaObject): _standalone_in_db = True
class Vessel(DessiaObject): _standalone_in_db = True
class Layout(DessiaObject): _standalone_in_db = True
What is the expected behavior?
What is the motivation / use case for changing the behavior?
Possible fixes
https://github.com/Dessia-tech/dessia_common/pull/645
Please tell us about your environment: