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

jupyter investigation to close any open h5 file handles so not to reuse old data #527

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

PhilipDeegan
Copy link
Member

@PhilipDeegan PhilipDeegan commented Apr 12, 2021

add exit registers closing any still existing h5file handles

@PhilipDeegan PhilipDeegan force-pushed the ipython branch 4 times, most recently from 2429a0b to 9b54bf9 Compare April 12, 2021 11:44
@PHAREHUB PHAREHUB deleted a comment from lgtm-com bot Apr 13, 2021
@PHAREHUB PHAREHUB deleted a comment from lgtm-com bot Apr 13, 2021
@PhilipDeegan
Copy link
Member Author

if you feel like testing this @nicolasaunai maybe it will resolve #526

@PhilipDeegan PhilipDeegan added experimental pharebook running PHARE from python notebooks labels Apr 27, 2021
@PhilipDeegan PhilipDeegan force-pushed the ipython branch 2 times, most recently from 4c7e078 to 6304e5e Compare May 3, 2021 13:37
@lgtm-com
Copy link

lgtm-com bot commented May 3, 2021

This pull request introduces 1 alert when merging 6304e5e into 4e7c94b - view on LGTM.com

new alerts:

  • 1 for Unused import

Copy link
Member

@nicolasaunai nicolasaunai left a comment

Choose a reason for hiding this comment

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

after reading the PR I wonder: isn't the problem actually that we never close the files explicitly? when reading with hierarchy_fromh5, there is never a data_file.close()

def callback():
fun()
ip.events.unregister('post_execute', callback)
ip.events.register('post_execute', callback)
Copy link
Member

Choose a reason for hiding this comment

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

probably not indented correclty?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's been some time since looking at this, and I'm pretty sure I had another later branch with modifications which I never added so it's quite likely

@nicolasaunai
Copy link
Member

after reading the PR I wonder: isn't the problem actually that we never close the files explicitly? when reading with hierarchy_fromh5, there is never a data_file.close()

ok probably not a good idea.
calling data_file.close() will make all our dataset become <Closed HDF5 dataset> and the only way to keep our data would then be to really read it, i.e. not storing the dataset like here but storing the dataset[:] which may loose the nice if/when h5 offers us... (not sure I'm clear?)

@PhilipDeegan
Copy link
Member Author

after reading the PR I wonder: isn't the problem actually that we never close the files explicitly? when reading with hierarchy_fromh5, there is never a data_file.close()

instead of closing the object, we could try to just reset it with a new handle = h5open(...)

and if that doesn't work we should probably ask the h5py people

@nicolasaunai nicolasaunai marked this pull request as draft October 17, 2023 08:23
@nicolasaunai
Copy link
Member

converted to draft since not sure it's needed, see #526

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
experimental pharebook running PHARE from python notebooks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants