Skip to content
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

Made LiquidMetalInterface instance pickable #209

Merged
merged 1 commit into from
Nov 15, 2024

Conversation

lelaus
Copy link
Collaborator

@lelaus lelaus commented Nov 14, 2024

The reason why a LiquidMetalInterface instance was not pickable was because a lambda function was used in the __add_property() method.

The solution implemented is to replace such lambda function passed to setattr() in the __add_property() method with the private __property_info() method of the LiquidMetalInterface class. This way pickle can reference the name of such private method. This also implies the need to use functools.partial to define the method to add to the LiquidMetalInterface instance in __add_property(), so that you can only define the method to call and not call it.

…ner function in LiquidMetalInterface class
@lelaus lelaus added the enhancement New feature or request label Nov 14, 2024
@lelaus lelaus added this to the Release of v3.0.0 milestone Nov 14, 2024
@lelaus lelaus requested a review from panDanieleN November 14, 2024 18:35
@panDanieleN panDanieleN merged commit 1853391 into master Nov 15, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants