Skip to content

Commit

Permalink
Minor updates to Chunker, FrameObj, MolSys
Browse files Browse the repository at this point in the history
  • Loading branch information
alsinmr committed Jan 31, 2024
1 parent 706e4dd commit ed26661
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Frames/FrameChunker.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def complete_chunks(self):
def partial_chunk(self):
"""
If a chunk was partially completed, this determines how many data
objects of that chunk were finised
objects of that chunk were finished
Returns
-------
Expand Down
6 changes: 3 additions & 3 deletions Frames/eval_fr.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def __init__(self,select=None,molecule=None):
self.__frames_loaded=False #Flag to check if frames currently loaded
self.include=None #Record of which frames were included in calculation
self.mode=self.defaults['mode']
self.sampling_info={'tf':None,'dt':None,'n':None,'nr':None} #Record the sampling info
self.sampling_info={'tf':None,'dt':None,'n':None,'nr':None,'t0':None} #Record the sampling info

self.return_index=ReturnIndex(**self.terms)
self.t=None
Expand Down Expand Up @@ -351,8 +351,8 @@ def load_frames(self,n=-1,nr=10,index=None):
tf=len(self.select.traj)
index=sparse_index(tf,n,nr)
if self.__frames_loaded:
if np.all(self.vecs['index']==index):return
self.sampling_info={'tf':tf,'dt':self.select.traj.dt/1e3,'n':n,'nr':nr}
if np.all(self.vecs['index']==index) and self.sampling_info['t0']==self.traj.t0:return
self.sampling_info={'tf':tf,'dt':self.select.traj.dt/1e3,'n':n,'nr':nr,'t0':self.traj.t0}
self.vecs=mol2vec(self,index=index)
self.__frames_loaded=True
self.include=None #If new frames loaded, we should re-set what frames used for correlation functions
Expand Down
2 changes: 1 addition & 1 deletion Selection/MolSys.py
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ def del_sel(self,index) -> None:
for i in index:self.del_sel(i)
return

for f in ['sel1','sel2','_repr_sel','label']:
for f in ['sel1','sel2','_repr_sel','_label']:
v=getattr(self,f)
if v is not None and len(v):
setattr(self,f,np.delete(v,index))
Expand Down

0 comments on commit ed26661

Please sign in to comment.