Skip to content
This repository has been archived by the owner on Mar 22, 2024. It is now read-only.

fix memory leaks #16

Merged
merged 1 commit into from
Nov 23, 2020
Merged

fix memory leaks #16

merged 1 commit into from
Nov 23, 2020

Conversation

manonreau
Copy link
Collaborator

No description provided.

Copy link
Member

@NicoRenaud NicoRenaud left a comment

Choose a reason for hiding this comment

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

Looks good ! let's hope it fixed the oom error

@@ -199,7 +199,11 @@ def load_one_graph(self, fname, mol):
#print('Load mol :', mol)

f5 = h5py.File(fname, 'r')
Copy link
Member

Choose a reason for hiding this comment

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

a usual way of writing is is

with h5py.File(fname,'r') as f5:
     grp = f5[mol]

so that you are sure that the file is closed when the scope of the with statement is finshed

@NicoRenaud
Copy link
Member

I've also added a code quality analysis. By default it's rather picky and now it flags a new trailing space. That's why we have the little red cross next to the commit. Depending on which editor you use you can install automatic formatting tools that fixes these small issues on save. Currently we mostly us VS code and there are tons of tools to format python code automatically

@manonreau manonreau merged commit 86b4f20 into master Nov 23, 2020
@manonreau manonreau deleted the fix_memory_issues branch December 3, 2020 08:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants