Improvements!

This commit is contained in:
Niels Müller
2017-02-02 14:01:37 +01:00
parent 9453b88a88
commit e52768e6de
6 changed files with 9619 additions and 4 deletions

View File

@ -2,7 +2,7 @@
from cpython.array cimport array from cpython.array cimport array
from array import array from array import array
cimport numpy as np #cimport numpy as np
import numpy as np import numpy as np
from utility cimport * from utility cimport *

9586
pygmx/tpxio.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,7 @@
from libc cimport stdio from libc cimport stdio
import numpy as np import numpy as np
cimport numpy as np #cimport numpy as np
from utility cimport * from utility cimport *
from math cimport * from math cimport *

0
pygmx/xtcindex.py Normal file
View File

View File

@ -76,7 +76,6 @@ cdef class XTCReader:
gmx_int64_t cur_step gmx_int64_t cur_step
real start_time, timestep, prec, cur_time real start_time, timestep, prec, cur_time
bint has_cache, has_times bint has_cache, has_times
rvec *coords
array _cache, _times array _cache, _times
public str filename public str filename
@ -208,3 +207,33 @@ cdef class XTCReader:
raise raise
else: else:
raise IndexError('Frame {} is out of range for trajectory of length {}.'.format(frame, len(self))) raise IndexError('Frame {} is out of range for trajectory of length {}.'.format(frame, len(self)))
def __getstate__(self):
# state = self.__dict__.copy()
state = {}
state['natoms'] = self.natoms
state['cur_step'] = self.cur_step
state['start_time'] = self.start_time
state['timestep'] = self.timestep
state['prec'] = self.prec
state['cur_time'] = self.cur_time
state['has_cache'] = self.has_cache
state['has_times'] = self.has_times
state['_cache'] = self._cache
state['filename'] = self.filename
return state
def __setstate__(self, state):
self.natoms = state.pop('natoms')
self.cur_step = state.pop('cur_step')
self.start_time = state.pop('start_time')
self.timestep = state.pop('timestep')
self.prec = state.pop('prec')
self.cur_time = state.pop('cur_time')
self.has_cache = state.pop('has_cache')
self.has_times = state.pop('has_times')
self._cache = state.pop('_cache')
self.filename = state.pop('filename')
self.fio = open_xtc(self.filename.encode(), b'r')
#self.__dict__.update(state)

View File

@ -14,7 +14,7 @@ def check_header_version(include_path):
return return
print('Gromacs version could not be checked.') print('Gromacs version could not be checked.')
include_dirs = [] include_dirs = [numpy.get_include()]
library_dirs = [] library_dirs = []
if 'gromacs' in os.environ.get('LD_LIBRARY_PATH', ''): if 'gromacs' in os.environ.get('LD_LIBRARY_PATH', ''):