Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
P pyOPALTools
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 8
    • Issues 8
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 1
    • Merge requests 1
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Code Review
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • OPAL
  • pyOPALTools
  • Issues
  • #75

Closed
Open
Created Mar 26, 2020 by snuverink_j@snuverink_jDeveloper

H5Parser method to close files

From Sebastian Thomas:

I have a question concerning the H5Parser https://gitlab.psi.ch/OPAL/pyOPALTools/blob/master/opal/parser/H5Parser.py

I'm not an extremely experienced coder, but shouldn't the file opened in H5Parser.parse("file") via

self.__h5f = h5py.File(fname, 'r')

be closed again? Wenn I use the parser on an H5 file in a juyter notebook, I run into some problems because for example OPAL tries to delete the monitor output, but is not allowed to, due to the file "beeing in use". I ask mainly out of curiosity.

Since h5py 2.4 opened file will automatically close: http://docs.h5py.org/en/stable/whatsnew/2.4.html#files-will-now-auto-close

However, if the H5Parser still exists, this will not work, and it would be nice to have a manual option to close the file.

Proposal is to add a specific close method to H5Parser, as discussed with @frey_m.

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking