From ba87760a965ce94a546c61e6223315648763b8d3 Mon Sep 17 00:00:00 2001 From: Max Linke Date: Mon, 7 Dec 2015 07:58:25 +0100 Subject: [PATCH] make offsets a property in xtc.pyx --- package/MDAnalysis/lib/formats/xtc.c | 1915 +++++++++++++----------- package/MDAnalysis/lib/formats/xtc.pyx | 29 +- 2 files changed, 1078 insertions(+), 866 deletions(-) diff --git a/package/MDAnalysis/lib/formats/xtc.c b/package/MDAnalysis/lib/formats/xtc.c index a040e0bf691..a5dc22f9fc2 100644 --- a/package/MDAnalysis/lib/formats/xtc.c +++ b/package/MDAnalysis/lib/formats/xtc.c @@ -908,6 +908,8 @@ struct __pyx_obj_10MDAnalysis_3lib_7formats_3xtc_XTCFile { int current_frame; PyObject *mode; PyArrayObject *box; + PyArrayObject *_offsets; + int _has_offsets; }; @@ -1336,6 +1338,8 @@ static int __Pyx_SetVtable(PyObject *dict, void *vtable); static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); +static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name); + typedef struct { int code_line; PyCodeObject* code_object; @@ -1390,8 +1394,6 @@ static PyObject* __pyx_print_kwargs = 0; static int __Pyx_PrintOne(PyObject* stream, PyObject *o); -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value); - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); #if CYTHON_CCOMPLEX @@ -1647,6 +1649,7 @@ static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_10MDAnalysis_3lib_7formats_3xtc_ int __pyx_module_is_main_MDAnalysis__lib__formats__xtc = 0; /* Implementation of 'MDAnalysis.lib.formats.xtc' */ +static PyObject *__pyx_builtin_property; static PyObject *__pyx_builtin_IOError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_StopIteration; @@ -1724,6 +1727,7 @@ static char __pyx_k_exists[] = "exists"; static char __pyx_k_format[] = "format"; static char __pyx_k_import[] = "__import__"; static char __pyx_k_name_2[] = "__name__"; +static char __pyx_k_setter[] = "setter"; static char __pyx_k_struct[] = "struct"; static char __pyx_k_unpack[] = "unpack"; static char __pyx_k_IOError[] = "IOError"; @@ -1731,11 +1735,13 @@ static char __pyx_k_exc_val[] = "exc_val"; static char __pyx_k_float32[] = "float32"; static char __pyx_k_fortran[] = "fortran"; static char __pyx_k_memview[] = "memview"; +static char __pyx_k_offsets[] = "offsets"; static char __pyx_k_os_path[] = "os.path"; static char __pyx_k_Ellipsis[] = "Ellipsis"; static char __pyx_k_allclose[] = "allclose"; static char __pyx_k_exc_type[] = "exc_type"; static char __pyx_k_itemsize[] = "itemsize"; +static char __pyx_k_property[] = "property"; static char __pyx_k_TypeError[] = "TypeError"; static char __pyx_k_enumerate[] = "enumerate"; static char __pyx_k_self_mode[] = "self.mode"; @@ -1744,23 +1750,21 @@ static char __pyx_k_ValueError[] = "ValueError"; static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static char __pyx_k_MemoryError[] = "MemoryError"; static char __pyx_k_RuntimeError[] = "RuntimeError"; -static char __pyx_k_first_offset[] = "first offset = {}"; -static char __pyx_k_len__offsets[] = "len(_offsets) == {}"; +static char __pyx_k_calc_offsets[] = "calc offsets"; static char __pyx_k_StopIteration[] = "StopIteration"; static char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer"; static char __pyx_k_No_file_opened[] = "No file opened"; static char __pyx_k_XTC_read_error[] = "XTC read error: {}"; +static char __pyx_k_calc_offsets_2[] = "calc_offsets"; static char __pyx_k_XTC_write_error[] = "XTC write error: {}"; static char __pyx_k_allocate_buffer[] = "allocate_buffer"; static char __pyx_k_dtype_is_object[] = "dtype_is_object"; -static char __pyx_k_offsets_NULL_ok[] = "offsets = NULL == {}, ok = {}"; static char __pyx_k_ascontiguousarray[] = "ascontiguousarray"; static char __pyx_k_strided_and_direct[] = ""; static char __pyx_k_Couldn_t_close_file[] = "Couldn't close file: {}"; static char __pyx_k_File_does_not_exists[] = "File does not exists: {}"; static char __pyx_k_strided_and_indirect[] = ""; static char __pyx_k_contiguous_and_direct[] = ""; -static char __pyx_k_read_frames_estimated[] = "read {} frames, estimated {}"; static char __pyx_k_MemoryView_of_r_object[] = ""; static char __pyx_k_XTC_Read_Error_occured[] = "XTC Read Error occured: {}"; static char __pyx_k_error_opening_xtf_file[] = "error opening xtf file: {}"; @@ -1849,6 +1853,8 @@ static PyObject *__pyx_n_s_base; static PyObject *__pyx_n_s_box; static PyObject *__pyx_n_s_c; static PyObject *__pyx_n_u_c; +static PyObject *__pyx_kp_s_calc_offsets; +static PyObject *__pyx_n_s_calc_offsets_2; static PyObject *__pyx_n_s_class; static PyObject *__pyx_n_s_close; static PyObject *__pyx_kp_s_contiguous_and_direct; @@ -1866,7 +1872,6 @@ static PyObject *__pyx_n_s_exc_type; static PyObject *__pyx_n_s_exc_val; static PyObject *__pyx_n_s_exists; static PyObject *__pyx_n_s_file; -static PyObject *__pyx_kp_s_first_offset; static PyObject *__pyx_n_s_flags; static PyObject *__pyx_n_s_float32; static PyObject *__pyx_n_s_fname; @@ -1879,7 +1884,6 @@ static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_int64; static PyObject *__pyx_n_s_itemsize; static PyObject *__pyx_kp_s_itemsize_0_for_cython_array; -static PyObject *__pyx_kp_s_len__offsets; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_memview; static PyObject *__pyx_n_s_mode; @@ -1892,22 +1896,23 @@ static PyObject *__pyx_n_s_ndim; static PyObject *__pyx_n_s_np; static PyObject *__pyx_n_s_numpy; static PyObject *__pyx_n_s_obj; -static PyObject *__pyx_kp_s_offsets_NULL_ok; +static PyObject *__pyx_n_s_offsets; static PyObject *__pyx_n_s_open; static PyObject *__pyx_n_s_os_path; static PyObject *__pyx_n_s_pack; static PyObject *__pyx_n_s_prec; static PyObject *__pyx_n_s_print; +static PyObject *__pyx_n_s_property; static PyObject *__pyx_n_s_pyx_getbuffer; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_b_r; static PyObject *__pyx_n_s_r; static PyObject *__pyx_n_s_range; static PyObject *__pyx_n_s_read; -static PyObject *__pyx_kp_s_read_frames_estimated; static PyObject *__pyx_n_s_rtol; static PyObject *__pyx_n_s_seek; static PyObject *__pyx_kp_s_self_mode; +static PyObject *__pyx_n_s_setter; static PyObject *__pyx_n_s_shape; static PyObject *__pyx_n_s_size; static PyObject *__pyx_n_s_start; @@ -1937,9 +1942,11 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_14__next__(st static Py_ssize_t __pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_16__len__(struct __pyx_obj_10MDAnalysis_3lib_7formats_3xtc_XTCFile *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_18seek(struct __pyx_obj_10MDAnalysis_3lib_7formats_3xtc_XTCFile *__pyx_v_self, PyObject *__pyx_v_frame); /* proto */ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_20tell(struct __pyx_obj_10MDAnalysis_3lib_7formats_3xtc_XTCFile *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_22offsets(struct __pyx_obj_10MDAnalysis_3lib_7formats_3xtc_XTCFile *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_24read(struct __pyx_obj_10MDAnalysis_3lib_7formats_3xtc_XTCFile *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_26write(struct __pyx_obj_10MDAnalysis_3lib_7formats_3xtc_XTCFile *__pyx_v_self, PyObject *__pyx_v_xyz, PyObject *__pyx_v_box, int __pyx_v_step, float __pyx_v_time, float __pyx_v_prec); /* proto */ +static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_22calc_offsets(struct __pyx_obj_10MDAnalysis_3lib_7formats_3xtc_XTCFile *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_24offsets(struct __pyx_obj_10MDAnalysis_3lib_7formats_3xtc_XTCFile *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_26offsets(struct __pyx_obj_10MDAnalysis_3lib_7formats_3xtc_XTCFile *__pyx_v_self, PyObject *__pyx_v_offsets); /* proto */ +static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_28read(struct __pyx_obj_10MDAnalysis_3lib_7formats_3xtc_XTCFile *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_30write(struct __pyx_obj_10MDAnalysis_3lib_7formats_3xtc_XTCFile *__pyx_v_self, PyObject *__pyx_v_xyz, PyObject *__pyx_v_box, int __pyx_v_step, float __pyx_v_time, float __pyx_v_prec); /* proto */ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_7n_atoms___get__(struct __pyx_obj_10MDAnalysis_3lib_7formats_3xtc_XTCFile *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_5fname___get__(struct __pyx_obj_10MDAnalysis_3lib_7formats_3xtc_XTCFile *__pyx_v_self); /* proto */ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ @@ -1994,9 +2001,9 @@ static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; -static PyObject *__pyx_slice__22; static PyObject *__pyx_slice__23; static PyObject *__pyx_slice__24; +static PyObject *__pyx_slice__25; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; @@ -2009,15 +2016,16 @@ static PyObject *__pyx_tuple__18; static PyObject *__pyx_tuple__19; static PyObject *__pyx_tuple__20; static PyObject *__pyx_tuple__21; -static PyObject *__pyx_tuple__25; +static PyObject *__pyx_tuple__22; static PyObject *__pyx_tuple__26; static PyObject *__pyx_tuple__27; static PyObject *__pyx_tuple__28; static PyObject *__pyx_tuple__29; static PyObject *__pyx_tuple__30; +static PyObject *__pyx_tuple__31; -/* "MDAnalysis/lib/formats/xtc.pyx":48 - * cdef np.ndarray box +/* "MDAnalysis/lib/formats/xtc.pyx":50 + * cdef int _has_offsets * * def __cinit__(self, fname, mode='r'): # <<<<<<<<<<<<<< * self.fname = fname @@ -2060,7 +2068,7 @@ static int __pyx_pw_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_1__cinit__(PyObject } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -2075,7 +2083,7 @@ static int __pyx_pw_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_1__cinit__(PyObject } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("MDAnalysis.lib.formats.xtc.XTCFile.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -2101,12 +2109,12 @@ static int __pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile___cinit__(struct __ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "MDAnalysis/lib/formats/xtc.pyx":49 + /* "MDAnalysis/lib/formats/xtc.pyx":51 * * def __cinit__(self, fname, mode='r'): * self.fname = fname # <<<<<<<<<<<<<< * self.is_open = False - * self.open(self.fname, mode) + * self._has_offsets = False */ __Pyx_INCREF(__pyx_v_fname); __Pyx_GIVEREF(__pyx_v_fname); @@ -2114,23 +2122,32 @@ static int __pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile___cinit__(struct __ __Pyx_DECREF(__pyx_v_self->fname); __pyx_v_self->fname = __pyx_v_fname; - /* "MDAnalysis/lib/formats/xtc.pyx":50 + /* "MDAnalysis/lib/formats/xtc.pyx":52 * def __cinit__(self, fname, mode='r'): * self.fname = fname * self.is_open = False # <<<<<<<<<<<<<< + * self._has_offsets = False * self.open(self.fname, mode) - * */ __pyx_v_self->is_open = 0; - /* "MDAnalysis/lib/formats/xtc.pyx":51 + /* "MDAnalysis/lib/formats/xtc.pyx":53 * self.fname = fname * self.is_open = False + * self._has_offsets = False # <<<<<<<<<<<<<< + * self.open(self.fname, mode) + * + */ + __pyx_v_self->_has_offsets = 0; + + /* "MDAnalysis/lib/formats/xtc.pyx":54 + * self.is_open = False + * self._has_offsets = False * self.open(self.fname, mode) # <<<<<<<<<<<<<< * * def __dealloc__(self): */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_open); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_open); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -2144,7 +2161,7 @@ static int __pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile___cinit__(struct __ __pyx_t_4 = 1; } } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; @@ -2155,14 +2172,14 @@ static int __pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile___cinit__(struct __ __Pyx_INCREF(__pyx_v_mode); __Pyx_GIVEREF(__pyx_v_mode); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_mode); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "MDAnalysis/lib/formats/xtc.pyx":48 - * cdef np.ndarray box + /* "MDAnalysis/lib/formats/xtc.pyx":50 + * cdef int _has_offsets * * def __cinit__(self, fname, mode='r'): # <<<<<<<<<<<<<< * self.fname = fname @@ -2184,7 +2201,7 @@ static int __pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile___cinit__(struct __ return __pyx_r; } -/* "MDAnalysis/lib/formats/xtc.pyx":53 +/* "MDAnalysis/lib/formats/xtc.pyx":56 * self.open(self.fname, mode) * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -2213,14 +2230,14 @@ static void __pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_2__dealloc__(struc int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "MDAnalysis/lib/formats/xtc.pyx":54 + /* "MDAnalysis/lib/formats/xtc.pyx":57 * * def __dealloc__(self): * self.close() # <<<<<<<<<<<<<< * * def close(self): */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { @@ -2233,16 +2250,16 @@ static void __pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_2__dealloc__(struc } } if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "MDAnalysis/lib/formats/xtc.pyx":53 + /* "MDAnalysis/lib/formats/xtc.pyx":56 * self.open(self.fname, mode) * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -2261,7 +2278,7 @@ static void __pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_2__dealloc__(struc __Pyx_RefNannyFinishContext(); } -/* "MDAnalysis/lib/formats/xtc.pyx":56 +/* "MDAnalysis/lib/formats/xtc.pyx":59 * self.close() * * def close(self): # <<<<<<<<<<<<<< @@ -2297,7 +2314,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_4close(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("close", 0); - /* "MDAnalysis/lib/formats/xtc.pyx":64 + /* "MDAnalysis/lib/formats/xtc.pyx":67 * If the XTC file can't be closed for some reason * """ * cdef int res = 1 # <<<<<<<<<<<<<< @@ -2306,7 +2323,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_4close(struct */ __pyx_v_res = 1; - /* "MDAnalysis/lib/formats/xtc.pyx":65 + /* "MDAnalysis/lib/formats/xtc.pyx":68 * """ * cdef int res = 1 * if self.is_open: # <<<<<<<<<<<<<< @@ -2316,7 +2333,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_4close(struct __pyx_t_1 = (__pyx_v_self->is_open != 0); if (__pyx_t_1) { - /* "MDAnalysis/lib/formats/xtc.pyx":66 + /* "MDAnalysis/lib/formats/xtc.pyx":69 * cdef int res = 1 * if self.is_open: * res = xdrlib.xdrfile_close(self.xfp) # <<<<<<<<<<<<<< @@ -2325,7 +2342,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_4close(struct */ __pyx_v_res = xdrfile_close(__pyx_v_self->xfp); - /* "MDAnalysis/lib/formats/xtc.pyx":67 + /* "MDAnalysis/lib/formats/xtc.pyx":70 * if self.is_open: * res = xdrlib.xdrfile_close(self.xfp) * self.is_open = False # <<<<<<<<<<<<<< @@ -2334,7 +2351,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_4close(struct */ __pyx_v_self->is_open = 0; - /* "MDAnalysis/lib/formats/xtc.pyx":68 + /* "MDAnalysis/lib/formats/xtc.pyx":71 * res = xdrlib.xdrfile_close(self.xfp) * self.is_open = False * if res != 0: # <<<<<<<<<<<<<< @@ -2344,14 +2361,14 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_4close(struct __pyx_t_1 = ((__pyx_v_res != 0) != 0); if (__pyx_t_1) { - /* "MDAnalysis/lib/formats/xtc.pyx":69 + /* "MDAnalysis/lib/formats/xtc.pyx":72 * self.is_open = False * if res != 0: * raise IOError('Couldn\'t close file: {}'.format(self.fname)) # <<<<<<<<<<<<<< * return True * */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Couldn_t_close_file, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Couldn_t_close_file, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { @@ -2364,33 +2381,33 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_4close(struct } } if (!__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->fname); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->fname); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_self->fname); __Pyx_GIVEREF(__pyx_v_self->fname); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_self->fname); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "MDAnalysis/lib/formats/xtc.pyx":68 + /* "MDAnalysis/lib/formats/xtc.pyx":71 * res = xdrlib.xdrfile_close(self.xfp) * self.is_open = False * if res != 0: # <<<<<<<<<<<<<< @@ -2399,7 +2416,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_4close(struct */ } - /* "MDAnalysis/lib/formats/xtc.pyx":65 + /* "MDAnalysis/lib/formats/xtc.pyx":68 * """ * cdef int res = 1 * if self.is_open: # <<<<<<<<<<<<<< @@ -2408,7 +2425,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_4close(struct */ } - /* "MDAnalysis/lib/formats/xtc.pyx":70 + /* "MDAnalysis/lib/formats/xtc.pyx":73 * if res != 0: * raise IOError('Couldn\'t close file: {}'.format(self.fname)) * return True # <<<<<<<<<<<<<< @@ -2420,7 +2437,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_4close(struct __pyx_r = Py_True; goto __pyx_L0; - /* "MDAnalysis/lib/formats/xtc.pyx":56 + /* "MDAnalysis/lib/formats/xtc.pyx":59 * self.close() * * def close(self): # <<<<<<<<<<<<<< @@ -2442,7 +2459,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_4close(struct return __pyx_r; } -/* "MDAnalysis/lib/formats/xtc.pyx":72 +/* "MDAnalysis/lib/formats/xtc.pyx":75 * return True * * def open(self, fname, mode): # <<<<<<<<<<<<<< @@ -2482,11 +2499,11 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_7open(PyObjec case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("open", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("open", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "open") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "open") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -2499,7 +2516,7 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_7open(PyObjec } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("open", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("open", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("MDAnalysis.lib.formats.xtc.XTCFile.open", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -2531,7 +2548,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_6open(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("open", 0); - /* "MDAnalysis/lib/formats/xtc.pyx":91 + /* "MDAnalysis/lib/formats/xtc.pyx":94 * Couldn't read the file * """ * if self.is_open: # <<<<<<<<<<<<<< @@ -2541,14 +2558,14 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_6open(struct __pyx_t_1 = (__pyx_v_self->is_open != 0); if (__pyx_t_1) { - /* "MDAnalysis/lib/formats/xtc.pyx":92 + /* "MDAnalysis/lib/formats/xtc.pyx":95 * """ * if self.is_open: * self.close() # <<<<<<<<<<<<<< * cdef int return_code = 1 * self.fname = fname */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { @@ -2561,16 +2578,16 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_6open(struct } } if (__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "MDAnalysis/lib/formats/xtc.pyx":91 + /* "MDAnalysis/lib/formats/xtc.pyx":94 * Couldn't read the file * """ * if self.is_open: # <<<<<<<<<<<<<< @@ -2579,7 +2596,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_6open(struct */ } - /* "MDAnalysis/lib/formats/xtc.pyx":93 + /* "MDAnalysis/lib/formats/xtc.pyx":96 * if self.is_open: * self.close() * cdef int return_code = 1 # <<<<<<<<<<<<<< @@ -2588,7 +2605,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_6open(struct */ __pyx_v_return_code = 1; - /* "MDAnalysis/lib/formats/xtc.pyx":94 + /* "MDAnalysis/lib/formats/xtc.pyx":97 * self.close() * cdef int return_code = 1 * self.fname = fname # <<<<<<<<<<<<<< @@ -2601,7 +2618,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_6open(struct __Pyx_DECREF(__pyx_v_self->fname); __pyx_v_self->fname = __pyx_v_fname; - /* "MDAnalysis/lib/formats/xtc.pyx":95 + /* "MDAnalysis/lib/formats/xtc.pyx":98 * cdef int return_code = 1 * self.fname = fname * self.n_atoms = 0 # <<<<<<<<<<<<<< @@ -2610,7 +2627,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_6open(struct */ __pyx_v_self->n_atoms = 0; - /* "MDAnalysis/lib/formats/xtc.pyx":96 + /* "MDAnalysis/lib/formats/xtc.pyx":99 * self.fname = fname * self.n_atoms = 0 * self.reached_eof = False # <<<<<<<<<<<<<< @@ -2619,7 +2636,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_6open(struct */ __pyx_v_self->reached_eof = 0; - /* "MDAnalysis/lib/formats/xtc.pyx":97 + /* "MDAnalysis/lib/formats/xtc.pyx":100 * self.n_atoms = 0 * self.reached_eof = False * self.current_frame = 0 # <<<<<<<<<<<<<< @@ -2628,17 +2645,17 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_6open(struct */ __pyx_v_self->current_frame = 0; - /* "MDAnalysis/lib/formats/xtc.pyx":99 + /* "MDAnalysis/lib/formats/xtc.pyx":102 * self.current_frame = 0 * * if mode == 'r': # <<<<<<<<<<<<<< * opening_mode = b'r' * elif mode == 'w': */ - __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_r, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_r, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { - /* "MDAnalysis/lib/formats/xtc.pyx":100 + /* "MDAnalysis/lib/formats/xtc.pyx":103 * * if mode == 'r': * opening_mode = b'r' # <<<<<<<<<<<<<< @@ -2648,7 +2665,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_6open(struct __Pyx_INCREF(__pyx_n_b_r); __pyx_v_opening_mode = __pyx_n_b_r; - /* "MDAnalysis/lib/formats/xtc.pyx":99 + /* "MDAnalysis/lib/formats/xtc.pyx":102 * self.current_frame = 0 * * if mode == 'r': # <<<<<<<<<<<<<< @@ -2658,17 +2675,17 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_6open(struct goto __pyx_L4; } - /* "MDAnalysis/lib/formats/xtc.pyx":101 + /* "MDAnalysis/lib/formats/xtc.pyx":104 * if mode == 'r': * opening_mode = b'r' * elif mode == 'w': # <<<<<<<<<<<<<< * opening_mode = b'w' * else: */ - __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_w, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_w, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { - /* "MDAnalysis/lib/formats/xtc.pyx":102 + /* "MDAnalysis/lib/formats/xtc.pyx":105 * opening_mode = b'r' * elif mode == 'w': * opening_mode = b'w' # <<<<<<<<<<<<<< @@ -2678,7 +2695,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_6open(struct __Pyx_INCREF(__pyx_n_b_w); __pyx_v_opening_mode = __pyx_n_b_w; - /* "MDAnalysis/lib/formats/xtc.pyx":101 + /* "MDAnalysis/lib/formats/xtc.pyx":104 * if mode == 'r': * opening_mode = b'r' * elif mode == 'w': # <<<<<<<<<<<<<< @@ -2688,7 +2705,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_6open(struct goto __pyx_L4; } - /* "MDAnalysis/lib/formats/xtc.pyx":104 + /* "MDAnalysis/lib/formats/xtc.pyx":107 * opening_mode = b'w' * else: * raise ValueError('mode must be one of "r" or "w", you ' # <<<<<<<<<<<<<< @@ -2697,14 +2714,14 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_6open(struct */ /*else*/ { - /* "MDAnalysis/lib/formats/xtc.pyx":105 + /* "MDAnalysis/lib/formats/xtc.pyx":108 * else: * raise ValueError('mode must be one of "r" or "w", you ' * 'supplied {}'.format(mode)) # <<<<<<<<<<<<<< * self.mode = mode * */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_mode_must_be_one_of_r_or_w_you_s, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_mode_must_be_one_of_r_or_w_you_s, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { @@ -2717,50 +2734,50 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_6open(struct } } if (!__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_mode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_mode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_mode); __Pyx_GIVEREF(__pyx_v_mode); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_mode); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "MDAnalysis/lib/formats/xtc.pyx":104 + /* "MDAnalysis/lib/formats/xtc.pyx":107 * opening_mode = b'w' * else: * raise ValueError('mode must be one of "r" or "w", you ' # <<<<<<<<<<<<<< * 'supplied {}'.format(mode)) * self.mode = mode */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L4:; - /* "MDAnalysis/lib/formats/xtc.pyx":106 + /* "MDAnalysis/lib/formats/xtc.pyx":109 * raise ValueError('mode must be one of "r" or "w", you ' * 'supplied {}'.format(mode)) * self.mode = mode # <<<<<<<<<<<<<< * * if self.mode == 'r': */ - if (!(likely(PyString_CheckExact(__pyx_v_mode))||((__pyx_v_mode) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_mode)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(PyString_CheckExact(__pyx_v_mode))||((__pyx_v_mode) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_mode)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __pyx_v_mode; __Pyx_INCREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); @@ -2769,25 +2786,25 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_6open(struct __pyx_v_self->mode = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "MDAnalysis/lib/formats/xtc.pyx":108 + /* "MDAnalysis/lib/formats/xtc.pyx":111 * self.mode = mode * * if self.mode == 'r': # <<<<<<<<<<<<<< * if not exists(self.fname): * raise IOError('File does not exists: {}'.format(self.fname)) */ - __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_self->mode, __pyx_n_s_r, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_self->mode, __pyx_n_s_r, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = (__pyx_t_1 != 0); if (__pyx_t_6) { - /* "MDAnalysis/lib/formats/xtc.pyx":109 + /* "MDAnalysis/lib/formats/xtc.pyx":112 * * if self.mode == 'r': * if not exists(self.fname): # <<<<<<<<<<<<<< * raise IOError('File does not exists: {}'.format(self.fname)) * */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_exists); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_exists); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -2800,33 +2817,33 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_6open(struct } } if (!__pyx_t_5) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->fname); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->fname); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } else { - __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_self->fname); __Pyx_GIVEREF(__pyx_v_self->fname); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_self->fname); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = ((!__pyx_t_6) != 0); if (__pyx_t_1) { - /* "MDAnalysis/lib/formats/xtc.pyx":110 + /* "MDAnalysis/lib/formats/xtc.pyx":113 * if self.mode == 'r': * if not exists(self.fname): * raise IOError('File does not exists: {}'.format(self.fname)) # <<<<<<<<<<<<<< * * return_code = xdrlib.read_xtc_natoms(fname, &self.n_atoms) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_File_does_not_exists, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_File_does_not_exists, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { @@ -2839,33 +2856,33 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_6open(struct } } if (!__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->fname); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->fname); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_self->fname); __Pyx_GIVEREF(__pyx_v_self->fname); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_self->fname); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "MDAnalysis/lib/formats/xtc.pyx":109 + /* "MDAnalysis/lib/formats/xtc.pyx":112 * * if self.mode == 'r': * if not exists(self.fname): # <<<<<<<<<<<<<< @@ -2874,17 +2891,17 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_6open(struct */ } - /* "MDAnalysis/lib/formats/xtc.pyx":112 + /* "MDAnalysis/lib/formats/xtc.pyx":115 * raise IOError('File does not exists: {}'.format(self.fname)) * * return_code = xdrlib.read_xtc_natoms(fname, &self.n_atoms) # <<<<<<<<<<<<<< * * if return_code != 0: */ - __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_fname); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_fname); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_return_code = read_xtc_natoms(__pyx_t_7, (&__pyx_v_self->n_atoms)); - /* "MDAnalysis/lib/formats/xtc.pyx":114 + /* "MDAnalysis/lib/formats/xtc.pyx":117 * return_code = xdrlib.read_xtc_natoms(fname, &self.n_atoms) * * if return_code != 0: # <<<<<<<<<<<<<< @@ -2894,16 +2911,16 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_6open(struct __pyx_t_1 = ((__pyx_v_return_code != 0) != 0); if (__pyx_t_1) { - /* "MDAnalysis/lib/formats/xtc.pyx":116 + /* "MDAnalysis/lib/formats/xtc.pyx":119 * if return_code != 0: * * raise IOError('XTC read error: {}'.format(return_code)) # <<<<<<<<<<<<<< * if self.n_atoms <= 0: * raise IOError('Couldn\'t read number of atoms: {}'.format( */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_XTC_read_error, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_XTC_read_error, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_return_code); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_return_code); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { @@ -2916,34 +2933,34 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_6open(struct } } if (!__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); } else { - __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "MDAnalysis/lib/formats/xtc.pyx":114 + /* "MDAnalysis/lib/formats/xtc.pyx":117 * return_code = xdrlib.read_xtc_natoms(fname, &self.n_atoms) * * if return_code != 0: # <<<<<<<<<<<<<< @@ -2952,7 +2969,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_6open(struct */ } - /* "MDAnalysis/lib/formats/xtc.pyx":117 + /* "MDAnalysis/lib/formats/xtc.pyx":120 * * raise IOError('XTC read error: {}'.format(return_code)) * if self.n_atoms <= 0: # <<<<<<<<<<<<<< @@ -2962,17 +2979,17 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_6open(struct __pyx_t_1 = ((__pyx_v_self->n_atoms <= 0) != 0); if (__pyx_t_1) { - /* "MDAnalysis/lib/formats/xtc.pyx":118 + /* "MDAnalysis/lib/formats/xtc.pyx":121 * raise IOError('XTC read error: {}'.format(return_code)) * if self.n_atoms <= 0: * raise IOError('Couldn\'t read number of atoms: {}'.format( # <<<<<<<<<<<<<< * self.fname)) * */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Couldn_t_read_number_of_atoms, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Couldn_t_read_number_of_atoms, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - /* "MDAnalysis/lib/formats/xtc.pyx":119 + /* "MDAnalysis/lib/formats/xtc.pyx":122 * if self.n_atoms <= 0: * raise IOError('Couldn\'t read number of atoms: {}'.format( * self.fname)) # <<<<<<<<<<<<<< @@ -2990,41 +3007,41 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_6open(struct } } if (!__pyx_t_8) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->fname); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->fname); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8); __pyx_t_8 = NULL; __Pyx_INCREF(__pyx_v_self->fname); __Pyx_GIVEREF(__pyx_v_self->fname); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_self->fname); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "MDAnalysis/lib/formats/xtc.pyx":118 + /* "MDAnalysis/lib/formats/xtc.pyx":121 * raise IOError('XTC read error: {}'.format(return_code)) * if self.n_atoms <= 0: * raise IOError('Couldn\'t read number of atoms: {}'.format( # <<<<<<<<<<<<<< * self.fname)) * */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "MDAnalysis/lib/formats/xtc.pyx":117 + /* "MDAnalysis/lib/formats/xtc.pyx":120 * * raise IOError('XTC read error: {}'.format(return_code)) * if self.n_atoms <= 0: # <<<<<<<<<<<<<< @@ -3033,7 +3050,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_6open(struct */ } - /* "MDAnalysis/lib/formats/xtc.pyx":108 + /* "MDAnalysis/lib/formats/xtc.pyx":111 * self.mode = mode * * if self.mode == 'r': # <<<<<<<<<<<<<< @@ -3042,18 +3059,18 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_6open(struct */ } - /* "MDAnalysis/lib/formats/xtc.pyx":121 + /* "MDAnalysis/lib/formats/xtc.pyx":124 * self.fname)) * * self.xfp = xdrlib.xdrfile_open(fname, opening_mode) # <<<<<<<<<<<<<< * if self.xfp is NULL: * raise IOError('error opening xtf file: {}'.format(self.fname)) */ - __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_fname); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_opening_mode); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_fname); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_opening_mode); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->xfp = xdrfile_open(__pyx_t_7, __pyx_t_9); - /* "MDAnalysis/lib/formats/xtc.pyx":122 + /* "MDAnalysis/lib/formats/xtc.pyx":125 * * self.xfp = xdrlib.xdrfile_open(fname, opening_mode) * if self.xfp is NULL: # <<<<<<<<<<<<<< @@ -3063,14 +3080,14 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_6open(struct __pyx_t_1 = ((__pyx_v_self->xfp == NULL) != 0); if (__pyx_t_1) { - /* "MDAnalysis/lib/formats/xtc.pyx":123 + /* "MDAnalysis/lib/formats/xtc.pyx":126 * self.xfp = xdrlib.xdrfile_open(fname, opening_mode) * if self.xfp is NULL: * raise IOError('error opening xtf file: {}'.format(self.fname)) # <<<<<<<<<<<<<< * self.is_open = True * */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_error_opening_xtf_file, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_error_opening_xtf_file, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { @@ -3083,33 +3100,33 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_6open(struct } } if (!__pyx_t_5) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->fname); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->fname); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } else { - __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_self->fname); __Pyx_GIVEREF(__pyx_v_self->fname); PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_self->fname); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "MDAnalysis/lib/formats/xtc.pyx":122 + /* "MDAnalysis/lib/formats/xtc.pyx":125 * * self.xfp = xdrlib.xdrfile_open(fname, opening_mode) * if self.xfp is NULL: # <<<<<<<<<<<<<< @@ -3118,7 +3135,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_6open(struct */ } - /* "MDAnalysis/lib/formats/xtc.pyx":124 + /* "MDAnalysis/lib/formats/xtc.pyx":127 * if self.xfp is NULL: * raise IOError('error opening xtf file: {}'.format(self.fname)) * self.is_open = True # <<<<<<<<<<<<<< @@ -3127,7 +3144,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_6open(struct */ __pyx_v_self->is_open = 1; - /* "MDAnalysis/lib/formats/xtc.pyx":72 + /* "MDAnalysis/lib/formats/xtc.pyx":75 * return True * * def open(self, fname, mode): # <<<<<<<<<<<<<< @@ -3153,7 +3170,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_6open(struct return __pyx_r; } -/* "MDAnalysis/lib/formats/xtc.pyx":126 +/* "MDAnalysis/lib/formats/xtc.pyx":129 * self.is_open = True * * def __enter__(self): # <<<<<<<<<<<<<< @@ -3180,7 +3197,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_8__enter__(st __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__enter__", 0); - /* "MDAnalysis/lib/formats/xtc.pyx":128 + /* "MDAnalysis/lib/formats/xtc.pyx":131 * def __enter__(self): * """Support context manager""" * return self # <<<<<<<<<<<<<< @@ -3192,7 +3209,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_8__enter__(st __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "MDAnalysis/lib/formats/xtc.pyx":126 + /* "MDAnalysis/lib/formats/xtc.pyx":129 * self.is_open = True * * def __enter__(self): # <<<<<<<<<<<<<< @@ -3207,7 +3224,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_8__enter__(st return __pyx_r; } -/* "MDAnalysis/lib/formats/xtc.pyx":130 +/* "MDAnalysis/lib/formats/xtc.pyx":133 * return self * * def __exit__(self, exc_type, exc_val, exc_tb): # <<<<<<<<<<<<<< @@ -3249,16 +3266,16 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_11__exit__(Py case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_exc_val)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_exc_tb)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -3273,7 +3290,7 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_11__exit__(Py } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("MDAnalysis.lib.formats.xtc.XTCFile.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -3297,14 +3314,14 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_10__exit__(st int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__exit__", 0); - /* "MDAnalysis/lib/formats/xtc.pyx":132 + /* "MDAnalysis/lib/formats/xtc.pyx":135 * def __exit__(self, exc_type, exc_val, exc_tb): * """Support context manager""" * self.close() # <<<<<<<<<<<<<< * # always propagate exceptions forward * return False */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { @@ -3317,16 +3334,16 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_10__exit__(st } } if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "MDAnalysis/lib/formats/xtc.pyx":134 + /* "MDAnalysis/lib/formats/xtc.pyx":137 * self.close() * # always propagate exceptions forward * return False # <<<<<<<<<<<<<< @@ -3338,7 +3355,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_10__exit__(st __pyx_r = Py_False; goto __pyx_L0; - /* "MDAnalysis/lib/formats/xtc.pyx":130 + /* "MDAnalysis/lib/formats/xtc.pyx":133 * return self * * def __exit__(self, exc_type, exc_val, exc_tb): # <<<<<<<<<<<<<< @@ -3359,7 +3376,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_10__exit__(st return __pyx_r; } -/* "MDAnalysis/lib/formats/xtc.pyx":136 +/* "MDAnalysis/lib/formats/xtc.pyx":139 * return False * * def __iter__(self): # <<<<<<<<<<<<<< @@ -3393,14 +3410,14 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_12__iter__(st int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__iter__", 0); - /* "MDAnalysis/lib/formats/xtc.pyx":137 + /* "MDAnalysis/lib/formats/xtc.pyx":140 * * def __iter__(self): * self.close() # <<<<<<<<<<<<<< * self.open(self.fname, self.mode) * return self */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { @@ -3413,23 +3430,23 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_12__iter__(st } } if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "MDAnalysis/lib/formats/xtc.pyx":138 + /* "MDAnalysis/lib/formats/xtc.pyx":141 * def __iter__(self): * self.close() * self.open(self.fname, self.mode) # <<<<<<<<<<<<<< * return self * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_open); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_open); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -3443,7 +3460,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_12__iter__(st __pyx_t_4 = 1; } } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; @@ -3454,13 +3471,13 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_12__iter__(st __Pyx_INCREF(__pyx_v_self->mode); __Pyx_GIVEREF(__pyx_v_self->mode); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_self->mode); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "MDAnalysis/lib/formats/xtc.pyx":139 + /* "MDAnalysis/lib/formats/xtc.pyx":142 * self.close() * self.open(self.fname, self.mode) * return self # <<<<<<<<<<<<<< @@ -3472,7 +3489,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_12__iter__(st __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "MDAnalysis/lib/formats/xtc.pyx":136 + /* "MDAnalysis/lib/formats/xtc.pyx":139 * return False * * def __iter__(self): # <<<<<<<<<<<<<< @@ -3494,7 +3511,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_12__iter__(st return __pyx_r; } -/* "MDAnalysis/lib/formats/xtc.pyx":141 +/* "MDAnalysis/lib/formats/xtc.pyx":144 * return self * * def __next__(self): # <<<<<<<<<<<<<< @@ -3527,7 +3544,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_14__next__(st int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__next__", 0); - /* "MDAnalysis/lib/formats/xtc.pyx":142 + /* "MDAnalysis/lib/formats/xtc.pyx":145 * * def __next__(self): * if self.reached_eof: # <<<<<<<<<<<<<< @@ -3537,7 +3554,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_14__next__(st __pyx_t_1 = (__pyx_v_self->reached_eof != 0); if (__pyx_t_1) { - /* "MDAnalysis/lib/formats/xtc.pyx":143 + /* "MDAnalysis/lib/formats/xtc.pyx":146 * def __next__(self): * if self.reached_eof: * raise StopIteration # <<<<<<<<<<<<<< @@ -3545,9 +3562,9 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_14__next__(st * */ __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "MDAnalysis/lib/formats/xtc.pyx":142 + /* "MDAnalysis/lib/formats/xtc.pyx":145 * * def __next__(self): * if self.reached_eof: # <<<<<<<<<<<<<< @@ -3556,7 +3573,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_14__next__(st */ } - /* "MDAnalysis/lib/formats/xtc.pyx":144 + /* "MDAnalysis/lib/formats/xtc.pyx":147 * if self.reached_eof: * raise StopIteration * return self.read() # <<<<<<<<<<<<<< @@ -3564,7 +3581,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_14__next__(st * # TODO: cache result in file */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { @@ -3577,10 +3594,10 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_14__next__(st } } if (__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -3588,7 +3605,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_14__next__(st __pyx_t_2 = 0; goto __pyx_L0; - /* "MDAnalysis/lib/formats/xtc.pyx":141 + /* "MDAnalysis/lib/formats/xtc.pyx":144 * return self * * def __next__(self): # <<<<<<<<<<<<<< @@ -3609,7 +3626,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_14__next__(st return __pyx_r; } -/* "MDAnalysis/lib/formats/xtc.pyx":147 +/* "MDAnalysis/lib/formats/xtc.pyx":150 * * # TODO: cache result in file * def __len__(self): # <<<<<<<<<<<<<< @@ -3650,7 +3667,7 @@ static Py_ssize_t __pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_16__len__(st int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__len__", 0); - /* "MDAnalysis/lib/formats/xtc.pyx":148 + /* "MDAnalysis/lib/formats/xtc.pyx":151 * # TODO: cache result in file * def __len__(self): * if not self.is_open: # <<<<<<<<<<<<<< @@ -3660,20 +3677,20 @@ static Py_ssize_t __pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_16__len__(st __pyx_t_1 = ((!(__pyx_v_self->is_open != 0)) != 0); if (__pyx_t_1) { - /* "MDAnalysis/lib/formats/xtc.pyx":149 + /* "MDAnalysis/lib/formats/xtc.pyx":152 * def __len__(self): * if not self.is_open: * raise RuntimeError('No file currently opened') # <<<<<<<<<<<<<< * * cdef int old_frame = self.current_frame */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "MDAnalysis/lib/formats/xtc.pyx":148 + /* "MDAnalysis/lib/formats/xtc.pyx":151 * # TODO: cache result in file * def __len__(self): * if not self.is_open: # <<<<<<<<<<<<<< @@ -3682,7 +3699,7 @@ static Py_ssize_t __pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_16__len__(st */ } - /* "MDAnalysis/lib/formats/xtc.pyx":151 + /* "MDAnalysis/lib/formats/xtc.pyx":154 * raise RuntimeError('No file currently opened') * * cdef int old_frame = self.current_frame # <<<<<<<<<<<<<< @@ -3692,7 +3709,7 @@ static Py_ssize_t __pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_16__len__(st __pyx_t_3 = __pyx_v_self->current_frame; __pyx_v_old_frame = __pyx_t_3; - /* "MDAnalysis/lib/formats/xtc.pyx":152 + /* "MDAnalysis/lib/formats/xtc.pyx":155 * * cdef int old_frame = self.current_frame * try: # <<<<<<<<<<<<<< @@ -3706,7 +3723,7 @@ static Py_ssize_t __pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_16__len__(st __Pyx_XGOTREF(__pyx_t_6); /*try:*/ { - /* "MDAnalysis/lib/formats/xtc.pyx":153 + /* "MDAnalysis/lib/formats/xtc.pyx":156 * cdef int old_frame = self.current_frame * try: * while True: # <<<<<<<<<<<<<< @@ -3715,14 +3732,14 @@ static Py_ssize_t __pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_16__len__(st */ while (1) { - /* "MDAnalysis/lib/formats/xtc.pyx":154 + /* "MDAnalysis/lib/formats/xtc.pyx":157 * try: * while True: * self.read() # <<<<<<<<<<<<<< * except StopIteration: * pass */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) { @@ -3735,17 +3752,17 @@ static Py_ssize_t __pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_16__len__(st } } if (__pyx_t_8) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L4_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - /* "MDAnalysis/lib/formats/xtc.pyx":152 + /* "MDAnalysis/lib/formats/xtc.pyx":155 * * cdef int old_frame = self.current_frame * try: # <<<<<<<<<<<<<< @@ -3762,7 +3779,7 @@ static Py_ssize_t __pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_16__len__(st __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "MDAnalysis/lib/formats/xtc.pyx":155 + /* "MDAnalysis/lib/formats/xtc.pyx":158 * while True: * self.read() * except StopIteration: # <<<<<<<<<<<<<< @@ -3777,7 +3794,7 @@ static Py_ssize_t __pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_16__len__(st goto __pyx_L6_except_error; __pyx_L6_except_error:; - /* "MDAnalysis/lib/formats/xtc.pyx":152 + /* "MDAnalysis/lib/formats/xtc.pyx":155 * * cdef int old_frame = self.current_frame * try: # <<<<<<<<<<<<<< @@ -3797,7 +3814,7 @@ static Py_ssize_t __pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_16__len__(st __pyx_L11_try_end:; } - /* "MDAnalysis/lib/formats/xtc.pyx":157 + /* "MDAnalysis/lib/formats/xtc.pyx":160 * except StopIteration: * pass * cur_frame = self.current_frame # <<<<<<<<<<<<<< @@ -3807,16 +3824,16 @@ static Py_ssize_t __pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_16__len__(st __pyx_t_3 = __pyx_v_self->current_frame; __pyx_v_cur_frame = __pyx_t_3; - /* "MDAnalysis/lib/formats/xtc.pyx":159 + /* "MDAnalysis/lib/formats/xtc.pyx":162 * cur_frame = self.current_frame * * self.seek(old_frame) # <<<<<<<<<<<<<< * return cur_frame * */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_seek); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_seek); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_old_frame); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_old_frame); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) { @@ -3829,24 +3846,24 @@ static Py_ssize_t __pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_16__len__(st } } if (!__pyx_t_9) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_2); } else { - __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL; __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_8); __pyx_t_8 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "MDAnalysis/lib/formats/xtc.pyx":160 + /* "MDAnalysis/lib/formats/xtc.pyx":163 * * self.seek(old_frame) * return cur_frame # <<<<<<<<<<<<<< @@ -3856,7 +3873,7 @@ static Py_ssize_t __pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_16__len__(st __pyx_r = __pyx_v_cur_frame; goto __pyx_L0; - /* "MDAnalysis/lib/formats/xtc.pyx":147 + /* "MDAnalysis/lib/formats/xtc.pyx":150 * * # TODO: cache result in file * def __len__(self): # <<<<<<<<<<<<<< @@ -3878,7 +3895,7 @@ static Py_ssize_t __pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_16__len__(st return __pyx_r; } -/* "MDAnalysis/lib/formats/xtc.pyx":163 +/* "MDAnalysis/lib/formats/xtc.pyx":166 * * # TODO: optimize with direct jump in file * def seek(self, frame): # <<<<<<<<<<<<<< @@ -3905,10 +3922,10 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_18seek(struct __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; @@ -3918,74 +3935,114 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_18seek(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("seek", 0); - /* "MDAnalysis/lib/formats/xtc.pyx":176 + /* "MDAnalysis/lib/formats/xtc.pyx":179 + * If you seek for more frames then are available + * """ + * if frame > self.offsets.size: # <<<<<<<<<<<<<< + * raise RuntimeError('Trying to seek over max number of frames') + * self.close() + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_offsets); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_v_frame, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_3) { + + /* "MDAnalysis/lib/formats/xtc.pyx":180 + * """ + * if frame > self.offsets.size: + * raise RuntimeError('Trying to seek over max number of frames') # <<<<<<<<<<<<<< + * self.close() + * self.open(self.fname, self.mode) + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "MDAnalysis/lib/formats/xtc.pyx":179 * If you seek for more frames then are available * """ + * if frame > self.offsets.size: # <<<<<<<<<<<<<< + * raise RuntimeError('Trying to seek over max number of frames') + * self.close() + */ + } + + /* "MDAnalysis/lib/formats/xtc.pyx":181 + * if frame > self.offsets.size: + * raise RuntimeError('Trying to seek over max number of frames') * self.close() # <<<<<<<<<<<<<< * self.open(self.fname, self.mode) * while self.current_frame < frame: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; + __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } - if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_4) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "MDAnalysis/lib/formats/xtc.pyx":177 - * """ + /* "MDAnalysis/lib/formats/xtc.pyx":182 + * raise RuntimeError('Trying to seek over max number of frames') * self.close() * self.open(self.fname, self.mode) # <<<<<<<<<<<<<< * while self.current_frame < frame: * try: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_open); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_open); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; + __pyx_t_4 = NULL; + __pyx_t_5 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; + __pyx_t_5 = 1; } } - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(__pyx_v_self->fname); __Pyx_GIVEREF(__pyx_v_self->fname); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self->fname); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_self->fname); __Pyx_INCREF(__pyx_v_self->mode); __Pyx_GIVEREF(__pyx_v_self->mode); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_self->mode); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_self->mode); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "MDAnalysis/lib/formats/xtc.pyx":178 + /* "MDAnalysis/lib/formats/xtc.pyx":183 * self.close() * self.open(self.fname, self.mode) * while self.current_frame < frame: # <<<<<<<<<<<<<< @@ -3993,15 +4050,15 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_18seek(struct * self.read() */ while (1) { - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->current_frame); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->current_frame); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_v_frame, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_v_frame, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!__pyx_t_6) break; + if (!__pyx_t_3) break; - /* "MDAnalysis/lib/formats/xtc.pyx":179 + /* "MDAnalysis/lib/formats/xtc.pyx":184 * self.open(self.fname, self.mode) * while self.current_frame < frame: * try: # <<<<<<<<<<<<<< @@ -4015,36 +4072,36 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_18seek(struct __Pyx_XGOTREF(__pyx_t_9); /*try:*/ { - /* "MDAnalysis/lib/formats/xtc.pyx":180 + /* "MDAnalysis/lib/formats/xtc.pyx":185 * while self.current_frame < frame: * try: * self.read() # <<<<<<<<<<<<<< * except StopIteration: * raise RuntimeError('Trying to seek over max number of frames') */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L6_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = NULL; + __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_5)) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } - if (__pyx_t_5) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L5_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L6_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L6_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "MDAnalysis/lib/formats/xtc.pyx":179 + /* "MDAnalysis/lib/formats/xtc.pyx":184 * self.open(self.fname, self.mode) * while self.current_frame < frame: * try: # <<<<<<<<<<<<<< @@ -4055,14 +4112,14 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_18seek(struct __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - goto __pyx_L12_try_end; - __pyx_L5_error:; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L13_try_end; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "MDAnalysis/lib/formats/xtc.pyx":181 + /* "MDAnalysis/lib/formats/xtc.pyx":186 * try: * self.read() * except StopIteration: # <<<<<<<<<<<<<< @@ -4072,28 +4129,28 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_18seek(struct __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_StopIteration); if (__pyx_t_10) { __Pyx_AddTraceback("MDAnalysis.lib.formats.xtc.XTCFile.seek", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_1); - __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); - /* "MDAnalysis/lib/formats/xtc.pyx":182 + /* "MDAnalysis/lib/formats/xtc.pyx":187 * self.read() * except StopIteration: * raise RuntimeError('Trying to seek over max number of frames') # <<<<<<<<<<<<<< * * def tell(self): */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} } - goto __pyx_L7_except_error; - __pyx_L7_except_error:; + goto __pyx_L8_except_error; + __pyx_L8_except_error:; - /* "MDAnalysis/lib/formats/xtc.pyx":179 + /* "MDAnalysis/lib/formats/xtc.pyx":184 * self.open(self.fname, self.mode) * while self.current_frame < frame: * try: # <<<<<<<<<<<<<< @@ -4105,11 +4162,11 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_18seek(struct __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9); goto __pyx_L1_error; - __pyx_L12_try_end:; + __pyx_L13_try_end:; } } - /* "MDAnalysis/lib/formats/xtc.pyx":163 + /* "MDAnalysis/lib/formats/xtc.pyx":166 * * # TODO: optimize with direct jump in file * def seek(self, frame): # <<<<<<<<<<<<<< @@ -4123,8 +4180,8 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_18seek(struct __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("MDAnalysis.lib.formats.xtc.XTCFile.seek", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -4133,7 +4190,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_18seek(struct return __pyx_r; } -/* "MDAnalysis/lib/formats/xtc.pyx":184 +/* "MDAnalysis/lib/formats/xtc.pyx":189 * raise RuntimeError('Trying to seek over max number of frames') * * def tell(self): # <<<<<<<<<<<<<< @@ -4164,21 +4221,21 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_20tell(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tell", 0); - /* "MDAnalysis/lib/formats/xtc.pyx":186 + /* "MDAnalysis/lib/formats/xtc.pyx":191 * def tell(self): * """Get current frame""" * return self.current_frame # <<<<<<<<<<<<<< * - * def offsets(self): + * def calc_offsets(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->current_frame); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->current_frame); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "MDAnalysis/lib/formats/xtc.pyx":184 + /* "MDAnalysis/lib/formats/xtc.pyx":189 * raise RuntimeError('Trying to seek over max number of frames') * * def tell(self): # <<<<<<<<<<<<<< @@ -4197,34 +4254,34 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_20tell(struct return __pyx_r; } -/* "MDAnalysis/lib/formats/xtc.pyx":188 +/* "MDAnalysis/lib/formats/xtc.pyx":193 * return self.current_frame * - * def offsets(self): # <<<<<<<<<<<<<< + * def calc_offsets(self): # <<<<<<<<<<<<<< + * print("calc offsets") * if not self.is_open: - * return np.array([]) */ /* Python wrapper */ -static PyObject *__pyx_pw_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_23offsets(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pw_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_23offsets(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pw_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_23calc_offsets(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_23calc_offsets(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("offsets (wrapper)", 0); - __pyx_r = __pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_22offsets(((struct __pyx_obj_10MDAnalysis_3lib_7formats_3xtc_XTCFile *)__pyx_v_self)); + __Pyx_RefNannySetupContext("calc_offsets (wrapper)", 0); + __pyx_r = __pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_22calc_offsets(((struct __pyx_obj_10MDAnalysis_3lib_7formats_3xtc_XTCFile *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_22offsets(struct __pyx_obj_10MDAnalysis_3lib_7formats_3xtc_XTCFile *__pyx_v_self) { +static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_22calc_offsets(struct __pyx_obj_10MDAnalysis_3lib_7formats_3xtc_XTCFile *__pyx_v_self) { int __pyx_v_n_frames; int __pyx_v_est_nframes; int64_t *__pyx_v_offsets; - int __pyx_v_ok; + CYTHON_UNUSED int __pyx_v_ok; PyArrayObject *__pyx_v_dims = 0; - PyArrayObject *__pyx_v__offsets = 0; + PyArrayObject *__pyx_v_nd_offsets = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -4235,16 +4292,23 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_22offsets(str PyObject *__pyx_t_6 = NULL; char *__pyx_t_7; __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } }; - Py_ssize_t __pyx_t_9; - PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("offsets", 0); + __Pyx_RefNannySetupContext("calc_offsets", 0); - /* "MDAnalysis/lib/formats/xtc.pyx":189 + /* "MDAnalysis/lib/formats/xtc.pyx":194 * - * def offsets(self): + * def calc_offsets(self): + * print("calc offsets") # <<<<<<<<<<<<<< + * if not self.is_open: + * return np.array([]) + */ + if (__Pyx_PrintOne(0, __pyx_kp_s_calc_offsets) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "MDAnalysis/lib/formats/xtc.pyx":195 + * def calc_offsets(self): + * print("calc offsets") * if not self.is_open: # <<<<<<<<<<<<<< * return np.array([]) * cdef int n_frames = 0 @@ -4252,20 +4316,20 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_22offsets(str __pyx_t_1 = ((!(__pyx_v_self->is_open != 0)) != 0); if (__pyx_t_1) { - /* "MDAnalysis/lib/formats/xtc.pyx":190 - * def offsets(self): + /* "MDAnalysis/lib/formats/xtc.pyx":196 + * print("calc offsets") * if not self.is_open: * return np.array([]) # <<<<<<<<<<<<<< * cdef int n_frames = 0 * cdef int est_nframes = 0 */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { @@ -4278,17 +4342,17 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_22offsets(str } } if (!__pyx_t_5) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -4297,16 +4361,16 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_22offsets(str __pyx_t_2 = 0; goto __pyx_L0; - /* "MDAnalysis/lib/formats/xtc.pyx":189 - * - * def offsets(self): + /* "MDAnalysis/lib/formats/xtc.pyx":195 + * def calc_offsets(self): + * print("calc offsets") * if not self.is_open: # <<<<<<<<<<<<<< * return np.array([]) * cdef int n_frames = 0 */ } - /* "MDAnalysis/lib/formats/xtc.pyx":191 + /* "MDAnalysis/lib/formats/xtc.pyx":197 * if not self.is_open: * return np.array([]) * cdef int n_frames = 0 # <<<<<<<<<<<<<< @@ -4315,300 +4379,337 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_22offsets(str */ __pyx_v_n_frames = 0; - /* "MDAnalysis/lib/formats/xtc.pyx":192 + /* "MDAnalysis/lib/formats/xtc.pyx":198 * return np.array([]) * cdef int n_frames = 0 * cdef int est_nframes = 0 # <<<<<<<<<<<<<< * cdef xdrlib.int64_t* offsets = NULL - * + * ok = xdrlib.read_xtc_n_frames(self.fname, &n_frames, &est_nframes, &offsets); */ __pyx_v_est_nframes = 0; - /* "MDAnalysis/lib/formats/xtc.pyx":193 + /* "MDAnalysis/lib/formats/xtc.pyx":199 * cdef int n_frames = 0 * cdef int est_nframes = 0 * cdef xdrlib.int64_t* offsets = NULL # <<<<<<<<<<<<<< - * * ok = xdrlib.read_xtc_n_frames(self.fname, &n_frames, &est_nframes, &offsets); + * # the read_xtc_n_frames allocates memory for the offsets with an */ __pyx_v_offsets = NULL; - /* "MDAnalysis/lib/formats/xtc.pyx":195 + /* "MDAnalysis/lib/formats/xtc.pyx":200 + * cdef int est_nframes = 0 * cdef xdrlib.int64_t* offsets = NULL - * * ok = xdrlib.read_xtc_n_frames(self.fname, &n_frames, &est_nframes, &offsets); # <<<<<<<<<<<<<< - * - * cdef np.ndarray dims = np.array([est_nframes], dtype=np.int64) + * # the read_xtc_n_frames allocates memory for the offsets with an + * # overestimation. This number is saved in est_nframes and we need to */ - __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_self->fname); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_self->fname); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_ok = read_xtc_n_frames(__pyx_t_7, (&__pyx_v_n_frames), (&__pyx_v_est_nframes), (&__pyx_v_offsets)); - /* "MDAnalysis/lib/formats/xtc.pyx":197 - * ok = xdrlib.read_xtc_n_frames(self.fname, &n_frames, &est_nframes, &offsets); - * + /* "MDAnalysis/lib/formats/xtc.pyx":205 + * # tell the new numpy array about the whole allocated memory to avoid + * # memory leaks. * cdef np.ndarray dims = np.array([est_nframes], dtype=np.int64) # <<<<<<<<<<<<<< - * cdef np.ndarray _offsets = ptr_to_ndarray( offsets, dims, np.NPY_INT64) - * print("read {} frames, estimated {}".format(n_frames, est_nframes)); + * # this handles freeing the allocated memory correctly. + * cdef np.ndarray nd_offsets = ptr_to_ndarray( offsets, dims, np.NPY_INT64) */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_est_nframes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_est_nframes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_dims = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "MDAnalysis/lib/formats/xtc.pyx":198 - * + /* "MDAnalysis/lib/formats/xtc.pyx":207 * cdef np.ndarray dims = np.array([est_nframes], dtype=np.int64) - * cdef np.ndarray _offsets = ptr_to_ndarray( offsets, dims, np.NPY_INT64) # <<<<<<<<<<<<<< - * print("read {} frames, estimated {}".format(n_frames, est_nframes)); - * print("offsets = NULL == {}, ok = {}".format( offsets == NULL, ok)) + * # this handles freeing the allocated memory correctly. + * cdef np.ndarray nd_offsets = ptr_to_ndarray( offsets, dims, np.NPY_INT64) # <<<<<<<<<<<<<< + * return nd_offsets[:n_frames] + * */ __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_dims)); - if (unlikely(!__pyx_t_8.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_5 = ((PyObject *)__pyx_f_10MDAnalysis_3lib_7formats_11cython_util_ptr_to_ndarray(((void *)__pyx_v_offsets), __pyx_t_8, NPY_INT64)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_t_8.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((PyObject *)__pyx_f_10MDAnalysis_3lib_7formats_11cython_util_ptr_to_ndarray(((void *)__pyx_v_offsets), __pyx_t_8, NPY_INT64)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); - __pyx_v__offsets = ((PyArrayObject *)__pyx_t_5); + __pyx_v_nd_offsets = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "MDAnalysis/lib/formats/xtc.pyx":199 - * cdef np.ndarray dims = np.array([est_nframes], dtype=np.int64) - * cdef np.ndarray _offsets = ptr_to_ndarray( offsets, dims, np.NPY_INT64) - * print("read {} frames, estimated {}".format(n_frames, est_nframes)); # <<<<<<<<<<<<<< - * print("offsets = NULL == {}, ok = {}".format( offsets == NULL, ok)) - * print("first offset = {}".format(offsets[0])) + /* "MDAnalysis/lib/formats/xtc.pyx":208 + * # this handles freeing the allocated memory correctly. + * cdef np.ndarray nd_offsets = ptr_to_ndarray( offsets, dims, np.NPY_INT64) + * return nd_offsets[:n_frames] # <<<<<<<<<<<<<< + * + * @property */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_read_frames_estimated, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_n_frames); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_est_nframes); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = NULL; - __pyx_t_9 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_9 = 1; - } - } - __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - if (__pyx_t_3) { - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL; - } - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_4); - __pyx_t_2 = 0; - __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_nd_offsets), 0, __pyx_v_n_frames, NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_PrintOne(0, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; - /* "MDAnalysis/lib/formats/xtc.pyx":200 - * cdef np.ndarray _offsets = ptr_to_ndarray( offsets, dims, np.NPY_INT64) - * print("read {} frames, estimated {}".format(n_frames, est_nframes)); - * print("offsets = NULL == {}, ok = {}".format( offsets == NULL, ok)) # <<<<<<<<<<<<<< - * print("first offset = {}".format(offsets[0])) - * print("len(_offsets) == {}".format(_offsets.size)) + /* "MDAnalysis/lib/formats/xtc.pyx":193 + * return self.current_frame + * + * def calc_offsets(self): # <<<<<<<<<<<<<< + * print("calc offsets") + * if not self.is_open: */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_offsets_NULL_ok, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_10 = __Pyx_PyBool_FromLong((__pyx_v_offsets == NULL)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_ok); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = NULL; - __pyx_t_9 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_9 = 1; - } - } - __pyx_t_3 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (__pyx_t_2) { - __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = NULL; - } - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_9, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_9, __pyx_t_4); - __pyx_t_10 = 0; - __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_PrintOne(0, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "MDAnalysis/lib/formats/xtc.pyx":201 - * print("read {} frames, estimated {}".format(n_frames, est_nframes)); - * print("offsets = NULL == {}, ok = {}".format( offsets == NULL, ok)) - * print("first offset = {}".format(offsets[0])) # <<<<<<<<<<<<<< - * print("len(_offsets) == {}".format(_offsets.size)) + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); + __Pyx_AddTraceback("MDAnalysis.lib.formats.xtc.XTCFile.calc_offsets", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_dims); + __Pyx_XDECREF((PyObject *)__pyx_v_nd_offsets); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "MDAnalysis/lib/formats/xtc.pyx":211 * + * @property + * def offsets(self): # <<<<<<<<<<<<<< + * if not self._has_offsets: + * self._offsets = self.calc_offsets() */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_first_offset, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyInt_From_int64_t((__pyx_v_offsets[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); + +/* Python wrapper */ +static PyObject *__pyx_pw_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_25offsets(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_25offsets(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("offsets (wrapper)", 0); + __pyx_r = __pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_24offsets(((struct __pyx_obj_10MDAnalysis_3lib_7formats_3xtc_XTCFile *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_24offsets(struct __pyx_obj_10MDAnalysis_3lib_7formats_3xtc_XTCFile *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("offsets", 0); + + /* "MDAnalysis/lib/formats/xtc.pyx":212 + * @property + * def offsets(self): + * if not self._has_offsets: # <<<<<<<<<<<<<< + * self._offsets = self.calc_offsets() + * self._has_offsets = True + */ + __pyx_t_1 = ((!(__pyx_v_self->_has_offsets != 0)) != 0); + if (__pyx_t_1) { + + /* "MDAnalysis/lib/formats/xtc.pyx":213 + * def offsets(self): + * if not self._has_offsets: + * self._offsets = self.calc_offsets() # <<<<<<<<<<<<<< + * self._has_offsets = True + * return self._offsets + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_calc_offsets_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } } - } - if (!__pyx_t_4) { - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_4) { + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GOTREF(__pyx_t_5); - } else { - __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4); __pyx_t_4 = NULL; - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->_offsets); + __Pyx_DECREF(((PyObject *)__pyx_v_self->_offsets)); + __pyx_v_self->_offsets = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "MDAnalysis/lib/formats/xtc.pyx":214 + * if not self._has_offsets: + * self._offsets = self.calc_offsets() + * self._has_offsets = True # <<<<<<<<<<<<<< + * return self._offsets + * + */ + __pyx_v_self->_has_offsets = 1; + + /* "MDAnalysis/lib/formats/xtc.pyx":212 + * @property + * def offsets(self): + * if not self._has_offsets: # <<<<<<<<<<<<<< + * self._offsets = self.calc_offsets() + * self._has_offsets = True + */ } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_PrintOne(0, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "MDAnalysis/lib/formats/xtc.pyx":202 - * print("offsets = NULL == {}, ok = {}".format( offsets == NULL, ok)) - * print("first offset = {}".format(offsets[0])) - * print("len(_offsets) == {}".format(_offsets.size)) # <<<<<<<<<<<<<< + /* "MDAnalysis/lib/formats/xtc.pyx":215 + * self._offsets = self.calc_offsets() + * self._has_offsets = True + * return self._offsets # <<<<<<<<<<<<<< + * + * @offsets.setter + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->_offsets)); + __pyx_r = ((PyObject *)__pyx_v_self->_offsets); + goto __pyx_L0; + + /* "MDAnalysis/lib/formats/xtc.pyx":211 + * + * @property + * def offsets(self): # <<<<<<<<<<<<<< + * if not self._has_offsets: + * self._offsets = self.calc_offsets() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("MDAnalysis.lib.formats.xtc.XTCFile.offsets", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "MDAnalysis/lib/formats/xtc.pyx":218 + * + * @offsets.setter + * def offsets(self, offsets): # <<<<<<<<<<<<<< + * self._offsets = offsets + * self._has_offsets = True + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_27offsets(PyObject *__pyx_v_self, PyObject *__pyx_v_offsets); /*proto*/ +static PyObject *__pyx_pw_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_27offsets(PyObject *__pyx_v_self, PyObject *__pyx_v_offsets) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("offsets (wrapper)", 0); + __pyx_r = __pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_26offsets(((struct __pyx_obj_10MDAnalysis_3lib_7formats_3xtc_XTCFile *)__pyx_v_self), ((PyObject *)__pyx_v_offsets)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_26offsets(struct __pyx_obj_10MDAnalysis_3lib_7formats_3xtc_XTCFile *__pyx_v_self, PyObject *__pyx_v_offsets) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("offsets", 0); + + /* "MDAnalysis/lib/formats/xtc.pyx":219 + * @offsets.setter + * def offsets(self, offsets): + * self._offsets = offsets # <<<<<<<<<<<<<< + * self._has_offsets = True * - * return _offsets[:n_frames] */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_len__offsets, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v__offsets), __pyx_n_s_size); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - } - } - if (!__pyx_t_3) { - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_10); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_GOTREF(__pyx_t_5); - } else { - __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_PrintOne(0, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_v_offsets) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_offsets, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_v_offsets; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_offsets); + __Pyx_DECREF(((PyObject *)__pyx_v_self->_offsets)); + __pyx_v_self->_offsets = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; - /* "MDAnalysis/lib/formats/xtc.pyx":204 - * print("len(_offsets) == {}".format(_offsets.size)) - * - * return _offsets[:n_frames] # <<<<<<<<<<<<<< + /* "MDAnalysis/lib/formats/xtc.pyx":220 + * def offsets(self, offsets): + * self._offsets = offsets + * self._has_offsets = True # <<<<<<<<<<<<<< * * def read(self): */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v__offsets), 0, __pyx_v_n_frames, NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; - goto __pyx_L0; + __pyx_v_self->_has_offsets = 1; - /* "MDAnalysis/lib/formats/xtc.pyx":188 - * return self.current_frame + /* "MDAnalysis/lib/formats/xtc.pyx":218 * - * def offsets(self): # <<<<<<<<<<<<<< - * if not self.is_open: - * return np.array([]) + * @offsets.setter + * def offsets(self, offsets): # <<<<<<<<<<<<<< + * self._offsets = offsets + * self._has_offsets = True */ /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); - __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("MDAnalysis.lib.formats.xtc.XTCFile.offsets", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_dims); - __Pyx_XDECREF((PyObject *)__pyx_v__offsets); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "MDAnalysis/lib/formats/xtc.pyx":206 - * return _offsets[:n_frames] +/* "MDAnalysis/lib/formats/xtc.pyx":222 + * self._has_offsets = True * * def read(self): # <<<<<<<<<<<<<< * """Read one frame in the XTC file @@ -4616,20 +4717,20 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_22offsets(str */ /* Python wrapper */ -static PyObject *__pyx_pw_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_25read(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_24read[] = "Read one frame in the XTC file\n\n Returns\n -------\n xyz: ndarray, shape=(n_atoms, 3)\n cartesion coordinates\n box: ndarray, shape=(3, 3)\n Box vectors for this frame\n int\n current step number, 1 indexed\n float\n current time\n float\n precision used to save file\n\n Raises\n ------\n RuntimeError\n Something must have happened reading the file\n "; -static PyObject *__pyx_pw_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_25read(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pw_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_29read(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_28read[] = "Read one frame in the XTC file\n\n Returns\n -------\n xyz: ndarray, shape=(n_atoms, 3)\n cartesion coordinates\n box: ndarray, shape=(3, 3)\n Box vectors for this frame\n int\n current step number, 1 indexed\n float\n current time\n float\n precision used to save file\n\n Raises\n ------\n RuntimeError\n Something must have happened reading the file\n "; +static PyObject *__pyx_pw_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_29read(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("read (wrapper)", 0); - __pyx_r = __pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_24read(((struct __pyx_obj_10MDAnalysis_3lib_7formats_3xtc_XTCFile *)__pyx_v_self)); + __pyx_r = __pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_28read(((struct __pyx_obj_10MDAnalysis_3lib_7formats_3xtc_XTCFile *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_24read(struct __pyx_obj_10MDAnalysis_3lib_7formats_3xtc_XTCFile *__pyx_v_self) { +static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_28read(struct __pyx_obj_10MDAnalysis_3lib_7formats_3xtc_XTCFile *__pyx_v_self) { int __pyx_v_return_code; int __pyx_v_step; float __pyx_v_time; @@ -4650,7 +4751,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_24read(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("read", 0); - /* "MDAnalysis/lib/formats/xtc.pyx":227 + /* "MDAnalysis/lib/formats/xtc.pyx":243 * Something must have happened reading the file * """ * if self.reached_eof: # <<<<<<<<<<<<<< @@ -4660,20 +4761,20 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_24read(struct __pyx_t_1 = (__pyx_v_self->reached_eof != 0); if (__pyx_t_1) { - /* "MDAnalysis/lib/formats/xtc.pyx":228 + /* "MDAnalysis/lib/formats/xtc.pyx":244 * """ * if self.reached_eof: * raise RuntimeError('Reached last frame in XTC, seek to 0') # <<<<<<<<<<<<<< * if not self.is_open: * raise RuntimeError('No file opened') */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "MDAnalysis/lib/formats/xtc.pyx":227 + /* "MDAnalysis/lib/formats/xtc.pyx":243 * Something must have happened reading the file * """ * if self.reached_eof: # <<<<<<<<<<<<<< @@ -4682,7 +4783,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_24read(struct */ } - /* "MDAnalysis/lib/formats/xtc.pyx":229 + /* "MDAnalysis/lib/formats/xtc.pyx":245 * if self.reached_eof: * raise RuntimeError('Reached last frame in XTC, seek to 0') * if not self.is_open: # <<<<<<<<<<<<<< @@ -4692,20 +4793,20 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_24read(struct __pyx_t_1 = ((!(__pyx_v_self->is_open != 0)) != 0); if (__pyx_t_1) { - /* "MDAnalysis/lib/formats/xtc.pyx":230 + /* "MDAnalysis/lib/formats/xtc.pyx":246 * raise RuntimeError('Reached last frame in XTC, seek to 0') * if not self.is_open: * raise RuntimeError('No file opened') # <<<<<<<<<<<<<< * if self.mode != 'r': * raise RuntimeError('File opened in mode: {}. Reading only allow ' */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "MDAnalysis/lib/formats/xtc.pyx":229 + /* "MDAnalysis/lib/formats/xtc.pyx":245 * if self.reached_eof: * raise RuntimeError('Reached last frame in XTC, seek to 0') * if not self.is_open: # <<<<<<<<<<<<<< @@ -4714,50 +4815,50 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_24read(struct */ } - /* "MDAnalysis/lib/formats/xtc.pyx":231 + /* "MDAnalysis/lib/formats/xtc.pyx":247 * if not self.is_open: * raise RuntimeError('No file opened') * if self.mode != 'r': # <<<<<<<<<<<<<< * raise RuntimeError('File opened in mode: {}. Reading only allow ' * 'in mode "r"'.format('self.mode')) */ - __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_self->mode, __pyx_n_s_r, Py_NE)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_self->mode, __pyx_n_s_r, Py_NE)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = (__pyx_t_1 != 0); if (__pyx_t_3) { - /* "MDAnalysis/lib/formats/xtc.pyx":233 + /* "MDAnalysis/lib/formats/xtc.pyx":249 * if self.mode != 'r': * raise RuntimeError('File opened in mode: {}. Reading only allow ' * 'in mode "r"'.format('self.mode')) # <<<<<<<<<<<<<< * * cdef int return_code = 1 */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_File_opened_in_mode_Reading_only, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_File_opened_in_mode_Reading_only, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "MDAnalysis/lib/formats/xtc.pyx":232 + /* "MDAnalysis/lib/formats/xtc.pyx":248 * raise RuntimeError('No file opened') * if self.mode != 'r': * raise RuntimeError('File opened in mode: {}. Reading only allow ' # <<<<<<<<<<<<<< * 'in mode "r"'.format('self.mode')) * */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "MDAnalysis/lib/formats/xtc.pyx":231 + /* "MDAnalysis/lib/formats/xtc.pyx":247 * if not self.is_open: * raise RuntimeError('No file opened') * if self.mode != 'r': # <<<<<<<<<<<<<< @@ -4766,7 +4867,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_24read(struct */ } - /* "MDAnalysis/lib/formats/xtc.pyx":235 + /* "MDAnalysis/lib/formats/xtc.pyx":251 * 'in mode "r"'.format('self.mode')) * * cdef int return_code = 1 # <<<<<<<<<<<<<< @@ -4775,23 +4876,23 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_24read(struct */ __pyx_v_return_code = 1; - /* "MDAnalysis/lib/formats/xtc.pyx":239 + /* "MDAnalysis/lib/formats/xtc.pyx":255 * cdef float time, prec * * cdef np.ndarray xyz = np.empty((self.n_atoms, DIMS), dtype=DTYPE) # <<<<<<<<<<<<<< * cdef np.ndarray box = np.empty((DIMS, DIMS), dtype=DTYPE) * */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->n_atoms); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->n_atoms); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_10MDAnalysis_3lib_7formats_3xtc_DIMS); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_10MDAnalysis_3lib_7formats_3xtc_DIMS); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); @@ -4799,43 +4900,43 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_24read(struct PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); __pyx_t_4 = 0; __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_xyz = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "MDAnalysis/lib/formats/xtc.pyx":240 + /* "MDAnalysis/lib/formats/xtc.pyx":256 * * cdef np.ndarray xyz = np.empty((self.n_atoms, DIMS), dtype=DTYPE) * cdef np.ndarray box = np.empty((DIMS, DIMS), dtype=DTYPE) # <<<<<<<<<<<<<< * * return_code = xdrlib.read_xtc(self.xfp, self.n_atoms, &step, */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_10MDAnalysis_3lib_7formats_3xtc_DIMS); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_10MDAnalysis_3lib_7formats_3xtc_DIMS); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_10MDAnalysis_3lib_7formats_3xtc_DIMS); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_10MDAnalysis_3lib_7formats_3xtc_DIMS); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); @@ -4843,27 +4944,27 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_24read(struct PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); __pyx_t_4 = 0; __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_box = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "MDAnalysis/lib/formats/xtc.pyx":242 + /* "MDAnalysis/lib/formats/xtc.pyx":258 * cdef np.ndarray box = np.empty((DIMS, DIMS), dtype=DTYPE) * * return_code = xdrlib.read_xtc(self.xfp, self.n_atoms, &step, # <<<<<<<<<<<<<< @@ -4872,7 +4973,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_24read(struct */ __pyx_v_return_code = read_xtc(__pyx_v_self->xfp, __pyx_v_self->n_atoms, ((int *)(&__pyx_v_step)), (&__pyx_v_time), ((float (*)[3])__pyx_v_box->data), ((rvec *)__pyx_v_xyz->data), ((float *)(&__pyx_v_prec))); - /* "MDAnalysis/lib/formats/xtc.pyx":245 + /* "MDAnalysis/lib/formats/xtc.pyx":261 * &time, box.data, * xyz.data, &prec) * if return_code != xdrlib.EOK and return_code != xdrlib.EENDOFFILE: # <<<<<<<<<<<<<< @@ -4890,16 +4991,16 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_24read(struct } if (__pyx_t_3) { - /* "MDAnalysis/lib/formats/xtc.pyx":246 + /* "MDAnalysis/lib/formats/xtc.pyx":262 * xyz.data, &prec) * if return_code != xdrlib.EOK and return_code != xdrlib.EENDOFFILE: * raise RuntimeError('XTC Read Error occured: {}'.format(return_code)) # <<<<<<<<<<<<<< * * if return_code == xdrlib.EENDOFFILE: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_XTC_Read_Error_occured, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_XTC_Read_Error_occured, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_return_code); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_return_code); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { @@ -4912,34 +5013,34 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_24read(struct } } if (!__pyx_t_6) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); } else { - __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "MDAnalysis/lib/formats/xtc.pyx":245 + /* "MDAnalysis/lib/formats/xtc.pyx":261 * &time, box.data, * xyz.data, &prec) * if return_code != xdrlib.EOK and return_code != xdrlib.EENDOFFILE: # <<<<<<<<<<<<<< @@ -4948,7 +5049,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_24read(struct */ } - /* "MDAnalysis/lib/formats/xtc.pyx":248 + /* "MDAnalysis/lib/formats/xtc.pyx":264 * raise RuntimeError('XTC Read Error occured: {}'.format(return_code)) * * if return_code == xdrlib.EENDOFFILE: # <<<<<<<<<<<<<< @@ -4958,7 +5059,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_24read(struct __pyx_t_3 = ((__pyx_v_return_code == __pyx_e_10MDAnalysis_3lib_7formats_6xdrlib_EENDOFFILE) != 0); if (__pyx_t_3) { - /* "MDAnalysis/lib/formats/xtc.pyx":249 + /* "MDAnalysis/lib/formats/xtc.pyx":265 * * if return_code == xdrlib.EENDOFFILE: * self.reached_eof = True # <<<<<<<<<<<<<< @@ -4967,7 +5068,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_24read(struct */ __pyx_v_self->reached_eof = 1; - /* "MDAnalysis/lib/formats/xtc.pyx":250 + /* "MDAnalysis/lib/formats/xtc.pyx":266 * if return_code == xdrlib.EENDOFFILE: * self.reached_eof = True * raise StopIteration # <<<<<<<<<<<<<< @@ -4975,9 +5076,9 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_24read(struct * if return_code == xdrlib.EOK: */ __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "MDAnalysis/lib/formats/xtc.pyx":248 + /* "MDAnalysis/lib/formats/xtc.pyx":264 * raise RuntimeError('XTC Read Error occured: {}'.format(return_code)) * * if return_code == xdrlib.EENDOFFILE: # <<<<<<<<<<<<<< @@ -4986,7 +5087,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_24read(struct */ } - /* "MDAnalysis/lib/formats/xtc.pyx":252 + /* "MDAnalysis/lib/formats/xtc.pyx":268 * raise StopIteration * * if return_code == xdrlib.EOK: # <<<<<<<<<<<<<< @@ -4996,7 +5097,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_24read(struct __pyx_t_3 = ((__pyx_v_return_code == __pyx_e_10MDAnalysis_3lib_7formats_6xdrlib_EOK) != 0); if (__pyx_t_3) { - /* "MDAnalysis/lib/formats/xtc.pyx":253 + /* "MDAnalysis/lib/formats/xtc.pyx":269 * * if return_code == xdrlib.EOK: * self.current_frame += 1 # <<<<<<<<<<<<<< @@ -5005,7 +5106,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_24read(struct */ __pyx_v_self->current_frame = (__pyx_v_self->current_frame + 1); - /* "MDAnalysis/lib/formats/xtc.pyx":252 + /* "MDAnalysis/lib/formats/xtc.pyx":268 * raise StopIteration * * if return_code == xdrlib.EOK: # <<<<<<<<<<<<<< @@ -5014,7 +5115,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_24read(struct */ } - /* "MDAnalysis/lib/formats/xtc.pyx":255 + /* "MDAnalysis/lib/formats/xtc.pyx":271 * self.current_frame += 1 * # TODO:(max) this is perfect to return a named tuple! * return xyz, box, step, time, prec # <<<<<<<<<<<<<< @@ -5022,13 +5123,13 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_24read(struct * def write(self, xyz, box, int step, float time, float prec=1000.0): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_step); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_step); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = PyFloat_FromDouble(__pyx_v_prec); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_prec); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_xyz)); __Pyx_GIVEREF(((PyObject *)__pyx_v_xyz)); @@ -5049,8 +5150,8 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_24read(struct __pyx_t_5 = 0; goto __pyx_L0; - /* "MDAnalysis/lib/formats/xtc.pyx":206 - * return _offsets[:n_frames] + /* "MDAnalysis/lib/formats/xtc.pyx":222 + * self._has_offsets = True * * def read(self): # <<<<<<<<<<<<<< * """Read one frame in the XTC file @@ -5074,7 +5175,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_24read(struct return __pyx_r; } -/* "MDAnalysis/lib/formats/xtc.pyx":257 +/* "MDAnalysis/lib/formats/xtc.pyx":273 * return xyz, box, step, time, prec * * def write(self, xyz, box, int step, float time, float prec=1000.0): # <<<<<<<<<<<<<< @@ -5083,9 +5184,9 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_24read(struct */ /* Python wrapper */ -static PyObject *__pyx_pw_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_27write(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_26write[] = "write one frame into XTC file\n\n Parameters\n ----------\n xyz: ndarray, shape=(n_atoms, 3)\n cartesion coordinates\n box: ndarray, shape=(3, 3)\n Box vectors for this frame\n step: int\n current step number, 1 indexed\n time: float\n current time\n pref: float (optional)\n precision used to save file\n\n Raises\n ------\n RuntimeError\n Couldn't write the file\n ValueError\n The arguments to not match with previous saved frames.\n "; -static PyObject *__pyx_pw_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_27write(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_31write(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_30write[] = "write one frame into XTC file\n\n Parameters\n ----------\n xyz: ndarray, shape=(n_atoms, 3)\n cartesion coordinates\n box: ndarray, shape=(3, 3)\n Box vectors for this frame\n step: int\n current step number, 1 indexed\n time: float\n current time\n pref: float (optional)\n precision used to save file\n\n Raises\n ------\n RuntimeError\n Couldn't write the file\n ValueError\n The arguments to not match with previous saved frames.\n "; +static PyObject *__pyx_pw_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_31write(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_xyz = 0; PyObject *__pyx_v_box = 0; int __pyx_v_step; @@ -5120,17 +5221,17 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_27write(PyObj case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_box)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("write", 0, 4, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("write", 0, 4, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_step)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("write", 0, 4, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("write", 0, 4, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_time)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("write", 0, 4, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("write", 0, 4, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (kw_args > 0) { @@ -5139,7 +5240,7 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_27write(PyObj } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -5154,30 +5255,30 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_27write(PyObj } __pyx_v_xyz = values[0]; __pyx_v_box = values[1]; - __pyx_v_step = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_step == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_time = __pyx_PyFloat_AsFloat(values[3]); if (unlikely((__pyx_v_time == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_step = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_step == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_time = __pyx_PyFloat_AsFloat(values[3]); if (unlikely((__pyx_v_time == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L3_error;} if (values[4]) { - __pyx_v_prec = __pyx_PyFloat_AsFloat(values[4]); if (unlikely((__pyx_v_prec == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_prec = __pyx_PyFloat_AsFloat(values[4]); if (unlikely((__pyx_v_prec == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_prec = ((float)1000.0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("write", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("write", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("MDAnalysis.lib.formats.xtc.XTCFile.write", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_26write(((struct __pyx_obj_10MDAnalysis_3lib_7formats_3xtc_XTCFile *)__pyx_v_self), __pyx_v_xyz, __pyx_v_box, __pyx_v_step, __pyx_v_time, __pyx_v_prec); + __pyx_r = __pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_30write(((struct __pyx_obj_10MDAnalysis_3lib_7formats_3xtc_XTCFile *)__pyx_v_self), __pyx_v_xyz, __pyx_v_box, __pyx_v_step, __pyx_v_time, __pyx_v_prec); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_26write(struct __pyx_obj_10MDAnalysis_3lib_7formats_3xtc_XTCFile *__pyx_v_self, PyObject *__pyx_v_xyz, PyObject *__pyx_v_box, int __pyx_v_step, float __pyx_v_time, float __pyx_v_prec) { +static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_30write(struct __pyx_obj_10MDAnalysis_3lib_7formats_3xtc_XTCFile *__pyx_v_self, PyObject *__pyx_v_xyz, PyObject *__pyx_v_box, int __pyx_v_step, float __pyx_v_time, float __pyx_v_prec) { __Pyx_memviewslice __pyx_v_xyz_view = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_box_view = { 0, 0, { 0 }, { 0 }, { 0 } }; int __pyx_v_return_code; @@ -5203,50 +5304,50 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_26write(struc int __pyx_clineno = 0; __Pyx_RefNannySetupContext("write", 0); - /* "MDAnalysis/lib/formats/xtc.pyx":280 + /* "MDAnalysis/lib/formats/xtc.pyx":296 * The arguments to not match with previous saved frames. * """ * if self.mode != 'w': # <<<<<<<<<<<<<< * raise RuntimeError('File opened in mode: {}. Writing only allow ' * 'in mode "w"'.format('self.mode')) */ - __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_self->mode, __pyx_n_s_w, Py_NE)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_self->mode, __pyx_n_s_w, Py_NE)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "MDAnalysis/lib/formats/xtc.pyx":282 + /* "MDAnalysis/lib/formats/xtc.pyx":298 * if self.mode != 'w': * raise RuntimeError('File opened in mode: {}. Writing only allow ' * 'in mode "w"'.format('self.mode')) # <<<<<<<<<<<<<< * * cdef DTYPE_T[:, ::1] xyz_view = np.ascontiguousarray(xyz, dtype=DTYPE) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_File_opened_in_mode_Writing_only, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_File_opened_in_mode_Writing_only, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "MDAnalysis/lib/formats/xtc.pyx":281 + /* "MDAnalysis/lib/formats/xtc.pyx":297 * """ * if self.mode != 'w': * raise RuntimeError('File opened in mode: {}. Writing only allow ' # <<<<<<<<<<<<<< * 'in mode "w"'.format('self.mode')) * */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "MDAnalysis/lib/formats/xtc.pyx":280 + /* "MDAnalysis/lib/formats/xtc.pyx":296 * The arguments to not match with previous saved frames. * """ * if self.mode != 'w': # <<<<<<<<<<<<<< @@ -5255,77 +5356,77 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_26write(struc */ } - /* "MDAnalysis/lib/formats/xtc.pyx":284 + /* "MDAnalysis/lib/formats/xtc.pyx":300 * 'in mode "w"'.format('self.mode')) * * cdef DTYPE_T[:, ::1] xyz_view = np.ascontiguousarray(xyz, dtype=DTYPE) # <<<<<<<<<<<<<< * cdef DTYPE_T[:, ::1] box_view = np.ascontiguousarray(box, dtype=DTYPE) * */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_xyz); __Pyx_GIVEREF(__pyx_v_xyz); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_xyz); - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_10MDAnalysis_3lib_7formats_3xtc_DTYPE_T(__pyx_t_6); - if (unlikely(!__pyx_t_7.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_t_7.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_xyz_view = __pyx_t_7; __pyx_t_7.memview = NULL; __pyx_t_7.data = NULL; - /* "MDAnalysis/lib/formats/xtc.pyx":285 + /* "MDAnalysis/lib/formats/xtc.pyx":301 * * cdef DTYPE_T[:, ::1] xyz_view = np.ascontiguousarray(xyz, dtype=DTYPE) * cdef DTYPE_T[:, ::1] box_view = np.ascontiguousarray(box, dtype=DTYPE) # <<<<<<<<<<<<<< * * if self.current_frame == 0: */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_box); __Pyx_GIVEREF(__pyx_v_box); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_box); - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_10MDAnalysis_3lib_7formats_3xtc_DTYPE_T(__pyx_t_3); - if (unlikely(!__pyx_t_7.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__pyx_t_7.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_box_view = __pyx_t_7; __pyx_t_7.memview = NULL; __pyx_t_7.data = NULL; - /* "MDAnalysis/lib/formats/xtc.pyx":287 + /* "MDAnalysis/lib/formats/xtc.pyx":303 * cdef DTYPE_T[:, ::1] box_view = np.ascontiguousarray(box, dtype=DTYPE) * * if self.current_frame == 0: # <<<<<<<<<<<<<< @@ -5335,30 +5436,30 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_26write(struc __pyx_t_2 = ((__pyx_v_self->current_frame == 0) != 0); if (__pyx_t_2) { - /* "MDAnalysis/lib/formats/xtc.pyx":288 + /* "MDAnalysis/lib/formats/xtc.pyx":304 * * if self.current_frame == 0: * self.n_atoms = xyz.shape[0] # <<<<<<<<<<<<<< * self.box = box * else: */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_xyz, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_xyz, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_self->n_atoms = __pyx_t_8; - /* "MDAnalysis/lib/formats/xtc.pyx":289 + /* "MDAnalysis/lib/formats/xtc.pyx":305 * if self.current_frame == 0: * self.n_atoms = xyz.shape[0] * self.box = box # <<<<<<<<<<<<<< * else: * if self.n_atoms != xyz.shape[0]: */ - if (!(likely(((__pyx_v_box) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_box, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_v_box) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_box, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __pyx_v_box; __Pyx_INCREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); @@ -5367,7 +5468,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_26write(struc __pyx_v_self->box = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "MDAnalysis/lib/formats/xtc.pyx":287 + /* "MDAnalysis/lib/formats/xtc.pyx":303 * cdef DTYPE_T[:, ::1] box_view = np.ascontiguousarray(box, dtype=DTYPE) * * if self.current_frame == 0: # <<<<<<<<<<<<<< @@ -5377,7 +5478,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_26write(struc goto __pyx_L4; } - /* "MDAnalysis/lib/formats/xtc.pyx":291 + /* "MDAnalysis/lib/formats/xtc.pyx":307 * self.box = box * else: * if self.n_atoms != xyz.shape[0]: # <<<<<<<<<<<<<< @@ -5385,42 +5486,42 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_26write(struc * 'are trying to write {} atoms.'.format( */ /*else*/ { - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->n_atoms); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->n_atoms); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_xyz, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_xyz, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { - /* "MDAnalysis/lib/formats/xtc.pyx":293 + /* "MDAnalysis/lib/formats/xtc.pyx":309 * if self.n_atoms != xyz.shape[0]: * raise ValueError('Previous frames contained {} atoms. You ' * 'are trying to write {} atoms.'.format( # <<<<<<<<<<<<<< * self.n_atoms, xyz.shape[1])) * if not np.allclose(self.box, box, rtol=0, atol=8): */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Previous_frames_contained_atoms, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Previous_frames_contained_atoms, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - /* "MDAnalysis/lib/formats/xtc.pyx":294 + /* "MDAnalysis/lib/formats/xtc.pyx":310 * raise ValueError('Previous frames contained {} atoms. You ' * 'are trying to write {} atoms.'.format( * self.n_atoms, xyz.shape[1])) # <<<<<<<<<<<<<< * if not np.allclose(self.box, box, rtol=0, atol=8): * raise ValueError('Previous frames contained {} box. You ' */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->n_atoms); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->n_atoms); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_xyz, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_xyz, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -5435,7 +5536,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_26write(struc __pyx_t_10 = 1; } } - __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5); __pyx_t_5 = NULL; @@ -5446,31 +5547,31 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_26write(struc PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_9); __pyx_t_4 = 0; __pyx_t_9 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "MDAnalysis/lib/formats/xtc.pyx":292 + /* "MDAnalysis/lib/formats/xtc.pyx":308 * else: * if self.n_atoms != xyz.shape[0]: * raise ValueError('Previous frames contained {} atoms. You ' # <<<<<<<<<<<<<< * 'are trying to write {} atoms.'.format( * self.n_atoms, xyz.shape[1])) */ - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "MDAnalysis/lib/formats/xtc.pyx":291 + /* "MDAnalysis/lib/formats/xtc.pyx":307 * self.box = box * else: * if self.n_atoms != xyz.shape[0]: # <<<<<<<<<<<<<< @@ -5479,19 +5580,19 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_26write(struc */ } - /* "MDAnalysis/lib/formats/xtc.pyx":295 + /* "MDAnalysis/lib/formats/xtc.pyx":311 * 'are trying to write {} atoms.'.format( * self.n_atoms, xyz.shape[1])) * if not np.allclose(self.box, box, rtol=0, atol=8): # <<<<<<<<<<<<<< * raise ValueError('Previous frames contained {} box. You ' * 'are trying to write {} box.'.format( */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_allclose); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_allclose); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self->box)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self->box)); @@ -5499,31 +5600,31 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_26write(struc __Pyx_INCREF(__pyx_v_box); __Pyx_GIVEREF(__pyx_v_box); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_box); - __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_rtol, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_atol, __pyx_int_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, __pyx_t_11); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_rtol, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_atol, __pyx_int_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, __pyx_t_11); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_1 = ((!__pyx_t_2) != 0); if (__pyx_t_1) { - /* "MDAnalysis/lib/formats/xtc.pyx":297 + /* "MDAnalysis/lib/formats/xtc.pyx":313 * if not np.allclose(self.box, box, rtol=0, atol=8): * raise ValueError('Previous frames contained {} box. You ' * 'are trying to write {} box.'.format( # <<<<<<<<<<<<<< * self.box, box)) * */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Previous_frames_contained_box_Yo, __pyx_n_s_format); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Previous_frames_contained_box_Yo, __pyx_n_s_format); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - /* "MDAnalysis/lib/formats/xtc.pyx":298 + /* "MDAnalysis/lib/formats/xtc.pyx":314 * raise ValueError('Previous frames contained {} box. You ' * 'are trying to write {} box.'.format( * self.box, box)) # <<<<<<<<<<<<<< @@ -5542,7 +5643,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_26write(struc __pyx_t_10 = 1; } } - __pyx_t_6 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL; @@ -5553,31 +5654,31 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_26write(struc __Pyx_INCREF(__pyx_v_box); __Pyx_GIVEREF(__pyx_v_box); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_10, __pyx_v_box); - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_6, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_6, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "MDAnalysis/lib/formats/xtc.pyx":296 + /* "MDAnalysis/lib/formats/xtc.pyx":312 * self.n_atoms, xyz.shape[1])) * if not np.allclose(self.box, box, rtol=0, atol=8): * raise ValueError('Previous frames contained {} box. You ' # <<<<<<<<<<<<<< * 'are trying to write {} box.'.format( * self.box, box)) */ - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "MDAnalysis/lib/formats/xtc.pyx":295 + /* "MDAnalysis/lib/formats/xtc.pyx":311 * 'are trying to write {} atoms.'.format( * self.n_atoms, xyz.shape[1])) * if not np.allclose(self.box, box, rtol=0, atol=8): # <<<<<<<<<<<<<< @@ -5588,7 +5689,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_26write(struc } __pyx_L4:; - /* "MDAnalysis/lib/formats/xtc.pyx":302 + /* "MDAnalysis/lib/formats/xtc.pyx":318 * cdef int return_code * return_code = xdrlib.write_xtc(self.xfp, self.n_atoms, step, time, * &box_view[0, 0], # <<<<<<<<<<<<<< @@ -5608,10 +5709,10 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_26write(struc } else if (unlikely(__pyx_t_13 >= __pyx_v_box_view.shape[1])) __pyx_t_8 = 1; if (unlikely(__pyx_t_8 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_8); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "MDAnalysis/lib/formats/xtc.pyx":303 + /* "MDAnalysis/lib/formats/xtc.pyx":319 * return_code = xdrlib.write_xtc(self.xfp, self.n_atoms, step, time, * &box_view[0, 0], * &xyz_view[0, 0], prec) # <<<<<<<<<<<<<< @@ -5631,10 +5732,10 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_26write(struc } else if (unlikely(__pyx_t_15 >= __pyx_v_xyz_view.shape[1])) __pyx_t_8 = 1; if (unlikely(__pyx_t_8 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_8); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "MDAnalysis/lib/formats/xtc.pyx":301 + /* "MDAnalysis/lib/formats/xtc.pyx":317 * * cdef int return_code * return_code = xdrlib.write_xtc(self.xfp, self.n_atoms, step, time, # <<<<<<<<<<<<<< @@ -5643,7 +5744,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_26write(struc */ __pyx_v_return_code = write_xtc(__pyx_v_self->xfp, __pyx_v_self->n_atoms, __pyx_v_step, __pyx_v_time, ((float (*)[3])(&(*((__pyx_t_10MDAnalysis_3lib_7formats_3xtc_DTYPE_T *) ( /* dim=1 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_7formats_3xtc_DTYPE_T *) ( /* dim=0 */ (__pyx_v_box_view.data + __pyx_t_12 * __pyx_v_box_view.strides[0]) )) + __pyx_t_13)) ))))), ((rvec *)(&(*((__pyx_t_10MDAnalysis_3lib_7formats_3xtc_DTYPE_T *) ( /* dim=1 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_7formats_3xtc_DTYPE_T *) ( /* dim=0 */ (__pyx_v_xyz_view.data + __pyx_t_14 * __pyx_v_xyz_view.strides[0]) )) + __pyx_t_15)) ))))), __pyx_v_prec); - /* "MDAnalysis/lib/formats/xtc.pyx":304 + /* "MDAnalysis/lib/formats/xtc.pyx":320 * &box_view[0, 0], * &xyz_view[0, 0], prec) * if return_code != xdrlib.EOK: # <<<<<<<<<<<<<< @@ -5653,16 +5754,16 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_26write(struc __pyx_t_1 = ((__pyx_v_return_code != __pyx_e_10MDAnalysis_3lib_7formats_6xdrlib_EOK) != 0); if (__pyx_t_1) { - /* "MDAnalysis/lib/formats/xtc.pyx":305 + /* "MDAnalysis/lib/formats/xtc.pyx":321 * &xyz_view[0, 0], prec) * if return_code != xdrlib.EOK: * raise RuntimeError('XTC write error: {}'.format(return_code)) # <<<<<<<<<<<<<< * * self.current_frame += 1 */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_XTC_write_error, __pyx_n_s_format); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_XTC_write_error, __pyx_n_s_format); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_return_code); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_return_code); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_11))) { @@ -5675,34 +5776,34 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_26write(struc } } if (!__pyx_t_3) { - __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_6); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_6); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_9); } else { - __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_4, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_4, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "MDAnalysis/lib/formats/xtc.pyx":304 + /* "MDAnalysis/lib/formats/xtc.pyx":320 * &box_view[0, 0], * &xyz_view[0, 0], prec) * if return_code != xdrlib.EOK: # <<<<<<<<<<<<<< @@ -5711,14 +5812,14 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_26write(struc */ } - /* "MDAnalysis/lib/formats/xtc.pyx":307 + /* "MDAnalysis/lib/formats/xtc.pyx":323 * raise RuntimeError('XTC write error: {}'.format(return_code)) * * self.current_frame += 1 # <<<<<<<<<<<<<< */ __pyx_v_self->current_frame = (__pyx_v_self->current_frame + 1); - /* "MDAnalysis/lib/formats/xtc.pyx":257 + /* "MDAnalysis/lib/formats/xtc.pyx":273 * return xyz, box, step, time, prec * * def write(self, xyz, box, int step, float time, float prec=1000.0): # <<<<<<<<<<<<<< @@ -6003,7 +6104,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -6059,7 +6160,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P * * info.buf = PyArray_DATA(self) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -6368,7 +6469,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -7201,7 +7302,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -7269,7 +7370,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -7378,7 +7479,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -8165,7 +8266,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * * if itemsize <= 0: */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -8197,7 +8298,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * * if not isinstance(format, bytes): */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -8232,7 +8333,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5); @@ -8308,7 +8409,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -8592,7 +8693,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * * if self.dtype_is_object: */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -8833,7 +8934,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru * info.buf = self.data * info.len = self.len */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -11619,7 +11720,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview * else: * if len(self.view.format) == 1: */ - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -12449,7 +12550,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -12566,7 +12667,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__21, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__22, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -13906,9 +14007,9 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __Pyx_GOTREF(__pyx_t_7); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__22); - __Pyx_GIVEREF(__pyx_slice__22); - PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__22); + __Pyx_INCREF(__pyx_slice__23); + __Pyx_GIVEREF(__pyx_slice__23); + PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__23); } } __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -13941,7 +14042,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { * else: */ /*else*/ { - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__23); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__24); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L7:; @@ -14086,9 +14187,9 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __Pyx_GOTREF(__pyx_t_3); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__24); - __Pyx_GIVEREF(__pyx_slice__24); - PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__24); + __Pyx_INCREF(__pyx_slice__25); + __Pyx_GIVEREF(__pyx_slice__25); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__25); } } __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -14215,7 +14316,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -19508,6 +19609,7 @@ static PyObject *__pyx_tp_new_10MDAnalysis_3lib_7formats_3xtc_XTCFile(PyTypeObje p->fname = Py_None; Py_INCREF(Py_None); p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None); p->box = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + p->_offsets = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); if (unlikely(__pyx_pw_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_1__cinit__(o, a, k) < 0)) { Py_DECREF(o); o = 0; } @@ -19533,6 +19635,7 @@ static void __pyx_tp_dealloc_10MDAnalysis_3lib_7formats_3xtc_XTCFile(PyObject *o Py_CLEAR(p->fname); Py_CLEAR(p->mode); Py_CLEAR(p->box); + Py_CLEAR(p->_offsets); (*Py_TYPE(o)->tp_free)(o); } @@ -19545,6 +19648,9 @@ static int __pyx_tp_traverse_10MDAnalysis_3lib_7formats_3xtc_XTCFile(PyObject *o if (p->box) { e = (*v)(((PyObject*)p->box), a); if (e) return e; } + if (p->_offsets) { + e = (*v)(((PyObject*)p->_offsets), a); if (e) return e; + } return 0; } @@ -19557,6 +19663,9 @@ static int __pyx_tp_clear_10MDAnalysis_3lib_7formats_3xtc_XTCFile(PyObject *o) { tmp = ((PyObject*)p->box); p->box = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); + tmp = ((PyObject*)p->_offsets); + p->_offsets = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); return 0; } @@ -19576,9 +19685,11 @@ static PyMethodDef __pyx_methods_10MDAnalysis_3lib_7formats_3xtc_XTCFile[] = { {"__next__", (PyCFunction)__pyx_pw_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_15__next__, METH_NOARGS|METH_COEXIST, 0}, {"seek", (PyCFunction)__pyx_pw_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_19seek, METH_O, __pyx_doc_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_18seek}, {"tell", (PyCFunction)__pyx_pw_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_21tell, METH_NOARGS, __pyx_doc_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_20tell}, - {"offsets", (PyCFunction)__pyx_pw_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_23offsets, METH_NOARGS, 0}, - {"read", (PyCFunction)__pyx_pw_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_25read, METH_NOARGS, __pyx_doc_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_24read}, - {"write", (PyCFunction)__pyx_pw_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_27write, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_26write}, + {"calc_offsets", (PyCFunction)__pyx_pw_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_23calc_offsets, METH_NOARGS, 0}, + {"offsets", (PyCFunction)__pyx_pw_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_25offsets, METH_NOARGS, 0}, + {"offsets", (PyCFunction)__pyx_pw_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_27offsets, METH_O, 0}, + {"read", (PyCFunction)__pyx_pw_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_29read, METH_NOARGS, __pyx_doc_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_28read}, + {"write", (PyCFunction)__pyx_pw_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_31write, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10MDAnalysis_3lib_7formats_3xtc_7XTCFile_30write}, {0, 0, 0, 0} }; @@ -20395,6 +20506,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_box, __pyx_k_box, sizeof(__pyx_k_box), 0, 0, 1, 1}, {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1}, + {&__pyx_kp_s_calc_offsets, __pyx_k_calc_offsets, sizeof(__pyx_k_calc_offsets), 0, 0, 1, 0}, + {&__pyx_n_s_calc_offsets_2, __pyx_k_calc_offsets_2, sizeof(__pyx_k_calc_offsets_2), 0, 0, 1, 1}, {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0}, @@ -20412,7 +20525,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_exc_val, __pyx_k_exc_val, sizeof(__pyx_k_exc_val), 0, 0, 1, 1}, {&__pyx_n_s_exists, __pyx_k_exists, sizeof(__pyx_k_exists), 0, 0, 1, 1}, {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1}, - {&__pyx_kp_s_first_offset, __pyx_k_first_offset, sizeof(__pyx_k_first_offset), 0, 0, 1, 0}, {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, {&__pyx_n_s_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 1, 1}, {&__pyx_n_s_fname, __pyx_k_fname, sizeof(__pyx_k_fname), 0, 0, 1, 1}, @@ -20425,7 +20537,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1}, {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1}, {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0}, - {&__pyx_kp_s_len__offsets, __pyx_k_len__offsets, sizeof(__pyx_k_len__offsets), 0, 0, 1, 0}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1}, {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, @@ -20438,22 +20549,23 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, - {&__pyx_kp_s_offsets_NULL_ok, __pyx_k_offsets_NULL_ok, sizeof(__pyx_k_offsets_NULL_ok), 0, 0, 1, 0}, + {&__pyx_n_s_offsets, __pyx_k_offsets, sizeof(__pyx_k_offsets), 0, 0, 1, 1}, {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1}, {&__pyx_n_s_os_path, __pyx_k_os_path, sizeof(__pyx_k_os_path), 0, 0, 1, 1}, {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1}, {&__pyx_n_s_prec, __pyx_k_prec, sizeof(__pyx_k_prec), 0, 0, 1, 1}, {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1}, + {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1}, {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_b_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 0, 1}, {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1}, - {&__pyx_kp_s_read_frames_estimated, __pyx_k_read_frames_estimated, sizeof(__pyx_k_read_frames_estimated), 0, 0, 1, 0}, {&__pyx_n_s_rtol, __pyx_k_rtol, sizeof(__pyx_k_rtol), 0, 0, 1, 1}, {&__pyx_n_s_seek, __pyx_k_seek, sizeof(__pyx_k_seek), 0, 0, 1, 1}, {&__pyx_kp_s_self_mode, __pyx_k_self_mode, sizeof(__pyx_k_self_mode), 0, 0, 1, 0}, + {&__pyx_n_s_setter, __pyx_k_setter, sizeof(__pyx_k_setter), 0, 0, 1, 1}, {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, @@ -20475,10 +20587,11 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -20495,71 +20608,82 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "MDAnalysis/lib/formats/xtc.pyx":149 + /* "MDAnalysis/lib/formats/xtc.pyx":152 * def __len__(self): * if not self.is_open: * raise RuntimeError('No file currently opened') # <<<<<<<<<<<<<< * * cdef int old_frame = self.current_frame */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_No_file_currently_opened); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_No_file_currently_opened); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "MDAnalysis/lib/formats/xtc.pyx":182 + /* "MDAnalysis/lib/formats/xtc.pyx":180 + * """ + * if frame > self.offsets.size: + * raise RuntimeError('Trying to seek over max number of frames') # <<<<<<<<<<<<<< + * self.close() + * self.open(self.fname, self.mode) + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Trying_to_seek_over_max_number_o); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "MDAnalysis/lib/formats/xtc.pyx":187 * self.read() * except StopIteration: * raise RuntimeError('Trying to seek over max number of frames') # <<<<<<<<<<<<<< * * def tell(self): */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Trying_to_seek_over_max_number_o); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__2); - __Pyx_GIVEREF(__pyx_tuple__2); + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Trying_to_seek_over_max_number_o); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); - /* "MDAnalysis/lib/formats/xtc.pyx":228 + /* "MDAnalysis/lib/formats/xtc.pyx":244 * """ * if self.reached_eof: * raise RuntimeError('Reached last frame in XTC, seek to 0') # <<<<<<<<<<<<<< * if not self.is_open: * raise RuntimeError('No file opened') */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Reached_last_frame_in_XTC_seek_t); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Reached_last_frame_in_XTC_seek_t); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); - /* "MDAnalysis/lib/formats/xtc.pyx":230 + /* "MDAnalysis/lib/formats/xtc.pyx":246 * raise RuntimeError('Reached last frame in XTC, seek to 0') * if not self.is_open: * raise RuntimeError('No file opened') # <<<<<<<<<<<<<< * if self.mode != 'r': * raise RuntimeError('File opened in mode: {}. Reading only allow ' */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_No_file_opened); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__4); - __Pyx_GIVEREF(__pyx_tuple__4); + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_No_file_opened); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); - /* "MDAnalysis/lib/formats/xtc.pyx":233 + /* "MDAnalysis/lib/formats/xtc.pyx":249 * if self.mode != 'r': * raise RuntimeError('File opened in mode: {}. Reading only allow ' * 'in mode "r"'.format('self.mode')) # <<<<<<<<<<<<<< * * cdef int return_code = 1 */ - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_self_mode); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_self_mode); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); - /* "MDAnalysis/lib/formats/xtc.pyx":282 + /* "MDAnalysis/lib/formats/xtc.pyx":298 * if self.mode != 'w': * raise RuntimeError('File opened in mode: {}. Writing only allow ' * 'in mode "w"'.format('self.mode')) # <<<<<<<<<<<<<< * * cdef DTYPE_T[:, ::1] xyz_view = np.ascontiguousarray(xyz, dtype=DTYPE) */ - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_self_mode); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__6); - __Pyx_GIVEREF(__pyx_tuple__6); + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_self_mode); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); /* "../../../../.virtualenvs/mda-py2/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) @@ -20568,9 +20692,9 @@ static int __Pyx_InitCachedConstants(void) { * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); /* "../../../../.virtualenvs/mda-py2/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) @@ -20579,9 +20703,9 @@ static int __Pyx_InitCachedConstants(void) { * * info.buf = PyArray_DATA(self) */ - __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); /* "../../../../.virtualenvs/mda-py2/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259 * if ((descr.byteorder == c'>' and little_endian) or @@ -20590,9 +20714,9 @@ static int __Pyx_InitCachedConstants(void) { * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__9); - __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); /* "../../../../.virtualenvs/mda-py2/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799 * @@ -20601,9 +20725,9 @@ static int __Pyx_InitCachedConstants(void) { * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); /* "../../../../.virtualenvs/mda-py2/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803 * if ((child.byteorder == c'>' and little_endian) or @@ -20612,9 +20736,9 @@ static int __Pyx_InitCachedConstants(void) { * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__11); - __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); /* "../../../../.virtualenvs/mda-py2/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num @@ -20623,9 +20747,9 @@ static int __Pyx_InitCachedConstants(void) { * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); /* "View.MemoryView":129 * @@ -20634,9 +20758,9 @@ static int __Pyx_InitCachedConstants(void) { * * if itemsize <= 0: */ - __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__13); - __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); /* "View.MemoryView":132 * @@ -20645,9 +20769,9 @@ static int __Pyx_InitCachedConstants(void) { * * if not isinstance(format, bytes): */ - __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); /* "View.MemoryView":135 * @@ -20656,9 +20780,9 @@ static int __Pyx_InitCachedConstants(void) { * self._format = format # keep a reference to the byte string * self.format = self._format */ - __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__15); - __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); /* "View.MemoryView":144 * @@ -20667,9 +20791,9 @@ static int __Pyx_InitCachedConstants(void) { * * */ - __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__16); - __Pyx_GIVEREF(__pyx_tuple__16); + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); /* "View.MemoryView":172 * self.data = malloc(self.len) @@ -20678,9 +20802,9 @@ static int __Pyx_InitCachedConstants(void) { * * if self.dtype_is_object: */ - __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); /* "View.MemoryView":188 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS @@ -20689,9 +20813,9 @@ static int __Pyx_InitCachedConstants(void) { * info.buf = self.data * info.len = self.len */ - __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__18); - __Pyx_GIVEREF(__pyx_tuple__18); + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); /* "View.MemoryView":447 * result = struct.unpack(self.view.format, bytesitem) @@ -20700,9 +20824,9 @@ static int __Pyx_InitCachedConstants(void) { * else: * if len(self.view.format) == 1: */ - __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__19); - __Pyx_GIVEREF(__pyx_tuple__19); + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); /* "View.MemoryView":523 * if self.view.strides == NULL: @@ -20711,9 +20835,9 @@ static int __Pyx_InitCachedConstants(void) { * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__20); - __Pyx_GIVEREF(__pyx_tuple__20); + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); /* "View.MemoryView":531 * def __get__(self): @@ -20722,12 +20846,12 @@ static int __Pyx_InitCachedConstants(void) { * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) */ - __pyx_tuple__21 = PyTuple_New(1); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__21); + __pyx_tuple__22 = PyTuple_New(1); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__22); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); - PyTuple_SET_ITEM(__pyx_tuple__21, 0, __pyx_int_neg_1); - __Pyx_GIVEREF(__pyx_tuple__21); + PyTuple_SET_ITEM(__pyx_tuple__22, 0, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_tuple__22); /* "View.MemoryView":640 * if item is Ellipsis: @@ -20736,9 +20860,9 @@ static int __Pyx_InitCachedConstants(void) { * seen_ellipsis = True * else: */ - __pyx_slice__22 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__22)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_slice__22); - __Pyx_GIVEREF(__pyx_slice__22); + __pyx_slice__23 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__23)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__23); + __Pyx_GIVEREF(__pyx_slice__23); /* "View.MemoryView":643 * seen_ellipsis = True @@ -20747,9 +20871,9 @@ static int __Pyx_InitCachedConstants(void) { * have_slices = True * else: */ - __pyx_slice__23 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__23)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_slice__23); - __Pyx_GIVEREF(__pyx_slice__23); + __pyx_slice__24 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__24)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__24); + __Pyx_GIVEREF(__pyx_slice__24); /* "View.MemoryView":654 * nslices = ndim - len(result) @@ -20758,9 +20882,9 @@ static int __Pyx_InitCachedConstants(void) { * * return have_slices or nslices, tuple(result) */ - __pyx_slice__24 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__24)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_slice__24); - __Pyx_GIVEREF(__pyx_slice__24); + __pyx_slice__25 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__25)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_slice__25); + __Pyx_GIVEREF(__pyx_slice__25); /* "View.MemoryView":661 * for suboffset in suboffsets[:ndim]: @@ -20769,9 +20893,9 @@ static int __Pyx_InitCachedConstants(void) { * * */ - __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__25); - __Pyx_GIVEREF(__pyx_tuple__25); + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); /* "View.MemoryView":278 * return self.name @@ -20780,9 +20904,9 @@ static int __Pyx_InitCachedConstants(void) { * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__26); - __Pyx_GIVEREF(__pyx_tuple__26); + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); /* "View.MemoryView":279 * @@ -20791,9 +20915,9 @@ static int __Pyx_InitCachedConstants(void) { * cdef indirect = Enum("") * */ - __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__27); - __Pyx_GIVEREF(__pyx_tuple__27); + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); /* "View.MemoryView":280 * cdef generic = Enum("") @@ -20802,9 +20926,9 @@ static int __Pyx_InitCachedConstants(void) { * * */ - __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__28); - __Pyx_GIVEREF(__pyx_tuple__28); + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); /* "View.MemoryView":283 * @@ -20813,9 +20937,9 @@ static int __Pyx_InitCachedConstants(void) { * cdef indirect_contiguous = Enum("") * */ - __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__29); - __Pyx_GIVEREF(__pyx_tuple__29); + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); /* "View.MemoryView":284 * @@ -20824,9 +20948,9 @@ static int __Pyx_InitCachedConstants(void) { * * */ - __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__30); - __Pyx_GIVEREF(__pyx_tuple__30); + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -20856,6 +20980,9 @@ PyMODINIT_FUNC PyInit_xtc(void) PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -21058,6 +21185,87 @@ PyMODINIT_FUNC PyInit_xtc(void) */ __pyx_v_10MDAnalysis_3lib_7formats_3xtc_DIMS = 3; + /* "MDAnalysis/lib/formats/xtc.pyx":211 + * + * @property + * def offsets(self): # <<<<<<<<<<<<<< + * if not self._has_offsets: + * self._offsets = self.calc_offsets() + */ + __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_10MDAnalysis_3lib_7formats_3xtc_XTCFile, __pyx_n_s_offsets); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "MDAnalysis/lib/formats/xtc.pyx":210 + * return nd_offsets[:n_frames] + * + * @property # <<<<<<<<<<<<<< + * def offsets(self): + * if not self._has_offsets: + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_10MDAnalysis_3lib_7formats_3xtc_XTCFile->tp_dict, __pyx_n_s_offsets, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_10MDAnalysis_3lib_7formats_3xtc_XTCFile); + + /* "MDAnalysis/lib/formats/xtc.pyx":217 + * return self._offsets + * + * @offsets.setter # <<<<<<<<<<<<<< + * def offsets(self, offsets): + * self._offsets = offsets + */ + __pyx_t_3 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_10MDAnalysis_3lib_7formats_3xtc_XTCFile, __pyx_n_s_offsets); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_setter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "MDAnalysis/lib/formats/xtc.pyx":218 + * + * @offsets.setter + * def offsets(self, offsets): # <<<<<<<<<<<<<< + * self._offsets = offsets + * self._has_offsets = True + */ + __pyx_t_3 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_10MDAnalysis_3lib_7formats_3xtc_XTCFile, __pyx_n_s_offsets); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + if (!__pyx_t_5) { + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else { + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_10MDAnalysis_3lib_7formats_3xtc_XTCFile->tp_dict, __pyx_n_s_offsets, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_10MDAnalysis_3lib_7formats_3xtc_XTCFile); + /* "MDAnalysis/lib/formats/xtc.pyx":1 * cimport numpy as np # <<<<<<<<<<<<<< * cimport cython @@ -21088,7 +21296,7 @@ PyMODINIT_FUNC PyInit_xtc(void) * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(generic); __Pyx_DECREF_SET(generic, __pyx_t_2); @@ -21102,7 +21310,7 @@ PyMODINIT_FUNC PyInit_xtc(void) * cdef indirect = Enum("") * */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(strided); __Pyx_DECREF_SET(strided, __pyx_t_2); @@ -21116,7 +21324,7 @@ PyMODINIT_FUNC PyInit_xtc(void) * * */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(indirect); __Pyx_DECREF_SET(indirect, __pyx_t_2); @@ -21130,7 +21338,7 @@ PyMODINIT_FUNC PyInit_xtc(void) * cdef indirect_contiguous = Enum("") * */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(contiguous); __Pyx_DECREF_SET(contiguous, __pyx_t_2); @@ -21144,7 +21352,7 @@ PyMODINIT_FUNC PyInit_xtc(void) * * */ - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(indirect_contiguous); __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_2); @@ -21192,6 +21400,9 @@ PyMODINIT_FUNC PyInit_xtc(void) __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init MDAnalysis.lib.formats.xtc", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -23117,6 +23328,14 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { return value; } +static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name) { + PyObject *result; + result = __Pyx_PyObject_GetAttrStr(nmspace, name); + if (!result) + result = __Pyx_GetModuleGlobalName(name); + return result; +} + static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { @@ -23671,32 +23890,6 @@ static int __Pyx_PrintOne(PyObject* stream, PyObject *o) { } #endif -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value) { - const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(int64_t) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(int64_t) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(int64_t) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(int64_t), - little, !is_unsigned); - } -} - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; diff --git a/package/MDAnalysis/lib/formats/xtc.pyx b/package/MDAnalysis/lib/formats/xtc.pyx index 4bfdf5f1d63..07263972743 100644 --- a/package/MDAnalysis/lib/formats/xtc.pyx +++ b/package/MDAnalysis/lib/formats/xtc.pyx @@ -44,10 +44,13 @@ cdef class XTCFile: cdef int current_frame cdef str mode cdef np.ndarray box + cdef np.ndarray _offsets + cdef int _has_offsets def __cinit__(self, fname, mode='r'): self.fname = fname self.is_open = False + self._has_offsets = False self.open(self.fname, mode) def __dealloc__(self): @@ -173,6 +176,8 @@ cdef class XTCFile: RuntimeError If you seek for more frames then are available """ + if frame > self.offsets.size: + raise RuntimeError('Trying to seek over max number of frames') self.close() self.open(self.fname, self.mode) while self.current_frame < frame: @@ -185,19 +190,33 @@ cdef class XTCFile: """Get current frame""" return self.current_frame - def offsets(self): + def calc_offsets(self): if not self.is_open: return np.array([]) cdef int n_frames = 0 cdef int est_nframes = 0 cdef xdrlib.int64_t* offsets = NULL - ok = xdrlib.read_xtc_n_frames(self.fname, &n_frames, &est_nframes, &offsets); - + # the read_xtc_n_frames allocates memory for the offsets with an + # overestimation. This number is saved in est_nframes and we need to + # tell the new numpy array about the whole allocated memory to avoid + # memory leaks. cdef np.ndarray dims = np.array([est_nframes], dtype=np.int64) - cdef np.ndarray _offsets = ptr_to_ndarray( offsets, dims, np.NPY_INT64) + # this handles freeing the allocated memory correctly. + cdef np.ndarray nd_offsets = ptr_to_ndarray( offsets, dims, np.NPY_INT64) + return nd_offsets[:n_frames] - return _offsets[:n_frames] + @property + def offsets(self): + if not self._has_offsets: + self._offsets = self.calc_offsets() + self._has_offsets = True + return self._offsets + + @offsets.setter + def offsets(self, offsets): + self._offsets = offsets + self._has_offsets = True def read(self): """Read one frame in the XTC file