ecole icon indicating copy to clipboard operation
ecole copied to clipboard

Unable to deep copy environment

Open xtjjyygy opened this issue 3 years ago • 3 comments

Describe the problem or improvement suggested

When branching, I want to deep copy multiple branch environments, but copy.deepcopy does not work, error is "TypeError: can't pickle ObservationFunction objects",

Environment like this: image

Thank you

Describe the solution you would like

Describe alternatives you have considered

Additional context

xtjjyygy avatar Jun 17 '22 02:06 xtjjyygy

Hi @xtjjyygy, We'd also love to provide this feature, but there we would need to deep copy a SCIP object, which is not possible right now.

AntoinePrv avatar Jun 27 '22 08:06 AntoinePrv

@AntoinePrv Thank you for your reply, I've tried writing __ deepcopy__ Method to copy multiple inherited classes, but ecole core. scip.Model class No constructor defined,Very frustrating. I wonder if you have a detailed plan to develop this feature. If it is convenient, I can also participate in the development of this feature. Thank you again!

xtjjyygy avatar Jun 30 '22 08:06 xtjjyygy

@AntoinePrv Thank you for your reply, I've tried writing __ deepcopy__ Method to copy multiple inherited classes, but ecole core. scip.Model class No constructor defined,Very frustrating. I wonder if you have a detailed plan to develop this feature. If it is convenient, I can also participate in the development of this feature. Thank you again!

Hello, I have met the same issue, have it been fixed now?

Wastedzz avatar Mar 11 '24 08:03 Wastedzz