Commit c297f842 authored by Erik Fransson's avatar Erik Fransson

try to make dynasor run with python3

parent 6faba413
......@@ -68,7 +68,7 @@ def get_itraj(filename: str, step: int=1, max_frames: int=0,
assert step > 0
assert max_frames >= 0
if max_frames == 0:
max_frames = sys.maxint
max_frames = sys.maxsize
elif step > 1:
max_frames = max_frames * step
......@@ -134,7 +134,7 @@ class iwindow:
def __iter__(self):
return self
def next(self):
def __next__(self):
""" Returns next element in sequence. """
if self._window is None:
self._window = deque(islice(self._it, self.width), self.width)
......
......@@ -27,6 +27,7 @@ import numpy as np
from itertools import count, islice
from functools import partial
from collections import deque
import dsf.filon as filon
from dsf.binner import fixed_bin_averager
......@@ -319,9 +320,8 @@ if __name__ == '__main__':
a, b, c = reference_box = f0['box']
reference_volume = abs(np.dot(np.cross(a, b), c))
particle_types = index.get_section_names()
particle_counts = map(len, index.get_section_indices())
particle_counts = list(deque(map(len, index.get_section_indices())))
particle_densities = [n / reference_volume for n in particle_counts]
logger.info('Trajectory file: %s' % options.trajectory)
logger.info('-- With a total of %i particles, %i types.' % (
f0['N'], len(particle_types)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment