Skip to content

Commit

Permalink
Update MolSys.py
Browse files Browse the repository at this point in the history
  • Loading branch information
alsinmr committed Mar 11, 2024
1 parent 958dace commit 7910123
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Selection/MolSys.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ def files(self):
return [self.mda_traj.filename] #Always return a list

class MolSelect():
def __init__(self,molsys:MolSys=None,topo:str=None,traj_files:list=None,t0:int=0,tf:int=None,step:int=1,dt:float=None,project=None):
def __init__(self,topo:str=None,traj_files:list=None,molsys:MolSys=None,t0:int=0,tf:int=None,step:int=1,dt:float=None,project=None):
"""
Provide either a MolSys object, or provide a topology file (usually pdb)
to generate a selection (MolSelect) object.
Expand Down Expand Up @@ -512,6 +512,11 @@ def __init__(self,molsys:MolSys=None,topo:str=None,traj_files:list=None,t0:int=0
"""
assert not(molsys is None and topo is None),'Either molsys or topo must be provided'


if isinstance(topo,clsDict['MolSys']):
molsys=topo
topo=None

if molsys is None:
molsys=MolSys(topo=topo,traj_files=traj_files,t0=t0,tf=tf,step=step,dt=dt,project=project)

Expand Down

0 comments on commit 7910123

Please sign in to comment.