Make filename a public attribute of XTCReader.
This commit is contained in:
@ -76,7 +76,7 @@ cdef class XTCReader:
|
|||||||
bint has_cache, has_times
|
bint has_cache, has_times
|
||||||
rvec *coords
|
rvec *coords
|
||||||
array _cache, _times
|
array _cache, _times
|
||||||
char *_filename
|
public str filename
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def cache(self):
|
def cache(self):
|
||||||
@ -102,9 +102,9 @@ cdef class XTCReader:
|
|||||||
self._times.append(t)
|
self._times.append(t)
|
||||||
self.has_times = True
|
self.has_times = True
|
||||||
|
|
||||||
@property
|
# @property
|
||||||
def filename(self):
|
# def filename(self):
|
||||||
return self._filename.decode()
|
# return self._filename.decode()
|
||||||
|
|
||||||
def seek(self, int frame):
|
def seek(self, int frame):
|
||||||
if self.has_cache:
|
if self.has_cache:
|
||||||
@ -146,11 +146,14 @@ cdef class XTCReader:
|
|||||||
|
|
||||||
def __cinit__(self):
|
def __cinit__(self):
|
||||||
self.has_cache = False
|
self.has_cache = False
|
||||||
|
self.has_times = False
|
||||||
|
|
||||||
def __init__(self, filename, indexfile=None, make_cache=False):
|
def __init__(self, filename, indexfile=None, make_cache=False):
|
||||||
if isinstance(filename, str):
|
if isinstance(filename, str):
|
||||||
|
self.filename = filename
|
||||||
filename = filename.encode()
|
filename = filename.encode()
|
||||||
self._filename = filename
|
else:
|
||||||
|
self.filename = filename.decode()
|
||||||
|
|
||||||
cdef:
|
cdef:
|
||||||
int step
|
int step
|
||||||
|
Reference in New Issue
Block a user