-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: pickling skeletons #90
Comments
Doing some more digging on this question. It's looking like the answer is no from here: Specifically I think this rule is probably being violated:
For example here where classes are being defined within the C++ implementation, though I'm not 100% on whether this technically violates the rule. https://github.com/scikit-geometry/scikit-geometry/blob/master/src/skeleton.cpp#L84 And there is no fallback provided per this rule:
So if I'm understanding everything correctly, to support pickling, each class would need to have a getstate member function added to it which returned a dictionary that captured its state, along with a setstate member function would would allow this state to be restored (with appropriate supporting CGAL calls assuming they are available.) Something along the lines of: https://docs.python.org/3/library/pickle.html#handling-stateful-objects |
Hi there,
I tried pickling a polygon-with-holes straight skeleton today and got an error. Example code to illustrate what I'm doing:
error:
My hope was to cache off this data structure as it takes quite a while to compute for my problem. Is this a bug, a limitation, or just something I'm doing wrong? Or do I need to unpack everything I need out of the skel object into lists/dictionaries and pickle that instead?
Didn't see any similar issues for this project and don't see a forum identified for questions, so adding this issue here. Apologies if there is a preferred other place to ask (e.g., stack overflow, etc.)
Thank you!
Josh.
The text was updated successfully, but these errors were encountered: