Ignore Cython c files.
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@ -5,3 +5,7 @@ dist/
|
|||||||
.cache/
|
.cache/
|
||||||
*.cpp
|
*.cpp
|
||||||
/gromacs
|
/gromacs
|
||||||
|
logarithmic.*.so
|
||||||
|
logarithmic.c
|
||||||
|
coordinates.*.so
|
||||||
|
coordinates.c
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
|||||||
# distutils: sources = mdevaluate/gromacs/compression.c
|
# distutils: sources = pygmx/gromacs/compression.c
|
||||||
|
|
||||||
from cython cimport view
|
from cython cimport view
|
||||||
from array import array
|
from array import array
|
||||||
@ -19,28 +19,28 @@ cdef extern from "compression.h":
|
|||||||
|
|
||||||
|
|
||||||
def decompress(int size, float precision, minint, maxint, int smallidx, bytes blob):
|
def decompress(int size, float precision, minint, maxint, int smallidx, bytes blob):
|
||||||
|
|
||||||
assert len(minint) == 3
|
assert len(minint) == 3
|
||||||
assert len(maxint) == 3
|
assert len(maxint) == 3
|
||||||
|
|
||||||
cdef int minints[3]
|
cdef int minints[3]
|
||||||
cdef int maxints[3]
|
cdef int maxints[3]
|
||||||
|
|
||||||
for i in range(3):
|
for i in range(3):
|
||||||
minints[i] = minint[i]
|
minints[i] = minint[i]
|
||||||
maxints[i] = maxint[i]
|
maxints[i] = maxint[i]
|
||||||
|
|
||||||
|
|
||||||
cdef np.ndarray[float, ndim=2] coordinates = np.empty((size,3), dtype=np.float32)
|
cdef np.ndarray[float, ndim=2] coordinates = np.empty((size,3), dtype=np.float32)
|
||||||
cdef size_t readed
|
cdef size_t readed
|
||||||
|
|
||||||
xdrfile_decompress_coord_float(
|
xdrfile_decompress_coord_float(
|
||||||
<float *>coordinates.data,
|
<float *>coordinates.data,
|
||||||
size,
|
size,
|
||||||
precision,
|
precision,
|
||||||
maxints,
|
maxints,
|
||||||
minints,
|
minints,
|
||||||
smallidx,
|
smallidx,
|
||||||
blob,
|
blob,
|
||||||
len(blob),
|
len(blob),
|
||||||
&readed)
|
&readed)
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -2,9 +2,9 @@ import xdrlib
|
|||||||
import io
|
import io
|
||||||
import os
|
import os
|
||||||
from .coordinates import decompress
|
from .coordinates import decompress
|
||||||
from ..utils import hash_anything, merge_hashes
|
|
||||||
from functools import partial
|
from functools import partial
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
import hashlib
|
||||||
|
|
||||||
TRR_MAGIC = 1993
|
TRR_MAGIC = 1993
|
||||||
XTC_MAGIC = 1995
|
XTC_MAGIC = 1995
|
||||||
@ -352,7 +352,11 @@ class XTCReader(BaseReader):
|
|||||||
return [self[i].time for i in indices]
|
return [self[i].time for i in indices]
|
||||||
|
|
||||||
def __hash__(self):
|
def __hash__(self):
|
||||||
return merge_hashes(hash_anything(self.filename), hash_anything(self._cache))
|
m = hashlib.md5()
|
||||||
|
m.update(self.filename.encode())
|
||||||
|
m.update(str(self._cache).encode())
|
||||||
|
return int.from_bytes(m.digest(), 'big')
|
||||||
|
# return merge_hashes(hash_anything(self.filename), hash_anything(self._cache))
|
||||||
|
|
||||||
|
|
||||||
class TRRHeader:
|
class TRRHeader:
|
||||||
|
12
setup.py
12
setup.py
@ -35,10 +35,10 @@ library_dirs = [os.path.abspath(p) for p in library_dirs]
|
|||||||
|
|
||||||
|
|
||||||
extensions = [
|
extensions = [
|
||||||
# Extension('mdevaluate.gromacs.coordinates', [
|
Extension('pygmx.gromacs.coordinates', [
|
||||||
# 'mdevaluate/gromacs/coordinates.pyx'], include_dirs=include_dirs),
|
'pygmx/gromacs/coordinates.pyx'], include_dirs=include_dirs),
|
||||||
# Extension('mdevaluate.gromacs.logarithmic', [
|
Extension('pygmx.gromacs.logarithmic', [
|
||||||
# 'mdevaluate/gromacs/logarithmic.pyx'], include_dirs=include_dirs),
|
'pygmx/gromacs/logarithmic.pyx'], include_dirs=include_dirs),
|
||||||
Extension('pygmx.tpxio',
|
Extension('pygmx.tpxio',
|
||||||
sources=['pygmx/tpxio.pyx'],
|
sources=['pygmx/tpxio.pyx'],
|
||||||
include_dirs=include_dirs,
|
include_dirs=include_dirs,
|
||||||
@ -76,8 +76,8 @@ setup(
|
|||||||
name='pygmx',
|
name='pygmx',
|
||||||
description='Python wrapper for gromacs library.',
|
description='Python wrapper for gromacs library.',
|
||||||
author_email='niels.mueller@physik.tu-darmstadt.de',
|
author_email='niels.mueller@physik.tu-darmstadt.de',
|
||||||
packages=['pygmx', ],
|
packages=['pygmx', 'pygmx.gromacs'],
|
||||||
version='0.0.2',
|
version='0.1',
|
||||||
requires=['numpy', 'Cython'],
|
requires=['numpy', 'Cython'],
|
||||||
ext_modules=cythonize(extensions),
|
ext_modules=cythonize(extensions),
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user