Skip to content

Conversation

@ftalbrecht
Copy link
Contributor

just FYI

PY2 = sys.version_info.major == 2

try:
from pymor.core.pickle import dumps, load
Copy link
Owner

Choose a reason for hiding this comment

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

I would prefer to not let have simdb any special cases for pyMOR. One could think of some mechanism, however, to customize pickling.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I ran across the need to use pyMORs more advanced pickling in simdb quite often in the recent past, so any mechanism in simdb would be appreciated.


@atexit.register
def _exit_hook():
declare_finished()
Copy link
Owner

Choose a reason for hiding this comment

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

What is the benefit of these changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In an interactive (notebook) session, I want to manually declare the run finished to start postprocessing. In particular in a notebook, the run is only declared finished upon closing the notebook, so any code relying on asserting that the current run is finished usually requires a notebook restart, and so on...

dump({kk: vv}, f, protocol=-1)
except PicklingError as e:
print(f'could not pickle "{kk}"')
raise e
Copy link
Owner

Choose a reason for hiding this comment

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

This seems helpful. Can you make a separate PR for it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

see #10

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.

3 participants