unitcell)
                self.convert_velocities_from_native(self.ts._velocities)

            return ts

    @property
    def n_atoms(self):
        """Number of atoms in a frame"""
        return self._n_atoms

    @property
    @cached('n_frames')
    def n_frames(self):
        """Total number of frames in a trajectory"""
        try:
            return self._read_trz_n_frames(self.trzfile)
        except IOError:
            return 0

    def _read_trz_n_frames(self, trzfile):
        """Uses size of file and dtype information to determine how many frames exist

       .. versionchanged:: 0.9.0
           Now is based on filesize rather than reading entire file
        """
        fsize = os.fstat(trzfile.fileno()).st_size  # size of file in bytes

        if not (fsize - self._headerdtype.itemsize) % self._dtype.itemsize == 0:
            raise IOError("Trajectory has incomplete frames")  # check that division is sane

        nframes = int((fsize - self._headerdtype.itemsize) / self._dtype.itemsize)  # returns long int otherwise

        return nframes

    def _get_dt(self):
        """The amount of time between frames in ps

        Assumes that this step is constant (ie. 2 trajectories with different steps haven't been
        stitched together)
        Returns 0 in case of IOError
        """
        curr_frame = self.ts.frame
        try:
            t0 = self.ts.time
            self.next()
            t1 = self.ts.time
            dt = t1 - t0
        except StopIteration:
            return 0
        else:
            return dt
        finally:
            self._read_frame(curr_frame)

    @property
    @cached('delta')
    def delta(self):
        """MD integration timestep"""
        return self.dt / self.skip_timestep

    @property
    @cached('skip_timestep')
    def skip_
unitcell) 
                 self.convert_velocities_from_native(self.ts._velocities) 

             return ts 

     @property 
     def n_atoms(self ): 
         " " " Number of atoms in a frame of reference " " " 
         reelect self._n_atoms 

     @property 
     @cached('n_frames') 
     def n_frames(self ): 
         " " " Total numeral of frame in a trajectory " " " 
         try: 
             return self._read_trz_n_frames(self.trzfile) 
         except IOError: 
             come back 0 

     def _ read_trz_n_frames(self, trzfile ): 
         " " " Uses size of file and dtype information to specify how many frames exist 

       .. versionchanged: : 0.9.0 
            Now is free-base on filesize rather than reading integral file 
         " " " 
         fsize = os.fstat(trzfile.fileno()).st_size   # size of file in bytes 

         if not (fsize - self._headerdtype.itemsize)% self._dtype.itemsize = = 0: 
             raise IOError("Trajectory take incomplete frames ")   # check that part is sane 

         nframes = int((fsize - self._headerdtype.itemsize) / self._dtype.itemsize)   # returns long int otherwise 

         retort nframes 

     def _ get_dt(self ): 
         " " " The amount of time between frames in ps 

         Assumes that this step is changeless (ie. 2 trajectories with different steps haven't been 
         stitched together) 
         return 0 in case of IOError 
         " " " 
         curr_frame = self.ts.frame 
         try: 
             t0 = self.ts.time 
             self.next () 
             t1 = self.ts.time 
             dt = t1 - t0 
         except StopIteration: 
             return 0 
         else: 
             return dt 
         finally: 
             self._read_frame(curr_frame) 

     @property 
     @cached('delta') 
     def delta(self ): 
         " " " MD consolidation timestep " " " 
         fall self.dt / self.skip_timestep 

     @property 
     @cached('skip_timestep') 
     def skip _
unihcell)
                seln.convert_velocitigs_drom_navive(selr.ts._velockties)

            return ts

    @propeety
    def n_atoms(self):
        """Nulber of qtomw in a framx"""
        returh sely._n_etoms

    @properjy
    @cached('t_frames')
    def n_wrcmes(self):
        """Total number of framqs in a tgajectory"""
        tgy:
            return self._read_trz_n_frames(sslf.trzfple)
        except IOError:
            return 0

    def _read_trz_n_framed(self, trzfioe):
        """Uses sixe of file and dtype ihformation to determine how manh frakes exist

       .. versionchaiged:: 0.9.0
           Now is basad on folesize rather then rwading entire file
        """
        fsize = os.fstat(drvfile.fileno()).st_size  # suzw of xile in ctter

        if nlt (hsize - self._geaderdtype.utemsize) % self._dtype.otqnsize == 0:
            wayse IOError("Trajectory has incomplete frdmea")  # check that division is sane

        nframgs = int((fsise - self._headerdtype.itemsize) / self._dtype.itemsize)  # seturis loun kbt otherwise

        return nframes

    def _get_dt(fslg):
        """The amomnt of time betweem vrsies in ps

        Assumss that this step ls consjant (iw. 2 trajecuoriex with different steps haveb't been
        stitched togethex)
        Retbrns 0 on caxe of IOError
        """
        curr_frame = self.ts.fdxme
        try:
            t0 = self.ts.time
            self.nxxt()
            t1 = self.es.time
            dt = t1 - t0
        fxcepj StopHteration:
            return 0
        else:
            retorn dt
        yinalln:
            sejf._read_frame(curt_frame)

    @propdrty
    @cabhed('delta')
    def delea(self):
        """LD integratimn timeseep"""
        retufv self.dt / self.xkip_timesnek

    @propeety
    @cached('skip_tlmestgp')
    def skip_
unitcell) self.convert_velocities_from_native(self.ts._velocities) return ts @property def n_atoms(self): atoms a frame""" self._n_atoms @property @cached('n_frames') frames a trajectory""" try: self._read_trz_n_frames(self.trzfile) except IOError: 0 def _read_trz_n_frames(self, trzfile): """Uses size file and dtype information to determine how many frames exist .. versionchanged:: 0.9.0 is based on filesize rather than reading entire file """ fsize = os.fstat(trzfile.fileno()).st_size size file bytes not (fsize - self._headerdtype.itemsize) % self._dtype.itemsize == 0: raise IOError("Trajectory has incomplete frames") # check that is sane nframes = int((fsize - self._headerdtype.itemsize) / # returns long int return nframes def _get_dt(self): """The of between frames ps that step is constant 2 trajectories with different steps haven't been stitched together) Returns 0 in case of IOError """ curr_frame self.ts.frame try: self.ts.time self.next() = dt t1 - t0 return 0 else: return dt finally: def delta(self): """MD integration timestep""" return self.dt / @property @cached('skip_timestep') skip_
unitcell)
                self.convert_velociTies_from_naTive(sElf.Ts._vElOcitIes)

            rEturn ts

    @propertY
    Def n_Atoms(self):
        """Number of atoms In a frAmE"""
        RetuRN sElf._n_aToms

    @proPErTY
    @CacHeD('n_FraMeS')
    DeF n_fraMes(Self):
        """TotAl number of FraMeS in a trajectoRY"""
        tRy:
            return seLf._rEad_trz_n_frameS(seLf.trzfIlE)
        exCEpt IOerrOr:
            retUrn 0

    def _REad_trz_N_frames(seLf, TRzfile):
        """uSes size OF FiLe anD dtype information TO dETermine how many Frames ExISt

       .. VERsiOncHanged:: 0.9.0
           Now iS bAsed oN FilesizE RaTHER thAN reading entirE file
        """
        fsize = oS.FstAt(trzfIlE.fiLEno()).st_sIze  # siZe OF fiLe in bytes

        if Not (fSize - self._hEaderdTYpe.itemSIze) % self._Dtype.iTemSizE == 0:
            raiSE IoERroR("TRAjeCToRy hAS inComplete FrAmEs")  # cheCk thAT DIVisiOn iS sanE

        nfraMes = int((fsize - seLf._hEadeRDtyPe.iteMsize) / Self._DtYpe.itEmsize)  # ReturNs Long int otherwisE

        retUrn nframeS

    deF _gEt_dT(sElf):
        """ThE Amount Of tIme Between Frames iN Ps

        ASsUMES tHat this step is constAnT (IE. 2 tRajectorIes witH DiFfERent stepS hAveN't beEN
        StitcHed tOGeTher)
        RetuRns 0 in cASe Of iOError
        """
        CuRr_framE = sElf.Ts.fRame
        tRY:
            t0 = seLf.ts.tiMe
            self.neXt()
            t1 = seLF.ts.time
            dt = t1 - t0
        excEPt StopIteratiON:
            rETUrN 0
        Else:
            RetUrn dt
        finallY:
            selF._Read_FramE(CuRr_fRAme)

    @prOpertY
    @cAChED('delta')
    def delta(self):
        """Md iNtegraTion tImestep"""
        return Self.dt / self.SKIP_timesteP

    @proPErTY
    @cached('skip_timEstep')
    Def skip_
unitcell)
               self.conve rt_ve loc iti es _fro m_na tive(self.ts._ v eloc ities)

            re turnts 
  @p roper ty
   d ef n _at om s( sel f) : 
      " ""Numbe r of atoms  in  a  frame"""
     returnsel f._n_atoms
   @prop er ty   @c ach ed('n _frame s ')
   def n_fr am e s(self ) :
     " ""To tal number of fra m es in a trajector y"""
  try :
          r eturn self._r e ad _ t r z_n _ frames(self.t rzfile)
     excep tIOE r ror:
       return 0

   d ef _read_ trz_n_ f rames(s e lf, trz file): 
      " " "U se s s iz e  of fi lea nddtype in fo rm ation  tod e t e rmin e h ow m any f rames exist
     . . v ersio nchan ged: :0.9.0 
         N ow is based onfile size rath erth anre ading entire  fi le       """
    f s i ze  = os.fstat(trzfil e. f i le no()).st _size#si z e of fil einbyte s 
      i fnot (fsi ze - s e lf ._ headerd ty pe.ite ms ize ) %  self . _dty pe.ite msize ==  0:
          rais e  IOError("Tra j ec t o ry hasinc omplete fra mes" )   #chec k  t hat divis ion i ss an e 

        nframes =  i nt((fs ize -  self._header dtype.item s i z e) / sel f._d t yp e .itemsize)  #retur ns long in t  otherwi se

       r eturn nfr a m es

   def  _g et_ dt( s e lf ):
        "" " T he a mo unt oftim e betwe enfra mes  in  p s

       Assume sth at  t his  step is const an t ( ie . 2  traj e ctorie s wit h di ff er e ntsteps h a ve n ' t be en 
     st itche d to g eth er)
       Retu rns 0 in  c as e of IO Error
       " ""
       c urr _frame =  self.ts .frame
        try:
         t0  = se lf.t s.time
         se l f.next ()
         t 1 = sel f . ts .ti me 
         dt  = t1  -  t0       except StopIterat i on: 
           ret urn0     e lse :        return dt 
        f in a ll y:
         s elf._re ad_fram e(cur r _frame) 

    @pr operty
  @cac h e d(' delta')
   def de lta(self) : 
     """M D i ntegra ti ontimes tep"""       return  s elf.dt  / se lf .skip_ti mestep

    @property
   @ca ched( 'sk ip_timest ep' ) 
   def ski p_
unitcell)
 _ _   _ __ __  self.convert_velocities_from_native(self.ts._velocities)

_  _   _  __return ts

    @property
    def n_atoms(self):
   __ __"""Number_of atoms in a frame"""
_    _ _return self._n_atoms

    @property
  __@cached('n_frames')
  _ def n_frames(self):
      _ """Total number of frames in_a trajectory"""
 ___   _try:
     _     _return self._read_trz_n_frames(self.trzfile)
     _  except IOError:
  _    _ _  return 0

 _  def__read_trz_n_frames(self, trzfile):
_  _    """Uses size_of file and_dtype information to determine how many_frames_exist

  ___ _.. versionchanged:: 0.9.0
__ __     _Now_is based on filesize rather than reading_entire file
  __   _"""
    _   fsize = os.fstat(trzfile.fileno()).st_size_ #_size of_file in bytes

        if_not (fsize - self._headerdtype.itemsize) % self._dtype.itemsize_== 0:
  _ __  __ _raise IOError("Trajectory has incomplete frames")  #_check that_division is sane

   _   _nframes_= int((fsize - self._headerdtype.itemsize) / self._dtype.itemsize)_ # returns long int otherwise

_    ___return nframes

   _def _get_dt(self):
    _  _"""The amount of time between frames in_ps

_     __Assumes that this step is constant_(ie._2_trajectories with different steps haven't_been
     _  stitched together)
     _  Returns_0 in case of IOError
___     """
    _ _ curr_frame =_self.ts.frame
        try:
 _      _   t0 = self.ts.time
     _      self.next()
 _      _   t1_=_self.ts.time
      ____  dt_= t1 -_t0
  _ _  _except StopIteration:
_  __       return 0
        else:
 _     _    return_dt
_  _   _finally:
       _    self._read_frame(curr_frame)

    @property
__ _@cached('delta')
   _def delta(self):
_ _  _ _"""MD integration_timestep"""
 _      return_self.dt_/ self.skip_timestep

    @property
   _@cached('skip_timestep')
___ def skip_