Skip to content

Commit

Permalink
Merge pull request #70 from nomad-coe/mdanalysis-cleanup
Browse files Browse the repository at this point in the history
Implement clean up function for mdanalysis
  • Loading branch information
ladinesa authored Oct 17, 2023
2 parents a3a33dd + 689317e commit 33ae2ef
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions atomisticparsers/gromacs/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -1066,3 +1066,5 @@ def parse(self, filepath, archive, logger):
self.parse_input()

self.parse_workflow()

self.traj_parser.clean()
6 changes: 6 additions & 0 deletions atomisticparsers/utils/mdanalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#

import numpy as np
import os
try:
import MDAnalysis
import MDAnalysis.analysis.rdf as MDA_RDF
Expand Down Expand Up @@ -529,3 +530,8 @@ def get_nojump_positions(self, selection):
nojump_positions.append(selection.positions - delta)

return np.array(nojump_positions)

def clean(self):
for name in os.listdir(self.maindir):
if name.startswith('.') and (name.endswith('.lock') or name.endswith('.npz')):
os.remove(os.path.join(self.maindir, name))
Binary file removed tests/data/gromacs/argon/.traj.trr_offsets.npz
Binary file not shown.
Binary file not shown.
Binary file removed tests/data/gromacs/water/.traj.trr_offsets.npz
Binary file not shown.

0 comments on commit 33ae2ef

Please sign in to comment.