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

Ksagiyam/io do not use pickle #2787

Merged
merged 2 commits into from
Mar 13, 2023
Merged

Conversation

ksagiyam
Copy link
Contributor

@ksagiyam ksagiyam commented Feb 24, 2023

Use repr instead of pickling.

Involves a minor fix in UFL, so depends on firedrakeproject/ufl#34

@ksagiyam ksagiyam force-pushed the ksagiyam/io_do_not_use_pickle branch 2 times, most recently from 20e4d76 to 8b99dbc Compare February 24, 2023 13:13
@ksagiyam ksagiyam force-pushed the ksagiyam/io_do_not_use_pickle branch from 8b99dbc to 2e070b4 Compare March 8, 2023 13:45
firedrake/bcs.py Outdated
@@ -347,11 +347,11 @@ def function_arg(self, g):
try:
g = as_ufl(g)
self._function_arg = g
except UFLException:
except BaseException:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ValueError

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.


def _load_ufl_element(self, path, name):
if self.has_attr(path, name + "_repr"):
return eval(self.get_attr(path, name + "_repr"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

locals = {}
globals = {}
eval("from ufl import *", locals, globals)
return eval(self.get_attr(path, name + "_repr"), locals, globals)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Copy link
Member

@dham dham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor quibble.

@ksagiyam ksagiyam force-pushed the ksagiyam/io_do_not_use_pickle branch 2 times, most recently from 93ce8e7 to 8c07488 Compare March 10, 2023 11:08
@ksagiyam ksagiyam force-pushed the ksagiyam/io_do_not_use_pickle branch 2 times, most recently from cca43bc to 29b1266 Compare March 13, 2023 16:42
@ksagiyam ksagiyam merged commit f528253 into master Mar 13, 2023
@ksagiyam ksagiyam deleted the ksagiyam/io_do_not_use_pickle branch March 13, 2023 16:42
@ksagiyam
Copy link
Contributor Author

Merged as discussed.

stephankramer added a commit to thetisproject/thetis that referenced this pull request Aug 18, 2023
Checkpoints should now hopefully be more stable after firedrakeproject/firedrake#2787
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants