Skip to content

Now closing dagmc h5 file after getting material names from file#84

Closed
shimwell wants to merge 2 commits intodevelopfrom
fixing-closure-of-dagmc-h5-file-when-reading-names
Closed

Now closing dagmc h5 file after getting material names from file#84
shimwell wants to merge 2 commits intodevelopfrom
fixing-closure-of-dagmc-h5-file-when-reading-names

Conversation

@shimwell
Copy link
Owner

@shimwell shimwell commented Jan 5, 2026

Description

when getting the material names from a DAGMC file it appears that we don't close the file afterwards.

This PR change the code to use a context manager which automatically closes the file for us.

Fixes # (issue)

Checklist

  • I have performed a self-review of my own code
  • I have followed the style guidelines for Python source files (if applicable)

@coveralls
Copy link

Pull Request Test Coverage Report for Build 20722776927

Details

  • 7 of 8 (87.5%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall first build on fixing-closure-of-dagmc-h5-file-when-reading-names at 82.154%

Changes Missing Coverage Covered Lines Changed/Added Lines %
openmc/dagmc.py 7 8 87.5%
Totals Coverage Status
Change from base Build 20717559605: 82.2%
Covered Lines: 55202
Relevant Lines: 64321

💛 - Coveralls

@shimwell shimwell closed this Jan 27, 2026
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