1 /* Generated by Cython 0.25.2 */
2
3 /* BEGIN: Cython Metadata
4 {
5 "distutils": {
6 "depends": [
7 "/home/richard/miniconda2/envs/mdadev/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h",
8 "/home/richard/miniconda2/envs/mdadev/lib/python2.7/site-packages/numpy/core/include/numpy/ufuncobject.h",
9 "MDAnalysis/coordinates/include/correl.h",
10 "MDAnalysis/coordinates/include/readdcd.h"
11 ],
12 "include_dirs": [
13 "/home/richard/miniconda2/envs/mdadev/lib/python2.7/site-packages/numpy/core/include",
14 "MDAnalysis/coordinates/include"
15 ]
16 },
17 "module_name": "coordinates.dcdtimeseries"
18 }
19 END: Cython Metadata */
20
21 #define PY_SSIZE_T_CLEAN
22 #include "Python.h"
23 #ifndef Py_PYTHON_H
24 #error Python headers needed to compile C extensions, please install development version of Python.
25 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
26 #error Cython requires Python 2.6+ or Python 3.2+.
27 #else
28 #define CYTHON_ABI "0_25_2"
29 #include <stddef.h>
30 #ifndef offsetof
31 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
32 #endif
33 #if !defined(WIN32) && !defined(MS_WINDOWS)
34 #ifndef __stdcall
35 #define __stdcall
36 #endif
37 #ifndef __cdecl
38 #define __cdecl
39 #endif
40 #ifndef __fastcall
41 #define __fastcall
42 #endif
43 #endif
44 #ifndef DL_IMPORT
45 #define DL_IMPORT(t) t
46 #endif
47 #ifndef DL_EXPORT
48 #define DL_EXPORT(t) t
49 #endif
50 #ifndef HAVE_LONG_LONG
51 #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
52 #define HAVE_LONG_LONG
53 #endif
54 #endif
55 #ifndef PY_LONG_LONG
56 #define PY_LONG_LONG LONG_LONG
57 #endif
58 #ifndef Py_HUGE_VAL
59 #define Py_HUGE_VAL HUGE_VAL
60 #endif
61 #ifdef PYPY_VERSION
62 #define CYTHON_COMPILING_IN_PYPY 1
63 #define CYTHON_COMPILING_IN_PYSTON 0
64 #define CYTHON_COMPILING_IN_CPYTHON 0
65 #undef CYTHON_USE_TYPE_SLOTS
66 #define CYTHON_USE_TYPE_SLOTS 0
67 #undef CYTHON_USE_ASYNC_SLOTS
68 #define CYTHON_USE_ASYNC_SLOTS 0
69 #undef CYTHON_USE_PYLIST_INTERNALS
70 #define CYTHON_USE_PYLIST_INTERNALS 0
71 #undef CYTHON_USE_UNICODE_INTERNALS
72 #define CYTHON_USE_UNICODE_INTERNALS 0
73 #undef CYTHON_USE_UNICODE_WRITER
74 #define CYTHON_USE_UNICODE_WRITER 0
75 #undef CYTHON_USE_PYLONG_INTERNALS
76 #define CYTHON_USE_PYLONG_INTERNALS 0
77 #undef CYTHON_AVOID_BORROWED_REFS
78 #define CYTHON_AVOID_BORROWED_REFS 1
79 #undef CYTHON_ASSUME_SAFE_MACROS
80 #define CYTHON_ASSUME_SAFE_MACROS 0
81 #undef CYTHON_UNPACK_METHODS
82 #define CYTHON_UNPACK_METHODS 0
83 #undef CYTHON_FAST_THREAD_STATE
84 #define CYTHON_FAST_THREAD_STATE 0
85 #undef CYTHON_FAST_PYCALL
86 #define CYTHON_FAST_PYCALL 0
87 #elif defined(PYSTON_VERSION)
88 #define CYTHON_COMPILING_IN_PYPY 0
89 #define CYTHON_COMPILING_IN_PYSTON 1
90 #define CYTHON_COMPILING_IN_CPYTHON 0
91 #ifndef CYTHON_USE_TYPE_SLOTS
92 #define CYTHON_USE_TYPE_SLOTS 1
93 #endif
94 #undef CYTHON_USE_ASYNC_SLOTS
95 #define CYTHON_USE_ASYNC_SLOTS 0
96 #undef CYTHON_USE_PYLIST_INTERNALS
97 #define CYTHON_USE_PYLIST_INTERNALS 0
98 #ifndef CYTHON_USE_UNICODE_INTERNALS
99 #define CYTHON_USE_UNICODE_INTERNALS 1
100 #endif
101 #undef CYTHON_USE_UNICODE_WRITER
102 #define CYTHON_USE_UNICODE_WRITER 0
103 #undef CYTHON_USE_PYLONG_INTERNALS
104 #define CYTHON_USE_PYLONG_INTERNALS 0
105 #ifndef CYTHON_AVOID_BORROWED_REFS
106 #define CYTHON_AVOID_BORROWED_REFS 0
107 #endif
108 #ifndef CYTHON_ASSUME_SAFE_MACROS
109 #define CYTHON_ASSUME_SAFE_MACROS 1
110 #endif
111 #ifndef CYTHON_UNPACK_METHODS
112 #define CYTHON_UNPACK_METHODS 1
113 #endif
114 #undef CYTHON_FAST_THREAD_STATE
115 #define CYTHON_FAST_THREAD_STATE 0
116 #undef CYTHON_FAST_PYCALL
117 #define CYTHON_FAST_PYCALL 0
118 #else
119 #define CYTHON_COMPILING_IN_PYPY 0
120 #define CYTHON_COMPILING_IN_PYSTON 0
121 #define CYTHON_COMPILING_IN_CPYTHON 1
122 #ifndef CYTHON_USE_TYPE_SLOTS
123 #define CYTHON_USE_TYPE_SLOTS 1
124 #endif
125 #if PY_MAJOR_VERSION < 3
126 #undef CYTHON_USE_ASYNC_SLOTS
127 #define CYTHON_USE_ASYNC_SLOTS 0
128 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
129 #define CYTHON_USE_ASYNC_SLOTS 1
130 #endif
131 #if PY_VERSION_HEX < 0x02070000
132 #undef CYTHON_USE_PYLONG_INTERNALS
133 #define CYTHON_USE_PYLONG_INTERNALS 0
134 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
135 #define CYTHON_USE_PYLONG_INTERNALS 1
136 #endif
137 #ifndef CYTHON_USE_PYLIST_INTERNALS
138 #define CYTHON_USE_PYLIST_INTERNALS 1
139 #endif
140 #ifndef CYTHON_USE_UNICODE_INTERNALS
141 #define CYTHON_USE_UNICODE_INTERNALS 1
142 #endif
143 #if PY_VERSION_HEX < 0x030300F0
144 #undef CYTHON_USE_UNICODE_WRITER
145 #define CYTHON_USE_UNICODE_WRITER 0
146 #elif !defined(CYTHON_USE_UNICODE_WRITER)
147 #define CYTHON_USE_UNICODE_WRITER 1
148 #endif
149 #ifndef CYTHON_AVOID_BORROWED_REFS
150 #define CYTHON_AVOID_BORROWED_REFS 0
151 #endif
152 #ifndef CYTHON_ASSUME_SAFE_MACROS
153 #define CYTHON_ASSUME_SAFE_MACROS 1
154 #endif
155 #ifndef CYTHON_UNPACK_METHODS
156 #define CYTHON_UNPACK_METHODS 1
157 #endif
158 #ifndef CYTHON_FAST_THREAD_STATE
159 #define CYTHON_FAST_THREAD_STATE 1
160 #endif
161 #ifndef CYTHON_FAST_PYCALL
162 #define CYTHON_FAST_PYCALL 1
163 #endif
164 #endif
165 #if !defined(CYTHON_FAST_PYCCALL)
166 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
167 #endif
168 #if CYTHON_USE_PYLONG_INTERNALS
169 #include "longintrepr.h"
170 #undef SHIFT
171 #undef BASE
172 #undef MASK
173 #endif
174 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
175 #define Py_OptimizeFlag 0
176 #endif
177 #define __PYX_BUILD_PY_SSIZE_T "n"
178 #define CYTHON_FORMAT_SSIZE_T "z"
179 #if PY_MAJOR_VERSION < 3
180 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
181 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
182 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
183 #define __Pyx_DefaultClassType PyClass_Type
184 #else
185 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
186 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
187 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
188 #define __Pyx_DefaultClassType PyType_Type
189 #endif
190 #ifndef Py_TPFLAGS_CHECKTYPES
191 #define Py_TPFLAGS_CHECKTYPES 0
192 #endif
193 #ifndef Py_TPFLAGS_HAVE_INDEX
194 #define Py_TPFLAGS_HAVE_INDEX 0
195 #endif
196 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
197 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
198 #endif
199 #ifndef Py_TPFLAGS_HAVE_FINALIZE
200 #define Py_TPFLAGS_HAVE_FINALIZE 0
201 #endif
202 #ifndef METH_FASTCALL
203 #define METH_FASTCALL 0x80
204 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
205 Py_ssize_t nargs, PyObject *kwnames);
206 #else
207 #define __Pyx_PyCFunctionFast _PyCFunctionFast
208 #endif
209 #if CYTHON_FAST_PYCCALL
210 #define __Pyx_PyFastCFunction_Check(func)\
211 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
212 #else
213 #define __Pyx_PyFastCFunction_Check(func) 0
214 #endif
215 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
216 #define CYTHON_PEP393_ENABLED 1
217 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
218 0 : _PyUnicode_Ready((PyObject *)(op)))
219 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
220 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
221 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
222 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
223 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
224 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
225 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
226 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
227 #else
228 #define CYTHON_PEP393_ENABLED 0
229 #define PyUnicode_1BYTE_KIND 1
230 #define PyUnicode_2BYTE_KIND 2
231 #define PyUnicode_4BYTE_KIND 4
232 #define __Pyx_PyUnicode_READY(op) (0)
233 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
234 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
235 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
236 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
237 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
238 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
239 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
240 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
241 #endif
242 #if CYTHON_COMPILING_IN_PYPY
243 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
244 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
245 #else
246 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
247 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
248 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
249 #endif
250 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
251 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
252 #endif
253 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
254 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
255 #endif
256 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
257 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
258 #endif
259 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
260 #define PyObject_Malloc(s) PyMem_Malloc(s)
261 #define PyObject_Free(p) PyMem_Free(p)
262 #define PyObject_Realloc(p) PyMem_Realloc(p)
263 #endif
264 #if CYTHON_COMPILING_IN_PYSTON
265 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
266 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
267 #else
268 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
269 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
270 #endif
271 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
272 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
273 #if PY_MAJOR_VERSION >= 3
274 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
275 #else
276 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
277 #endif
278 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
279 #define PyObject_ASCII(o) PyObject_Repr(o)
280 #endif
281 #if PY_MAJOR_VERSION >= 3
282 #define PyBaseString_Type PyUnicode_Type
283 #define PyStringObject PyUnicodeObject
284 #define PyString_Type PyUnicode_Type
285 #define PyString_Check PyUnicode_Check
286 #define PyString_CheckExact PyUnicode_CheckExact
287 #endif
288 #if PY_MAJOR_VERSION >= 3
289 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
290 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
291 #else
292 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
293 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
294 #endif
295 #ifndef PySet_CheckExact
296 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
297 #endif
298 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
299 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
300 #if PY_MAJOR_VERSION >= 3
301 #define PyIntObject PyLongObject
302 #define PyInt_Type PyLong_Type
303 #define PyInt_Check(op) PyLong_Check(op)
304 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
305 #define PyInt_FromString PyLong_FromString
306 #define PyInt_FromUnicode PyLong_FromUnicode
307 #define PyInt_FromLong PyLong_FromLong
308 #define PyInt_FromSize_t PyLong_FromSize_t
309 #define PyInt_FromSsize_t PyLong_FromSsize_t
310 #define PyInt_AsLong PyLong_AsLong
311 #define PyInt_AS_LONG PyLong_AS_LONG
312 #define PyInt_AsSsize_t PyLong_AsSsize_t
313 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
314 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
315 #define PyNumber_Int PyNumber_Long
316 #endif
317 #if PY_MAJOR_VERSION >= 3
318 #define PyBoolObject PyLongObject
319 #endif
320 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
321 #ifndef PyUnicode_InternFromString
322 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
323 #endif
324 #endif
325 #if PY_VERSION_HEX < 0x030200A4
326 typedef long Py_hash_t;
327 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
328 #define __Pyx_PyInt_AsHash_t PyInt_AsLong
329 #else
330 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
331 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
332 #endif
333 #if PY_MAJOR_VERSION >= 3
334 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
335 #else
336 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
337 #endif
338 #if CYTHON_USE_ASYNC_SLOTS
339 #if PY_VERSION_HEX >= 0x030500B1
340 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
341 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
342 #else
343 typedef struct {
344 unaryfunc am_await;
345 unaryfunc am_aiter;
346 unaryfunc am_anext;
347 } __Pyx_PyAsyncMethodsStruct;
348 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
349 #endif
350 #else
351 #define __Pyx_PyType_AsAsync(obj) NULL
352 #endif
353 #ifndef CYTHON_RESTRICT
354 #if defined(__GNUC__)
355 #define CYTHON_RESTRICT __restrict__
356 #elif defined(_MSC_VER) && _MSC_VER >= 1400
357 #define CYTHON_RESTRICT __restrict
358 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
359 #define CYTHON_RESTRICT restrict
360 #else
361 #define CYTHON_RESTRICT
362 #endif
363 #endif
364 #ifndef CYTHON_UNUSED
365 # if defined(__GNUC__)
366 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
367 # define CYTHON_UNUSED __attribute__ ((__unused__))
368 # else
369 # define CYTHON_UNUSED
370 # endif
371 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
372 # define CYTHON_UNUSED __attribute__ ((__unused__))
373 # else
374 # define CYTHON_UNUSED
375 # endif
376 #endif
377 #ifndef CYTHON_MAYBE_UNUSED_VAR
378 # if defined(__cplusplus)
CYTHON_MAYBE_UNUSED_VAR(const T &)379 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
380 # else
381 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
382 # endif
383 #endif
384 #ifndef CYTHON_NCP_UNUSED
385 # if CYTHON_COMPILING_IN_CPYTHON
386 # define CYTHON_NCP_UNUSED
387 # else
388 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
389 # endif
390 #endif
391 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
392
393 #ifndef CYTHON_INLINE
394 #if defined(__clang__)
395 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
396 #elif defined(__GNUC__)
397 #define CYTHON_INLINE __inline__
398 #elif defined(_MSC_VER)
399 #define CYTHON_INLINE __inline
400 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
401 #define CYTHON_INLINE inline
402 #else
403 #define CYTHON_INLINE
404 #endif
405 #endif
406
407 #if defined(WIN32) || defined(MS_WINDOWS)
408 #define _USE_MATH_DEFINES
409 #endif
410 #include <math.h>
411 #ifdef NAN
412 #define __PYX_NAN() ((float) NAN)
413 #else
__PYX_NAN()414 static CYTHON_INLINE float __PYX_NAN() {
415 float value;
416 memset(&value, 0xFF, sizeof(value));
417 return value;
418 }
419 #endif
420 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
421 #define __Pyx_truncl trunc
422 #else
423 #define __Pyx_truncl truncl
424 #endif
425
426
427 #define __PYX_ERR(f_index, lineno, Ln_error) \
428 { \
429 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
430 }
431
432 #if PY_MAJOR_VERSION >= 3
433 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
434 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
435 #else
436 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
437 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
438 #endif
439
440 #ifndef __PYX_EXTERN_C
441 #ifdef __cplusplus
442 #define __PYX_EXTERN_C extern "C"
443 #else
444 #define __PYX_EXTERN_C extern
445 #endif
446 #endif
447
448 #define __PYX_HAVE__MDAnalysis__coordinates__dcdtimeseries
449 #define __PYX_HAVE_API__MDAnalysis__coordinates__dcdtimeseries
450 #include <string.h>
451 #include <stdio.h>
452 #include <stdlib.h>
453 #include "numpy/arrayobject.h"
454 #include "numpy/ufuncobject.h"
455 #include "readdcd.h"
456 #include "correl.h"
457 #ifdef _OPENMP
458 #include <omp.h>
459 #endif /* _OPENMP */
460
461 #ifdef PYREX_WITHOUT_ASSERTIONS
462 #define CYTHON_WITHOUT_ASSERTIONS
463 #endif
464
465 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
466 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
467
468 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
469 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
470 #define __PYX_DEFAULT_STRING_ENCODING ""
471 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
472 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
473 #define __Pyx_uchar_cast(c) ((unsigned char)c)
474 #define __Pyx_long_cast(x) ((long)x)
475 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
476 (sizeof(type) < sizeof(Py_ssize_t)) ||\
477 (sizeof(type) > sizeof(Py_ssize_t) &&\
478 likely(v < (type)PY_SSIZE_T_MAX ||\
479 v == (type)PY_SSIZE_T_MAX) &&\
480 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
481 v == (type)PY_SSIZE_T_MIN))) ||\
482 (sizeof(type) == sizeof(Py_ssize_t) &&\
483 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
484 v == (type)PY_SSIZE_T_MAX))) )
485 #if defined (__cplusplus) && __cplusplus >= 201103L
486 #include <cstdlib>
487 #define __Pyx_sst_abs(value) std::abs(value)
488 #elif SIZEOF_INT >= SIZEOF_SIZE_T
489 #define __Pyx_sst_abs(value) abs(value)
490 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
491 #define __Pyx_sst_abs(value) labs(value)
492 #elif defined (_MSC_VER) && defined (_M_X64)
493 #define __Pyx_sst_abs(value) _abs64(value)
494 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
495 #define __Pyx_sst_abs(value) llabs(value)
496 #elif defined (__GNUC__)
497 #define __Pyx_sst_abs(value) __builtin_llabs(value)
498 #else
499 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
500 #endif
501 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
502 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
503 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
504 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
505 #define __Pyx_PyBytes_FromString PyBytes_FromString
506 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
507 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
508 #if PY_MAJOR_VERSION < 3
509 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
510 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
511 #else
512 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
513 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
514 #endif
515 #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
516 #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
517 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
518 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
519 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
520 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
521 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
522 #if PY_MAJOR_VERSION < 3
__Pyx_Py_UNICODE_strlen(const Py_UNICODE * u)523 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
524 {
525 const Py_UNICODE *u_end = u;
526 while (*u_end++) ;
527 return (size_t)(u_end - u - 1);
528 }
529 #else
530 #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
531 #endif
532 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
533 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
534 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
535 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
536 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
537 #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
538 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
539 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
540 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
541 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
542 #if CYTHON_ASSUME_SAFE_MACROS
543 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
544 #else
545 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
546 #endif
547 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
548 #if PY_MAJOR_VERSION >= 3
549 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
550 #else
551 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
552 #endif
553 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
554 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
555 static int __Pyx_sys_getdefaultencoding_not_ascii;
__Pyx_init_sys_getdefaultencoding_params(void)556 static int __Pyx_init_sys_getdefaultencoding_params(void) {
557 PyObject* sys;
558 PyObject* default_encoding = NULL;
559 PyObject* ascii_chars_u = NULL;
560 PyObject* ascii_chars_b = NULL;
561 const char* default_encoding_c;
562 sys = PyImport_ImportModule("sys");
563 if (!sys) goto bad;
564 default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
565 Py_DECREF(sys);
566 if (!default_encoding) goto bad;
567 default_encoding_c = PyBytes_AsString(default_encoding);
568 if (!default_encoding_c) goto bad;
569 if (strcmp(default_encoding_c, "ascii") == 0) {
570 __Pyx_sys_getdefaultencoding_not_ascii = 0;
571 } else {
572 char ascii_chars[128];
573 int c;
574 for (c = 0; c < 128; c++) {
575 ascii_chars[c] = c;
576 }
577 __Pyx_sys_getdefaultencoding_not_ascii = 1;
578 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
579 if (!ascii_chars_u) goto bad;
580 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
581 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
582 PyErr_Format(
583 PyExc_ValueError,
584 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
585 default_encoding_c);
586 goto bad;
587 }
588 Py_DECREF(ascii_chars_u);
589 Py_DECREF(ascii_chars_b);
590 }
591 Py_DECREF(default_encoding);
592 return 0;
593 bad:
594 Py_XDECREF(default_encoding);
595 Py_XDECREF(ascii_chars_u);
596 Py_XDECREF(ascii_chars_b);
597 return -1;
598 }
599 #endif
600 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
601 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
602 #else
603 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
604 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
605 static char* __PYX_DEFAULT_STRING_ENCODING;
__Pyx_init_sys_getdefaultencoding_params(void)606 static int __Pyx_init_sys_getdefaultencoding_params(void) {
607 PyObject* sys;
608 PyObject* default_encoding = NULL;
609 char* default_encoding_c;
610 sys = PyImport_ImportModule("sys");
611 if (!sys) goto bad;
612 default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
613 Py_DECREF(sys);
614 if (!default_encoding) goto bad;
615 default_encoding_c = PyBytes_AsString(default_encoding);
616 if (!default_encoding_c) goto bad;
617 __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
618 if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
619 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
620 Py_DECREF(default_encoding);
621 return 0;
622 bad:
623 Py_XDECREF(default_encoding);
624 return -1;
625 }
626 #endif
627 #endif
628
629
630 /* Test for GCC > 2.95 */
631 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
632 #define likely(x) __builtin_expect(!!(x), 1)
633 #define unlikely(x) __builtin_expect(!!(x), 0)
634 #else /* !__GNUC__ or GCC < 2.95 */
635 #define likely(x) (x)
636 #define unlikely(x) (x)
637 #endif /* __GNUC__ */
638
639 static PyObject *__pyx_m;
640 static PyObject *__pyx_d;
641 static PyObject *__pyx_b;
642 static PyObject *__pyx_empty_tuple;
643 static PyObject *__pyx_empty_bytes;
644 static PyObject *__pyx_empty_unicode;
645 static int __pyx_lineno;
646 static int __pyx_clineno = 0;
647 static const char * __pyx_cfilenm= __FILE__;
648 static const char *__pyx_filename;
649
650 /* Header.proto */
651 #if !defined(CYTHON_CCOMPLEX)
652 #if defined(__cplusplus)
653 #define CYTHON_CCOMPLEX 1
654 #elif defined(_Complex_I)
655 #define CYTHON_CCOMPLEX 1
656 #else
657 #define CYTHON_CCOMPLEX 0
658 #endif
659 #endif
660 #if CYTHON_CCOMPLEX
661 #ifdef __cplusplus
662 #include <complex>
663 #else
664 #include <complex.h>
665 #endif
666 #endif
667 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
668 #undef _Complex_I
669 #define _Complex_I 1.0fj
670 #endif
671
672
673 static const char *__pyx_f[] = {
674 "MDAnalysis/coordinates/dcdtimeseries.pyx",
675 "__init__.pxd",
676 "type.pxd",
677 };
678
679 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":725
680 * # in Cython to enable them only on the right systems.
681 *
682 * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
683 * ctypedef npy_int16 int16_t
684 * ctypedef npy_int32 int32_t
685 */
686 typedef npy_int8 __pyx_t_5numpy_int8_t;
687
688 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":726
689 *
690 * ctypedef npy_int8 int8_t
691 * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
692 * ctypedef npy_int32 int32_t
693 * ctypedef npy_int64 int64_t
694 */
695 typedef npy_int16 __pyx_t_5numpy_int16_t;
696
697 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":727
698 * ctypedef npy_int8 int8_t
699 * ctypedef npy_int16 int16_t
700 * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
701 * ctypedef npy_int64 int64_t
702 * #ctypedef npy_int96 int96_t
703 */
704 typedef npy_int32 __pyx_t_5numpy_int32_t;
705
706 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":728
707 * ctypedef npy_int16 int16_t
708 * ctypedef npy_int32 int32_t
709 * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
710 * #ctypedef npy_int96 int96_t
711 * #ctypedef npy_int128 int128_t
712 */
713 typedef npy_int64 __pyx_t_5numpy_int64_t;
714
715 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":732
716 * #ctypedef npy_int128 int128_t
717 *
718 * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
719 * ctypedef npy_uint16 uint16_t
720 * ctypedef npy_uint32 uint32_t
721 */
722 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
723
724 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":733
725 *
726 * ctypedef npy_uint8 uint8_t
727 * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
728 * ctypedef npy_uint32 uint32_t
729 * ctypedef npy_uint64 uint64_t
730 */
731 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
732
733 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":734
734 * ctypedef npy_uint8 uint8_t
735 * ctypedef npy_uint16 uint16_t
736 * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
737 * ctypedef npy_uint64 uint64_t
738 * #ctypedef npy_uint96 uint96_t
739 */
740 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
741
742 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":735
743 * ctypedef npy_uint16 uint16_t
744 * ctypedef npy_uint32 uint32_t
745 * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
746 * #ctypedef npy_uint96 uint96_t
747 * #ctypedef npy_uint128 uint128_t
748 */
749 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
750
751 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":739
752 * #ctypedef npy_uint128 uint128_t
753 *
754 * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
755 * ctypedef npy_float64 float64_t
756 * #ctypedef npy_float80 float80_t
757 */
758 typedef npy_float32 __pyx_t_5numpy_float32_t;
759
760 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":740
761 *
762 * ctypedef npy_float32 float32_t
763 * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
764 * #ctypedef npy_float80 float80_t
765 * #ctypedef npy_float128 float128_t
766 */
767 typedef npy_float64 __pyx_t_5numpy_float64_t;
768
769 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":749
770 * # The int types are mapped a bit surprising --
771 * # numpy.int corresponds to 'l' and numpy.long to 'q'
772 * ctypedef npy_long int_t # <<<<<<<<<<<<<<
773 * ctypedef npy_longlong long_t
774 * ctypedef npy_longlong longlong_t
775 */
776 typedef npy_long __pyx_t_5numpy_int_t;
777
778 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":750
779 * # numpy.int corresponds to 'l' and numpy.long to 'q'
780 * ctypedef npy_long int_t
781 * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
782 * ctypedef npy_longlong longlong_t
783 *
784 */
785 typedef npy_longlong __pyx_t_5numpy_long_t;
786
787 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":751
788 * ctypedef npy_long int_t
789 * ctypedef npy_longlong long_t
790 * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
791 *
792 * ctypedef npy_ulong uint_t
793 */
794 typedef npy_longlong __pyx_t_5numpy_longlong_t;
795
796 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":753
797 * ctypedef npy_longlong longlong_t
798 *
799 * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
800 * ctypedef npy_ulonglong ulong_t
801 * ctypedef npy_ulonglong ulonglong_t
802 */
803 typedef npy_ulong __pyx_t_5numpy_uint_t;
804
805 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":754
806 *
807 * ctypedef npy_ulong uint_t
808 * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
809 * ctypedef npy_ulonglong ulonglong_t
810 *
811 */
812 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
813
814 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":755
815 * ctypedef npy_ulong uint_t
816 * ctypedef npy_ulonglong ulong_t
817 * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
818 *
819 * ctypedef npy_intp intp_t
820 */
821 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
822
823 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":757
824 * ctypedef npy_ulonglong ulonglong_t
825 *
826 * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
827 * ctypedef npy_uintp uintp_t
828 *
829 */
830 typedef npy_intp __pyx_t_5numpy_intp_t;
831
832 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":758
833 *
834 * ctypedef npy_intp intp_t
835 * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
836 *
837 * ctypedef npy_double float_t
838 */
839 typedef npy_uintp __pyx_t_5numpy_uintp_t;
840
841 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":760
842 * ctypedef npy_uintp uintp_t
843 *
844 * ctypedef npy_double float_t # <<<<<<<<<<<<<<
845 * ctypedef npy_double double_t
846 * ctypedef npy_longdouble longdouble_t
847 */
848 typedef npy_double __pyx_t_5numpy_float_t;
849
850 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":761
851 *
852 * ctypedef npy_double float_t
853 * ctypedef npy_double double_t # <<<<<<<<<<<<<<
854 * ctypedef npy_longdouble longdouble_t
855 *
856 */
857 typedef npy_double __pyx_t_5numpy_double_t;
858
859 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":762
860 * ctypedef npy_double float_t
861 * ctypedef npy_double double_t
862 * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
863 *
864 * ctypedef npy_cfloat cfloat_t
865 */
866 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
867
868 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":27
869 * cimport numpy
870 *
871 * ctypedef int size_t # <<<<<<<<<<<<<<
872 *
873 * cdef extern from "Python.h":
874 */
875 typedef int __pyx_t_10MDAnalysis_11coordinates_13dcdtimeseries_size_t;
876 /* Declarations.proto */
877 #if CYTHON_CCOMPLEX
878 #ifdef __cplusplus
879 typedef ::std::complex< float > __pyx_t_float_complex;
880 #else
881 typedef float _Complex __pyx_t_float_complex;
882 #endif
883 #else
884 typedef struct { float real, imag; } __pyx_t_float_complex;
885 #endif
886 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
887
888 /* Declarations.proto */
889 #if CYTHON_CCOMPLEX
890 #ifdef __cplusplus
891 typedef ::std::complex< double > __pyx_t_double_complex;
892 #else
893 typedef double _Complex __pyx_t_double_complex;
894 #endif
895 #else
896 typedef struct { double real, imag; } __pyx_t_double_complex;
897 #endif
898 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
899
900
901 /*--- Type declarations ---*/
902
903 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":764
904 * ctypedef npy_longdouble longdouble_t
905 *
906 * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
907 * ctypedef npy_cdouble cdouble_t
908 * ctypedef npy_clongdouble clongdouble_t
909 */
910 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
911
912 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":765
913 *
914 * ctypedef npy_cfloat cfloat_t
915 * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
916 * ctypedef npy_clongdouble clongdouble_t
917 *
918 */
919 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
920
921 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":766
922 * ctypedef npy_cfloat cfloat_t
923 * ctypedef npy_cdouble cdouble_t
924 * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
925 *
926 * ctypedef npy_cdouble complex_t
927 */
928 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
929
930 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":768
931 * ctypedef npy_clongdouble clongdouble_t
932 *
933 * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
934 *
935 * cdef inline object PyArray_MultiIterNew1(a):
936 */
937 typedef npy_cdouble __pyx_t_5numpy_complex_t;
938 struct __pyx_t_10MDAnalysis_11coordinates_13dcdtimeseries_dcdhandle;
939 typedef struct __pyx_t_10MDAnalysis_11coordinates_13dcdtimeseries_dcdhandle __pyx_t_10MDAnalysis_11coordinates_13dcdtimeseries_dcdhandle;
940
941 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":46
942 * int jump_to_dcdstep(fio_fd fd, int natoms, int nsets, int nfixed, int charmm, int header_size, int step)
943 *
944 * ctypedef struct dcdhandle: # <<<<<<<<<<<<<<
945 * fio_fd fd
946 * fio_size_t header_size
947 */
948 struct __pyx_t_10MDAnalysis_11coordinates_13dcdtimeseries_dcdhandle {
949 fio_fd fd;
950 fio_size_t header_size;
951 int natoms;
952 int nsets;
953 int setsread;
954 int istart;
955 int nsavc;
956 double delta;
957 int nfixed;
958 int *freeind;
959 float *fixedcoords;
960 int reverse;
961 int charmm;
962 int first;
963 int with_unitcell;
964 };
965
966 /* --- Runtime support code (head) --- */
967 /* Refnanny.proto */
968 #ifndef CYTHON_REFNANNY
969 #define CYTHON_REFNANNY 0
970 #endif
971 #if CYTHON_REFNANNY
972 typedef struct {
973 void (*INCREF)(void*, PyObject*, int);
974 void (*DECREF)(void*, PyObject*, int);
975 void (*GOTREF)(void*, PyObject*, int);
976 void (*GIVEREF)(void*, PyObject*, int);
977 void* (*SetupContext)(const char*, int, const char*);
978 void (*FinishContext)(void**);
979 } __Pyx_RefNannyAPIStruct;
980 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
981 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
982 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
983 #ifdef WITH_THREAD
984 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
985 if (acquire_gil) {\
986 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
987 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
988 PyGILState_Release(__pyx_gilstate_save);\
989 } else {\
990 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
991 }
992 #else
993 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
994 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
995 #endif
996 #define __Pyx_RefNannyFinishContext()\
997 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
998 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
999 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1000 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1001 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1002 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1003 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1004 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1005 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1006 #else
1007 #define __Pyx_RefNannyDeclarations
1008 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1009 #define __Pyx_RefNannyFinishContext()
1010 #define __Pyx_INCREF(r) Py_INCREF(r)
1011 #define __Pyx_DECREF(r) Py_DECREF(r)
1012 #define __Pyx_GOTREF(r)
1013 #define __Pyx_GIVEREF(r)
1014 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1015 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1016 #define __Pyx_XGOTREF(r)
1017 #define __Pyx_XGIVEREF(r)
1018 #endif
1019 #define __Pyx_XDECREF_SET(r, v) do {\
1020 PyObject *tmp = (PyObject *) r;\
1021 r = v; __Pyx_XDECREF(tmp);\
1022 } while (0)
1023 #define __Pyx_DECREF_SET(r, v) do {\
1024 PyObject *tmp = (PyObject *) r;\
1025 r = v; __Pyx_DECREF(tmp);\
1026 } while (0)
1027 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1028 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1029
1030 /* PyObjectGetAttrStr.proto */
1031 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetAttrStr(PyObject * obj,PyObject * attr_name)1032 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
1033 PyTypeObject* tp = Py_TYPE(obj);
1034 if (likely(tp->tp_getattro))
1035 return tp->tp_getattro(obj, attr_name);
1036 #if PY_MAJOR_VERSION < 3
1037 if (likely(tp->tp_getattr))
1038 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
1039 #endif
1040 return PyObject_GetAttr(obj, attr_name);
1041 }
1042 #else
1043 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1044 #endif
1045
1046 /* GetBuiltinName.proto */
1047 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1048
1049 /* RaiseArgTupleInvalid.proto */
1050 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1051 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1052
1053 /* RaiseDoubleKeywords.proto */
1054 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1055
1056 /* ParseKeywords.proto */
1057 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1058 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1059 const char* function_name);
1060
1061 /* None.proto */
1062 static CYTHON_INLINE int __Pyx_div_int(int, int);
1063
1064 /* UnaryNegOverflows.proto */
1065 #define UNARY_NEG_WOULD_OVERFLOW(x)\
1066 (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
1067
1068 /* None.proto */
1069 static CYTHON_INLINE int __Pyx_mod_int(int, int);
1070
1071 /* PyObjectCall.proto */
1072 #if CYTHON_COMPILING_IN_CPYTHON
1073 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1074 #else
1075 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1076 #endif
1077
1078 /* PyThreadStateGet.proto */
1079 #if CYTHON_FAST_THREAD_STATE
1080 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1081 #define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET();
1082 #else
1083 #define __Pyx_PyThreadState_declare
1084 #define __Pyx_PyThreadState_assign
1085 #endif
1086
1087 /* PyErrFetchRestore.proto */
1088 #if CYTHON_FAST_THREAD_STATE
1089 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1090 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1091 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1092 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1093 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1094 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1095 #else
1096 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1097 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1098 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1099 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1100 #endif
1101
1102 /* RaiseException.proto */
1103 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1104
1105 /* GetModuleGlobalName.proto */
1106 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
1107
1108 /* PyFunctionFastCall.proto */
1109 #if CYTHON_FAST_PYCALL
1110 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1111 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1112 #if 1 || PY_VERSION_HEX < 0x030600B1
1113 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs);
1114 #else
1115 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1116 #endif
1117 #endif
1118
1119 /* PyCFunctionFastCall.proto */
1120 #if CYTHON_FAST_PYCCALL
1121 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1122 #else
1123 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1124 #endif
1125
1126 /* ExtTypeTest.proto */
1127 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1128
1129 /* PyObjectCallMethO.proto */
1130 #if CYTHON_COMPILING_IN_CPYTHON
1131 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1132 #endif
1133
1134 /* PyObjectCallOneArg.proto */
1135 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1136
1137 /* GetItemInt.proto */
1138 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1139 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1140 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1141 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1142 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1143 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1144 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1145 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1146 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1147 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1148 int wraparound, int boundscheck);
1149 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1150 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1151 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1152 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1153 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1154 int wraparound, int boundscheck);
1155 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1156 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1157 int is_list, int wraparound, int boundscheck);
1158
1159 /* DictGetItem.proto */
1160 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
__Pyx_PyDict_GetItem(PyObject * d,PyObject * key)1161 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
1162 PyObject *value;
1163 value = PyDict_GetItemWithError(d, key);
1164 if (unlikely(!value)) {
1165 if (!PyErr_Occurred()) {
1166 PyObject* args = PyTuple_Pack(1, key);
1167 if (likely(args))
1168 PyErr_SetObject(PyExc_KeyError, args);
1169 Py_XDECREF(args);
1170 }
1171 return NULL;
1172 }
1173 Py_INCREF(value);
1174 return value;
1175 }
1176 #else
1177 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1178 #endif
1179
1180 /* RaiseTooManyValuesToUnpack.proto */
1181 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1182
1183 /* RaiseNeedMoreValuesToUnpack.proto */
1184 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1185
1186 /* RaiseNoneIterError.proto */
1187 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
1188
1189 /* SaveResetException.proto */
1190 #if CYTHON_FAST_THREAD_STATE
1191 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1192 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1193 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1194 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1195 #else
1196 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1197 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1198 #endif
1199
1200 /* PyErrExceptionMatches.proto */
1201 #if CYTHON_FAST_THREAD_STATE
1202 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1203 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1204 #else
1205 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1206 #endif
1207
1208 /* GetException.proto */
1209 #if CYTHON_FAST_THREAD_STATE
1210 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1211 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1212 #else
1213 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1214 #endif
1215
1216 /* Import.proto */
1217 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1218
1219 /* CodeObjectCache.proto */
1220 typedef struct {
1221 PyCodeObject* code_object;
1222 int code_line;
1223 } __Pyx_CodeObjectCacheEntry;
1224 struct __Pyx_CodeObjectCache {
1225 int count;
1226 int max_count;
1227 __Pyx_CodeObjectCacheEntry* entries;
1228 };
1229 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1230 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1231 static PyCodeObject *__pyx_find_code_object(int code_line);
1232 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1233
1234 /* AddTraceback.proto */
1235 static void __Pyx_AddTraceback(const char *funcname, int c_line,
1236 int py_line, const char *filename);
1237
1238 /* CIntToPy.proto */
1239 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
1240
1241 /* CIntToPy.proto */
1242 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
1243
1244 /* RealImag.proto */
1245 #if CYTHON_CCOMPLEX
1246 #ifdef __cplusplus
1247 #define __Pyx_CREAL(z) ((z).real())
1248 #define __Pyx_CIMAG(z) ((z).imag())
1249 #else
1250 #define __Pyx_CREAL(z) (__real__(z))
1251 #define __Pyx_CIMAG(z) (__imag__(z))
1252 #endif
1253 #else
1254 #define __Pyx_CREAL(z) ((z).real)
1255 #define __Pyx_CIMAG(z) ((z).imag)
1256 #endif
1257 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
1258 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
1259 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
1260 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
1261 #else
1262 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
1263 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
1264 #endif
1265
1266 /* Arithmetic.proto */
1267 #if CYTHON_CCOMPLEX
1268 #define __Pyx_c_eq_float(a, b) ((a)==(b))
1269 #define __Pyx_c_sum_float(a, b) ((a)+(b))
1270 #define __Pyx_c_diff_float(a, b) ((a)-(b))
1271 #define __Pyx_c_prod_float(a, b) ((a)*(b))
1272 #define __Pyx_c_quot_float(a, b) ((a)/(b))
1273 #define __Pyx_c_neg_float(a) (-(a))
1274 #ifdef __cplusplus
1275 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
1276 #define __Pyx_c_conj_float(z) (::std::conj(z))
1277 #if 1
1278 #define __Pyx_c_abs_float(z) (::std::abs(z))
1279 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
1280 #endif
1281 #else
1282 #define __Pyx_c_is_zero_float(z) ((z)==0)
1283 #define __Pyx_c_conj_float(z) (conjf(z))
1284 #if 1
1285 #define __Pyx_c_abs_float(z) (cabsf(z))
1286 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
1287 #endif
1288 #endif
1289 #else
1290 static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
1291 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
1292 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
1293 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
1294 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
1295 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
1296 static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
1297 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
1298 #if 1
1299 static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
1300 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
1301 #endif
1302 #endif
1303
1304 /* Arithmetic.proto */
1305 #if CYTHON_CCOMPLEX
1306 #define __Pyx_c_eq_double(a, b) ((a)==(b))
1307 #define __Pyx_c_sum_double(a, b) ((a)+(b))
1308 #define __Pyx_c_diff_double(a, b) ((a)-(b))
1309 #define __Pyx_c_prod_double(a, b) ((a)*(b))
1310 #define __Pyx_c_quot_double(a, b) ((a)/(b))
1311 #define __Pyx_c_neg_double(a) (-(a))
1312 #ifdef __cplusplus
1313 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
1314 #define __Pyx_c_conj_double(z) (::std::conj(z))
1315 #if 1
1316 #define __Pyx_c_abs_double(z) (::std::abs(z))
1317 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
1318 #endif
1319 #else
1320 #define __Pyx_c_is_zero_double(z) ((z)==0)
1321 #define __Pyx_c_conj_double(z) (conj(z))
1322 #if 1
1323 #define __Pyx_c_abs_double(z) (cabs(z))
1324 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
1325 #endif
1326 #endif
1327 #else
1328 static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
1329 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
1330 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
1331 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
1332 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
1333 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
1334 static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
1335 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
1336 #if 1
1337 static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
1338 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
1339 #endif
1340 #endif
1341
1342 /* CIntToPy.proto */
1343 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
1344
1345 /* CIntFromPy.proto */
1346 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
1347
1348 /* CIntFromPy.proto */
1349 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
1350
1351 /* CheckBinaryVersion.proto */
1352 static int __Pyx_check_binary_version(void);
1353
1354 /* PyIdentifierFromString.proto */
1355 #if !defined(__Pyx_PyIdentifier_FromString)
1356 #if PY_MAJOR_VERSION < 3
1357 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
1358 #else
1359 #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
1360 #endif
1361 #endif
1362
1363 /* ModuleImport.proto */
1364 static PyObject *__Pyx_ImportModule(const char *name);
1365
1366 /* TypeImport.proto */
1367 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
1368
1369 /* InitStrings.proto */
1370 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1371
1372
1373 /* Module declarations from 'cpython.buffer' */
1374
1375 /* Module declarations from 'libc.string' */
1376
1377 /* Module declarations from 'libc.stdio' */
1378
1379 /* Module declarations from '__builtin__' */
1380
1381 /* Module declarations from 'cpython.type' */
1382 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
1383
1384 /* Module declarations from 'cpython' */
1385
1386 /* Module declarations from 'cpython.object' */
1387
1388 /* Module declarations from 'cpython.ref' */
1389
1390 /* Module declarations from 'libc.stdlib' */
1391
1392 /* Module declarations from 'numpy' */
1393
1394 /* Module declarations from 'numpy' */
1395 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
1396 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
1397 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
1398 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
1399 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
1400 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
1401
1402 /* Module declarations from 'MDAnalysis.coordinates.dcdtimeseries' */
1403 #define __Pyx_MODULE_NAME "MDAnalysis.coordinates.dcdtimeseries"
1404 int __pyx_module_is_main_MDAnalysis__coordinates__dcdtimeseries = 0;
1405
1406 /* Implementation of 'MDAnalysis.coordinates.dcdtimeseries' */
1407 static PyObject *__pyx_builtin_IOError;
1408 static PyObject *__pyx_builtin_ValueError;
1409 static PyObject *__pyx_builtin_range;
1410 static PyObject *__pyx_builtin_RuntimeError;
1411 static PyObject *__pyx_builtin_ImportError;
1412 static const char __pyx_k_i[] = "i";
1413 static const char __pyx_k_j[] = "j";
1414 static const char __pyx_k_np[] = "np";
1415 static const char __pyx_k_rc[] = "rc";
1416 static const char __pyx_k_dcd[] = "dcd";
1417 static const char __pyx_k_data[] = "data";
1418 static const char __pyx_k_main[] = "__main__";
1419 static const char __pyx_k_self[] = "self";
1420 static const char __pyx_k_skip[] = "skip";
1421 static const char __pyx_k_step[] = "step";
1422 static const char __pyx_k_stop[] = "stop";
1423 static const char __pyx_k_temp[] = "temp";
1424 static const char __pyx_k_test[] = "__test__";
1425 static const char __pyx_k_array[] = "array";
1426 static const char __pyx_k_atoms[] = "atoms";
1427 static const char __pyx_k_coord[] = "coord";
1428 static const char __pyx_k_index[] = "index";
1429 static const char __pyx_k_int32[] = "int32";
1430 static const char __pyx_k_numpy[] = "numpy";
1431 static const char __pyx_k_range[] = "range";
1432 static const char __pyx_k_start[] = "start";
1433 static const char __pyx_k_tempX[] = "tempX";
1434 static const char __pyx_k_tempY[] = "tempY";
1435 static const char __pyx_k_tempZ[] = "tempZ";
1436 static const char __pyx_k_zeros[] = "zeros";
1437 static const char __pyx_k_fmtstr[] = "fmtstr";
1438 static const char __pyx_k_format[] = "format";
1439 static const char __pyx_k_import[] = "__import__";
1440 static const char __pyx_k_lowerb[] = "lowerb";
1441 static const char __pyx_k_upperb[] = "upperb";
1442 static const char __pyx_k_IOError[] = "IOError";
1443 static const char __pyx_k_auxdata[] = "auxdata";
1444 static const char __pyx_k_auxlist[] = "auxlist";
1445 static const char __pyx_k_float32[] = "float32";
1446 static const char __pyx_k_float64[] = "float64";
1447 static const char __pyx_k_n_atoms[] = "n_atoms";
1448 static const char __pyx_k_numdata[] = "numdata";
1449 static const char __pyx_k_numskip[] = "numskip";
1450 static const char __pyx_k_atomlist[] = "atomlist";
1451 static const char __pyx_k_n_frames[] = "n_frames";
1452 static const char __pyx_k_sizedata[] = "sizedata";
1453 static const char __pyx_k_unitcell[] = "unitcell";
1454 static const char __pyx_k_dcd_C_ptr[] = "_dcd_C_ptr";
1455 static const char __pyx_k_ValueError[] = "ValueError";
1456 static const char __pyx_k_atomcounts[] = "atomcounts";
1457 static const char __pyx_k_ImportError[] = "ImportError";
1458 static const char __pyx_k_RuntimeError[] = "RuntimeError";
1459 static const char __pyx_k_atomcountslist[] = "atomcountslist";
1460 static const char __pyx_k_read_timecorrel[] = "__read_timecorrel";
1461 static const char __pyx_k_read_timeseries[] = "__read_timeseries";
1462 static const char __pyx_k_remaining_frames[] = "remaining_frames";
1463 static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
1464 static const char __pyx_k_Error_jumping_to_starting_frame[] = "Error jumping to starting frame";
1465 static const char __pyx_k_No_data_requested_timeseries_is[] = "No data requested, timeseries is empty";
1466 static const char __pyx_k_home_richard_code_mdanalysis_pa[] = "/home/richard/code/mdanalysis/package/MDAnalysis/coordinates/dcdtimeseries.pyx";
1467 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
1468 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
1469 static const char __pyx_k_Error_reading_frame_from_DCD_fil[] = "Error reading frame from DCD file";
1470 static const char __pyx_k_Error_skipping_frame_from_DCD_fi[] = "Error skipping frame from DCD file";
1471 static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
1472 static const char __pyx_k_MDAnalysis_coordinates_dcdtimese[] = "MDAnalysis.coordinates.dcdtimeseries";
1473 static const char __pyx_k_No_atoms_passed_into___read_time[] = "No atoms passed into __read_timeseries function";
1474 static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
1475 static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
1476 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
1477 static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
1478 static PyObject *__pyx_kp_s_Error_jumping_to_starting_frame;
1479 static PyObject *__pyx_kp_s_Error_reading_frame_from_DCD_fil;
1480 static PyObject *__pyx_kp_s_Error_skipping_frame_from_DCD_fi;
1481 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
1482 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
1483 static PyObject *__pyx_n_s_IOError;
1484 static PyObject *__pyx_n_s_ImportError;
1485 static PyObject *__pyx_n_s_MDAnalysis_coordinates_dcdtimese;
1486 static PyObject *__pyx_kp_s_No_atoms_passed_into___read_time;
1487 static PyObject *__pyx_kp_s_No_data_requested_timeseries_is;
1488 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
1489 static PyObject *__pyx_n_s_RuntimeError;
1490 static PyObject *__pyx_n_s_ValueError;
1491 static PyObject *__pyx_n_s_array;
1492 static PyObject *__pyx_n_s_atomcounts;
1493 static PyObject *__pyx_n_s_atomcountslist;
1494 static PyObject *__pyx_n_s_atomlist;
1495 static PyObject *__pyx_n_s_atoms;
1496 static PyObject *__pyx_n_s_auxdata;
1497 static PyObject *__pyx_n_s_auxlist;
1498 static PyObject *__pyx_n_s_coord;
1499 static PyObject *__pyx_n_s_data;
1500 static PyObject *__pyx_n_s_dcd;
1501 static PyObject *__pyx_n_s_dcd_C_ptr;
1502 static PyObject *__pyx_n_s_float32;
1503 static PyObject *__pyx_n_s_float64;
1504 static PyObject *__pyx_n_s_fmtstr;
1505 static PyObject *__pyx_n_s_format;
1506 static PyObject *__pyx_kp_s_home_richard_code_mdanalysis_pa;
1507 static PyObject *__pyx_n_s_i;
1508 static PyObject *__pyx_n_s_import;
1509 static PyObject *__pyx_n_s_index;
1510 static PyObject *__pyx_n_s_int32;
1511 static PyObject *__pyx_n_s_j;
1512 static PyObject *__pyx_n_s_lowerb;
1513 static PyObject *__pyx_n_s_main;
1514 static PyObject *__pyx_n_s_n_atoms;
1515 static PyObject *__pyx_n_s_n_frames;
1516 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
1517 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
1518 static PyObject *__pyx_n_s_np;
1519 static PyObject *__pyx_n_s_numdata;
1520 static PyObject *__pyx_n_s_numpy;
1521 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
1522 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
1523 static PyObject *__pyx_n_s_numskip;
1524 static PyObject *__pyx_n_s_range;
1525 static PyObject *__pyx_n_s_rc;
1526 static PyObject *__pyx_n_s_read_timecorrel;
1527 static PyObject *__pyx_n_s_read_timeseries;
1528 static PyObject *__pyx_n_s_remaining_frames;
1529 static PyObject *__pyx_n_s_self;
1530 static PyObject *__pyx_n_s_sizedata;
1531 static PyObject *__pyx_n_s_skip;
1532 static PyObject *__pyx_n_s_start;
1533 static PyObject *__pyx_n_s_step;
1534 static PyObject *__pyx_n_s_stop;
1535 static PyObject *__pyx_n_s_temp;
1536 static PyObject *__pyx_n_s_tempX;
1537 static PyObject *__pyx_n_s_tempY;
1538 static PyObject *__pyx_n_s_tempZ;
1539 static PyObject *__pyx_n_s_test;
1540 static PyObject *__pyx_n_s_unitcell;
1541 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
1542 static PyObject *__pyx_n_s_upperb;
1543 static PyObject *__pyx_n_s_zeros;
1544 static PyObject *__pyx_pf_10MDAnalysis_11coordinates_13dcdtimeseries___read_timecorrel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_atoms, PyObject *__pyx_v_atomcounts, PyObject *__pyx_v_format, PyObject *__pyx_v_auxdata, int __pyx_v_sizedata, int __pyx_v_lowerb, int __pyx_v_upperb, int __pyx_v_start, int __pyx_v_stop, int __pyx_v_step); /* proto */
1545 static PyObject *__pyx_pf_10MDAnalysis_11coordinates_13dcdtimeseries_2__read_timeseries(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_atoms, int __pyx_v_skip); /* proto */
1546 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
1547 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
1548 static PyObject *__pyx_int_3;
1549 static PyObject *__pyx_tuple_;
1550 static PyObject *__pyx_tuple__2;
1551 static PyObject *__pyx_tuple__3;
1552 static PyObject *__pyx_tuple__4;
1553 static PyObject *__pyx_tuple__5;
1554 static PyObject *__pyx_tuple__6;
1555 static PyObject *__pyx_tuple__7;
1556 static PyObject *__pyx_tuple__8;
1557 static PyObject *__pyx_tuple__9;
1558 static PyObject *__pyx_tuple__10;
1559 static PyObject *__pyx_tuple__11;
1560 static PyObject *__pyx_tuple__12;
1561 static PyObject *__pyx_tuple__13;
1562 static PyObject *__pyx_tuple__14;
1563 static PyObject *__pyx_tuple__15;
1564 static PyObject *__pyx_tuple__16;
1565 static PyObject *__pyx_tuple__17;
1566 static PyObject *__pyx_tuple__19;
1567 static PyObject *__pyx_codeobj__18;
1568 static PyObject *__pyx_codeobj__20;
1569
1570 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":68
1571 * import numpy as np
1572 *
1573 * def __read_timecorrel(object self, object atoms, object atomcounts, object format, object auxdata, int sizedata, int lowerb, int upperb, int start, int stop, int step): # <<<<<<<<<<<<<<
1574 * cdef dcdhandle* dcd
1575 * cdef numpy.ndarray atomlist, atomcountslist, auxlist
1576 */
1577
1578 /* Python wrapper */
1579 static PyObject *__pyx_pw_10MDAnalysis_11coordinates_13dcdtimeseries_1__read_timecorrel(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1580 static PyMethodDef __pyx_mdef_10MDAnalysis_11coordinates_13dcdtimeseries_1__read_timecorrel = {"__read_timecorrel", (PyCFunction)__pyx_pw_10MDAnalysis_11coordinates_13dcdtimeseries_1__read_timecorrel, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_10MDAnalysis_11coordinates_13dcdtimeseries_1__read_timecorrel(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)1581 static PyObject *__pyx_pw_10MDAnalysis_11coordinates_13dcdtimeseries_1__read_timecorrel(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1582 PyObject *__pyx_v_self = 0;
1583 PyObject *__pyx_v_atoms = 0;
1584 PyObject *__pyx_v_atomcounts = 0;
1585 PyObject *__pyx_v_format = 0;
1586 PyObject *__pyx_v_auxdata = 0;
1587 int __pyx_v_sizedata;
1588 int __pyx_v_lowerb;
1589 int __pyx_v_upperb;
1590 int __pyx_v_start;
1591 int __pyx_v_stop;
1592 int __pyx_v_step;
1593 PyObject *__pyx_r = 0;
1594 __Pyx_RefNannyDeclarations
1595 __Pyx_RefNannySetupContext("__read_timecorrel (wrapper)", 0);
1596 {
1597 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_atoms,&__pyx_n_s_atomcounts,&__pyx_n_s_format,&__pyx_n_s_auxdata,&__pyx_n_s_sizedata,&__pyx_n_s_lowerb,&__pyx_n_s_upperb,&__pyx_n_s_start,&__pyx_n_s_stop,&__pyx_n_s_step,0};
1598 PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0};
1599 if (unlikely(__pyx_kwds)) {
1600 Py_ssize_t kw_args;
1601 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
1602 switch (pos_args) {
1603 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
1604 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
1605 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
1606 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
1607 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
1608 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
1609 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
1610 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
1611 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
1612 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1613 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1614 case 0: break;
1615 default: goto __pyx_L5_argtuple_error;
1616 }
1617 kw_args = PyDict_Size(__pyx_kwds);
1618 switch (pos_args) {
1619 case 0:
1620 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
1621 else goto __pyx_L5_argtuple_error;
1622 case 1:
1623 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_atoms)) != 0)) kw_args--;
1624 else {
1625 __Pyx_RaiseArgtupleInvalid("__read_timecorrel", 1, 11, 11, 1); __PYX_ERR(0, 68, __pyx_L3_error)
1626 }
1627 case 2:
1628 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_atomcounts)) != 0)) kw_args--;
1629 else {
1630 __Pyx_RaiseArgtupleInvalid("__read_timecorrel", 1, 11, 11, 2); __PYX_ERR(0, 68, __pyx_L3_error)
1631 }
1632 case 3:
1633 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
1634 else {
1635 __Pyx_RaiseArgtupleInvalid("__read_timecorrel", 1, 11, 11, 3); __PYX_ERR(0, 68, __pyx_L3_error)
1636 }
1637 case 4:
1638 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_auxdata)) != 0)) kw_args--;
1639 else {
1640 __Pyx_RaiseArgtupleInvalid("__read_timecorrel", 1, 11, 11, 4); __PYX_ERR(0, 68, __pyx_L3_error)
1641 }
1642 case 5:
1643 if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sizedata)) != 0)) kw_args--;
1644 else {
1645 __Pyx_RaiseArgtupleInvalid("__read_timecorrel", 1, 11, 11, 5); __PYX_ERR(0, 68, __pyx_L3_error)
1646 }
1647 case 6:
1648 if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lowerb)) != 0)) kw_args--;
1649 else {
1650 __Pyx_RaiseArgtupleInvalid("__read_timecorrel", 1, 11, 11, 6); __PYX_ERR(0, 68, __pyx_L3_error)
1651 }
1652 case 7:
1653 if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_upperb)) != 0)) kw_args--;
1654 else {
1655 __Pyx_RaiseArgtupleInvalid("__read_timecorrel", 1, 11, 11, 7); __PYX_ERR(0, 68, __pyx_L3_error)
1656 }
1657 case 8:
1658 if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
1659 else {
1660 __Pyx_RaiseArgtupleInvalid("__read_timecorrel", 1, 11, 11, 8); __PYX_ERR(0, 68, __pyx_L3_error)
1661 }
1662 case 9:
1663 if (likely((values[9] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
1664 else {
1665 __Pyx_RaiseArgtupleInvalid("__read_timecorrel", 1, 11, 11, 9); __PYX_ERR(0, 68, __pyx_L3_error)
1666 }
1667 case 10:
1668 if (likely((values[10] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_step)) != 0)) kw_args--;
1669 else {
1670 __Pyx_RaiseArgtupleInvalid("__read_timecorrel", 1, 11, 11, 10); __PYX_ERR(0, 68, __pyx_L3_error)
1671 }
1672 }
1673 if (unlikely(kw_args > 0)) {
1674 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__read_timecorrel") < 0)) __PYX_ERR(0, 68, __pyx_L3_error)
1675 }
1676 } else if (PyTuple_GET_SIZE(__pyx_args) != 11) {
1677 goto __pyx_L5_argtuple_error;
1678 } else {
1679 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1680 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1681 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
1682 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
1683 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
1684 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
1685 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
1686 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
1687 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
1688 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
1689 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
1690 }
1691 __pyx_v_self = values[0];
1692 __pyx_v_atoms = values[1];
1693 __pyx_v_atomcounts = values[2];
1694 __pyx_v_format = values[3];
1695 __pyx_v_auxdata = values[4];
1696 __pyx_v_sizedata = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_sizedata == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 68, __pyx_L3_error)
1697 __pyx_v_lowerb = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_lowerb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 68, __pyx_L3_error)
1698 __pyx_v_upperb = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_upperb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 68, __pyx_L3_error)
1699 __pyx_v_start = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_start == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 68, __pyx_L3_error)
1700 __pyx_v_stop = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_stop == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 68, __pyx_L3_error)
1701 __pyx_v_step = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_step == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 68, __pyx_L3_error)
1702 }
1703 goto __pyx_L4_argument_unpacking_done;
1704 __pyx_L5_argtuple_error:;
1705 __Pyx_RaiseArgtupleInvalid("__read_timecorrel", 1, 11, 11, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 68, __pyx_L3_error)
1706 __pyx_L3_error:;
1707 __Pyx_AddTraceback("MDAnalysis.coordinates.dcdtimeseries.__read_timecorrel", __pyx_clineno, __pyx_lineno, __pyx_filename);
1708 __Pyx_RefNannyFinishContext();
1709 return NULL;
1710 __pyx_L4_argument_unpacking_done:;
1711 __pyx_r = __pyx_pf_10MDAnalysis_11coordinates_13dcdtimeseries___read_timecorrel(__pyx_self, __pyx_v_self, __pyx_v_atoms, __pyx_v_atomcounts, __pyx_v_format, __pyx_v_auxdata, __pyx_v_sizedata, __pyx_v_lowerb, __pyx_v_upperb, __pyx_v_start, __pyx_v_stop, __pyx_v_step);
1712
1713 /* function exit code */
1714 __Pyx_RefNannyFinishContext();
1715 return __pyx_r;
1716 }
1717
__pyx_pf_10MDAnalysis_11coordinates_13dcdtimeseries___read_timecorrel(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_self,PyObject * __pyx_v_atoms,PyObject * __pyx_v_atomcounts,PyObject * __pyx_v_format,PyObject * __pyx_v_auxdata,int __pyx_v_sizedata,int __pyx_v_lowerb,int __pyx_v_upperb,int __pyx_v_start,int __pyx_v_stop,int __pyx_v_step)1718 static PyObject *__pyx_pf_10MDAnalysis_11coordinates_13dcdtimeseries___read_timecorrel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_atoms, PyObject *__pyx_v_atomcounts, PyObject *__pyx_v_format, PyObject *__pyx_v_auxdata, int __pyx_v_sizedata, int __pyx_v_lowerb, int __pyx_v_upperb, int __pyx_v_start, int __pyx_v_stop, int __pyx_v_step) {
1719 __pyx_t_10MDAnalysis_11coordinates_13dcdtimeseries_dcdhandle *__pyx_v_dcd;
1720 PyArrayObject *__pyx_v_atomlist = 0;
1721 PyArrayObject *__pyx_v_atomcountslist = 0;
1722 PyArrayObject *__pyx_v_auxlist = 0;
1723 PyArrayObject *__pyx_v_data = 0;
1724 PyArrayObject *__pyx_v_temp = 0;
1725 float *__pyx_v_tempX;
1726 float *__pyx_v_tempY;
1727 float *__pyx_v_tempZ;
1728 int __pyx_v_rc;
1729 char *__pyx_v_fmtstr;
1730 int __pyx_v_n_frames;
1731 int __pyx_v_numdata;
1732 int __pyx_v_range;
1733 int __pyx_v_numskip;
1734 int __pyx_v_i;
1735 float __pyx_v_unitcell[6];
1736 int __pyx_v_remaining_frames;
1737 PyObject *__pyx_r = NULL;
1738 __Pyx_RefNannyDeclarations
1739 PyObject *__pyx_t_1 = NULL;
1740 int __pyx_t_2;
1741 int __pyx_t_3;
1742 Py_ssize_t __pyx_t_4;
1743 PyObject *__pyx_t_5 = NULL;
1744 PyObject *__pyx_t_6 = NULL;
1745 PyObject *__pyx_t_7 = NULL;
1746 PyObject *__pyx_t_8 = NULL;
1747 PyObject *__pyx_t_9 = NULL;
1748 int __pyx_t_10;
1749 __Pyx_RefNannySetupContext("__read_timecorrel", 0);
1750
1751 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":76
1752 * cdef char* fmtstr
1753 *
1754 * dcd = <dcdhandle*>PyCObject_AsVoidPtr(self._dcd_C_ptr) # <<<<<<<<<<<<<<
1755 * cdef int n_frames
1756 *
1757 */
1758 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dcd_C_ptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error)
1759 __Pyx_GOTREF(__pyx_t_1);
1760 __pyx_v_dcd = ((__pyx_t_10MDAnalysis_11coordinates_13dcdtimeseries_dcdhandle *)PyCObject_AsVoidPtr(__pyx_t_1));
1761 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1762
1763 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":79
1764 * cdef int n_frames
1765 *
1766 * n_frames = ((stop-start) / step); # <<<<<<<<<<<<<<
1767 * if (stop-start) % step > 0 : n_frames += 1;
1768 * cdef int numdata
1769 */
1770 __pyx_t_2 = (__pyx_v_stop - __pyx_v_start);
1771 if (unlikely(__pyx_v_step == 0)) {
1772 PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
1773 __PYX_ERR(0, 79, __pyx_L1_error)
1774 }
1775 else if (sizeof(int) == sizeof(long) && (!(((int)-1) > 0)) && unlikely(__pyx_v_step == (int)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_t_2))) {
1776 PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
1777 __PYX_ERR(0, 79, __pyx_L1_error)
1778 }
1779 __pyx_v_n_frames = __Pyx_div_int(__pyx_t_2, __pyx_v_step);
1780
1781 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":80
1782 *
1783 * n_frames = ((stop-start) / step);
1784 * if (stop-start) % step > 0 : n_frames += 1; # <<<<<<<<<<<<<<
1785 * cdef int numdata
1786 * numdata = len(format)
1787 */
1788 __pyx_t_2 = (__pyx_v_stop - __pyx_v_start);
1789 if (unlikely(__pyx_v_step == 0)) {
1790 PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
1791 __PYX_ERR(0, 80, __pyx_L1_error)
1792 }
1793 __pyx_t_3 = ((__Pyx_mod_int(__pyx_t_2, __pyx_v_step) > 0) != 0);
1794 if (__pyx_t_3) {
1795 __pyx_v_n_frames = (__pyx_v_n_frames + 1);
1796 }
1797
1798 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":82
1799 * if (stop-start) % step > 0 : n_frames += 1;
1800 * cdef int numdata
1801 * numdata = len(format) # <<<<<<<<<<<<<<
1802 * if numdata==0:
1803 * raise Exception("No data requested, timeseries is empty")
1804 */
1805 __pyx_t_4 = PyObject_Length(__pyx_v_format); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 82, __pyx_L1_error)
1806 __pyx_v_numdata = __pyx_t_4;
1807
1808 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":83
1809 * cdef int numdata
1810 * numdata = len(format)
1811 * if numdata==0: # <<<<<<<<<<<<<<
1812 * raise Exception("No data requested, timeseries is empty")
1813 * fmtstr = PyString_AsString(format)
1814 */
1815 __pyx_t_3 = ((__pyx_v_numdata == 0) != 0);
1816 if (__pyx_t_3) {
1817
1818 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":84
1819 * numdata = len(format)
1820 * if numdata==0:
1821 * raise Exception("No data requested, timeseries is empty") # <<<<<<<<<<<<<<
1822 * fmtstr = PyString_AsString(format)
1823 *
1824 */
1825 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
1826 __Pyx_GOTREF(__pyx_t_1);
1827 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
1828 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1829 __PYX_ERR(0, 84, __pyx_L1_error)
1830
1831 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":83
1832 * cdef int numdata
1833 * numdata = len(format)
1834 * if numdata==0: # <<<<<<<<<<<<<<
1835 * raise Exception("No data requested, timeseries is empty")
1836 * fmtstr = PyString_AsString(format)
1837 */
1838 }
1839
1840 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":85
1841 * if numdata==0:
1842 * raise Exception("No data requested, timeseries is empty")
1843 * fmtstr = PyString_AsString(format) # <<<<<<<<<<<<<<
1844 *
1845 * atomlist = np.array(atoms, np.int32)
1846 */
1847 __pyx_v_fmtstr = PyString_AsString(__pyx_v_format);
1848
1849 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":87
1850 * fmtstr = PyString_AsString(format)
1851 *
1852 * atomlist = np.array(atoms, np.int32) # <<<<<<<<<<<<<<
1853 * atomcountslist = np.array(atomcounts, np.int32)
1854 * auxlist = np.array(auxdata, np.float64)
1855 */
1856 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 87, __pyx_L1_error)
1857 __Pyx_GOTREF(__pyx_t_5);
1858 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 87, __pyx_L1_error)
1859 __Pyx_GOTREF(__pyx_t_6);
1860 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1861 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 87, __pyx_L1_error)
1862 __Pyx_GOTREF(__pyx_t_5);
1863 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 87, __pyx_L1_error)
1864 __Pyx_GOTREF(__pyx_t_7);
1865 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1866 __pyx_t_5 = NULL;
1867 __pyx_t_2 = 0;
1868 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
1869 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
1870 if (likely(__pyx_t_5)) {
1871 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
1872 __Pyx_INCREF(__pyx_t_5);
1873 __Pyx_INCREF(function);
1874 __Pyx_DECREF_SET(__pyx_t_6, function);
1875 __pyx_t_2 = 1;
1876 }
1877 }
1878 #if CYTHON_FAST_PYCALL
1879 if (PyFunction_Check(__pyx_t_6)) {
1880 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_atoms, __pyx_t_7};
1881 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
1882 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
1883 __Pyx_GOTREF(__pyx_t_1);
1884 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
1885 } else
1886 #endif
1887 #if CYTHON_FAST_PYCCALL
1888 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
1889 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_atoms, __pyx_t_7};
1890 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
1891 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
1892 __Pyx_GOTREF(__pyx_t_1);
1893 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
1894 } else
1895 #endif
1896 {
1897 __pyx_t_8 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 87, __pyx_L1_error)
1898 __Pyx_GOTREF(__pyx_t_8);
1899 if (__pyx_t_5) {
1900 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
1901 }
1902 __Pyx_INCREF(__pyx_v_atoms);
1903 __Pyx_GIVEREF(__pyx_v_atoms);
1904 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_2, __pyx_v_atoms);
1905 __Pyx_GIVEREF(__pyx_t_7);
1906 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_2, __pyx_t_7);
1907 __pyx_t_7 = 0;
1908 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
1909 __Pyx_GOTREF(__pyx_t_1);
1910 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
1911 }
1912 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1913 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 87, __pyx_L1_error)
1914 __pyx_v_atomlist = ((PyArrayObject *)__pyx_t_1);
1915 __pyx_t_1 = 0;
1916
1917 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":88
1918 *
1919 * atomlist = np.array(atoms, np.int32)
1920 * atomcountslist = np.array(atomcounts, np.int32) # <<<<<<<<<<<<<<
1921 * auxlist = np.array(auxdata, np.float64)
1922 * #print "atomlist", atomlist
1923 */
1924 __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 88, __pyx_L1_error)
1925 __Pyx_GOTREF(__pyx_t_6);
1926 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 88, __pyx_L1_error)
1927 __Pyx_GOTREF(__pyx_t_8);
1928 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1929 __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 88, __pyx_L1_error)
1930 __Pyx_GOTREF(__pyx_t_6);
1931 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 88, __pyx_L1_error)
1932 __Pyx_GOTREF(__pyx_t_7);
1933 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1934 __pyx_t_6 = NULL;
1935 __pyx_t_2 = 0;
1936 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
1937 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
1938 if (likely(__pyx_t_6)) {
1939 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
1940 __Pyx_INCREF(__pyx_t_6);
1941 __Pyx_INCREF(function);
1942 __Pyx_DECREF_SET(__pyx_t_8, function);
1943 __pyx_t_2 = 1;
1944 }
1945 }
1946 #if CYTHON_FAST_PYCALL
1947 if (PyFunction_Check(__pyx_t_8)) {
1948 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_atomcounts, __pyx_t_7};
1949 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
1950 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
1951 __Pyx_GOTREF(__pyx_t_1);
1952 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
1953 } else
1954 #endif
1955 #if CYTHON_FAST_PYCCALL
1956 if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
1957 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_atomcounts, __pyx_t_7};
1958 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
1959 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
1960 __Pyx_GOTREF(__pyx_t_1);
1961 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
1962 } else
1963 #endif
1964 {
1965 __pyx_t_5 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 88, __pyx_L1_error)
1966 __Pyx_GOTREF(__pyx_t_5);
1967 if (__pyx_t_6) {
1968 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL;
1969 }
1970 __Pyx_INCREF(__pyx_v_atomcounts);
1971 __Pyx_GIVEREF(__pyx_v_atomcounts);
1972 PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_2, __pyx_v_atomcounts);
1973 __Pyx_GIVEREF(__pyx_t_7);
1974 PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_2, __pyx_t_7);
1975 __pyx_t_7 = 0;
1976 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
1977 __Pyx_GOTREF(__pyx_t_1);
1978 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1979 }
1980 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
1981 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 88, __pyx_L1_error)
1982 __pyx_v_atomcountslist = ((PyArrayObject *)__pyx_t_1);
1983 __pyx_t_1 = 0;
1984
1985 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":89
1986 * atomlist = np.array(atoms, np.int32)
1987 * atomcountslist = np.array(atomcounts, np.int32)
1988 * auxlist = np.array(auxdata, np.float64) # <<<<<<<<<<<<<<
1989 * #print "atomlist", atomlist
1990 * #print "atomcountslist", atomcountslist
1991 */
1992 __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 89, __pyx_L1_error)
1993 __Pyx_GOTREF(__pyx_t_8);
1994 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 89, __pyx_L1_error)
1995 __Pyx_GOTREF(__pyx_t_5);
1996 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
1997 __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 89, __pyx_L1_error)
1998 __Pyx_GOTREF(__pyx_t_8);
1999 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 89, __pyx_L1_error)
2000 __Pyx_GOTREF(__pyx_t_7);
2001 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
2002 __pyx_t_8 = NULL;
2003 __pyx_t_2 = 0;
2004 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
2005 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
2006 if (likely(__pyx_t_8)) {
2007 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
2008 __Pyx_INCREF(__pyx_t_8);
2009 __Pyx_INCREF(function);
2010 __Pyx_DECREF_SET(__pyx_t_5, function);
2011 __pyx_t_2 = 1;
2012 }
2013 }
2014 #if CYTHON_FAST_PYCALL
2015 if (PyFunction_Check(__pyx_t_5)) {
2016 PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_auxdata, __pyx_t_7};
2017 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
2018 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
2019 __Pyx_GOTREF(__pyx_t_1);
2020 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2021 } else
2022 #endif
2023 #if CYTHON_FAST_PYCCALL
2024 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
2025 PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_auxdata, __pyx_t_7};
2026 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
2027 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
2028 __Pyx_GOTREF(__pyx_t_1);
2029 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2030 } else
2031 #endif
2032 {
2033 __pyx_t_6 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 89, __pyx_L1_error)
2034 __Pyx_GOTREF(__pyx_t_6);
2035 if (__pyx_t_8) {
2036 __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); __pyx_t_8 = NULL;
2037 }
2038 __Pyx_INCREF(__pyx_v_auxdata);
2039 __Pyx_GIVEREF(__pyx_v_auxdata);
2040 PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_2, __pyx_v_auxdata);
2041 __Pyx_GIVEREF(__pyx_t_7);
2042 PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_2, __pyx_t_7);
2043 __pyx_t_7 = 0;
2044 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
2045 __Pyx_GOTREF(__pyx_t_1);
2046 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2047 }
2048 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2049 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 89, __pyx_L1_error)
2050 __pyx_v_auxlist = ((PyArrayObject *)__pyx_t_1);
2051 __pyx_t_1 = 0;
2052
2053 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":94
2054 * #print "formatcode", fmtstr
2055 * cdef int range
2056 * range = upperb - lowerb + 1 # <<<<<<<<<<<<<<
2057 * # Create data list
2058 * #data = np.zeros((n_frames, sizedata), np.float64)
2059 */
2060 __pyx_v_range = ((__pyx_v_upperb - __pyx_v_lowerb) + 1);
2061
2062 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":97
2063 * # Create data list
2064 * #data = np.zeros((n_frames, sizedata), np.float64)
2065 * data = np.zeros((sizedata, n_frames), np.float64) # <<<<<<<<<<<<<<
2066 * temp = np.zeros((3, range), np.float32)
2067 * tempX = <float*>(temp.data+0*temp.strides[0])
2068 */
2069 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 97, __pyx_L1_error)
2070 __Pyx_GOTREF(__pyx_t_5);
2071 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 97, __pyx_L1_error)
2072 __Pyx_GOTREF(__pyx_t_6);
2073 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2074 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_sizedata); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 97, __pyx_L1_error)
2075 __Pyx_GOTREF(__pyx_t_5);
2076 __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_n_frames); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 97, __pyx_L1_error)
2077 __Pyx_GOTREF(__pyx_t_7);
2078 __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 97, __pyx_L1_error)
2079 __Pyx_GOTREF(__pyx_t_8);
2080 __Pyx_GIVEREF(__pyx_t_5);
2081 PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5);
2082 __Pyx_GIVEREF(__pyx_t_7);
2083 PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7);
2084 __pyx_t_5 = 0;
2085 __pyx_t_7 = 0;
2086 __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 97, __pyx_L1_error)
2087 __Pyx_GOTREF(__pyx_t_7);
2088 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 97, __pyx_L1_error)
2089 __Pyx_GOTREF(__pyx_t_5);
2090 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2091 __pyx_t_7 = NULL;
2092 __pyx_t_2 = 0;
2093 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
2094 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
2095 if (likely(__pyx_t_7)) {
2096 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
2097 __Pyx_INCREF(__pyx_t_7);
2098 __Pyx_INCREF(function);
2099 __Pyx_DECREF_SET(__pyx_t_6, function);
2100 __pyx_t_2 = 1;
2101 }
2102 }
2103 #if CYTHON_FAST_PYCALL
2104 if (PyFunction_Check(__pyx_t_6)) {
2105 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_8, __pyx_t_5};
2106 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
2107 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
2108 __Pyx_GOTREF(__pyx_t_1);
2109 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
2110 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2111 } else
2112 #endif
2113 #if CYTHON_FAST_PYCCALL
2114 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
2115 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_8, __pyx_t_5};
2116 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
2117 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
2118 __Pyx_GOTREF(__pyx_t_1);
2119 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
2120 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2121 } else
2122 #endif
2123 {
2124 __pyx_t_9 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 97, __pyx_L1_error)
2125 __Pyx_GOTREF(__pyx_t_9);
2126 if (__pyx_t_7) {
2127 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
2128 }
2129 __Pyx_GIVEREF(__pyx_t_8);
2130 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_2, __pyx_t_8);
2131 __Pyx_GIVEREF(__pyx_t_5);
2132 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_2, __pyx_t_5);
2133 __pyx_t_8 = 0;
2134 __pyx_t_5 = 0;
2135 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
2136 __Pyx_GOTREF(__pyx_t_1);
2137 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
2138 }
2139 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2140 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 97, __pyx_L1_error)
2141 __pyx_v_data = ((PyArrayObject *)__pyx_t_1);
2142 __pyx_t_1 = 0;
2143
2144 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":98
2145 * #data = np.zeros((n_frames, sizedata), np.float64)
2146 * data = np.zeros((sizedata, n_frames), np.float64)
2147 * temp = np.zeros((3, range), np.float32) # <<<<<<<<<<<<<<
2148 * tempX = <float*>(temp.data+0*temp.strides[0])
2149 * tempY = <float*>(temp.data+1*temp.strides[0])
2150 */
2151 __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 98, __pyx_L1_error)
2152 __Pyx_GOTREF(__pyx_t_6);
2153 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 98, __pyx_L1_error)
2154 __Pyx_GOTREF(__pyx_t_9);
2155 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2156 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_range); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 98, __pyx_L1_error)
2157 __Pyx_GOTREF(__pyx_t_6);
2158 __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 98, __pyx_L1_error)
2159 __Pyx_GOTREF(__pyx_t_5);
2160 __Pyx_INCREF(__pyx_int_3);
2161 __Pyx_GIVEREF(__pyx_int_3);
2162 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_3);
2163 __Pyx_GIVEREF(__pyx_t_6);
2164 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
2165 __pyx_t_6 = 0;
2166 __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 98, __pyx_L1_error)
2167 __Pyx_GOTREF(__pyx_t_6);
2168 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 98, __pyx_L1_error)
2169 __Pyx_GOTREF(__pyx_t_8);
2170 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2171 __pyx_t_6 = NULL;
2172 __pyx_t_2 = 0;
2173 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
2174 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
2175 if (likely(__pyx_t_6)) {
2176 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
2177 __Pyx_INCREF(__pyx_t_6);
2178 __Pyx_INCREF(function);
2179 __Pyx_DECREF_SET(__pyx_t_9, function);
2180 __pyx_t_2 = 1;
2181 }
2182 }
2183 #if CYTHON_FAST_PYCALL
2184 if (PyFunction_Check(__pyx_t_9)) {
2185 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_t_8};
2186 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error)
2187 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
2188 __Pyx_GOTREF(__pyx_t_1);
2189 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2190 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
2191 } else
2192 #endif
2193 #if CYTHON_FAST_PYCCALL
2194 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
2195 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_t_8};
2196 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error)
2197 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
2198 __Pyx_GOTREF(__pyx_t_1);
2199 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2200 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
2201 } else
2202 #endif
2203 {
2204 __pyx_t_7 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 98, __pyx_L1_error)
2205 __Pyx_GOTREF(__pyx_t_7);
2206 if (__pyx_t_6) {
2207 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
2208 }
2209 __Pyx_GIVEREF(__pyx_t_5);
2210 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_2, __pyx_t_5);
2211 __Pyx_GIVEREF(__pyx_t_8);
2212 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_2, __pyx_t_8);
2213 __pyx_t_5 = 0;
2214 __pyx_t_8 = 0;
2215 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error)
2216 __Pyx_GOTREF(__pyx_t_1);
2217 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2218 }
2219 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
2220 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 98, __pyx_L1_error)
2221 __pyx_v_temp = ((PyArrayObject *)__pyx_t_1);
2222 __pyx_t_1 = 0;
2223
2224 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":99
2225 * data = np.zeros((sizedata, n_frames), np.float64)
2226 * temp = np.zeros((3, range), np.float32)
2227 * tempX = <float*>(temp.data+0*temp.strides[0]) # <<<<<<<<<<<<<<
2228 * tempY = <float*>(temp.data+1*temp.strides[0])
2229 * tempZ = <float*>(temp.data+2*temp.strides[0])
2230 */
2231 __pyx_v_tempX = ((float *)(__pyx_v_temp->data + (0 * (__pyx_v_temp->strides[0]))));
2232
2233 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":100
2234 * temp = np.zeros((3, range), np.float32)
2235 * tempX = <float*>(temp.data+0*temp.strides[0])
2236 * tempY = <float*>(temp.data+1*temp.strides[0]) # <<<<<<<<<<<<<<
2237 * tempZ = <float*>(temp.data+2*temp.strides[0])
2238 *
2239 */
2240 __pyx_v_tempY = ((float *)(__pyx_v_temp->data + (1 * (__pyx_v_temp->strides[0]))));
2241
2242 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":101
2243 * tempX = <float*>(temp.data+0*temp.strides[0])
2244 * tempY = <float*>(temp.data+1*temp.strides[0])
2245 * tempZ = <float*>(temp.data+2*temp.strides[0]) # <<<<<<<<<<<<<<
2246 *
2247 * # Reset trajectory
2248 */
2249 __pyx_v_tempZ = ((float *)(__pyx_v_temp->data + (2 * (__pyx_v_temp->strides[0]))));
2250
2251 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":104
2252 *
2253 * # Reset trajectory
2254 * rc = fio_fseek(dcd.fd, dcd.header_size, 0) #FIO_SEEK_SET # <<<<<<<<<<<<<<
2255 * dcd.setsread = 0
2256 * dcd.first = 1
2257 */
2258 __pyx_v_rc = fio_fseek(__pyx_v_dcd->fd, __pyx_v_dcd->header_size, 0);
2259
2260 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":105
2261 * # Reset trajectory
2262 * rc = fio_fseek(dcd.fd, dcd.header_size, 0) #FIO_SEEK_SET
2263 * dcd.setsread = 0 # <<<<<<<<<<<<<<
2264 * dcd.first = 1
2265 *
2266 */
2267 __pyx_v_dcd->setsread = 0;
2268
2269 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":106
2270 * rc = fio_fseek(dcd.fd, dcd.header_size, 0) #FIO_SEEK_SET
2271 * dcd.setsread = 0
2272 * dcd.first = 1 # <<<<<<<<<<<<<<
2273 *
2274 * # Jump to frame
2275 */
2276 __pyx_v_dcd->first = 1;
2277
2278 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":109
2279 *
2280 * # Jump to frame
2281 * if (start > 0): # <<<<<<<<<<<<<<
2282 * rc = jump_to_dcdstep(dcd.fd, dcd.natoms, dcd.nsets, dcd.nfixed, dcd.charmm, dcd.header_size, start)
2283 * if (rc < 0):
2284 */
2285 __pyx_t_3 = ((__pyx_v_start > 0) != 0);
2286 if (__pyx_t_3) {
2287
2288 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":110
2289 * # Jump to frame
2290 * if (start > 0):
2291 * rc = jump_to_dcdstep(dcd.fd, dcd.natoms, dcd.nsets, dcd.nfixed, dcd.charmm, dcd.header_size, start) # <<<<<<<<<<<<<<
2292 * if (rc < 0):
2293 * raise IOError("Error jumping to starting frame")
2294 */
2295 __pyx_v_rc = jump_to_dcdstep(__pyx_v_dcd->fd, __pyx_v_dcd->natoms, __pyx_v_dcd->nsets, __pyx_v_dcd->nfixed, __pyx_v_dcd->charmm, __pyx_v_dcd->header_size, __pyx_v_start);
2296
2297 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":111
2298 * if (start > 0):
2299 * rc = jump_to_dcdstep(dcd.fd, dcd.natoms, dcd.nsets, dcd.nfixed, dcd.charmm, dcd.header_size, start)
2300 * if (rc < 0): # <<<<<<<<<<<<<<
2301 * raise IOError("Error jumping to starting frame")
2302 * dcd.first = 0
2303 */
2304 __pyx_t_3 = ((__pyx_v_rc < 0) != 0);
2305 if (__pyx_t_3) {
2306
2307 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":112
2308 * rc = jump_to_dcdstep(dcd.fd, dcd.natoms, dcd.nsets, dcd.nfixed, dcd.charmm, dcd.header_size, start)
2309 * if (rc < 0):
2310 * raise IOError("Error jumping to starting frame") # <<<<<<<<<<<<<<
2311 * dcd.first = 0
2312 * dcd.setsread = start
2313 */
2314 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error)
2315 __Pyx_GOTREF(__pyx_t_1);
2316 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
2317 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2318 __PYX_ERR(0, 112, __pyx_L1_error)
2319
2320 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":111
2321 * if (start > 0):
2322 * rc = jump_to_dcdstep(dcd.fd, dcd.natoms, dcd.nsets, dcd.nfixed, dcd.charmm, dcd.header_size, start)
2323 * if (rc < 0): # <<<<<<<<<<<<<<
2324 * raise IOError("Error jumping to starting frame")
2325 * dcd.first = 0
2326 */
2327 }
2328
2329 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":113
2330 * if (rc < 0):
2331 * raise IOError("Error jumping to starting frame")
2332 * dcd.first = 0 # <<<<<<<<<<<<<<
2333 * dcd.setsread = start
2334 *
2335 */
2336 __pyx_v_dcd->first = 0;
2337
2338 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":114
2339 * raise IOError("Error jumping to starting frame")
2340 * dcd.first = 0
2341 * dcd.setsread = start # <<<<<<<<<<<<<<
2342 *
2343 * cdef int index, numskip
2344 */
2345 __pyx_v_dcd->setsread = __pyx_v_start;
2346
2347 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":109
2348 *
2349 * # Jump to frame
2350 * if (start > 0): # <<<<<<<<<<<<<<
2351 * rc = jump_to_dcdstep(dcd.fd, dcd.natoms, dcd.nsets, dcd.nfixed, dcd.charmm, dcd.header_size, start)
2352 * if (rc < 0):
2353 */
2354 }
2355
2356 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":119
2357 * cdef int i, j
2358 * cdef float unitcell[6]
2359 * cdef int remaining_frames = stop-start # <<<<<<<<<<<<<<
2360 * numskip = 0
2361 * for i from 0 <= i < n_frames:
2362 */
2363 __pyx_v_remaining_frames = (__pyx_v_stop - __pyx_v_start);
2364
2365 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":120
2366 * cdef float unitcell[6]
2367 * cdef int remaining_frames = stop-start
2368 * numskip = 0 # <<<<<<<<<<<<<<
2369 * for i from 0 <= i < n_frames:
2370 * if (step > 1 and i > 0):
2371 */
2372 __pyx_v_numskip = 0;
2373
2374 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":121
2375 * cdef int remaining_frames = stop-start
2376 * numskip = 0
2377 * for i from 0 <= i < n_frames: # <<<<<<<<<<<<<<
2378 * if (step > 1 and i > 0):
2379 * # Check if we have fixed atoms
2380 */
2381 __pyx_t_2 = __pyx_v_n_frames;
2382 for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {
2383
2384 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":122
2385 * numskip = 0
2386 * for i from 0 <= i < n_frames:
2387 * if (step > 1 and i > 0): # <<<<<<<<<<<<<<
2388 * # Check if we have fixed atoms
2389 * # XXX not done
2390 */
2391 __pyx_t_10 = ((__pyx_v_step > 1) != 0);
2392 if (__pyx_t_10) {
2393 } else {
2394 __pyx_t_3 = __pyx_t_10;
2395 goto __pyx_L10_bool_binop_done;
2396 }
2397 __pyx_t_10 = ((__pyx_v_i > 0) != 0);
2398 __pyx_t_3 = __pyx_t_10;
2399 __pyx_L10_bool_binop_done:;
2400 if (__pyx_t_3) {
2401
2402 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":127
2403 * # Figure out how many steps to step over, if step = n, np array
2404 * # slicing treats this as skip over n-1, read the nth.
2405 * numskip = step - 1 # <<<<<<<<<<<<<<
2406 * # If the number to skip is greater than the number of frames left
2407 * # to be jumped over, just take one more step to reflect np slicing
2408 */
2409 __pyx_v_numskip = (__pyx_v_step - 1);
2410
2411 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":132
2412 * # if there is a remainder, guaranteed to have at least one more
2413 * # frame.
2414 * if(remaining_frames < numskip): # <<<<<<<<<<<<<<
2415 * numskip = 1
2416 *
2417 */
2418 __pyx_t_3 = ((__pyx_v_remaining_frames < __pyx_v_numskip) != 0);
2419 if (__pyx_t_3) {
2420
2421 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":133
2422 * # frame.
2423 * if(remaining_frames < numskip):
2424 * numskip = 1 # <<<<<<<<<<<<<<
2425 *
2426 * rc = skip_dcdstep(dcd.fd, dcd.natoms, dcd.nfixed, dcd.charmm, numskip)
2427 */
2428 __pyx_v_numskip = 1;
2429
2430 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":132
2431 * # if there is a remainder, guaranteed to have at least one more
2432 * # frame.
2433 * if(remaining_frames < numskip): # <<<<<<<<<<<<<<
2434 * numskip = 1
2435 *
2436 */
2437 }
2438
2439 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":135
2440 * numskip = 1
2441 *
2442 * rc = skip_dcdstep(dcd.fd, dcd.natoms, dcd.nfixed, dcd.charmm, numskip) # <<<<<<<<<<<<<<
2443 * if (rc < 0):
2444 * raise IOError("Error skipping frame from DCD file")
2445 */
2446 __pyx_v_rc = skip_dcdstep(__pyx_v_dcd->fd, __pyx_v_dcd->natoms, __pyx_v_dcd->nfixed, __pyx_v_dcd->charmm, __pyx_v_numskip);
2447
2448 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":136
2449 *
2450 * rc = skip_dcdstep(dcd.fd, dcd.natoms, dcd.nfixed, dcd.charmm, numskip)
2451 * if (rc < 0): # <<<<<<<<<<<<<<
2452 * raise IOError("Error skipping frame from DCD file")
2453 * # on first iteration, numskip = 0, first set is always read.
2454 */
2455 __pyx_t_3 = ((__pyx_v_rc < 0) != 0);
2456 if (__pyx_t_3) {
2457
2458 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":137
2459 * rc = skip_dcdstep(dcd.fd, dcd.natoms, dcd.nfixed, dcd.charmm, numskip)
2460 * if (rc < 0):
2461 * raise IOError("Error skipping frame from DCD file") # <<<<<<<<<<<<<<
2462 * # on first iteration, numskip = 0, first set is always read.
2463 * dcd.setsread += numskip
2464 */
2465 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error)
2466 __Pyx_GOTREF(__pyx_t_1);
2467 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
2468 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2469 __PYX_ERR(0, 137, __pyx_L1_error)
2470
2471 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":136
2472 *
2473 * rc = skip_dcdstep(dcd.fd, dcd.natoms, dcd.nfixed, dcd.charmm, numskip)
2474 * if (rc < 0): # <<<<<<<<<<<<<<
2475 * raise IOError("Error skipping frame from DCD file")
2476 * # on first iteration, numskip = 0, first set is always read.
2477 */
2478 }
2479
2480 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":122
2481 * numskip = 0
2482 * for i from 0 <= i < n_frames:
2483 * if (step > 1 and i > 0): # <<<<<<<<<<<<<<
2484 * # Check if we have fixed atoms
2485 * # XXX not done
2486 */
2487 }
2488
2489 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":139
2490 * raise IOError("Error skipping frame from DCD file")
2491 * # on first iteration, numskip = 0, first set is always read.
2492 * dcd.setsread += numskip # <<<<<<<<<<<<<<
2493 * rc = read_dcdsubset(dcd.fd, dcd.natoms, lowerb, upperb, tempX, tempY, tempZ, unitcell, dcd.nfixed, dcd.first, dcd.freeind, dcd.fixedcoords, dcd.reverse, dcd.charmm)
2494 * dcd.first = 0
2495 */
2496 __pyx_v_dcd->setsread = (__pyx_v_dcd->setsread + __pyx_v_numskip);
2497
2498 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":140
2499 * # on first iteration, numskip = 0, first set is always read.
2500 * dcd.setsread += numskip
2501 * rc = read_dcdsubset(dcd.fd, dcd.natoms, lowerb, upperb, tempX, tempY, tempZ, unitcell, dcd.nfixed, dcd.first, dcd.freeind, dcd.fixedcoords, dcd.reverse, dcd.charmm) # <<<<<<<<<<<<<<
2502 * dcd.first = 0
2503 * dcd.setsread += 1
2504 */
2505 __pyx_v_rc = read_dcdsubset(__pyx_v_dcd->fd, __pyx_v_dcd->natoms, __pyx_v_lowerb, __pyx_v_upperb, __pyx_v_tempX, __pyx_v_tempY, __pyx_v_tempZ, __pyx_v_unitcell, __pyx_v_dcd->nfixed, __pyx_v_dcd->first, __pyx_v_dcd->freeind, __pyx_v_dcd->fixedcoords, __pyx_v_dcd->reverse, __pyx_v_dcd->charmm);
2506
2507 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":141
2508 * dcd.setsread += numskip
2509 * rc = read_dcdsubset(dcd.fd, dcd.natoms, lowerb, upperb, tempX, tempY, tempZ, unitcell, dcd.nfixed, dcd.first, dcd.freeind, dcd.fixedcoords, dcd.reverse, dcd.charmm)
2510 * dcd.first = 0 # <<<<<<<<<<<<<<
2511 * dcd.setsread += 1
2512 * remaining_frames = stop - dcd.setsread
2513 */
2514 __pyx_v_dcd->first = 0;
2515
2516 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":142
2517 * rc = read_dcdsubset(dcd.fd, dcd.natoms, lowerb, upperb, tempX, tempY, tempZ, unitcell, dcd.nfixed, dcd.first, dcd.freeind, dcd.fixedcoords, dcd.reverse, dcd.charmm)
2518 * dcd.first = 0
2519 * dcd.setsread += 1 # <<<<<<<<<<<<<<
2520 * remaining_frames = stop - dcd.setsread
2521 * if (rc < 0):
2522 */
2523 __pyx_v_dcd->setsread = (__pyx_v_dcd->setsread + 1);
2524
2525 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":143
2526 * dcd.first = 0
2527 * dcd.setsread += 1
2528 * remaining_frames = stop - dcd.setsread # <<<<<<<<<<<<<<
2529 * if (rc < 0):
2530 * raise IOError("Error reading frame from DCD file")
2531 */
2532 __pyx_v_remaining_frames = (__pyx_v_stop - __pyx_v_dcd->setsread);
2533
2534 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":144
2535 * dcd.setsread += 1
2536 * remaining_frames = stop - dcd.setsread
2537 * if (rc < 0): # <<<<<<<<<<<<<<
2538 * raise IOError("Error reading frame from DCD file")
2539 * # Copy into data array based on format
2540 */
2541 __pyx_t_3 = ((__pyx_v_rc < 0) != 0);
2542 if (__pyx_t_3) {
2543
2544 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":145
2545 * remaining_frames = stop - dcd.setsread
2546 * if (rc < 0):
2547 * raise IOError("Error reading frame from DCD file") # <<<<<<<<<<<<<<
2548 * # Copy into data array based on format
2549 * copyseries(i, <char*>data.data, data.strides, tempX, tempY, tempZ, fmtstr, numdata, <int*>atomlist.data, <int*>atomcountslist.data, lowerb, <double*>auxlist.data);
2550 */
2551 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error)
2552 __Pyx_GOTREF(__pyx_t_1);
2553 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
2554 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2555 __PYX_ERR(0, 145, __pyx_L1_error)
2556
2557 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":144
2558 * dcd.setsread += 1
2559 * remaining_frames = stop - dcd.setsread
2560 * if (rc < 0): # <<<<<<<<<<<<<<
2561 * raise IOError("Error reading frame from DCD file")
2562 * # Copy into data array based on format
2563 */
2564 }
2565
2566 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":147
2567 * raise IOError("Error reading frame from DCD file")
2568 * # Copy into data array based on format
2569 * copyseries(i, <char*>data.data, data.strides, tempX, tempY, tempZ, fmtstr, numdata, <int*>atomlist.data, <int*>atomcountslist.data, lowerb, <double*>auxlist.data); # <<<<<<<<<<<<<<
2570 * PyErr_CheckSignals()
2571 *
2572 */
2573 copyseries(__pyx_v_i, ((char *)__pyx_v_data->data), __pyx_v_data->strides, __pyx_v_tempX, __pyx_v_tempY, __pyx_v_tempZ, __pyx_v_fmtstr, __pyx_v_numdata, ((int *)__pyx_v_atomlist->data), ((int *)__pyx_v_atomcountslist->data), __pyx_v_lowerb, ((double *)__pyx_v_auxlist->data));
2574
2575 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":148
2576 * # Copy into data array based on format
2577 * copyseries(i, <char*>data.data, data.strides, tempX, tempY, tempZ, fmtstr, numdata, <int*>atomlist.data, <int*>atomcountslist.data, lowerb, <double*>auxlist.data);
2578 * PyErr_CheckSignals() # <<<<<<<<<<<<<<
2579 *
2580 * # Reset trajectory
2581 */
2582 PyErr_CheckSignals();
2583 }
2584
2585 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":151
2586 *
2587 * # Reset trajectory
2588 * rc = fio_fseek(dcd.fd, dcd.header_size, 0) #FIO_SEEK_SET # <<<<<<<<<<<<<<
2589 * dcd.setsread = 0
2590 * dcd.first = 1
2591 */
2592 __pyx_v_rc = fio_fseek(__pyx_v_dcd->fd, __pyx_v_dcd->header_size, 0);
2593
2594 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":152
2595 * # Reset trajectory
2596 * rc = fio_fseek(dcd.fd, dcd.header_size, 0) #FIO_SEEK_SET
2597 * dcd.setsread = 0 # <<<<<<<<<<<<<<
2598 * dcd.first = 1
2599 * return data
2600 */
2601 __pyx_v_dcd->setsread = 0;
2602
2603 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":153
2604 * rc = fio_fseek(dcd.fd, dcd.header_size, 0) #FIO_SEEK_SET
2605 * dcd.setsread = 0
2606 * dcd.first = 1 # <<<<<<<<<<<<<<
2607 * return data
2608 *
2609 */
2610 __pyx_v_dcd->first = 1;
2611
2612 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":154
2613 * dcd.setsread = 0
2614 * dcd.first = 1
2615 * return data # <<<<<<<<<<<<<<
2616 *
2617 * def __read_timeseries(object self, object atoms, int skip):
2618 */
2619 __Pyx_XDECREF(__pyx_r);
2620 __Pyx_INCREF(((PyObject *)__pyx_v_data));
2621 __pyx_r = ((PyObject *)__pyx_v_data);
2622 goto __pyx_L0;
2623
2624 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":68
2625 * import numpy as np
2626 *
2627 * def __read_timecorrel(object self, object atoms, object atomcounts, object format, object auxdata, int sizedata, int lowerb, int upperb, int start, int stop, int step): # <<<<<<<<<<<<<<
2628 * cdef dcdhandle* dcd
2629 * cdef numpy.ndarray atomlist, atomcountslist, auxlist
2630 */
2631
2632 /* function exit code */
2633 __pyx_L1_error:;
2634 __Pyx_XDECREF(__pyx_t_1);
2635 __Pyx_XDECREF(__pyx_t_5);
2636 __Pyx_XDECREF(__pyx_t_6);
2637 __Pyx_XDECREF(__pyx_t_7);
2638 __Pyx_XDECREF(__pyx_t_8);
2639 __Pyx_XDECREF(__pyx_t_9);
2640 __Pyx_AddTraceback("MDAnalysis.coordinates.dcdtimeseries.__read_timecorrel", __pyx_clineno, __pyx_lineno, __pyx_filename);
2641 __pyx_r = NULL;
2642 __pyx_L0:;
2643 __Pyx_XDECREF((PyObject *)__pyx_v_atomlist);
2644 __Pyx_XDECREF((PyObject *)__pyx_v_atomcountslist);
2645 __Pyx_XDECREF((PyObject *)__pyx_v_auxlist);
2646 __Pyx_XDECREF((PyObject *)__pyx_v_data);
2647 __Pyx_XDECREF((PyObject *)__pyx_v_temp);
2648 __Pyx_XGIVEREF(__pyx_r);
2649 __Pyx_RefNannyFinishContext();
2650 return __pyx_r;
2651 }
2652
2653 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":156
2654 * return data
2655 *
2656 * def __read_timeseries(object self, object atoms, int skip): # <<<<<<<<<<<<<<
2657 * cdef dcdhandle* dcd
2658 * cdef numpy.ndarray atomlist
2659 */
2660
2661 /* Python wrapper */
2662 static PyObject *__pyx_pw_10MDAnalysis_11coordinates_13dcdtimeseries_3__read_timeseries(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2663 static PyMethodDef __pyx_mdef_10MDAnalysis_11coordinates_13dcdtimeseries_3__read_timeseries = {"__read_timeseries", (PyCFunction)__pyx_pw_10MDAnalysis_11coordinates_13dcdtimeseries_3__read_timeseries, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_10MDAnalysis_11coordinates_13dcdtimeseries_3__read_timeseries(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)2664 static PyObject *__pyx_pw_10MDAnalysis_11coordinates_13dcdtimeseries_3__read_timeseries(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2665 PyObject *__pyx_v_self = 0;
2666 PyObject *__pyx_v_atoms = 0;
2667 int __pyx_v_skip;
2668 PyObject *__pyx_r = 0;
2669 __Pyx_RefNannyDeclarations
2670 __Pyx_RefNannySetupContext("__read_timeseries (wrapper)", 0);
2671 {
2672 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_atoms,&__pyx_n_s_skip,0};
2673 PyObject* values[3] = {0,0,0};
2674 if (unlikely(__pyx_kwds)) {
2675 Py_ssize_t kw_args;
2676 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2677 switch (pos_args) {
2678 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2679 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2680 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2681 case 0: break;
2682 default: goto __pyx_L5_argtuple_error;
2683 }
2684 kw_args = PyDict_Size(__pyx_kwds);
2685 switch (pos_args) {
2686 case 0:
2687 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
2688 else goto __pyx_L5_argtuple_error;
2689 case 1:
2690 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_atoms)) != 0)) kw_args--;
2691 else {
2692 __Pyx_RaiseArgtupleInvalid("__read_timeseries", 1, 3, 3, 1); __PYX_ERR(0, 156, __pyx_L3_error)
2693 }
2694 case 2:
2695 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_skip)) != 0)) kw_args--;
2696 else {
2697 __Pyx_RaiseArgtupleInvalid("__read_timeseries", 1, 3, 3, 2); __PYX_ERR(0, 156, __pyx_L3_error)
2698 }
2699 }
2700 if (unlikely(kw_args > 0)) {
2701 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__read_timeseries") < 0)) __PYX_ERR(0, 156, __pyx_L3_error)
2702 }
2703 } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
2704 goto __pyx_L5_argtuple_error;
2705 } else {
2706 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2707 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2708 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2709 }
2710 __pyx_v_self = values[0];
2711 __pyx_v_atoms = values[1];
2712 __pyx_v_skip = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_skip == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 156, __pyx_L3_error)
2713 }
2714 goto __pyx_L4_argument_unpacking_done;
2715 __pyx_L5_argtuple_error:;
2716 __Pyx_RaiseArgtupleInvalid("__read_timeseries", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 156, __pyx_L3_error)
2717 __pyx_L3_error:;
2718 __Pyx_AddTraceback("MDAnalysis.coordinates.dcdtimeseries.__read_timeseries", __pyx_clineno, __pyx_lineno, __pyx_filename);
2719 __Pyx_RefNannyFinishContext();
2720 return NULL;
2721 __pyx_L4_argument_unpacking_done:;
2722 __pyx_r = __pyx_pf_10MDAnalysis_11coordinates_13dcdtimeseries_2__read_timeseries(__pyx_self, __pyx_v_self, __pyx_v_atoms, __pyx_v_skip);
2723
2724 /* function exit code */
2725 __Pyx_RefNannyFinishContext();
2726 return __pyx_r;
2727 }
2728
__pyx_pf_10MDAnalysis_11coordinates_13dcdtimeseries_2__read_timeseries(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_self,PyObject * __pyx_v_atoms,int __pyx_v_skip)2729 static PyObject *__pyx_pf_10MDAnalysis_11coordinates_13dcdtimeseries_2__read_timeseries(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_atoms, int __pyx_v_skip) {
2730 __pyx_t_10MDAnalysis_11coordinates_13dcdtimeseries_dcdhandle *__pyx_v_dcd;
2731 PyArrayObject *__pyx_v_atomlist = 0;
2732 PyArrayObject *__pyx_v_coord = 0;
2733 PyArrayObject *__pyx_v_temp = 0;
2734 float *__pyx_v_tempX;
2735 float *__pyx_v_tempY;
2736 float *__pyx_v_tempZ;
2737 int __pyx_v_rc;
2738 int __pyx_v_n_frames;
2739 int __pyx_v_n_atoms;
2740 int __pyx_v_lowerb;
2741 int __pyx_v_upperb;
2742 int __pyx_v_range;
2743 int __pyx_v_index;
2744 int __pyx_v_numskip;
2745 int __pyx_v_i;
2746 int __pyx_v_j;
2747 float __pyx_v_unitcell[6];
2748 PyObject *__pyx_r = NULL;
2749 __Pyx_RefNannyDeclarations
2750 PyObject *__pyx_t_1 = NULL;
2751 Py_ssize_t __pyx_t_2;
2752 int __pyx_t_3;
2753 PyObject *__pyx_t_4 = NULL;
2754 PyObject *__pyx_t_5 = NULL;
2755 PyObject *__pyx_t_6 = NULL;
2756 int __pyx_t_7;
2757 PyObject *__pyx_t_8 = NULL;
2758 PyObject *__pyx_t_9 = NULL;
2759 int __pyx_t_10;
2760 __Pyx_RefNannySetupContext("__read_timeseries", 0);
2761
2762 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":163
2763 * cdef int rc
2764 *
2765 * dcd = <dcdhandle*>PyCObject_AsVoidPtr(self._dcd_C_ptr) # <<<<<<<<<<<<<<
2766 * cdef int n_frames
2767 * n_frames = dcd.nsets / skip
2768 */
2769 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dcd_C_ptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error)
2770 __Pyx_GOTREF(__pyx_t_1);
2771 __pyx_v_dcd = ((__pyx_t_10MDAnalysis_11coordinates_13dcdtimeseries_dcdhandle *)PyCObject_AsVoidPtr(__pyx_t_1));
2772 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2773
2774 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":165
2775 * dcd = <dcdhandle*>PyCObject_AsVoidPtr(self._dcd_C_ptr)
2776 * cdef int n_frames
2777 * n_frames = dcd.nsets / skip # <<<<<<<<<<<<<<
2778 * cdef int n_atoms
2779 * n_atoms = len(atoms)
2780 */
2781 if (unlikely(__pyx_v_skip == 0)) {
2782 PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
2783 __PYX_ERR(0, 165, __pyx_L1_error)
2784 }
2785 else if (sizeof(int) == sizeof(long) && (!(((int)-1) > 0)) && unlikely(__pyx_v_skip == (int)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_dcd->nsets))) {
2786 PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
2787 __PYX_ERR(0, 165, __pyx_L1_error)
2788 }
2789 __pyx_v_n_frames = __Pyx_div_int(__pyx_v_dcd->nsets, __pyx_v_skip);
2790
2791 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":167
2792 * n_frames = dcd.nsets / skip
2793 * cdef int n_atoms
2794 * n_atoms = len(atoms) # <<<<<<<<<<<<<<
2795 * if n_atoms==0:
2796 * raise Exception("No atoms passed into __read_timeseries function")
2797 */
2798 __pyx_t_2 = PyObject_Length(__pyx_v_atoms); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 167, __pyx_L1_error)
2799 __pyx_v_n_atoms = __pyx_t_2;
2800
2801 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":168
2802 * cdef int n_atoms
2803 * n_atoms = len(atoms)
2804 * if n_atoms==0: # <<<<<<<<<<<<<<
2805 * raise Exception("No atoms passed into __read_timeseries function")
2806 * atomlist = np.array(atoms)
2807 */
2808 __pyx_t_3 = ((__pyx_v_n_atoms == 0) != 0);
2809 if (__pyx_t_3) {
2810
2811 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":169
2812 * n_atoms = len(atoms)
2813 * if n_atoms==0:
2814 * raise Exception("No atoms passed into __read_timeseries function") # <<<<<<<<<<<<<<
2815 * atomlist = np.array(atoms)
2816 * cdef int lowerb, upperb, range
2817 */
2818 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error)
2819 __Pyx_GOTREF(__pyx_t_1);
2820 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
2821 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2822 __PYX_ERR(0, 169, __pyx_L1_error)
2823
2824 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":168
2825 * cdef int n_atoms
2826 * n_atoms = len(atoms)
2827 * if n_atoms==0: # <<<<<<<<<<<<<<
2828 * raise Exception("No atoms passed into __read_timeseries function")
2829 * atomlist = np.array(atoms)
2830 */
2831 }
2832
2833 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":170
2834 * if n_atoms==0:
2835 * raise Exception("No atoms passed into __read_timeseries function")
2836 * atomlist = np.array(atoms) # <<<<<<<<<<<<<<
2837 * cdef int lowerb, upperb, range
2838 * lowerb = atoms[0]
2839 */
2840 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 170, __pyx_L1_error)
2841 __Pyx_GOTREF(__pyx_t_4);
2842 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 170, __pyx_L1_error)
2843 __Pyx_GOTREF(__pyx_t_5);
2844 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2845 __pyx_t_4 = NULL;
2846 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
2847 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
2848 if (likely(__pyx_t_4)) {
2849 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
2850 __Pyx_INCREF(__pyx_t_4);
2851 __Pyx_INCREF(function);
2852 __Pyx_DECREF_SET(__pyx_t_5, function);
2853 }
2854 }
2855 if (!__pyx_t_4) {
2856 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_atoms); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error)
2857 __Pyx_GOTREF(__pyx_t_1);
2858 } else {
2859 #if CYTHON_FAST_PYCALL
2860 if (PyFunction_Check(__pyx_t_5)) {
2861 PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_atoms};
2862 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error)
2863 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2864 __Pyx_GOTREF(__pyx_t_1);
2865 } else
2866 #endif
2867 #if CYTHON_FAST_PYCCALL
2868 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
2869 PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_atoms};
2870 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error)
2871 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2872 __Pyx_GOTREF(__pyx_t_1);
2873 } else
2874 #endif
2875 {
2876 __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 170, __pyx_L1_error)
2877 __Pyx_GOTREF(__pyx_t_6);
2878 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
2879 __Pyx_INCREF(__pyx_v_atoms);
2880 __Pyx_GIVEREF(__pyx_v_atoms);
2881 PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_atoms);
2882 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error)
2883 __Pyx_GOTREF(__pyx_t_1);
2884 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2885 }
2886 }
2887 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2888 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 170, __pyx_L1_error)
2889 __pyx_v_atomlist = ((PyArrayObject *)__pyx_t_1);
2890 __pyx_t_1 = 0;
2891
2892 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":172
2893 * atomlist = np.array(atoms)
2894 * cdef int lowerb, upperb, range
2895 * lowerb = atoms[0] # <<<<<<<<<<<<<<
2896 * upperb = atoms[-1]
2897 * range = upperb - lowerb + 1
2898 */
2899 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_atoms, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error)
2900 __Pyx_GOTREF(__pyx_t_1);
2901 __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L1_error)
2902 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2903 __pyx_v_lowerb = __pyx_t_7;
2904
2905 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":173
2906 * cdef int lowerb, upperb, range
2907 * lowerb = atoms[0]
2908 * upperb = atoms[-1] # <<<<<<<<<<<<<<
2909 * range = upperb - lowerb + 1
2910 * # Create atom list
2911 */
2912 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_atoms, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error)
2913 __Pyx_GOTREF(__pyx_t_1);
2914 __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 173, __pyx_L1_error)
2915 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2916 __pyx_v_upperb = __pyx_t_7;
2917
2918 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":174
2919 * lowerb = atoms[0]
2920 * upperb = atoms[-1]
2921 * range = upperb - lowerb + 1 # <<<<<<<<<<<<<<
2922 * # Create atom list
2923 * coord = np.zeros((n_atoms, n_frames, 3), np.float64)
2924 */
2925 __pyx_v_range = ((__pyx_v_upperb - __pyx_v_lowerb) + 1);
2926
2927 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":176
2928 * range = upperb - lowerb + 1
2929 * # Create atom list
2930 * coord = np.zeros((n_atoms, n_frames, 3), np.float64) # <<<<<<<<<<<<<<
2931 * temp = np.zeros((3, range), np.float32)
2932 * tempX = <float*>(temp.data+0*temp.strides[0])
2933 */
2934 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 176, __pyx_L1_error)
2935 __Pyx_GOTREF(__pyx_t_5);
2936 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 176, __pyx_L1_error)
2937 __Pyx_GOTREF(__pyx_t_6);
2938 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2939 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_n_atoms); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 176, __pyx_L1_error)
2940 __Pyx_GOTREF(__pyx_t_5);
2941 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_n_frames); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 176, __pyx_L1_error)
2942 __Pyx_GOTREF(__pyx_t_4);
2943 __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 176, __pyx_L1_error)
2944 __Pyx_GOTREF(__pyx_t_8);
2945 __Pyx_GIVEREF(__pyx_t_5);
2946 PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5);
2947 __Pyx_GIVEREF(__pyx_t_4);
2948 PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4);
2949 __Pyx_INCREF(__pyx_int_3);
2950 __Pyx_GIVEREF(__pyx_int_3);
2951 PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_int_3);
2952 __pyx_t_5 = 0;
2953 __pyx_t_4 = 0;
2954 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 176, __pyx_L1_error)
2955 __Pyx_GOTREF(__pyx_t_4);
2956 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 176, __pyx_L1_error)
2957 __Pyx_GOTREF(__pyx_t_5);
2958 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2959 __pyx_t_4 = NULL;
2960 __pyx_t_7 = 0;
2961 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
2962 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
2963 if (likely(__pyx_t_4)) {
2964 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
2965 __Pyx_INCREF(__pyx_t_4);
2966 __Pyx_INCREF(function);
2967 __Pyx_DECREF_SET(__pyx_t_6, function);
2968 __pyx_t_7 = 1;
2969 }
2970 }
2971 #if CYTHON_FAST_PYCALL
2972 if (PyFunction_Check(__pyx_t_6)) {
2973 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_8, __pyx_t_5};
2974 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error)
2975 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2976 __Pyx_GOTREF(__pyx_t_1);
2977 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
2978 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2979 } else
2980 #endif
2981 #if CYTHON_FAST_PYCCALL
2982 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
2983 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_8, __pyx_t_5};
2984 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error)
2985 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2986 __Pyx_GOTREF(__pyx_t_1);
2987 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
2988 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2989 } else
2990 #endif
2991 {
2992 __pyx_t_9 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 176, __pyx_L1_error)
2993 __Pyx_GOTREF(__pyx_t_9);
2994 if (__pyx_t_4) {
2995 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL;
2996 }
2997 __Pyx_GIVEREF(__pyx_t_8);
2998 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_7, __pyx_t_8);
2999 __Pyx_GIVEREF(__pyx_t_5);
3000 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_7, __pyx_t_5);
3001 __pyx_t_8 = 0;
3002 __pyx_t_5 = 0;
3003 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error)
3004 __Pyx_GOTREF(__pyx_t_1);
3005 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3006 }
3007 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3008 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 176, __pyx_L1_error)
3009 __pyx_v_coord = ((PyArrayObject *)__pyx_t_1);
3010 __pyx_t_1 = 0;
3011
3012 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":177
3013 * # Create atom list
3014 * coord = np.zeros((n_atoms, n_frames, 3), np.float64)
3015 * temp = np.zeros((3, range), np.float32) # <<<<<<<<<<<<<<
3016 * tempX = <float*>(temp.data+0*temp.strides[0])
3017 * tempY = <float*>(temp.data+1*temp.strides[0])
3018 */
3019 __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 177, __pyx_L1_error)
3020 __Pyx_GOTREF(__pyx_t_6);
3021 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 177, __pyx_L1_error)
3022 __Pyx_GOTREF(__pyx_t_9);
3023 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3024 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_range); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 177, __pyx_L1_error)
3025 __Pyx_GOTREF(__pyx_t_6);
3026 __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 177, __pyx_L1_error)
3027 __Pyx_GOTREF(__pyx_t_5);
3028 __Pyx_INCREF(__pyx_int_3);
3029 __Pyx_GIVEREF(__pyx_int_3);
3030 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_3);
3031 __Pyx_GIVEREF(__pyx_t_6);
3032 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
3033 __pyx_t_6 = 0;
3034 __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 177, __pyx_L1_error)
3035 __Pyx_GOTREF(__pyx_t_6);
3036 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 177, __pyx_L1_error)
3037 __Pyx_GOTREF(__pyx_t_8);
3038 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3039 __pyx_t_6 = NULL;
3040 __pyx_t_7 = 0;
3041 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
3042 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
3043 if (likely(__pyx_t_6)) {
3044 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
3045 __Pyx_INCREF(__pyx_t_6);
3046 __Pyx_INCREF(function);
3047 __Pyx_DECREF_SET(__pyx_t_9, function);
3048 __pyx_t_7 = 1;
3049 }
3050 }
3051 #if CYTHON_FAST_PYCALL
3052 if (PyFunction_Check(__pyx_t_9)) {
3053 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_t_8};
3054 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error)
3055 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
3056 __Pyx_GOTREF(__pyx_t_1);
3057 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3058 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3059 } else
3060 #endif
3061 #if CYTHON_FAST_PYCCALL
3062 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
3063 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_t_8};
3064 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error)
3065 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
3066 __Pyx_GOTREF(__pyx_t_1);
3067 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3068 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3069 } else
3070 #endif
3071 {
3072 __pyx_t_4 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 177, __pyx_L1_error)
3073 __Pyx_GOTREF(__pyx_t_4);
3074 if (__pyx_t_6) {
3075 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
3076 }
3077 __Pyx_GIVEREF(__pyx_t_5);
3078 PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_7, __pyx_t_5);
3079 __Pyx_GIVEREF(__pyx_t_8);
3080 PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_7, __pyx_t_8);
3081 __pyx_t_5 = 0;
3082 __pyx_t_8 = 0;
3083 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error)
3084 __Pyx_GOTREF(__pyx_t_1);
3085 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3086 }
3087 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3088 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 177, __pyx_L1_error)
3089 __pyx_v_temp = ((PyArrayObject *)__pyx_t_1);
3090 __pyx_t_1 = 0;
3091
3092 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":178
3093 * coord = np.zeros((n_atoms, n_frames, 3), np.float64)
3094 * temp = np.zeros((3, range), np.float32)
3095 * tempX = <float*>(temp.data+0*temp.strides[0]) # <<<<<<<<<<<<<<
3096 * tempY = <float*>(temp.data+1*temp.strides[0])
3097 * tempZ = <float*>(temp.data+2*temp.strides[0])
3098 */
3099 __pyx_v_tempX = ((float *)(__pyx_v_temp->data + (0 * (__pyx_v_temp->strides[0]))));
3100
3101 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":179
3102 * temp = np.zeros((3, range), np.float32)
3103 * tempX = <float*>(temp.data+0*temp.strides[0])
3104 * tempY = <float*>(temp.data+1*temp.strides[0]) # <<<<<<<<<<<<<<
3105 * tempZ = <float*>(temp.data+2*temp.strides[0])
3106 * # Jump to the beginning of the trajectory file
3107 */
3108 __pyx_v_tempY = ((float *)(__pyx_v_temp->data + (1 * (__pyx_v_temp->strides[0]))));
3109
3110 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":180
3111 * tempX = <float*>(temp.data+0*temp.strides[0])
3112 * tempY = <float*>(temp.data+1*temp.strides[0])
3113 * tempZ = <float*>(temp.data+2*temp.strides[0]) # <<<<<<<<<<<<<<
3114 * # Jump to the beginning of the trajectory file
3115 * rc = fio_fseek(dcd.fd, dcd.header_size, 0) #FIO_SEEK_SET
3116 */
3117 __pyx_v_tempZ = ((float *)(__pyx_v_temp->data + (2 * (__pyx_v_temp->strides[0]))));
3118
3119 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":182
3120 * tempZ = <float*>(temp.data+2*temp.strides[0])
3121 * # Jump to the beginning of the trajectory file
3122 * rc = fio_fseek(dcd.fd, dcd.header_size, 0) #FIO_SEEK_SET # <<<<<<<<<<<<<<
3123 * dcd.setsread = 0
3124 * dcd.first = 1
3125 */
3126 __pyx_v_rc = fio_fseek(__pyx_v_dcd->fd, __pyx_v_dcd->header_size, 0);
3127
3128 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":183
3129 * # Jump to the beginning of the trajectory file
3130 * rc = fio_fseek(dcd.fd, dcd.header_size, 0) #FIO_SEEK_SET
3131 * dcd.setsread = 0 # <<<<<<<<<<<<<<
3132 * dcd.first = 1
3133 *
3134 */
3135 __pyx_v_dcd->setsread = 0;
3136
3137 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":184
3138 * rc = fio_fseek(dcd.fd, dcd.header_size, 0) #FIO_SEEK_SET
3139 * dcd.setsread = 0
3140 * dcd.first = 1 # <<<<<<<<<<<<<<
3141 *
3142 * cdef int index, numskip
3143 */
3144 __pyx_v_dcd->first = 1;
3145
3146 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":189
3147 * cdef int i, j
3148 * cdef float unitcell[6]
3149 * for i from 0 <= i < n_frames: # <<<<<<<<<<<<<<
3150 * if (skip > 1):
3151 * # Check if we have fixed atoms
3152 */
3153 __pyx_t_7 = __pyx_v_n_frames;
3154 for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {
3155
3156 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":190
3157 * cdef float unitcell[6]
3158 * for i from 0 <= i < n_frames:
3159 * if (skip > 1): # <<<<<<<<<<<<<<
3160 * # Check if we have fixed atoms
3161 * # XXX not done
3162 */
3163 __pyx_t_3 = ((__pyx_v_skip > 1) != 0);
3164 if (__pyx_t_3) {
3165
3166 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":193
3167 * # Check if we have fixed atoms
3168 * # XXX not done
3169 * numskip = skip - (dcd.setsread % skip) - 1 # <<<<<<<<<<<<<<
3170 * rc = skip_dcdstep(dcd.fd, dcd.natoms, dcd.nfixed, dcd.charmm, numskip)
3171 * if (rc < 0):
3172 */
3173 if (unlikely(__pyx_v_skip == 0)) {
3174 PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
3175 __PYX_ERR(0, 193, __pyx_L1_error)
3176 }
3177 __pyx_v_numskip = ((__pyx_v_skip - __Pyx_mod_int(__pyx_v_dcd->setsread, __pyx_v_skip)) - 1);
3178
3179 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":194
3180 * # XXX not done
3181 * numskip = skip - (dcd.setsread % skip) - 1
3182 * rc = skip_dcdstep(dcd.fd, dcd.natoms, dcd.nfixed, dcd.charmm, numskip) # <<<<<<<<<<<<<<
3183 * if (rc < 0):
3184 * raise IOError("Error skipping frame from DCD file")
3185 */
3186 __pyx_v_rc = skip_dcdstep(__pyx_v_dcd->fd, __pyx_v_dcd->natoms, __pyx_v_dcd->nfixed, __pyx_v_dcd->charmm, __pyx_v_numskip);
3187
3188 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":195
3189 * numskip = skip - (dcd.setsread % skip) - 1
3190 * rc = skip_dcdstep(dcd.fd, dcd.natoms, dcd.nfixed, dcd.charmm, numskip)
3191 * if (rc < 0): # <<<<<<<<<<<<<<
3192 * raise IOError("Error skipping frame from DCD file")
3193 * dcd.setsread = dcd.setsread + numskip
3194 */
3195 __pyx_t_3 = ((__pyx_v_rc < 0) != 0);
3196 if (__pyx_t_3) {
3197
3198 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":196
3199 * rc = skip_dcdstep(dcd.fd, dcd.natoms, dcd.nfixed, dcd.charmm, numskip)
3200 * if (rc < 0):
3201 * raise IOError("Error skipping frame from DCD file") # <<<<<<<<<<<<<<
3202 * dcd.setsread = dcd.setsread + numskip
3203 * rc = read_dcdsubset(dcd.fd, dcd.natoms, lowerb, upperb, tempX, tempY, tempZ, unitcell, dcd.nfixed, dcd.first, dcd.freeind, dcd.fixedcoords, dcd.reverse, dcd.charmm)
3204 */
3205 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error)
3206 __Pyx_GOTREF(__pyx_t_1);
3207 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3208 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3209 __PYX_ERR(0, 196, __pyx_L1_error)
3210
3211 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":195
3212 * numskip = skip - (dcd.setsread % skip) - 1
3213 * rc = skip_dcdstep(dcd.fd, dcd.natoms, dcd.nfixed, dcd.charmm, numskip)
3214 * if (rc < 0): # <<<<<<<<<<<<<<
3215 * raise IOError("Error skipping frame from DCD file")
3216 * dcd.setsread = dcd.setsread + numskip
3217 */
3218 }
3219
3220 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":197
3221 * if (rc < 0):
3222 * raise IOError("Error skipping frame from DCD file")
3223 * dcd.setsread = dcd.setsread + numskip # <<<<<<<<<<<<<<
3224 * rc = read_dcdsubset(dcd.fd, dcd.natoms, lowerb, upperb, tempX, tempY, tempZ, unitcell, dcd.nfixed, dcd.first, dcd.freeind, dcd.fixedcoords, dcd.reverse, dcd.charmm)
3225 * dcd.first=0
3226 */
3227 __pyx_v_dcd->setsread = (__pyx_v_dcd->setsread + __pyx_v_numskip);
3228
3229 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":190
3230 * cdef float unitcell[6]
3231 * for i from 0 <= i < n_frames:
3232 * if (skip > 1): # <<<<<<<<<<<<<<
3233 * # Check if we have fixed atoms
3234 * # XXX not done
3235 */
3236 }
3237
3238 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":198
3239 * raise IOError("Error skipping frame from DCD file")
3240 * dcd.setsread = dcd.setsread + numskip
3241 * rc = read_dcdsubset(dcd.fd, dcd.natoms, lowerb, upperb, tempX, tempY, tempZ, unitcell, dcd.nfixed, dcd.first, dcd.freeind, dcd.fixedcoords, dcd.reverse, dcd.charmm) # <<<<<<<<<<<<<<
3242 * dcd.first=0
3243 * dcd.setsread = dcd.setsread + 1
3244 */
3245 __pyx_v_rc = read_dcdsubset(__pyx_v_dcd->fd, __pyx_v_dcd->natoms, __pyx_v_lowerb, __pyx_v_upperb, __pyx_v_tempX, __pyx_v_tempY, __pyx_v_tempZ, __pyx_v_unitcell, __pyx_v_dcd->nfixed, __pyx_v_dcd->first, __pyx_v_dcd->freeind, __pyx_v_dcd->fixedcoords, __pyx_v_dcd->reverse, __pyx_v_dcd->charmm);
3246
3247 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":199
3248 * dcd.setsread = dcd.setsread + numskip
3249 * rc = read_dcdsubset(dcd.fd, dcd.natoms, lowerb, upperb, tempX, tempY, tempZ, unitcell, dcd.nfixed, dcd.first, dcd.freeind, dcd.fixedcoords, dcd.reverse, dcd.charmm)
3250 * dcd.first=0 # <<<<<<<<<<<<<<
3251 * dcd.setsread = dcd.setsread + 1
3252 * if (rc < 0):
3253 */
3254 __pyx_v_dcd->first = 0;
3255
3256 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":200
3257 * rc = read_dcdsubset(dcd.fd, dcd.natoms, lowerb, upperb, tempX, tempY, tempZ, unitcell, dcd.nfixed, dcd.first, dcd.freeind, dcd.fixedcoords, dcd.reverse, dcd.charmm)
3258 * dcd.first=0
3259 * dcd.setsread = dcd.setsread + 1 # <<<<<<<<<<<<<<
3260 * if (rc < 0):
3261 * raise IOError("Error reading frame from DCD file")
3262 */
3263 __pyx_v_dcd->setsread = (__pyx_v_dcd->setsread + 1);
3264
3265 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":201
3266 * dcd.first=0
3267 * dcd.setsread = dcd.setsread + 1
3268 * if (rc < 0): # <<<<<<<<<<<<<<
3269 * raise IOError("Error reading frame from DCD file")
3270 * # Copy into numeric array
3271 */
3272 __pyx_t_3 = ((__pyx_v_rc < 0) != 0);
3273 if (__pyx_t_3) {
3274
3275 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":202
3276 * dcd.setsread = dcd.setsread + 1
3277 * if (rc < 0):
3278 * raise IOError("Error reading frame from DCD file") # <<<<<<<<<<<<<<
3279 * # Copy into numeric array
3280 * for j from 0 <= j < n_atoms:
3281 */
3282 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error)
3283 __Pyx_GOTREF(__pyx_t_1);
3284 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3285 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3286 __PYX_ERR(0, 202, __pyx_L1_error)
3287
3288 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":201
3289 * dcd.first=0
3290 * dcd.setsread = dcd.setsread + 1
3291 * if (rc < 0): # <<<<<<<<<<<<<<
3292 * raise IOError("Error reading frame from DCD file")
3293 * # Copy into numeric array
3294 */
3295 }
3296
3297 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":204
3298 * raise IOError("Error reading frame from DCD file")
3299 * # Copy into numeric array
3300 * for j from 0 <= j < n_atoms: # <<<<<<<<<<<<<<
3301 * index = (<int*>atomlist.data)[j]-lowerb
3302 * (<double*> (coord.data+j*coord.strides[0]+i*coord.strides[1]+0*coord.strides[2]))[0] = tempX[index]
3303 */
3304 __pyx_t_10 = __pyx_v_n_atoms;
3305 for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_10; __pyx_v_j++) {
3306
3307 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":205
3308 * # Copy into numeric array
3309 * for j from 0 <= j < n_atoms:
3310 * index = (<int*>atomlist.data)[j]-lowerb # <<<<<<<<<<<<<<
3311 * (<double*> (coord.data+j*coord.strides[0]+i*coord.strides[1]+0*coord.strides[2]))[0] = tempX[index]
3312 * (<double*> (coord.data+j*coord.strides[0]+i*coord.strides[1]+1*coord.strides[2]))[0] = tempY[index]
3313 */
3314 __pyx_v_index = ((((int *)__pyx_v_atomlist->data)[__pyx_v_j]) - __pyx_v_lowerb);
3315
3316 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":206
3317 * for j from 0 <= j < n_atoms:
3318 * index = (<int*>atomlist.data)[j]-lowerb
3319 * (<double*> (coord.data+j*coord.strides[0]+i*coord.strides[1]+0*coord.strides[2]))[0] = tempX[index] # <<<<<<<<<<<<<<
3320 * (<double*> (coord.data+j*coord.strides[0]+i*coord.strides[1]+1*coord.strides[2]))[0] = tempY[index]
3321 * (<double*> (coord.data+j*coord.strides[0]+i*coord.strides[1]+2*coord.strides[2]))[0] = tempZ[index]
3322 */
3323 (((double *)(((__pyx_v_coord->data + (__pyx_v_j * (__pyx_v_coord->strides[0]))) + (__pyx_v_i * (__pyx_v_coord->strides[1]))) + (0 * (__pyx_v_coord->strides[2]))))[0]) = (__pyx_v_tempX[__pyx_v_index]);
3324
3325 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":207
3326 * index = (<int*>atomlist.data)[j]-lowerb
3327 * (<double*> (coord.data+j*coord.strides[0]+i*coord.strides[1]+0*coord.strides[2]))[0] = tempX[index]
3328 * (<double*> (coord.data+j*coord.strides[0]+i*coord.strides[1]+1*coord.strides[2]))[0] = tempY[index] # <<<<<<<<<<<<<<
3329 * (<double*> (coord.data+j*coord.strides[0]+i*coord.strides[1]+2*coord.strides[2]))[0] = tempZ[index]
3330 * return coord
3331 */
3332 (((double *)(((__pyx_v_coord->data + (__pyx_v_j * (__pyx_v_coord->strides[0]))) + (__pyx_v_i * (__pyx_v_coord->strides[1]))) + (1 * (__pyx_v_coord->strides[2]))))[0]) = (__pyx_v_tempY[__pyx_v_index]);
3333
3334 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":208
3335 * (<double*> (coord.data+j*coord.strides[0]+i*coord.strides[1]+0*coord.strides[2]))[0] = tempX[index]
3336 * (<double*> (coord.data+j*coord.strides[0]+i*coord.strides[1]+1*coord.strides[2]))[0] = tempY[index]
3337 * (<double*> (coord.data+j*coord.strides[0]+i*coord.strides[1]+2*coord.strides[2]))[0] = tempZ[index] # <<<<<<<<<<<<<<
3338 * return coord
3339 */
3340 (((double *)(((__pyx_v_coord->data + (__pyx_v_j * (__pyx_v_coord->strides[0]))) + (__pyx_v_i * (__pyx_v_coord->strides[1]))) + (2 * (__pyx_v_coord->strides[2]))))[0]) = (__pyx_v_tempZ[__pyx_v_index]);
3341 }
3342 }
3343
3344 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":209
3345 * (<double*> (coord.data+j*coord.strides[0]+i*coord.strides[1]+1*coord.strides[2]))[0] = tempY[index]
3346 * (<double*> (coord.data+j*coord.strides[0]+i*coord.strides[1]+2*coord.strides[2]))[0] = tempZ[index]
3347 * return coord # <<<<<<<<<<<<<<
3348 */
3349 __Pyx_XDECREF(__pyx_r);
3350 __Pyx_INCREF(((PyObject *)__pyx_v_coord));
3351 __pyx_r = ((PyObject *)__pyx_v_coord);
3352 goto __pyx_L0;
3353
3354 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":156
3355 * return data
3356 *
3357 * def __read_timeseries(object self, object atoms, int skip): # <<<<<<<<<<<<<<
3358 * cdef dcdhandle* dcd
3359 * cdef numpy.ndarray atomlist
3360 */
3361
3362 /* function exit code */
3363 __pyx_L1_error:;
3364 __Pyx_XDECREF(__pyx_t_1);
3365 __Pyx_XDECREF(__pyx_t_4);
3366 __Pyx_XDECREF(__pyx_t_5);
3367 __Pyx_XDECREF(__pyx_t_6);
3368 __Pyx_XDECREF(__pyx_t_8);
3369 __Pyx_XDECREF(__pyx_t_9);
3370 __Pyx_AddTraceback("MDAnalysis.coordinates.dcdtimeseries.__read_timeseries", __pyx_clineno, __pyx_lineno, __pyx_filename);
3371 __pyx_r = NULL;
3372 __pyx_L0:;
3373 __Pyx_XDECREF((PyObject *)__pyx_v_atomlist);
3374 __Pyx_XDECREF((PyObject *)__pyx_v_coord);
3375 __Pyx_XDECREF((PyObject *)__pyx_v_temp);
3376 __Pyx_XGIVEREF(__pyx_r);
3377 __Pyx_RefNannyFinishContext();
3378 return __pyx_r;
3379 }
3380
3381 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":197
3382 * # experimental exception made for __getbuffer__ and __releasebuffer__
3383 * # -- the details of this may change.
3384 * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
3385 * # This implementation of getbuffer is geared towards Cython
3386 * # requirements, and does not yet fullfill the PEP.
3387 */
3388
3389 /* Python wrapper */
3390 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
__pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)3391 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
3392 int __pyx_r;
3393 __Pyx_RefNannyDeclarations
3394 __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
3395 __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
3396
3397 /* function exit code */
3398 __Pyx_RefNannyFinishContext();
3399 return __pyx_r;
3400 }
3401
__pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)3402 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
3403 int __pyx_v_copy_shape;
3404 int __pyx_v_i;
3405 int __pyx_v_ndim;
3406 int __pyx_v_endian_detector;
3407 int __pyx_v_little_endian;
3408 int __pyx_v_t;
3409 char *__pyx_v_f;
3410 PyArray_Descr *__pyx_v_descr = 0;
3411 int __pyx_v_offset;
3412 int __pyx_v_hasfields;
3413 int __pyx_r;
3414 __Pyx_RefNannyDeclarations
3415 int __pyx_t_1;
3416 int __pyx_t_2;
3417 PyObject *__pyx_t_3 = NULL;
3418 int __pyx_t_4;
3419 int __pyx_t_5;
3420 PyObject *__pyx_t_6 = NULL;
3421 char *__pyx_t_7;
3422 __Pyx_RefNannySetupContext("__getbuffer__", 0);
3423 if (__pyx_v_info != NULL) {
3424 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
3425 __Pyx_GIVEREF(__pyx_v_info->obj);
3426 }
3427
3428 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":203
3429 * # of flags
3430 *
3431 * if info == NULL: return # <<<<<<<<<<<<<<
3432 *
3433 * cdef int copy_shape, i, ndim
3434 */
3435 __pyx_t_1 = ((__pyx_v_info == NULL) != 0);
3436 if (__pyx_t_1) {
3437 __pyx_r = 0;
3438 goto __pyx_L0;
3439 }
3440
3441 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":206
3442 *
3443 * cdef int copy_shape, i, ndim
3444 * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
3445 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
3446 *
3447 */
3448 __pyx_v_endian_detector = 1;
3449
3450 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":207
3451 * cdef int copy_shape, i, ndim
3452 * cdef int endian_detector = 1
3453 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
3454 *
3455 * ndim = PyArray_NDIM(self)
3456 */
3457 __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
3458
3459 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":209
3460 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
3461 *
3462 * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
3463 *
3464 * if sizeof(npy_intp) != sizeof(Py_ssize_t):
3465 */
3466 __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
3467
3468 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":211
3469 * ndim = PyArray_NDIM(self)
3470 *
3471 * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
3472 * copy_shape = 1
3473 * else:
3474 */
3475 __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
3476 if (__pyx_t_1) {
3477
3478 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":212
3479 *
3480 * if sizeof(npy_intp) != sizeof(Py_ssize_t):
3481 * copy_shape = 1 # <<<<<<<<<<<<<<
3482 * else:
3483 * copy_shape = 0
3484 */
3485 __pyx_v_copy_shape = 1;
3486
3487 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":211
3488 * ndim = PyArray_NDIM(self)
3489 *
3490 * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
3491 * copy_shape = 1
3492 * else:
3493 */
3494 goto __pyx_L4;
3495 }
3496
3497 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":214
3498 * copy_shape = 1
3499 * else:
3500 * copy_shape = 0 # <<<<<<<<<<<<<<
3501 *
3502 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
3503 */
3504 /*else*/ {
3505 __pyx_v_copy_shape = 0;
3506 }
3507 __pyx_L4:;
3508
3509 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":216
3510 * copy_shape = 0
3511 *
3512 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
3513 * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
3514 * raise ValueError(u"ndarray is not C contiguous")
3515 */
3516 __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
3517 if (__pyx_t_2) {
3518 } else {
3519 __pyx_t_1 = __pyx_t_2;
3520 goto __pyx_L6_bool_binop_done;
3521 }
3522
3523 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":217
3524 *
3525 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
3526 * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
3527 * raise ValueError(u"ndarray is not C contiguous")
3528 *
3529 */
3530 __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
3531 __pyx_t_1 = __pyx_t_2;
3532 __pyx_L6_bool_binop_done:;
3533
3534 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":216
3535 * copy_shape = 0
3536 *
3537 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
3538 * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
3539 * raise ValueError(u"ndarray is not C contiguous")
3540 */
3541 if (__pyx_t_1) {
3542
3543 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218
3544 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
3545 * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
3546 * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
3547 *
3548 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
3549 */
3550 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __pyx_L1_error)
3551 __Pyx_GOTREF(__pyx_t_3);
3552 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
3553 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3554 __PYX_ERR(1, 218, __pyx_L1_error)
3555
3556 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":216
3557 * copy_shape = 0
3558 *
3559 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
3560 * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
3561 * raise ValueError(u"ndarray is not C contiguous")
3562 */
3563 }
3564
3565 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":220
3566 * raise ValueError(u"ndarray is not C contiguous")
3567 *
3568 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
3569 * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
3570 * raise ValueError(u"ndarray is not Fortran contiguous")
3571 */
3572 __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
3573 if (__pyx_t_2) {
3574 } else {
3575 __pyx_t_1 = __pyx_t_2;
3576 goto __pyx_L9_bool_binop_done;
3577 }
3578
3579 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":221
3580 *
3581 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
3582 * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
3583 * raise ValueError(u"ndarray is not Fortran contiguous")
3584 *
3585 */
3586 __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
3587 __pyx_t_1 = __pyx_t_2;
3588 __pyx_L9_bool_binop_done:;
3589
3590 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":220
3591 * raise ValueError(u"ndarray is not C contiguous")
3592 *
3593 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
3594 * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
3595 * raise ValueError(u"ndarray is not Fortran contiguous")
3596 */
3597 if (__pyx_t_1) {
3598
3599 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222
3600 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
3601 * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
3602 * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
3603 *
3604 * info.buf = PyArray_DATA(self)
3605 */
3606 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error)
3607 __Pyx_GOTREF(__pyx_t_3);
3608 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
3609 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3610 __PYX_ERR(1, 222, __pyx_L1_error)
3611
3612 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":220
3613 * raise ValueError(u"ndarray is not C contiguous")
3614 *
3615 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
3616 * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
3617 * raise ValueError(u"ndarray is not Fortran contiguous")
3618 */
3619 }
3620
3621 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":224
3622 * raise ValueError(u"ndarray is not Fortran contiguous")
3623 *
3624 * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
3625 * info.ndim = ndim
3626 * if copy_shape:
3627 */
3628 __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
3629
3630 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":225
3631 *
3632 * info.buf = PyArray_DATA(self)
3633 * info.ndim = ndim # <<<<<<<<<<<<<<
3634 * if copy_shape:
3635 * # Allocate new buffer for strides and shape info.
3636 */
3637 __pyx_v_info->ndim = __pyx_v_ndim;
3638
3639 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":226
3640 * info.buf = PyArray_DATA(self)
3641 * info.ndim = ndim
3642 * if copy_shape: # <<<<<<<<<<<<<<
3643 * # Allocate new buffer for strides and shape info.
3644 * # This is allocated as one block, strides first.
3645 */
3646 __pyx_t_1 = (__pyx_v_copy_shape != 0);
3647 if (__pyx_t_1) {
3648
3649 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":229
3650 * # Allocate new buffer for strides and shape info.
3651 * # This is allocated as one block, strides first.
3652 * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2) # <<<<<<<<<<<<<<
3653 * info.shape = info.strides + ndim
3654 * for i in range(ndim):
3655 */
3656 __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));
3657
3658 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":230
3659 * # This is allocated as one block, strides first.
3660 * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
3661 * info.shape = info.strides + ndim # <<<<<<<<<<<<<<
3662 * for i in range(ndim):
3663 * info.strides[i] = PyArray_STRIDES(self)[i]
3664 */
3665 __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
3666
3667 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":231
3668 * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
3669 * info.shape = info.strides + ndim
3670 * for i in range(ndim): # <<<<<<<<<<<<<<
3671 * info.strides[i] = PyArray_STRIDES(self)[i]
3672 * info.shape[i] = PyArray_DIMS(self)[i]
3673 */
3674 __pyx_t_4 = __pyx_v_ndim;
3675 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
3676 __pyx_v_i = __pyx_t_5;
3677
3678 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":232
3679 * info.shape = info.strides + ndim
3680 * for i in range(ndim):
3681 * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
3682 * info.shape[i] = PyArray_DIMS(self)[i]
3683 * else:
3684 */
3685 (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
3686
3687 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":233
3688 * for i in range(ndim):
3689 * info.strides[i] = PyArray_STRIDES(self)[i]
3690 * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
3691 * else:
3692 * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
3693 */
3694 (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
3695 }
3696
3697 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":226
3698 * info.buf = PyArray_DATA(self)
3699 * info.ndim = ndim
3700 * if copy_shape: # <<<<<<<<<<<<<<
3701 * # Allocate new buffer for strides and shape info.
3702 * # This is allocated as one block, strides first.
3703 */
3704 goto __pyx_L11;
3705 }
3706
3707 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":235
3708 * info.shape[i] = PyArray_DIMS(self)[i]
3709 * else:
3710 * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<<
3711 * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
3712 * info.suboffsets = NULL
3713 */
3714 /*else*/ {
3715 __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
3716
3717 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":236
3718 * else:
3719 * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
3720 * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
3721 * info.suboffsets = NULL
3722 * info.itemsize = PyArray_ITEMSIZE(self)
3723 */
3724 __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
3725 }
3726 __pyx_L11:;
3727
3728 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":237
3729 * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
3730 * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
3731 * info.suboffsets = NULL # <<<<<<<<<<<<<<
3732 * info.itemsize = PyArray_ITEMSIZE(self)
3733 * info.readonly = not PyArray_ISWRITEABLE(self)
3734 */
3735 __pyx_v_info->suboffsets = NULL;
3736
3737 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":238
3738 * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
3739 * info.suboffsets = NULL
3740 * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
3741 * info.readonly = not PyArray_ISWRITEABLE(self)
3742 *
3743 */
3744 __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
3745
3746 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":239
3747 * info.suboffsets = NULL
3748 * info.itemsize = PyArray_ITEMSIZE(self)
3749 * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
3750 *
3751 * cdef int t
3752 */
3753 __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
3754
3755 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":242
3756 *
3757 * cdef int t
3758 * cdef char* f = NULL # <<<<<<<<<<<<<<
3759 * cdef dtype descr = self.descr
3760 * cdef int offset
3761 */
3762 __pyx_v_f = NULL;
3763
3764 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":243
3765 * cdef int t
3766 * cdef char* f = NULL
3767 * cdef dtype descr = self.descr # <<<<<<<<<<<<<<
3768 * cdef int offset
3769 *
3770 */
3771 __pyx_t_3 = ((PyObject *)__pyx_v_self->descr);
3772 __Pyx_INCREF(__pyx_t_3);
3773 __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
3774 __pyx_t_3 = 0;
3775
3776 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":246
3777 * cdef int offset
3778 *
3779 * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<<
3780 *
3781 * if not hasfields and not copy_shape:
3782 */
3783 __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);
3784
3785 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":248
3786 * cdef bint hasfields = PyDataType_HASFIELDS(descr)
3787 *
3788 * if not hasfields and not copy_shape: # <<<<<<<<<<<<<<
3789 * # do not call releasebuffer
3790 * info.obj = None
3791 */
3792 __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0);
3793 if (__pyx_t_2) {
3794 } else {
3795 __pyx_t_1 = __pyx_t_2;
3796 goto __pyx_L15_bool_binop_done;
3797 }
3798 __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0);
3799 __pyx_t_1 = __pyx_t_2;
3800 __pyx_L15_bool_binop_done:;
3801 if (__pyx_t_1) {
3802
3803 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":250
3804 * if not hasfields and not copy_shape:
3805 * # do not call releasebuffer
3806 * info.obj = None # <<<<<<<<<<<<<<
3807 * else:
3808 * # need to call releasebuffer
3809 */
3810 __Pyx_INCREF(Py_None);
3811 __Pyx_GIVEREF(Py_None);
3812 __Pyx_GOTREF(__pyx_v_info->obj);
3813 __Pyx_DECREF(__pyx_v_info->obj);
3814 __pyx_v_info->obj = Py_None;
3815
3816 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":248
3817 * cdef bint hasfields = PyDataType_HASFIELDS(descr)
3818 *
3819 * if not hasfields and not copy_shape: # <<<<<<<<<<<<<<
3820 * # do not call releasebuffer
3821 * info.obj = None
3822 */
3823 goto __pyx_L14;
3824 }
3825
3826 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":253
3827 * else:
3828 * # need to call releasebuffer
3829 * info.obj = self # <<<<<<<<<<<<<<
3830 *
3831 * if not hasfields:
3832 */
3833 /*else*/ {
3834 __Pyx_INCREF(((PyObject *)__pyx_v_self));
3835 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
3836 __Pyx_GOTREF(__pyx_v_info->obj);
3837 __Pyx_DECREF(__pyx_v_info->obj);
3838 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
3839 }
3840 __pyx_L14:;
3841
3842 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":255
3843 * info.obj = self
3844 *
3845 * if not hasfields: # <<<<<<<<<<<<<<
3846 * t = descr.type_num
3847 * if ((descr.byteorder == c'>' and little_endian) or
3848 */
3849 __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0);
3850 if (__pyx_t_1) {
3851
3852 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":256
3853 *
3854 * if not hasfields:
3855 * t = descr.type_num # <<<<<<<<<<<<<<
3856 * if ((descr.byteorder == c'>' and little_endian) or
3857 * (descr.byteorder == c'<' and not little_endian)):
3858 */
3859 __pyx_t_4 = __pyx_v_descr->type_num;
3860 __pyx_v_t = __pyx_t_4;
3861
3862 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257
3863 * if not hasfields:
3864 * t = descr.type_num
3865 * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
3866 * (descr.byteorder == c'<' and not little_endian)):
3867 * raise ValueError(u"Non-native byte order not supported")
3868 */
3869 __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
3870 if (!__pyx_t_2) {
3871 goto __pyx_L20_next_or;
3872 } else {
3873 }
3874 __pyx_t_2 = (__pyx_v_little_endian != 0);
3875 if (!__pyx_t_2) {
3876 } else {
3877 __pyx_t_1 = __pyx_t_2;
3878 goto __pyx_L19_bool_binop_done;
3879 }
3880 __pyx_L20_next_or:;
3881
3882 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":258
3883 * t = descr.type_num
3884 * if ((descr.byteorder == c'>' and little_endian) or
3885 * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
3886 * raise ValueError(u"Non-native byte order not supported")
3887 * if t == NPY_BYTE: f = "b"
3888 */
3889 __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
3890 if (__pyx_t_2) {
3891 } else {
3892 __pyx_t_1 = __pyx_t_2;
3893 goto __pyx_L19_bool_binop_done;
3894 }
3895 __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
3896 __pyx_t_1 = __pyx_t_2;
3897 __pyx_L19_bool_binop_done:;
3898
3899 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257
3900 * if not hasfields:
3901 * t = descr.type_num
3902 * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
3903 * (descr.byteorder == c'<' and not little_endian)):
3904 * raise ValueError(u"Non-native byte order not supported")
3905 */
3906 if (__pyx_t_1) {
3907
3908 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259
3909 * if ((descr.byteorder == c'>' and little_endian) or
3910 * (descr.byteorder == c'<' and not little_endian)):
3911 * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
3912 * if t == NPY_BYTE: f = "b"
3913 * elif t == NPY_UBYTE: f = "B"
3914 */
3915 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error)
3916 __Pyx_GOTREF(__pyx_t_3);
3917 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
3918 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3919 __PYX_ERR(1, 259, __pyx_L1_error)
3920
3921 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257
3922 * if not hasfields:
3923 * t = descr.type_num
3924 * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
3925 * (descr.byteorder == c'<' and not little_endian)):
3926 * raise ValueError(u"Non-native byte order not supported")
3927 */
3928 }
3929
3930 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260
3931 * (descr.byteorder == c'<' and not little_endian)):
3932 * raise ValueError(u"Non-native byte order not supported")
3933 * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<<
3934 * elif t == NPY_UBYTE: f = "B"
3935 * elif t == NPY_SHORT: f = "h"
3936 */
3937 switch (__pyx_v_t) {
3938 case NPY_BYTE:
3939 __pyx_v_f = ((char *)"b");
3940 break;
3941
3942 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261
3943 * raise ValueError(u"Non-native byte order not supported")
3944 * if t == NPY_BYTE: f = "b"
3945 * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
3946 * elif t == NPY_SHORT: f = "h"
3947 * elif t == NPY_USHORT: f = "H"
3948 */
3949 case NPY_UBYTE:
3950 __pyx_v_f = ((char *)"B");
3951 break;
3952
3953 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":262
3954 * if t == NPY_BYTE: f = "b"
3955 * elif t == NPY_UBYTE: f = "B"
3956 * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
3957 * elif t == NPY_USHORT: f = "H"
3958 * elif t == NPY_INT: f = "i"
3959 */
3960 case NPY_SHORT:
3961 __pyx_v_f = ((char *)"h");
3962 break;
3963
3964 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":263
3965 * elif t == NPY_UBYTE: f = "B"
3966 * elif t == NPY_SHORT: f = "h"
3967 * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
3968 * elif t == NPY_INT: f = "i"
3969 * elif t == NPY_UINT: f = "I"
3970 */
3971 case NPY_USHORT:
3972 __pyx_v_f = ((char *)"H");
3973 break;
3974
3975 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":264
3976 * elif t == NPY_SHORT: f = "h"
3977 * elif t == NPY_USHORT: f = "H"
3978 * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
3979 * elif t == NPY_UINT: f = "I"
3980 * elif t == NPY_LONG: f = "l"
3981 */
3982 case NPY_INT:
3983 __pyx_v_f = ((char *)"i");
3984 break;
3985
3986 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":265
3987 * elif t == NPY_USHORT: f = "H"
3988 * elif t == NPY_INT: f = "i"
3989 * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
3990 * elif t == NPY_LONG: f = "l"
3991 * elif t == NPY_ULONG: f = "L"
3992 */
3993 case NPY_UINT:
3994 __pyx_v_f = ((char *)"I");
3995 break;
3996
3997 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":266
3998 * elif t == NPY_INT: f = "i"
3999 * elif t == NPY_UINT: f = "I"
4000 * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
4001 * elif t == NPY_ULONG: f = "L"
4002 * elif t == NPY_LONGLONG: f = "q"
4003 */
4004 case NPY_LONG:
4005 __pyx_v_f = ((char *)"l");
4006 break;
4007
4008 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":267
4009 * elif t == NPY_UINT: f = "I"
4010 * elif t == NPY_LONG: f = "l"
4011 * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
4012 * elif t == NPY_LONGLONG: f = "q"
4013 * elif t == NPY_ULONGLONG: f = "Q"
4014 */
4015 case NPY_ULONG:
4016 __pyx_v_f = ((char *)"L");
4017 break;
4018
4019 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":268
4020 * elif t == NPY_LONG: f = "l"
4021 * elif t == NPY_ULONG: f = "L"
4022 * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
4023 * elif t == NPY_ULONGLONG: f = "Q"
4024 * elif t == NPY_FLOAT: f = "f"
4025 */
4026 case NPY_LONGLONG:
4027 __pyx_v_f = ((char *)"q");
4028 break;
4029
4030 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":269
4031 * elif t == NPY_ULONG: f = "L"
4032 * elif t == NPY_LONGLONG: f = "q"
4033 * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
4034 * elif t == NPY_FLOAT: f = "f"
4035 * elif t == NPY_DOUBLE: f = "d"
4036 */
4037 case NPY_ULONGLONG:
4038 __pyx_v_f = ((char *)"Q");
4039 break;
4040
4041 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
4042 * elif t == NPY_LONGLONG: f = "q"
4043 * elif t == NPY_ULONGLONG: f = "Q"
4044 * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
4045 * elif t == NPY_DOUBLE: f = "d"
4046 * elif t == NPY_LONGDOUBLE: f = "g"
4047 */
4048 case NPY_FLOAT:
4049 __pyx_v_f = ((char *)"f");
4050 break;
4051
4052 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":271
4053 * elif t == NPY_ULONGLONG: f = "Q"
4054 * elif t == NPY_FLOAT: f = "f"
4055 * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
4056 * elif t == NPY_LONGDOUBLE: f = "g"
4057 * elif t == NPY_CFLOAT: f = "Zf"
4058 */
4059 case NPY_DOUBLE:
4060 __pyx_v_f = ((char *)"d");
4061 break;
4062
4063 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":272
4064 * elif t == NPY_FLOAT: f = "f"
4065 * elif t == NPY_DOUBLE: f = "d"
4066 * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
4067 * elif t == NPY_CFLOAT: f = "Zf"
4068 * elif t == NPY_CDOUBLE: f = "Zd"
4069 */
4070 case NPY_LONGDOUBLE:
4071 __pyx_v_f = ((char *)"g");
4072 break;
4073
4074 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":273
4075 * elif t == NPY_DOUBLE: f = "d"
4076 * elif t == NPY_LONGDOUBLE: f = "g"
4077 * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
4078 * elif t == NPY_CDOUBLE: f = "Zd"
4079 * elif t == NPY_CLONGDOUBLE: f = "Zg"
4080 */
4081 case NPY_CFLOAT:
4082 __pyx_v_f = ((char *)"Zf");
4083 break;
4084
4085 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
4086 * elif t == NPY_LONGDOUBLE: f = "g"
4087 * elif t == NPY_CFLOAT: f = "Zf"
4088 * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
4089 * elif t == NPY_CLONGDOUBLE: f = "Zg"
4090 * elif t == NPY_OBJECT: f = "O"
4091 */
4092 case NPY_CDOUBLE:
4093 __pyx_v_f = ((char *)"Zd");
4094 break;
4095
4096 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":275
4097 * elif t == NPY_CFLOAT: f = "Zf"
4098 * elif t == NPY_CDOUBLE: f = "Zd"
4099 * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
4100 * elif t == NPY_OBJECT: f = "O"
4101 * else:
4102 */
4103 case NPY_CLONGDOUBLE:
4104 __pyx_v_f = ((char *)"Zg");
4105 break;
4106
4107 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":276
4108 * elif t == NPY_CDOUBLE: f = "Zd"
4109 * elif t == NPY_CLONGDOUBLE: f = "Zg"
4110 * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
4111 * else:
4112 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
4113 */
4114 case NPY_OBJECT:
4115 __pyx_v_f = ((char *)"O");
4116 break;
4117 default:
4118
4119 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":278
4120 * elif t == NPY_OBJECT: f = "O"
4121 * else:
4122 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
4123 * info.format = f
4124 * return
4125 */
4126 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error)
4127 __Pyx_GOTREF(__pyx_t_3);
4128 __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error)
4129 __Pyx_GOTREF(__pyx_t_6);
4130 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4131 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error)
4132 __Pyx_GOTREF(__pyx_t_3);
4133 __Pyx_GIVEREF(__pyx_t_6);
4134 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
4135 __pyx_t_6 = 0;
4136 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error)
4137 __Pyx_GOTREF(__pyx_t_6);
4138 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4139 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
4140 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4141 __PYX_ERR(1, 278, __pyx_L1_error)
4142 break;
4143 }
4144
4145 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":279
4146 * else:
4147 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
4148 * info.format = f # <<<<<<<<<<<<<<
4149 * return
4150 * else:
4151 */
4152 __pyx_v_info->format = __pyx_v_f;
4153
4154 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":280
4155 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
4156 * info.format = f
4157 * return # <<<<<<<<<<<<<<
4158 * else:
4159 * info.format = <char*>stdlib.malloc(_buffer_format_string_len)
4160 */
4161 __pyx_r = 0;
4162 goto __pyx_L0;
4163
4164 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":255
4165 * info.obj = self
4166 *
4167 * if not hasfields: # <<<<<<<<<<<<<<
4168 * t = descr.type_num
4169 * if ((descr.byteorder == c'>' and little_endian) or
4170 */
4171 }
4172
4173 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":282
4174 * return
4175 * else:
4176 * info.format = <char*>stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<<
4177 * info.format[0] = c'^' # Native data types, manual alignment
4178 * offset = 0
4179 */
4180 /*else*/ {
4181 __pyx_v_info->format = ((char *)malloc(0xFF));
4182
4183 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":283
4184 * else:
4185 * info.format = <char*>stdlib.malloc(_buffer_format_string_len)
4186 * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<<
4187 * offset = 0
4188 * f = _util_dtypestring(descr, info.format + 1,
4189 */
4190 (__pyx_v_info->format[0]) = '^';
4191
4192 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":284
4193 * info.format = <char*>stdlib.malloc(_buffer_format_string_len)
4194 * info.format[0] = c'^' # Native data types, manual alignment
4195 * offset = 0 # <<<<<<<<<<<<<<
4196 * f = _util_dtypestring(descr, info.format + 1,
4197 * info.format + _buffer_format_string_len,
4198 */
4199 __pyx_v_offset = 0;
4200
4201 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":285
4202 * info.format[0] = c'^' # Native data types, manual alignment
4203 * offset = 0
4204 * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<<
4205 * info.format + _buffer_format_string_len,
4206 * &offset)
4207 */
4208 __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error)
4209 __pyx_v_f = __pyx_t_7;
4210
4211 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288
4212 * info.format + _buffer_format_string_len,
4213 * &offset)
4214 * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
4215 *
4216 * def __releasebuffer__(ndarray self, Py_buffer* info):
4217 */
4218 (__pyx_v_f[0]) = '\x00';
4219 }
4220
4221 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":197
4222 * # experimental exception made for __getbuffer__ and __releasebuffer__
4223 * # -- the details of this may change.
4224 * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
4225 * # This implementation of getbuffer is geared towards Cython
4226 * # requirements, and does not yet fullfill the PEP.
4227 */
4228
4229 /* function exit code */
4230 __pyx_r = 0;
4231 goto __pyx_L0;
4232 __pyx_L1_error:;
4233 __Pyx_XDECREF(__pyx_t_3);
4234 __Pyx_XDECREF(__pyx_t_6);
4235 __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4236 __pyx_r = -1;
4237 if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) {
4238 __Pyx_GOTREF(__pyx_v_info->obj);
4239 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
4240 }
4241 goto __pyx_L2;
4242 __pyx_L0:;
4243 if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
4244 __Pyx_GOTREF(Py_None);
4245 __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
4246 }
4247 __pyx_L2:;
4248 __Pyx_XDECREF((PyObject *)__pyx_v_descr);
4249 __Pyx_RefNannyFinishContext();
4250 return __pyx_r;
4251 }
4252
4253 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":290
4254 * f[0] = c'\0' # Terminate format string
4255 *
4256 * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
4257 * if PyArray_HASFIELDS(self):
4258 * stdlib.free(info.format)
4259 */
4260
4261 /* Python wrapper */
4262 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
__pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject * __pyx_v_self,Py_buffer * __pyx_v_info)4263 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
4264 __Pyx_RefNannyDeclarations
4265 __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
4266 __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
4267
4268 /* function exit code */
4269 __Pyx_RefNannyFinishContext();
4270 }
4271
__pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject * __pyx_v_self,Py_buffer * __pyx_v_info)4272 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
4273 __Pyx_RefNannyDeclarations
4274 int __pyx_t_1;
4275 __Pyx_RefNannySetupContext("__releasebuffer__", 0);
4276
4277 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291
4278 *
4279 * def __releasebuffer__(ndarray self, Py_buffer* info):
4280 * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
4281 * stdlib.free(info.format)
4282 * if sizeof(npy_intp) != sizeof(Py_ssize_t):
4283 */
4284 __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
4285 if (__pyx_t_1) {
4286
4287 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":292
4288 * def __releasebuffer__(ndarray self, Py_buffer* info):
4289 * if PyArray_HASFIELDS(self):
4290 * stdlib.free(info.format) # <<<<<<<<<<<<<<
4291 * if sizeof(npy_intp) != sizeof(Py_ssize_t):
4292 * stdlib.free(info.strides)
4293 */
4294 free(__pyx_v_info->format);
4295
4296 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291
4297 *
4298 * def __releasebuffer__(ndarray self, Py_buffer* info):
4299 * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
4300 * stdlib.free(info.format)
4301 * if sizeof(npy_intp) != sizeof(Py_ssize_t):
4302 */
4303 }
4304
4305 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":293
4306 * if PyArray_HASFIELDS(self):
4307 * stdlib.free(info.format)
4308 * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
4309 * stdlib.free(info.strides)
4310 * # info.shape was stored after info.strides in the same block
4311 */
4312 __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
4313 if (__pyx_t_1) {
4314
4315 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":294
4316 * stdlib.free(info.format)
4317 * if sizeof(npy_intp) != sizeof(Py_ssize_t):
4318 * stdlib.free(info.strides) # <<<<<<<<<<<<<<
4319 * # info.shape was stored after info.strides in the same block
4320 *
4321 */
4322 free(__pyx_v_info->strides);
4323
4324 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":293
4325 * if PyArray_HASFIELDS(self):
4326 * stdlib.free(info.format)
4327 * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
4328 * stdlib.free(info.strides)
4329 * # info.shape was stored after info.strides in the same block
4330 */
4331 }
4332
4333 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":290
4334 * f[0] = c'\0' # Terminate format string
4335 *
4336 * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
4337 * if PyArray_HASFIELDS(self):
4338 * stdlib.free(info.format)
4339 */
4340
4341 /* function exit code */
4342 __Pyx_RefNannyFinishContext();
4343 }
4344
4345 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":770
4346 * ctypedef npy_cdouble complex_t
4347 *
4348 * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
4349 * return PyArray_MultiIterNew(1, <void*>a)
4350 *
4351 */
4352
__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject * __pyx_v_a)4353 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
4354 PyObject *__pyx_r = NULL;
4355 __Pyx_RefNannyDeclarations
4356 PyObject *__pyx_t_1 = NULL;
4357 __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
4358
4359 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771
4360 *
4361 * cdef inline object PyArray_MultiIterNew1(a):
4362 * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
4363 *
4364 * cdef inline object PyArray_MultiIterNew2(a, b):
4365 */
4366 __Pyx_XDECREF(__pyx_r);
4367 __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 771, __pyx_L1_error)
4368 __Pyx_GOTREF(__pyx_t_1);
4369 __pyx_r = __pyx_t_1;
4370 __pyx_t_1 = 0;
4371 goto __pyx_L0;
4372
4373 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":770
4374 * ctypedef npy_cdouble complex_t
4375 *
4376 * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
4377 * return PyArray_MultiIterNew(1, <void*>a)
4378 *
4379 */
4380
4381 /* function exit code */
4382 __pyx_L1_error:;
4383 __Pyx_XDECREF(__pyx_t_1);
4384 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
4385 __pyx_r = 0;
4386 __pyx_L0:;
4387 __Pyx_XGIVEREF(__pyx_r);
4388 __Pyx_RefNannyFinishContext();
4389 return __pyx_r;
4390 }
4391
4392 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":773
4393 * return PyArray_MultiIterNew(1, <void*>a)
4394 *
4395 * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
4396 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
4397 *
4398 */
4399
__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject * __pyx_v_a,PyObject * __pyx_v_b)4400 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
4401 PyObject *__pyx_r = NULL;
4402 __Pyx_RefNannyDeclarations
4403 PyObject *__pyx_t_1 = NULL;
4404 __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
4405
4406 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774
4407 *
4408 * cdef inline object PyArray_MultiIterNew2(a, b):
4409 * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
4410 *
4411 * cdef inline object PyArray_MultiIterNew3(a, b, c):
4412 */
4413 __Pyx_XDECREF(__pyx_r);
4414 __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 774, __pyx_L1_error)
4415 __Pyx_GOTREF(__pyx_t_1);
4416 __pyx_r = __pyx_t_1;
4417 __pyx_t_1 = 0;
4418 goto __pyx_L0;
4419
4420 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":773
4421 * return PyArray_MultiIterNew(1, <void*>a)
4422 *
4423 * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
4424 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
4425 *
4426 */
4427
4428 /* function exit code */
4429 __pyx_L1_error:;
4430 __Pyx_XDECREF(__pyx_t_1);
4431 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
4432 __pyx_r = 0;
4433 __pyx_L0:;
4434 __Pyx_XGIVEREF(__pyx_r);
4435 __Pyx_RefNannyFinishContext();
4436 return __pyx_r;
4437 }
4438
4439 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":776
4440 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
4441 *
4442 * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
4443 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
4444 *
4445 */
4446
__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c)4447 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
4448 PyObject *__pyx_r = NULL;
4449 __Pyx_RefNannyDeclarations
4450 PyObject *__pyx_t_1 = NULL;
4451 __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
4452
4453 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777
4454 *
4455 * cdef inline object PyArray_MultiIterNew3(a, b, c):
4456 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
4457 *
4458 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
4459 */
4460 __Pyx_XDECREF(__pyx_r);
4461 __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 777, __pyx_L1_error)
4462 __Pyx_GOTREF(__pyx_t_1);
4463 __pyx_r = __pyx_t_1;
4464 __pyx_t_1 = 0;
4465 goto __pyx_L0;
4466
4467 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":776
4468 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
4469 *
4470 * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
4471 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
4472 *
4473 */
4474
4475 /* function exit code */
4476 __pyx_L1_error:;
4477 __Pyx_XDECREF(__pyx_t_1);
4478 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
4479 __pyx_r = 0;
4480 __pyx_L0:;
4481 __Pyx_XGIVEREF(__pyx_r);
4482 __Pyx_RefNannyFinishContext();
4483 return __pyx_r;
4484 }
4485
4486 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":779
4487 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
4488 *
4489 * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
4490 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
4491 *
4492 */
4493
__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c,PyObject * __pyx_v_d)4494 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
4495 PyObject *__pyx_r = NULL;
4496 __Pyx_RefNannyDeclarations
4497 PyObject *__pyx_t_1 = NULL;
4498 __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
4499
4500 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780
4501 *
4502 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
4503 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
4504 *
4505 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
4506 */
4507 __Pyx_XDECREF(__pyx_r);
4508 __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 780, __pyx_L1_error)
4509 __Pyx_GOTREF(__pyx_t_1);
4510 __pyx_r = __pyx_t_1;
4511 __pyx_t_1 = 0;
4512 goto __pyx_L0;
4513
4514 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":779
4515 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
4516 *
4517 * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
4518 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
4519 *
4520 */
4521
4522 /* function exit code */
4523 __pyx_L1_error:;
4524 __Pyx_XDECREF(__pyx_t_1);
4525 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
4526 __pyx_r = 0;
4527 __pyx_L0:;
4528 __Pyx_XGIVEREF(__pyx_r);
4529 __Pyx_RefNannyFinishContext();
4530 return __pyx_r;
4531 }
4532
4533 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":782
4534 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
4535 *
4536 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
4537 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
4538 *
4539 */
4540
__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c,PyObject * __pyx_v_d,PyObject * __pyx_v_e)4541 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
4542 PyObject *__pyx_r = NULL;
4543 __Pyx_RefNannyDeclarations
4544 PyObject *__pyx_t_1 = NULL;
4545 __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
4546
4547 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783
4548 *
4549 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
4550 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
4551 *
4552 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
4553 */
4554 __Pyx_XDECREF(__pyx_r);
4555 __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 783, __pyx_L1_error)
4556 __Pyx_GOTREF(__pyx_t_1);
4557 __pyx_r = __pyx_t_1;
4558 __pyx_t_1 = 0;
4559 goto __pyx_L0;
4560
4561 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":782
4562 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
4563 *
4564 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
4565 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
4566 *
4567 */
4568
4569 /* function exit code */
4570 __pyx_L1_error:;
4571 __Pyx_XDECREF(__pyx_t_1);
4572 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
4573 __pyx_r = 0;
4574 __pyx_L0:;
4575 __Pyx_XGIVEREF(__pyx_r);
4576 __Pyx_RefNannyFinishContext();
4577 return __pyx_r;
4578 }
4579
4580 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":785
4581 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
4582 *
4583 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
4584 * # Recursive utility function used in __getbuffer__ to get format
4585 * # string. The new location in the format string is returned.
4586 */
4587
__pyx_f_5numpy__util_dtypestring(PyArray_Descr * __pyx_v_descr,char * __pyx_v_f,char * __pyx_v_end,int * __pyx_v_offset)4588 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
4589 PyArray_Descr *__pyx_v_child = 0;
4590 int __pyx_v_endian_detector;
4591 int __pyx_v_little_endian;
4592 PyObject *__pyx_v_fields = 0;
4593 PyObject *__pyx_v_childname = NULL;
4594 PyObject *__pyx_v_new_offset = NULL;
4595 PyObject *__pyx_v_t = NULL;
4596 char *__pyx_r;
4597 __Pyx_RefNannyDeclarations
4598 PyObject *__pyx_t_1 = NULL;
4599 Py_ssize_t __pyx_t_2;
4600 PyObject *__pyx_t_3 = NULL;
4601 PyObject *__pyx_t_4 = NULL;
4602 int __pyx_t_5;
4603 int __pyx_t_6;
4604 int __pyx_t_7;
4605 long __pyx_t_8;
4606 char *__pyx_t_9;
4607 __Pyx_RefNannySetupContext("_util_dtypestring", 0);
4608
4609 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":790
4610 *
4611 * cdef dtype child
4612 * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
4613 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
4614 * cdef tuple fields
4615 */
4616 __pyx_v_endian_detector = 1;
4617
4618 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":791
4619 * cdef dtype child
4620 * cdef int endian_detector = 1
4621 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
4622 * cdef tuple fields
4623 *
4624 */
4625 __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
4626
4627 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794
4628 * cdef tuple fields
4629 *
4630 * for childname in descr.names: # <<<<<<<<<<<<<<
4631 * fields = descr.fields[childname]
4632 * child, new_offset = fields
4633 */
4634 if (unlikely(__pyx_v_descr->names == Py_None)) {
4635 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
4636 __PYX_ERR(1, 794, __pyx_L1_error)
4637 }
4638 __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
4639 for (;;) {
4640 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
4641 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4642 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 794, __pyx_L1_error)
4643 #else
4644 __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error)
4645 __Pyx_GOTREF(__pyx_t_3);
4646 #endif
4647 __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
4648 __pyx_t_3 = 0;
4649
4650 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":795
4651 *
4652 * for childname in descr.names:
4653 * fields = descr.fields[childname] # <<<<<<<<<<<<<<
4654 * child, new_offset = fields
4655 *
4656 */
4657 if (unlikely(__pyx_v_descr->fields == Py_None)) {
4658 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
4659 __PYX_ERR(1, 795, __pyx_L1_error)
4660 }
4661 __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error)
4662 __Pyx_GOTREF(__pyx_t_3);
4663 if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 795, __pyx_L1_error)
4664 __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
4665 __pyx_t_3 = 0;
4666
4667 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":796
4668 * for childname in descr.names:
4669 * fields = descr.fields[childname]
4670 * child, new_offset = fields # <<<<<<<<<<<<<<
4671 *
4672 * if (end - f) - <int>(new_offset - offset[0]) < 15:
4673 */
4674 if (likely(__pyx_v_fields != Py_None)) {
4675 PyObject* sequence = __pyx_v_fields;
4676 #if !CYTHON_COMPILING_IN_PYPY
4677 Py_ssize_t size = Py_SIZE(sequence);
4678 #else
4679 Py_ssize_t size = PySequence_Size(sequence);
4680 #endif
4681 if (unlikely(size != 2)) {
4682 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
4683 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
4684 __PYX_ERR(1, 796, __pyx_L1_error)
4685 }
4686 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4687 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
4688 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
4689 __Pyx_INCREF(__pyx_t_3);
4690 __Pyx_INCREF(__pyx_t_4);
4691 #else
4692 __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 796, __pyx_L1_error)
4693 __Pyx_GOTREF(__pyx_t_3);
4694 __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error)
4695 __Pyx_GOTREF(__pyx_t_4);
4696 #endif
4697 } else {
4698 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error)
4699 }
4700 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __pyx_L1_error)
4701 __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
4702 __pyx_t_3 = 0;
4703 __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
4704 __pyx_t_4 = 0;
4705
4706 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":798
4707 * child, new_offset = fields
4708 *
4709 * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
4710 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
4711 *
4712 */
4713 __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 798, __pyx_L1_error)
4714 __Pyx_GOTREF(__pyx_t_4);
4715 __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error)
4716 __Pyx_GOTREF(__pyx_t_3);
4717 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4718 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __pyx_L1_error)
4719 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4720 __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
4721 if (__pyx_t_6) {
4722
4723 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799
4724 *
4725 * if (end - f) - <int>(new_offset - offset[0]) < 15:
4726 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
4727 *
4728 * if ((child.byteorder == c'>' and little_endian) or
4729 */
4730 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __pyx_L1_error)
4731 __Pyx_GOTREF(__pyx_t_3);
4732 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
4733 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4734 __PYX_ERR(1, 799, __pyx_L1_error)
4735
4736 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":798
4737 * child, new_offset = fields
4738 *
4739 * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
4740 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
4741 *
4742 */
4743 }
4744
4745 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801
4746 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
4747 *
4748 * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
4749 * (child.byteorder == c'<' and not little_endian)):
4750 * raise ValueError(u"Non-native byte order not supported")
4751 */
4752 __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
4753 if (!__pyx_t_7) {
4754 goto __pyx_L8_next_or;
4755 } else {
4756 }
4757 __pyx_t_7 = (__pyx_v_little_endian != 0);
4758 if (!__pyx_t_7) {
4759 } else {
4760 __pyx_t_6 = __pyx_t_7;
4761 goto __pyx_L7_bool_binop_done;
4762 }
4763 __pyx_L8_next_or:;
4764
4765 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802
4766 *
4767 * if ((child.byteorder == c'>' and little_endian) or
4768 * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
4769 * raise ValueError(u"Non-native byte order not supported")
4770 * # One could encode it in the format string and have Cython
4771 */
4772 __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
4773 if (__pyx_t_7) {
4774 } else {
4775 __pyx_t_6 = __pyx_t_7;
4776 goto __pyx_L7_bool_binop_done;
4777 }
4778 __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
4779 __pyx_t_6 = __pyx_t_7;
4780 __pyx_L7_bool_binop_done:;
4781
4782 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801
4783 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
4784 *
4785 * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
4786 * (child.byteorder == c'<' and not little_endian)):
4787 * raise ValueError(u"Non-native byte order not supported")
4788 */
4789 if (__pyx_t_6) {
4790
4791 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803
4792 * if ((child.byteorder == c'>' and little_endian) or
4793 * (child.byteorder == c'<' and not little_endian)):
4794 * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
4795 * # One could encode it in the format string and have Cython
4796 * # complain instead, BUT: < and > in format strings also imply
4797 */
4798 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error)
4799 __Pyx_GOTREF(__pyx_t_3);
4800 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
4801 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4802 __PYX_ERR(1, 803, __pyx_L1_error)
4803
4804 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801
4805 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
4806 *
4807 * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
4808 * (child.byteorder == c'<' and not little_endian)):
4809 * raise ValueError(u"Non-native byte order not supported")
4810 */
4811 }
4812
4813 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":813
4814 *
4815 * # Output padding bytes
4816 * while offset[0] < new_offset: # <<<<<<<<<<<<<<
4817 * f[0] = 120 # "x"; pad byte
4818 * f += 1
4819 */
4820 while (1) {
4821 __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __pyx_L1_error)
4822 __Pyx_GOTREF(__pyx_t_3);
4823 __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error)
4824 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4825 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error)
4826 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4827 if (!__pyx_t_6) break;
4828
4829 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":814
4830 * # Output padding bytes
4831 * while offset[0] < new_offset:
4832 * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
4833 * f += 1
4834 * offset[0] += 1
4835 */
4836 (__pyx_v_f[0]) = 0x78;
4837
4838 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":815
4839 * while offset[0] < new_offset:
4840 * f[0] = 120 # "x"; pad byte
4841 * f += 1 # <<<<<<<<<<<<<<
4842 * offset[0] += 1
4843 *
4844 */
4845 __pyx_v_f = (__pyx_v_f + 1);
4846
4847 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":816
4848 * f[0] = 120 # "x"; pad byte
4849 * f += 1
4850 * offset[0] += 1 # <<<<<<<<<<<<<<
4851 *
4852 * offset[0] += child.itemsize
4853 */
4854 __pyx_t_8 = 0;
4855 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
4856 }
4857
4858 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":818
4859 * offset[0] += 1
4860 *
4861 * offset[0] += child.itemsize # <<<<<<<<<<<<<<
4862 *
4863 * if not PyDataType_HASFIELDS(child):
4864 */
4865 __pyx_t_8 = 0;
4866 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
4867
4868 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":820
4869 * offset[0] += child.itemsize
4870 *
4871 * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
4872 * t = child.type_num
4873 * if end - f < 5:
4874 */
4875 __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
4876 if (__pyx_t_6) {
4877
4878 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":821
4879 *
4880 * if not PyDataType_HASFIELDS(child):
4881 * t = child.type_num # <<<<<<<<<<<<<<
4882 * if end - f < 5:
4883 * raise RuntimeError(u"Format string allocated too short.")
4884 */
4885 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 821, __pyx_L1_error)
4886 __Pyx_GOTREF(__pyx_t_4);
4887 __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
4888 __pyx_t_4 = 0;
4889
4890 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":822
4891 * if not PyDataType_HASFIELDS(child):
4892 * t = child.type_num
4893 * if end - f < 5: # <<<<<<<<<<<<<<
4894 * raise RuntimeError(u"Format string allocated too short.")
4895 *
4896 */
4897 __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
4898 if (__pyx_t_6) {
4899
4900 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823
4901 * t = child.type_num
4902 * if end - f < 5:
4903 * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
4904 *
4905 * # Until ticket #99 is fixed, use integers to avoid warnings
4906 */
4907 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __pyx_L1_error)
4908 __Pyx_GOTREF(__pyx_t_4);
4909 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
4910 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4911 __PYX_ERR(1, 823, __pyx_L1_error)
4912
4913 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":822
4914 * if not PyDataType_HASFIELDS(child):
4915 * t = child.type_num
4916 * if end - f < 5: # <<<<<<<<<<<<<<
4917 * raise RuntimeError(u"Format string allocated too short.")
4918 *
4919 */
4920 }
4921
4922 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826
4923 *
4924 * # Until ticket #99 is fixed, use integers to avoid warnings
4925 * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<<
4926 * elif t == NPY_UBYTE: f[0] = 66 #"B"
4927 * elif t == NPY_SHORT: f[0] = 104 #"h"
4928 */
4929 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 826, __pyx_L1_error)
4930 __Pyx_GOTREF(__pyx_t_4);
4931 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __pyx_L1_error)
4932 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4933 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __pyx_L1_error)
4934 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4935 if (__pyx_t_6) {
4936 (__pyx_v_f[0]) = 98;
4937 goto __pyx_L15;
4938 }
4939
4940 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":827
4941 * # Until ticket #99 is fixed, use integers to avoid warnings
4942 * if t == NPY_BYTE: f[0] = 98 #"b"
4943 * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<<
4944 * elif t == NPY_SHORT: f[0] = 104 #"h"
4945 * elif t == NPY_USHORT: f[0] = 72 #"H"
4946 */
4947 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 827, __pyx_L1_error)
4948 __Pyx_GOTREF(__pyx_t_3);
4949 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error)
4950 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4951 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __pyx_L1_error)
4952 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4953 if (__pyx_t_6) {
4954 (__pyx_v_f[0]) = 66;
4955 goto __pyx_L15;
4956 }
4957
4958 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":828
4959 * if t == NPY_BYTE: f[0] = 98 #"b"
4960 * elif t == NPY_UBYTE: f[0] = 66 #"B"
4961 * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<<
4962 * elif t == NPY_USHORT: f[0] = 72 #"H"
4963 * elif t == NPY_INT: f[0] = 105 #"i"
4964 */
4965 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 828, __pyx_L1_error)
4966 __Pyx_GOTREF(__pyx_t_4);
4967 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error)
4968 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4969 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error)
4970 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4971 if (__pyx_t_6) {
4972 (__pyx_v_f[0]) = 0x68;
4973 goto __pyx_L15;
4974 }
4975
4976 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":829
4977 * elif t == NPY_UBYTE: f[0] = 66 #"B"
4978 * elif t == NPY_SHORT: f[0] = 104 #"h"
4979 * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<<
4980 * elif t == NPY_INT: f[0] = 105 #"i"
4981 * elif t == NPY_UINT: f[0] = 73 #"I"
4982 */
4983 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 829, __pyx_L1_error)
4984 __Pyx_GOTREF(__pyx_t_3);
4985 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error)
4986 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4987 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __pyx_L1_error)
4988 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4989 if (__pyx_t_6) {
4990 (__pyx_v_f[0]) = 72;
4991 goto __pyx_L15;
4992 }
4993
4994 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":830
4995 * elif t == NPY_SHORT: f[0] = 104 #"h"
4996 * elif t == NPY_USHORT: f[0] = 72 #"H"
4997 * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<<
4998 * elif t == NPY_UINT: f[0] = 73 #"I"
4999 * elif t == NPY_LONG: f[0] = 108 #"l"
5000 */
5001 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __pyx_L1_error)
5002 __Pyx_GOTREF(__pyx_t_4);
5003 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error)
5004 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5005 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error)
5006 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5007 if (__pyx_t_6) {
5008 (__pyx_v_f[0]) = 0x69;
5009 goto __pyx_L15;
5010 }
5011
5012 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":831
5013 * elif t == NPY_USHORT: f[0] = 72 #"H"
5014 * elif t == NPY_INT: f[0] = 105 #"i"
5015 * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<<
5016 * elif t == NPY_LONG: f[0] = 108 #"l"
5017 * elif t == NPY_ULONG: f[0] = 76 #"L"
5018 */
5019 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 831, __pyx_L1_error)
5020 __Pyx_GOTREF(__pyx_t_3);
5021 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error)
5022 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5023 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __pyx_L1_error)
5024 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5025 if (__pyx_t_6) {
5026 (__pyx_v_f[0]) = 73;
5027 goto __pyx_L15;
5028 }
5029
5030 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":832
5031 * elif t == NPY_INT: f[0] = 105 #"i"
5032 * elif t == NPY_UINT: f[0] = 73 #"I"
5033 * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<<
5034 * elif t == NPY_ULONG: f[0] = 76 #"L"
5035 * elif t == NPY_LONGLONG: f[0] = 113 #"q"
5036 */
5037 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __pyx_L1_error)
5038 __Pyx_GOTREF(__pyx_t_4);
5039 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __pyx_L1_error)
5040 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5041 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error)
5042 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5043 if (__pyx_t_6) {
5044 (__pyx_v_f[0]) = 0x6C;
5045 goto __pyx_L15;
5046 }
5047
5048 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":833
5049 * elif t == NPY_UINT: f[0] = 73 #"I"
5050 * elif t == NPY_LONG: f[0] = 108 #"l"
5051 * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<<
5052 * elif t == NPY_LONGLONG: f[0] = 113 #"q"
5053 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
5054 */
5055 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 833, __pyx_L1_error)
5056 __Pyx_GOTREF(__pyx_t_3);
5057 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __pyx_L1_error)
5058 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5059 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __pyx_L1_error)
5060 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5061 if (__pyx_t_6) {
5062 (__pyx_v_f[0]) = 76;
5063 goto __pyx_L15;
5064 }
5065
5066 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":834
5067 * elif t == NPY_LONG: f[0] = 108 #"l"
5068 * elif t == NPY_ULONG: f[0] = 76 #"L"
5069 * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<<
5070 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
5071 * elif t == NPY_FLOAT: f[0] = 102 #"f"
5072 */
5073 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __pyx_L1_error)
5074 __Pyx_GOTREF(__pyx_t_4);
5075 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __pyx_L1_error)
5076 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5077 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error)
5078 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5079 if (__pyx_t_6) {
5080 (__pyx_v_f[0]) = 0x71;
5081 goto __pyx_L15;
5082 }
5083
5084 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":835
5085 * elif t == NPY_ULONG: f[0] = 76 #"L"
5086 * elif t == NPY_LONGLONG: f[0] = 113 #"q"
5087 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<<
5088 * elif t == NPY_FLOAT: f[0] = 102 #"f"
5089 * elif t == NPY_DOUBLE: f[0] = 100 #"d"
5090 */
5091 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __pyx_L1_error)
5092 __Pyx_GOTREF(__pyx_t_3);
5093 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __pyx_L1_error)
5094 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5095 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __pyx_L1_error)
5096 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5097 if (__pyx_t_6) {
5098 (__pyx_v_f[0]) = 81;
5099 goto __pyx_L15;
5100 }
5101
5102 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":836
5103 * elif t == NPY_LONGLONG: f[0] = 113 #"q"
5104 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
5105 * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<<
5106 * elif t == NPY_DOUBLE: f[0] = 100 #"d"
5107 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
5108 */
5109 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 836, __pyx_L1_error)
5110 __Pyx_GOTREF(__pyx_t_4);
5111 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __pyx_L1_error)
5112 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5113 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error)
5114 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5115 if (__pyx_t_6) {
5116 (__pyx_v_f[0]) = 0x66;
5117 goto __pyx_L15;
5118 }
5119
5120 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":837
5121 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
5122 * elif t == NPY_FLOAT: f[0] = 102 #"f"
5123 * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<<
5124 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
5125 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
5126 */
5127 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __pyx_L1_error)
5128 __Pyx_GOTREF(__pyx_t_3);
5129 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error)
5130 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5131 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error)
5132 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5133 if (__pyx_t_6) {
5134 (__pyx_v_f[0]) = 0x64;
5135 goto __pyx_L15;
5136 }
5137
5138 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":838
5139 * elif t == NPY_FLOAT: f[0] = 102 #"f"
5140 * elif t == NPY_DOUBLE: f[0] = 100 #"d"
5141 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<<
5142 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
5143 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
5144 */
5145 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __pyx_L1_error)
5146 __Pyx_GOTREF(__pyx_t_4);
5147 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error)
5148 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5149 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error)
5150 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5151 if (__pyx_t_6) {
5152 (__pyx_v_f[0]) = 0x67;
5153 goto __pyx_L15;
5154 }
5155
5156 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":839
5157 * elif t == NPY_DOUBLE: f[0] = 100 #"d"
5158 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
5159 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<<
5160 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
5161 * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
5162 */
5163 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __pyx_L1_error)
5164 __Pyx_GOTREF(__pyx_t_3);
5165 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error)
5166 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5167 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error)
5168 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5169 if (__pyx_t_6) {
5170 (__pyx_v_f[0]) = 90;
5171 (__pyx_v_f[1]) = 0x66;
5172 __pyx_v_f = (__pyx_v_f + 1);
5173 goto __pyx_L15;
5174 }
5175
5176 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":840
5177 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
5178 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
5179 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<<
5180 * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
5181 * elif t == NPY_OBJECT: f[0] = 79 #"O"
5182 */
5183 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __pyx_L1_error)
5184 __Pyx_GOTREF(__pyx_t_4);
5185 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error)
5186 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5187 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error)
5188 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5189 if (__pyx_t_6) {
5190 (__pyx_v_f[0]) = 90;
5191 (__pyx_v_f[1]) = 0x64;
5192 __pyx_v_f = (__pyx_v_f + 1);
5193 goto __pyx_L15;
5194 }
5195
5196 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":841
5197 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
5198 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
5199 * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<<
5200 * elif t == NPY_OBJECT: f[0] = 79 #"O"
5201 * else:
5202 */
5203 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __pyx_L1_error)
5204 __Pyx_GOTREF(__pyx_t_3);
5205 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error)
5206 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5207 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error)
5208 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5209 if (__pyx_t_6) {
5210 (__pyx_v_f[0]) = 90;
5211 (__pyx_v_f[1]) = 0x67;
5212 __pyx_v_f = (__pyx_v_f + 1);
5213 goto __pyx_L15;
5214 }
5215
5216 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":842
5217 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
5218 * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
5219 * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<<
5220 * else:
5221 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
5222 */
5223 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __pyx_L1_error)
5224 __Pyx_GOTREF(__pyx_t_4);
5225 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error)
5226 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5227 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error)
5228 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5229 if (__pyx_t_6) {
5230 (__pyx_v_f[0]) = 79;
5231 goto __pyx_L15;
5232 }
5233
5234 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":844
5235 * elif t == NPY_OBJECT: f[0] = 79 #"O"
5236 * else:
5237 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
5238 * f += 1
5239 * else:
5240 */
5241 /*else*/ {
5242 __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error)
5243 __Pyx_GOTREF(__pyx_t_3);
5244 __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __pyx_L1_error)
5245 __Pyx_GOTREF(__pyx_t_4);
5246 __Pyx_GIVEREF(__pyx_t_3);
5247 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
5248 __pyx_t_3 = 0;
5249 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error)
5250 __Pyx_GOTREF(__pyx_t_3);
5251 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5252 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5253 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5254 __PYX_ERR(1, 844, __pyx_L1_error)
5255 }
5256 __pyx_L15:;
5257
5258 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":845
5259 * else:
5260 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
5261 * f += 1 # <<<<<<<<<<<<<<
5262 * else:
5263 * # Cython ignores struct boundary information ("T{...}"),
5264 */
5265 __pyx_v_f = (__pyx_v_f + 1);
5266
5267 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":820
5268 * offset[0] += child.itemsize
5269 *
5270 * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
5271 * t = child.type_num
5272 * if end - f < 5:
5273 */
5274 goto __pyx_L13;
5275 }
5276
5277 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":849
5278 * # Cython ignores struct boundary information ("T{...}"),
5279 * # so don't output it
5280 * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<<
5281 * return f
5282 *
5283 */
5284 /*else*/ {
5285 __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(1, 849, __pyx_L1_error)
5286 __pyx_v_f = __pyx_t_9;
5287 }
5288 __pyx_L13:;
5289
5290 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794
5291 * cdef tuple fields
5292 *
5293 * for childname in descr.names: # <<<<<<<<<<<<<<
5294 * fields = descr.fields[childname]
5295 * child, new_offset = fields
5296 */
5297 }
5298 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5299
5300 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":850
5301 * # so don't output it
5302 * f = _util_dtypestring(child, f, end, offset)
5303 * return f # <<<<<<<<<<<<<<
5304 *
5305 *
5306 */
5307 __pyx_r = __pyx_v_f;
5308 goto __pyx_L0;
5309
5310 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":785
5311 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
5312 *
5313 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
5314 * # Recursive utility function used in __getbuffer__ to get format
5315 * # string. The new location in the format string is returned.
5316 */
5317
5318 /* function exit code */
5319 __pyx_L1_error:;
5320 __Pyx_XDECREF(__pyx_t_1);
5321 __Pyx_XDECREF(__pyx_t_3);
5322 __Pyx_XDECREF(__pyx_t_4);
5323 __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
5324 __pyx_r = NULL;
5325 __pyx_L0:;
5326 __Pyx_XDECREF((PyObject *)__pyx_v_child);
5327 __Pyx_XDECREF(__pyx_v_fields);
5328 __Pyx_XDECREF(__pyx_v_childname);
5329 __Pyx_XDECREF(__pyx_v_new_offset);
5330 __Pyx_XDECREF(__pyx_v_t);
5331 __Pyx_RefNannyFinishContext();
5332 return __pyx_r;
5333 }
5334
5335 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966
5336 *
5337 *
5338 * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
5339 * cdef PyObject* baseptr
5340 * if base is None:
5341 */
5342
__pyx_f_5numpy_set_array_base(PyArrayObject * __pyx_v_arr,PyObject * __pyx_v_base)5343 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
5344 PyObject *__pyx_v_baseptr;
5345 __Pyx_RefNannyDeclarations
5346 int __pyx_t_1;
5347 int __pyx_t_2;
5348 __Pyx_RefNannySetupContext("set_array_base", 0);
5349
5350 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":968
5351 * cdef inline void set_array_base(ndarray arr, object base):
5352 * cdef PyObject* baseptr
5353 * if base is None: # <<<<<<<<<<<<<<
5354 * baseptr = NULL
5355 * else:
5356 */
5357 __pyx_t_1 = (__pyx_v_base == Py_None);
5358 __pyx_t_2 = (__pyx_t_1 != 0);
5359 if (__pyx_t_2) {
5360
5361 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":969
5362 * cdef PyObject* baseptr
5363 * if base is None:
5364 * baseptr = NULL # <<<<<<<<<<<<<<
5365 * else:
5366 * Py_INCREF(base) # important to do this before decref below!
5367 */
5368 __pyx_v_baseptr = NULL;
5369
5370 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":968
5371 * cdef inline void set_array_base(ndarray arr, object base):
5372 * cdef PyObject* baseptr
5373 * if base is None: # <<<<<<<<<<<<<<
5374 * baseptr = NULL
5375 * else:
5376 */
5377 goto __pyx_L3;
5378 }
5379
5380 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":971
5381 * baseptr = NULL
5382 * else:
5383 * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<<
5384 * baseptr = <PyObject*>base
5385 * Py_XDECREF(arr.base)
5386 */
5387 /*else*/ {
5388 Py_INCREF(__pyx_v_base);
5389
5390 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":972
5391 * else:
5392 * Py_INCREF(base) # important to do this before decref below!
5393 * baseptr = <PyObject*>base # <<<<<<<<<<<<<<
5394 * Py_XDECREF(arr.base)
5395 * arr.base = baseptr
5396 */
5397 __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
5398 }
5399 __pyx_L3:;
5400
5401 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":973
5402 * Py_INCREF(base) # important to do this before decref below!
5403 * baseptr = <PyObject*>base
5404 * Py_XDECREF(arr.base) # <<<<<<<<<<<<<<
5405 * arr.base = baseptr
5406 *
5407 */
5408 Py_XDECREF(__pyx_v_arr->base);
5409
5410 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":974
5411 * baseptr = <PyObject*>base
5412 * Py_XDECREF(arr.base)
5413 * arr.base = baseptr # <<<<<<<<<<<<<<
5414 *
5415 * cdef inline object get_array_base(ndarray arr):
5416 */
5417 __pyx_v_arr->base = __pyx_v_baseptr;
5418
5419 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966
5420 *
5421 *
5422 * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
5423 * cdef PyObject* baseptr
5424 * if base is None:
5425 */
5426
5427 /* function exit code */
5428 __Pyx_RefNannyFinishContext();
5429 }
5430
5431 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976
5432 * arr.base = baseptr
5433 *
5434 * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
5435 * if arr.base is NULL:
5436 * return None
5437 */
5438
__pyx_f_5numpy_get_array_base(PyArrayObject * __pyx_v_arr)5439 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
5440 PyObject *__pyx_r = NULL;
5441 __Pyx_RefNannyDeclarations
5442 int __pyx_t_1;
5443 __Pyx_RefNannySetupContext("get_array_base", 0);
5444
5445 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977
5446 *
5447 * cdef inline object get_array_base(ndarray arr):
5448 * if arr.base is NULL: # <<<<<<<<<<<<<<
5449 * return None
5450 * else:
5451 */
5452 __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
5453 if (__pyx_t_1) {
5454
5455 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":978
5456 * cdef inline object get_array_base(ndarray arr):
5457 * if arr.base is NULL:
5458 * return None # <<<<<<<<<<<<<<
5459 * else:
5460 * return <object>arr.base
5461 */
5462 __Pyx_XDECREF(__pyx_r);
5463 __Pyx_INCREF(Py_None);
5464 __pyx_r = Py_None;
5465 goto __pyx_L0;
5466
5467 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977
5468 *
5469 * cdef inline object get_array_base(ndarray arr):
5470 * if arr.base is NULL: # <<<<<<<<<<<<<<
5471 * return None
5472 * else:
5473 */
5474 }
5475
5476 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":980
5477 * return None
5478 * else:
5479 * return <object>arr.base # <<<<<<<<<<<<<<
5480 *
5481 *
5482 */
5483 /*else*/ {
5484 __Pyx_XDECREF(__pyx_r);
5485 __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
5486 __pyx_r = ((PyObject *)__pyx_v_arr->base);
5487 goto __pyx_L0;
5488 }
5489
5490 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976
5491 * arr.base = baseptr
5492 *
5493 * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
5494 * if arr.base is NULL:
5495 * return None
5496 */
5497
5498 /* function exit code */
5499 __pyx_L0:;
5500 __Pyx_XGIVEREF(__pyx_r);
5501 __Pyx_RefNannyFinishContext();
5502 return __pyx_r;
5503 }
5504
5505 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":985
5506 * # Versions of the import_* functions which are more suitable for
5507 * # Cython code.
5508 * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
5509 * try:
5510 * _import_array()
5511 */
5512
__pyx_f_5numpy_import_array(void)5513 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
5514 int __pyx_r;
5515 __Pyx_RefNannyDeclarations
5516 PyObject *__pyx_t_1 = NULL;
5517 PyObject *__pyx_t_2 = NULL;
5518 PyObject *__pyx_t_3 = NULL;
5519 int __pyx_t_4;
5520 PyObject *__pyx_t_5 = NULL;
5521 PyObject *__pyx_t_6 = NULL;
5522 PyObject *__pyx_t_7 = NULL;
5523 PyObject *__pyx_t_8 = NULL;
5524 __Pyx_RefNannySetupContext("import_array", 0);
5525
5526 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":986
5527 * # Cython code.
5528 * cdef inline int import_array() except -1:
5529 * try: # <<<<<<<<<<<<<<
5530 * _import_array()
5531 * except Exception:
5532 */
5533 {
5534 __Pyx_PyThreadState_declare
5535 __Pyx_PyThreadState_assign
5536 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5537 __Pyx_XGOTREF(__pyx_t_1);
5538 __Pyx_XGOTREF(__pyx_t_2);
5539 __Pyx_XGOTREF(__pyx_t_3);
5540 /*try:*/ {
5541
5542 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":987
5543 * cdef inline int import_array() except -1:
5544 * try:
5545 * _import_array() # <<<<<<<<<<<<<<
5546 * except Exception:
5547 * raise ImportError("numpy.core.multiarray failed to import")
5548 */
5549 __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error)
5550
5551 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":986
5552 * # Cython code.
5553 * cdef inline int import_array() except -1:
5554 * try: # <<<<<<<<<<<<<<
5555 * _import_array()
5556 * except Exception:
5557 */
5558 }
5559 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5560 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5561 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5562 goto __pyx_L10_try_end;
5563 __pyx_L3_error:;
5564 __Pyx_PyThreadState_assign
5565
5566 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":988
5567 * try:
5568 * _import_array()
5569 * except Exception: # <<<<<<<<<<<<<<
5570 * raise ImportError("numpy.core.multiarray failed to import")
5571 *
5572 */
5573 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
5574 if (__pyx_t_4) {
5575 __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
5576 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error)
5577 __Pyx_GOTREF(__pyx_t_5);
5578 __Pyx_GOTREF(__pyx_t_6);
5579 __Pyx_GOTREF(__pyx_t_7);
5580
5581 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":989
5582 * _import_array()
5583 * except Exception:
5584 * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
5585 *
5586 * cdef inline int import_umath() except -1:
5587 */
5588 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error)
5589 __Pyx_GOTREF(__pyx_t_8);
5590 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5591 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5592 __PYX_ERR(1, 989, __pyx_L5_except_error)
5593 }
5594 goto __pyx_L5_except_error;
5595 __pyx_L5_except_error:;
5596
5597 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":986
5598 * # Cython code.
5599 * cdef inline int import_array() except -1:
5600 * try: # <<<<<<<<<<<<<<
5601 * _import_array()
5602 * except Exception:
5603 */
5604 __Pyx_PyThreadState_assign
5605 __Pyx_XGIVEREF(__pyx_t_1);
5606 __Pyx_XGIVEREF(__pyx_t_2);
5607 __Pyx_XGIVEREF(__pyx_t_3);
5608 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5609 goto __pyx_L1_error;
5610 __pyx_L10_try_end:;
5611 }
5612
5613 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":985
5614 * # Versions of the import_* functions which are more suitable for
5615 * # Cython code.
5616 * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
5617 * try:
5618 * _import_array()
5619 */
5620
5621 /* function exit code */
5622 __pyx_r = 0;
5623 goto __pyx_L0;
5624 __pyx_L1_error:;
5625 __Pyx_XDECREF(__pyx_t_5);
5626 __Pyx_XDECREF(__pyx_t_6);
5627 __Pyx_XDECREF(__pyx_t_7);
5628 __Pyx_XDECREF(__pyx_t_8);
5629 __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
5630 __pyx_r = -1;
5631 __pyx_L0:;
5632 __Pyx_RefNannyFinishContext();
5633 return __pyx_r;
5634 }
5635
5636 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":991
5637 * raise ImportError("numpy.core.multiarray failed to import")
5638 *
5639 * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
5640 * try:
5641 * _import_umath()
5642 */
5643
__pyx_f_5numpy_import_umath(void)5644 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
5645 int __pyx_r;
5646 __Pyx_RefNannyDeclarations
5647 PyObject *__pyx_t_1 = NULL;
5648 PyObject *__pyx_t_2 = NULL;
5649 PyObject *__pyx_t_3 = NULL;
5650 int __pyx_t_4;
5651 PyObject *__pyx_t_5 = NULL;
5652 PyObject *__pyx_t_6 = NULL;
5653 PyObject *__pyx_t_7 = NULL;
5654 PyObject *__pyx_t_8 = NULL;
5655 __Pyx_RefNannySetupContext("import_umath", 0);
5656
5657 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":992
5658 *
5659 * cdef inline int import_umath() except -1:
5660 * try: # <<<<<<<<<<<<<<
5661 * _import_umath()
5662 * except Exception:
5663 */
5664 {
5665 __Pyx_PyThreadState_declare
5666 __Pyx_PyThreadState_assign
5667 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5668 __Pyx_XGOTREF(__pyx_t_1);
5669 __Pyx_XGOTREF(__pyx_t_2);
5670 __Pyx_XGOTREF(__pyx_t_3);
5671 /*try:*/ {
5672
5673 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":993
5674 * cdef inline int import_umath() except -1:
5675 * try:
5676 * _import_umath() # <<<<<<<<<<<<<<
5677 * except Exception:
5678 * raise ImportError("numpy.core.umath failed to import")
5679 */
5680 __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error)
5681
5682 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":992
5683 *
5684 * cdef inline int import_umath() except -1:
5685 * try: # <<<<<<<<<<<<<<
5686 * _import_umath()
5687 * except Exception:
5688 */
5689 }
5690 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5691 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5692 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5693 goto __pyx_L10_try_end;
5694 __pyx_L3_error:;
5695 __Pyx_PyThreadState_assign
5696
5697 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":994
5698 * try:
5699 * _import_umath()
5700 * except Exception: # <<<<<<<<<<<<<<
5701 * raise ImportError("numpy.core.umath failed to import")
5702 *
5703 */
5704 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
5705 if (__pyx_t_4) {
5706 __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
5707 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error)
5708 __Pyx_GOTREF(__pyx_t_5);
5709 __Pyx_GOTREF(__pyx_t_6);
5710 __Pyx_GOTREF(__pyx_t_7);
5711
5712 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":995
5713 * _import_umath()
5714 * except Exception:
5715 * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
5716 *
5717 * cdef inline int import_ufunc() except -1:
5718 */
5719 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error)
5720 __Pyx_GOTREF(__pyx_t_8);
5721 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5722 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5723 __PYX_ERR(1, 995, __pyx_L5_except_error)
5724 }
5725 goto __pyx_L5_except_error;
5726 __pyx_L5_except_error:;
5727
5728 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":992
5729 *
5730 * cdef inline int import_umath() except -1:
5731 * try: # <<<<<<<<<<<<<<
5732 * _import_umath()
5733 * except Exception:
5734 */
5735 __Pyx_PyThreadState_assign
5736 __Pyx_XGIVEREF(__pyx_t_1);
5737 __Pyx_XGIVEREF(__pyx_t_2);
5738 __Pyx_XGIVEREF(__pyx_t_3);
5739 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5740 goto __pyx_L1_error;
5741 __pyx_L10_try_end:;
5742 }
5743
5744 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":991
5745 * raise ImportError("numpy.core.multiarray failed to import")
5746 *
5747 * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
5748 * try:
5749 * _import_umath()
5750 */
5751
5752 /* function exit code */
5753 __pyx_r = 0;
5754 goto __pyx_L0;
5755 __pyx_L1_error:;
5756 __Pyx_XDECREF(__pyx_t_5);
5757 __Pyx_XDECREF(__pyx_t_6);
5758 __Pyx_XDECREF(__pyx_t_7);
5759 __Pyx_XDECREF(__pyx_t_8);
5760 __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
5761 __pyx_r = -1;
5762 __pyx_L0:;
5763 __Pyx_RefNannyFinishContext();
5764 return __pyx_r;
5765 }
5766
5767 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":997
5768 * raise ImportError("numpy.core.umath failed to import")
5769 *
5770 * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
5771 * try:
5772 * _import_umath()
5773 */
5774
__pyx_f_5numpy_import_ufunc(void)5775 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
5776 int __pyx_r;
5777 __Pyx_RefNannyDeclarations
5778 PyObject *__pyx_t_1 = NULL;
5779 PyObject *__pyx_t_2 = NULL;
5780 PyObject *__pyx_t_3 = NULL;
5781 int __pyx_t_4;
5782 PyObject *__pyx_t_5 = NULL;
5783 PyObject *__pyx_t_6 = NULL;
5784 PyObject *__pyx_t_7 = NULL;
5785 PyObject *__pyx_t_8 = NULL;
5786 __Pyx_RefNannySetupContext("import_ufunc", 0);
5787
5788 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":998
5789 *
5790 * cdef inline int import_ufunc() except -1:
5791 * try: # <<<<<<<<<<<<<<
5792 * _import_umath()
5793 * except Exception:
5794 */
5795 {
5796 __Pyx_PyThreadState_declare
5797 __Pyx_PyThreadState_assign
5798 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5799 __Pyx_XGOTREF(__pyx_t_1);
5800 __Pyx_XGOTREF(__pyx_t_2);
5801 __Pyx_XGOTREF(__pyx_t_3);
5802 /*try:*/ {
5803
5804 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":999
5805 * cdef inline int import_ufunc() except -1:
5806 * try:
5807 * _import_umath() # <<<<<<<<<<<<<<
5808 * except Exception:
5809 * raise ImportError("numpy.core.umath failed to import")
5810 */
5811 __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error)
5812
5813 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":998
5814 *
5815 * cdef inline int import_ufunc() except -1:
5816 * try: # <<<<<<<<<<<<<<
5817 * _import_umath()
5818 * except Exception:
5819 */
5820 }
5821 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5822 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5823 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5824 goto __pyx_L10_try_end;
5825 __pyx_L3_error:;
5826 __Pyx_PyThreadState_assign
5827
5828 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1000
5829 * try:
5830 * _import_umath()
5831 * except Exception: # <<<<<<<<<<<<<<
5832 * raise ImportError("numpy.core.umath failed to import")
5833 */
5834 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
5835 if (__pyx_t_4) {
5836 __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
5837 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error)
5838 __Pyx_GOTREF(__pyx_t_5);
5839 __Pyx_GOTREF(__pyx_t_6);
5840 __Pyx_GOTREF(__pyx_t_7);
5841
5842 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1001
5843 * _import_umath()
5844 * except Exception:
5845 * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
5846 */
5847 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error)
5848 __Pyx_GOTREF(__pyx_t_8);
5849 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5850 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5851 __PYX_ERR(1, 1001, __pyx_L5_except_error)
5852 }
5853 goto __pyx_L5_except_error;
5854 __pyx_L5_except_error:;
5855
5856 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":998
5857 *
5858 * cdef inline int import_ufunc() except -1:
5859 * try: # <<<<<<<<<<<<<<
5860 * _import_umath()
5861 * except Exception:
5862 */
5863 __Pyx_PyThreadState_assign
5864 __Pyx_XGIVEREF(__pyx_t_1);
5865 __Pyx_XGIVEREF(__pyx_t_2);
5866 __Pyx_XGIVEREF(__pyx_t_3);
5867 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5868 goto __pyx_L1_error;
5869 __pyx_L10_try_end:;
5870 }
5871
5872 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":997
5873 * raise ImportError("numpy.core.umath failed to import")
5874 *
5875 * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
5876 * try:
5877 * _import_umath()
5878 */
5879
5880 /* function exit code */
5881 __pyx_r = 0;
5882 goto __pyx_L0;
5883 __pyx_L1_error:;
5884 __Pyx_XDECREF(__pyx_t_5);
5885 __Pyx_XDECREF(__pyx_t_6);
5886 __Pyx_XDECREF(__pyx_t_7);
5887 __Pyx_XDECREF(__pyx_t_8);
5888 __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
5889 __pyx_r = -1;
5890 __pyx_L0:;
5891 __Pyx_RefNannyFinishContext();
5892 return __pyx_r;
5893 }
5894
5895 static PyMethodDef __pyx_methods[] = {
5896 {0, 0, 0, 0}
5897 };
5898
5899 #if PY_MAJOR_VERSION >= 3
5900 static struct PyModuleDef __pyx_moduledef = {
5901 #if PY_VERSION_HEX < 0x03020000
5902 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
5903 #else
5904 PyModuleDef_HEAD_INIT,
5905 #endif
5906 "dcdtimeseries",
5907 0, /* m_doc */
5908 -1, /* m_size */
5909 __pyx_methods /* m_methods */,
5910 NULL, /* m_reload */
5911 NULL, /* m_traverse */
5912 NULL, /* m_clear */
5913 NULL /* m_free */
5914 };
5915 #endif
5916
5917 static __Pyx_StringTabEntry __pyx_string_tab[] = {
5918 {&__pyx_kp_s_Error_jumping_to_starting_frame, __pyx_k_Error_jumping_to_starting_frame, sizeof(__pyx_k_Error_jumping_to_starting_frame), 0, 0, 1, 0},
5919 {&__pyx_kp_s_Error_reading_frame_from_DCD_fil, __pyx_k_Error_reading_frame_from_DCD_fil, sizeof(__pyx_k_Error_reading_frame_from_DCD_fil), 0, 0, 1, 0},
5920 {&__pyx_kp_s_Error_skipping_frame_from_DCD_fi, __pyx_k_Error_skipping_frame_from_DCD_fi, sizeof(__pyx_k_Error_skipping_frame_from_DCD_fi), 0, 0, 1, 0},
5921 {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
5922 {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
5923 {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1},
5924 {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
5925 {&__pyx_n_s_MDAnalysis_coordinates_dcdtimese, __pyx_k_MDAnalysis_coordinates_dcdtimese, sizeof(__pyx_k_MDAnalysis_coordinates_dcdtimese), 0, 0, 1, 1},
5926 {&__pyx_kp_s_No_atoms_passed_into___read_time, __pyx_k_No_atoms_passed_into___read_time, sizeof(__pyx_k_No_atoms_passed_into___read_time), 0, 0, 1, 0},
5927 {&__pyx_kp_s_No_data_requested_timeseries_is, __pyx_k_No_data_requested_timeseries_is, sizeof(__pyx_k_No_data_requested_timeseries_is), 0, 0, 1, 0},
5928 {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
5929 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
5930 {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
5931 {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1},
5932 {&__pyx_n_s_atomcounts, __pyx_k_atomcounts, sizeof(__pyx_k_atomcounts), 0, 0, 1, 1},
5933 {&__pyx_n_s_atomcountslist, __pyx_k_atomcountslist, sizeof(__pyx_k_atomcountslist), 0, 0, 1, 1},
5934 {&__pyx_n_s_atomlist, __pyx_k_atomlist, sizeof(__pyx_k_atomlist), 0, 0, 1, 1},
5935 {&__pyx_n_s_atoms, __pyx_k_atoms, sizeof(__pyx_k_atoms), 0, 0, 1, 1},
5936 {&__pyx_n_s_auxdata, __pyx_k_auxdata, sizeof(__pyx_k_auxdata), 0, 0, 1, 1},
5937 {&__pyx_n_s_auxlist, __pyx_k_auxlist, sizeof(__pyx_k_auxlist), 0, 0, 1, 1},
5938 {&__pyx_n_s_coord, __pyx_k_coord, sizeof(__pyx_k_coord), 0, 0, 1, 1},
5939 {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
5940 {&__pyx_n_s_dcd, __pyx_k_dcd, sizeof(__pyx_k_dcd), 0, 0, 1, 1},
5941 {&__pyx_n_s_dcd_C_ptr, __pyx_k_dcd_C_ptr, sizeof(__pyx_k_dcd_C_ptr), 0, 0, 1, 1},
5942 {&__pyx_n_s_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 1, 1},
5943 {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1},
5944 {&__pyx_n_s_fmtstr, __pyx_k_fmtstr, sizeof(__pyx_k_fmtstr), 0, 0, 1, 1},
5945 {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
5946 {&__pyx_kp_s_home_richard_code_mdanalysis_pa, __pyx_k_home_richard_code_mdanalysis_pa, sizeof(__pyx_k_home_richard_code_mdanalysis_pa), 0, 0, 1, 0},
5947 {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
5948 {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
5949 {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
5950 {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1},
5951 {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1},
5952 {&__pyx_n_s_lowerb, __pyx_k_lowerb, sizeof(__pyx_k_lowerb), 0, 0, 1, 1},
5953 {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
5954 {&__pyx_n_s_n_atoms, __pyx_k_n_atoms, sizeof(__pyx_k_n_atoms), 0, 0, 1, 1},
5955 {&__pyx_n_s_n_frames, __pyx_k_n_frames, sizeof(__pyx_k_n_frames), 0, 0, 1, 1},
5956 {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
5957 {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
5958 {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
5959 {&__pyx_n_s_numdata, __pyx_k_numdata, sizeof(__pyx_k_numdata), 0, 0, 1, 1},
5960 {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
5961 {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
5962 {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
5963 {&__pyx_n_s_numskip, __pyx_k_numskip, sizeof(__pyx_k_numskip), 0, 0, 1, 1},
5964 {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
5965 {&__pyx_n_s_rc, __pyx_k_rc, sizeof(__pyx_k_rc), 0, 0, 1, 1},
5966 {&__pyx_n_s_read_timecorrel, __pyx_k_read_timecorrel, sizeof(__pyx_k_read_timecorrel), 0, 0, 1, 1},
5967 {&__pyx_n_s_read_timeseries, __pyx_k_read_timeseries, sizeof(__pyx_k_read_timeseries), 0, 0, 1, 1},
5968 {&__pyx_n_s_remaining_frames, __pyx_k_remaining_frames, sizeof(__pyx_k_remaining_frames), 0, 0, 1, 1},
5969 {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
5970 {&__pyx_n_s_sizedata, __pyx_k_sizedata, sizeof(__pyx_k_sizedata), 0, 0, 1, 1},
5971 {&__pyx_n_s_skip, __pyx_k_skip, sizeof(__pyx_k_skip), 0, 0, 1, 1},
5972 {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
5973 {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
5974 {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
5975 {&__pyx_n_s_temp, __pyx_k_temp, sizeof(__pyx_k_temp), 0, 0, 1, 1},
5976 {&__pyx_n_s_tempX, __pyx_k_tempX, sizeof(__pyx_k_tempX), 0, 0, 1, 1},
5977 {&__pyx_n_s_tempY, __pyx_k_tempY, sizeof(__pyx_k_tempY), 0, 0, 1, 1},
5978 {&__pyx_n_s_tempZ, __pyx_k_tempZ, sizeof(__pyx_k_tempZ), 0, 0, 1, 1},
5979 {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
5980 {&__pyx_n_s_unitcell, __pyx_k_unitcell, sizeof(__pyx_k_unitcell), 0, 0, 1, 1},
5981 {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
5982 {&__pyx_n_s_upperb, __pyx_k_upperb, sizeof(__pyx_k_upperb), 0, 0, 1, 1},
5983 {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
5984 {0, 0, 0, 0, 0, 0, 0}
5985 };
__Pyx_InitCachedBuiltins(void)5986 static int __Pyx_InitCachedBuiltins(void) {
5987 __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(0, 112, __pyx_L1_error)
5988 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 218, __pyx_L1_error)
5989 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 231, __pyx_L1_error)
5990 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 799, __pyx_L1_error)
5991 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 989, __pyx_L1_error)
5992 return 0;
5993 __pyx_L1_error:;
5994 return -1;
5995 }
5996
__Pyx_InitCachedConstants(void)5997 static int __Pyx_InitCachedConstants(void) {
5998 __Pyx_RefNannyDeclarations
5999 __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
6000
6001 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":84
6002 * numdata = len(format)
6003 * if numdata==0:
6004 * raise Exception("No data requested, timeseries is empty") # <<<<<<<<<<<<<<
6005 * fmtstr = PyString_AsString(format)
6006 *
6007 */
6008 __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_No_data_requested_timeseries_is); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 84, __pyx_L1_error)
6009 __Pyx_GOTREF(__pyx_tuple_);
6010 __Pyx_GIVEREF(__pyx_tuple_);
6011
6012 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":112
6013 * rc = jump_to_dcdstep(dcd.fd, dcd.natoms, dcd.nsets, dcd.nfixed, dcd.charmm, dcd.header_size, start)
6014 * if (rc < 0):
6015 * raise IOError("Error jumping to starting frame") # <<<<<<<<<<<<<<
6016 * dcd.first = 0
6017 * dcd.setsread = start
6018 */
6019 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Error_jumping_to_starting_frame); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 112, __pyx_L1_error)
6020 __Pyx_GOTREF(__pyx_tuple__2);
6021 __Pyx_GIVEREF(__pyx_tuple__2);
6022
6023 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":137
6024 * rc = skip_dcdstep(dcd.fd, dcd.natoms, dcd.nfixed, dcd.charmm, numskip)
6025 * if (rc < 0):
6026 * raise IOError("Error skipping frame from DCD file") # <<<<<<<<<<<<<<
6027 * # on first iteration, numskip = 0, first set is always read.
6028 * dcd.setsread += numskip
6029 */
6030 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Error_skipping_frame_from_DCD_fi); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 137, __pyx_L1_error)
6031 __Pyx_GOTREF(__pyx_tuple__3);
6032 __Pyx_GIVEREF(__pyx_tuple__3);
6033
6034 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":145
6035 * remaining_frames = stop - dcd.setsread
6036 * if (rc < 0):
6037 * raise IOError("Error reading frame from DCD file") # <<<<<<<<<<<<<<
6038 * # Copy into data array based on format
6039 * copyseries(i, <char*>data.data, data.strides, tempX, tempY, tempZ, fmtstr, numdata, <int*>atomlist.data, <int*>atomcountslist.data, lowerb, <double*>auxlist.data);
6040 */
6041 __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Error_reading_frame_from_DCD_fil); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 145, __pyx_L1_error)
6042 __Pyx_GOTREF(__pyx_tuple__4);
6043 __Pyx_GIVEREF(__pyx_tuple__4);
6044
6045 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":169
6046 * n_atoms = len(atoms)
6047 * if n_atoms==0:
6048 * raise Exception("No atoms passed into __read_timeseries function") # <<<<<<<<<<<<<<
6049 * atomlist = np.array(atoms)
6050 * cdef int lowerb, upperb, range
6051 */
6052 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_No_atoms_passed_into___read_time); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 169, __pyx_L1_error)
6053 __Pyx_GOTREF(__pyx_tuple__5);
6054 __Pyx_GIVEREF(__pyx_tuple__5);
6055
6056 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":196
6057 * rc = skip_dcdstep(dcd.fd, dcd.natoms, dcd.nfixed, dcd.charmm, numskip)
6058 * if (rc < 0):
6059 * raise IOError("Error skipping frame from DCD file") # <<<<<<<<<<<<<<
6060 * dcd.setsread = dcd.setsread + numskip
6061 * rc = read_dcdsubset(dcd.fd, dcd.natoms, lowerb, upperb, tempX, tempY, tempZ, unitcell, dcd.nfixed, dcd.first, dcd.freeind, dcd.fixedcoords, dcd.reverse, dcd.charmm)
6062 */
6063 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_Error_skipping_frame_from_DCD_fi); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 196, __pyx_L1_error)
6064 __Pyx_GOTREF(__pyx_tuple__6);
6065 __Pyx_GIVEREF(__pyx_tuple__6);
6066
6067 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":202
6068 * dcd.setsread = dcd.setsread + 1
6069 * if (rc < 0):
6070 * raise IOError("Error reading frame from DCD file") # <<<<<<<<<<<<<<
6071 * # Copy into numeric array
6072 * for j from 0 <= j < n_atoms:
6073 */
6074 __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Error_reading_frame_from_DCD_fil); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 202, __pyx_L1_error)
6075 __Pyx_GOTREF(__pyx_tuple__7);
6076 __Pyx_GIVEREF(__pyx_tuple__7);
6077
6078 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218
6079 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
6080 * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
6081 * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
6082 *
6083 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
6084 */
6085 __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 218, __pyx_L1_error)
6086 __Pyx_GOTREF(__pyx_tuple__8);
6087 __Pyx_GIVEREF(__pyx_tuple__8);
6088
6089 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222
6090 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
6091 * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
6092 * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
6093 *
6094 * info.buf = PyArray_DATA(self)
6095 */
6096 __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 222, __pyx_L1_error)
6097 __Pyx_GOTREF(__pyx_tuple__9);
6098 __Pyx_GIVEREF(__pyx_tuple__9);
6099
6100 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259
6101 * if ((descr.byteorder == c'>' and little_endian) or
6102 * (descr.byteorder == c'<' and not little_endian)):
6103 * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
6104 * if t == NPY_BYTE: f = "b"
6105 * elif t == NPY_UBYTE: f = "B"
6106 */
6107 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 259, __pyx_L1_error)
6108 __Pyx_GOTREF(__pyx_tuple__10);
6109 __Pyx_GIVEREF(__pyx_tuple__10);
6110
6111 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799
6112 *
6113 * if (end - f) - <int>(new_offset - offset[0]) < 15:
6114 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
6115 *
6116 * if ((child.byteorder == c'>' and little_endian) or
6117 */
6118 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 799, __pyx_L1_error)
6119 __Pyx_GOTREF(__pyx_tuple__11);
6120 __Pyx_GIVEREF(__pyx_tuple__11);
6121
6122 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803
6123 * if ((child.byteorder == c'>' and little_endian) or
6124 * (child.byteorder == c'<' and not little_endian)):
6125 * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
6126 * # One could encode it in the format string and have Cython
6127 * # complain instead, BUT: < and > in format strings also imply
6128 */
6129 __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 803, __pyx_L1_error)
6130 __Pyx_GOTREF(__pyx_tuple__12);
6131 __Pyx_GIVEREF(__pyx_tuple__12);
6132
6133 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823
6134 * t = child.type_num
6135 * if end - f < 5:
6136 * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
6137 *
6138 * # Until ticket #99 is fixed, use integers to avoid warnings
6139 */
6140 __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 823, __pyx_L1_error)
6141 __Pyx_GOTREF(__pyx_tuple__13);
6142 __Pyx_GIVEREF(__pyx_tuple__13);
6143
6144 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":989
6145 * _import_array()
6146 * except Exception:
6147 * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
6148 *
6149 * cdef inline int import_umath() except -1:
6150 */
6151 __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 989, __pyx_L1_error)
6152 __Pyx_GOTREF(__pyx_tuple__14);
6153 __Pyx_GIVEREF(__pyx_tuple__14);
6154
6155 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":995
6156 * _import_umath()
6157 * except Exception:
6158 * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
6159 *
6160 * cdef inline int import_ufunc() except -1:
6161 */
6162 __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 995, __pyx_L1_error)
6163 __Pyx_GOTREF(__pyx_tuple__15);
6164 __Pyx_GIVEREF(__pyx_tuple__15);
6165
6166 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1001
6167 * _import_umath()
6168 * except Exception:
6169 * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
6170 */
6171 __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 1001, __pyx_L1_error)
6172 __Pyx_GOTREF(__pyx_tuple__16);
6173 __Pyx_GIVEREF(__pyx_tuple__16);
6174
6175 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":68
6176 * import numpy as np
6177 *
6178 * def __read_timecorrel(object self, object atoms, object atomcounts, object format, object auxdata, int sizedata, int lowerb, int upperb, int start, int stop, int step): # <<<<<<<<<<<<<<
6179 * cdef dcdhandle* dcd
6180 * cdef numpy.ndarray atomlist, atomcountslist, auxlist
6181 */
6182 __pyx_tuple__17 = PyTuple_Pack(31, __pyx_n_s_self, __pyx_n_s_atoms, __pyx_n_s_atomcounts, __pyx_n_s_format, __pyx_n_s_auxdata, __pyx_n_s_sizedata, __pyx_n_s_lowerb, __pyx_n_s_upperb, __pyx_n_s_start, __pyx_n_s_stop, __pyx_n_s_step, __pyx_n_s_dcd, __pyx_n_s_atomlist, __pyx_n_s_atomcountslist, __pyx_n_s_auxlist, __pyx_n_s_data, __pyx_n_s_temp, __pyx_n_s_tempX, __pyx_n_s_tempY, __pyx_n_s_tempZ, __pyx_n_s_rc, __pyx_n_s_fmtstr, __pyx_n_s_n_frames, __pyx_n_s_numdata, __pyx_n_s_range, __pyx_n_s_index, __pyx_n_s_numskip, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_unitcell, __pyx_n_s_remaining_frames); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 68, __pyx_L1_error)
6183 __Pyx_GOTREF(__pyx_tuple__17);
6184 __Pyx_GIVEREF(__pyx_tuple__17);
6185 __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(11, 0, 31, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_richard_code_mdanalysis_pa, __pyx_n_s_read_timecorrel, 68, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 68, __pyx_L1_error)
6186
6187 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":156
6188 * return data
6189 *
6190 * def __read_timeseries(object self, object atoms, int skip): # <<<<<<<<<<<<<<
6191 * cdef dcdhandle* dcd
6192 * cdef numpy.ndarray atomlist
6193 */
6194 __pyx_tuple__19 = PyTuple_Pack(21, __pyx_n_s_self, __pyx_n_s_atoms, __pyx_n_s_skip, __pyx_n_s_dcd, __pyx_n_s_atomlist, __pyx_n_s_coord, __pyx_n_s_temp, __pyx_n_s_tempX, __pyx_n_s_tempY, __pyx_n_s_tempZ, __pyx_n_s_rc, __pyx_n_s_n_frames, __pyx_n_s_n_atoms, __pyx_n_s_lowerb, __pyx_n_s_upperb, __pyx_n_s_range, __pyx_n_s_index, __pyx_n_s_numskip, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_unitcell); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 156, __pyx_L1_error)
6195 __Pyx_GOTREF(__pyx_tuple__19);
6196 __Pyx_GIVEREF(__pyx_tuple__19);
6197 __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(3, 0, 21, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_richard_code_mdanalysis_pa, __pyx_n_s_read_timeseries, 156, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 156, __pyx_L1_error)
6198 __Pyx_RefNannyFinishContext();
6199 return 0;
6200 __pyx_L1_error:;
6201 __Pyx_RefNannyFinishContext();
6202 return -1;
6203 }
6204
__Pyx_InitGlobals(void)6205 static int __Pyx_InitGlobals(void) {
6206 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
6207 __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
6208 return 0;
6209 __pyx_L1_error:;
6210 return -1;
6211 }
6212
6213 #if PY_MAJOR_VERSION < 3
6214 PyMODINIT_FUNC initdcdtimeseries(void); /*proto*/
initdcdtimeseries(void)6215 PyMODINIT_FUNC initdcdtimeseries(void)
6216 #else
6217 PyMODINIT_FUNC PyInit_dcdtimeseries(void); /*proto*/
6218 PyMODINIT_FUNC PyInit_dcdtimeseries(void)
6219 #endif
6220 {
6221 PyObject *__pyx_t_1 = NULL;
6222 __Pyx_RefNannyDeclarations
6223 #if CYTHON_REFNANNY
6224 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
6225 if (!__Pyx_RefNanny) {
6226 PyErr_Clear();
6227 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
6228 if (!__Pyx_RefNanny)
6229 Py_FatalError("failed to import 'refnanny' module");
6230 }
6231 #endif
6232 __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_dcdtimeseries(void)", 0);
6233 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6234 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
6235 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
6236 __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
6237 #ifdef __Pyx_CyFunction_USED
6238 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6239 #endif
6240 #ifdef __Pyx_FusedFunction_USED
6241 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6242 #endif
6243 #ifdef __Pyx_Coroutine_USED
6244 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6245 #endif
6246 #ifdef __Pyx_Generator_USED
6247 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6248 #endif
6249 #ifdef __Pyx_StopAsyncIteration_USED
6250 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6251 #endif
6252 /*--- Library function declarations ---*/
6253 /*--- Threads initialization code ---*/
6254 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
6255 #ifdef WITH_THREAD /* Python build with threading support? */
6256 PyEval_InitThreads();
6257 #endif
6258 #endif
6259 /*--- Module creation code ---*/
6260 #if PY_MAJOR_VERSION < 3
6261 __pyx_m = Py_InitModule4("dcdtimeseries", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
6262 #else
6263 __pyx_m = PyModule_Create(&__pyx_moduledef);
6264 #endif
6265 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
6266 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
6267 Py_INCREF(__pyx_d);
6268 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
6269 #if CYTHON_COMPILING_IN_PYPY
6270 Py_INCREF(__pyx_b);
6271 #endif
6272 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
6273 /*--- Initialize various global constants etc. ---*/
6274 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6275 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
6276 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6277 #endif
6278 if (__pyx_module_is_main_MDAnalysis__coordinates__dcdtimeseries) {
6279 if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6280 }
6281 #if PY_MAJOR_VERSION >= 3
6282 {
6283 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
6284 if (!PyDict_GetItemString(modules, "MDAnalysis.coordinates.dcdtimeseries")) {
6285 if (unlikely(PyDict_SetItemString(modules, "MDAnalysis.coordinates.dcdtimeseries", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
6286 }
6287 }
6288 #endif
6289 /*--- Builtin init code ---*/
6290 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6291 /*--- Constants init code ---*/
6292 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6293 /*--- Global init code ---*/
6294 /*--- Variable export code ---*/
6295 /*--- Function export code ---*/
6296 /*--- Type init code ---*/
6297 /*--- Type import code ---*/
6298 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type",
6299 #if CYTHON_COMPILING_IN_PYPY
6300 sizeof(PyTypeObject),
6301 #else
6302 sizeof(PyHeapTypeObject),
6303 #endif
6304 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(2, 9, __pyx_L1_error)
6305 __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(1, 155, __pyx_L1_error)
6306 __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(1, 168, __pyx_L1_error)
6307 __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(1, 172, __pyx_L1_error)
6308 __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(1, 181, __pyx_L1_error)
6309 __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 861, __pyx_L1_error)
6310 /*--- Variable import code ---*/
6311 /*--- Function import code ---*/
6312 /*--- Execution code ---*/
6313 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
6314 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6315 #endif
6316
6317 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":24
6318 * #
6319 *
6320 * import numpy # <<<<<<<<<<<<<<
6321 * cimport numpy
6322 *
6323 */
6324 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
6325 __Pyx_GOTREF(__pyx_t_1);
6326 if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
6327 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6328
6329 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":66
6330 * void copyseries(int frame, char *data, int *strides, float *tempX, float *tempY, float *tempZ, char* datacode, int numdata, int* atomlist, int* atomcounts, int lowerb, double *aux)
6331 *
6332 * import numpy as np # <<<<<<<<<<<<<<
6333 *
6334 * def __read_timecorrel(object self, object atoms, object atomcounts, object format, object auxdata, int sizedata, int lowerb, int upperb, int start, int stop, int step):
6335 */
6336 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error)
6337 __Pyx_GOTREF(__pyx_t_1);
6338 if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 66, __pyx_L1_error)
6339 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6340
6341 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":68
6342 * import numpy as np
6343 *
6344 * def __read_timecorrel(object self, object atoms, object atomcounts, object format, object auxdata, int sizedata, int lowerb, int upperb, int start, int stop, int step): # <<<<<<<<<<<<<<
6345 * cdef dcdhandle* dcd
6346 * cdef numpy.ndarray atomlist, atomcountslist, auxlist
6347 */
6348 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_11coordinates_13dcdtimeseries_1__read_timecorrel, NULL, __pyx_n_s_MDAnalysis_coordinates_dcdtimese); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error)
6349 __Pyx_GOTREF(__pyx_t_1);
6350 if (PyDict_SetItem(__pyx_d, __pyx_n_s_read_timecorrel, __pyx_t_1) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
6351 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6352
6353 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":156
6354 * return data
6355 *
6356 * def __read_timeseries(object self, object atoms, int skip): # <<<<<<<<<<<<<<
6357 * cdef dcdhandle* dcd
6358 * cdef numpy.ndarray atomlist
6359 */
6360 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_11coordinates_13dcdtimeseries_3__read_timeseries, NULL, __pyx_n_s_MDAnalysis_coordinates_dcdtimese); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error)
6361 __Pyx_GOTREF(__pyx_t_1);
6362 if (PyDict_SetItem(__pyx_d, __pyx_n_s_read_timeseries, __pyx_t_1) < 0) __PYX_ERR(0, 156, __pyx_L1_error)
6363 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6364
6365 /* "MDAnalysis/coordinates/dcdtimeseries.pyx":1
6366 * # -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; -*- # <<<<<<<<<<<<<<
6367 * # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
6368 * #
6369 */
6370 __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
6371 __Pyx_GOTREF(__pyx_t_1);
6372 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6373 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6374
6375 /* "../../../miniconda2/envs/mdadev/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":997
6376 * raise ImportError("numpy.core.umath failed to import")
6377 *
6378 * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
6379 * try:
6380 * _import_umath()
6381 */
6382
6383 /*--- Wrapped vars code ---*/
6384
6385 goto __pyx_L0;
6386 __pyx_L1_error:;
6387 __Pyx_XDECREF(__pyx_t_1);
6388 if (__pyx_m) {
6389 if (__pyx_d) {
6390 __Pyx_AddTraceback("init MDAnalysis.coordinates.dcdtimeseries", __pyx_clineno, __pyx_lineno, __pyx_filename);
6391 }
6392 Py_DECREF(__pyx_m); __pyx_m = 0;
6393 } else if (!PyErr_Occurred()) {
6394 PyErr_SetString(PyExc_ImportError, "init MDAnalysis.coordinates.dcdtimeseries");
6395 }
6396 __pyx_L0:;
6397 __Pyx_RefNannyFinishContext();
6398 #if PY_MAJOR_VERSION < 3
6399 return;
6400 #else
6401 return __pyx_m;
6402 #endif
6403 }
6404
6405 /* --- Runtime support code --- */
6406 /* Refnanny */
6407 #if CYTHON_REFNANNY
__Pyx_RefNannyImportAPI(const char * modname)6408 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
6409 PyObject *m = NULL, *p = NULL;
6410 void *r = NULL;
6411 m = PyImport_ImportModule((char *)modname);
6412 if (!m) goto end;
6413 p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
6414 if (!p) goto end;
6415 r = PyLong_AsVoidPtr(p);
6416 end:
6417 Py_XDECREF(p);
6418 Py_XDECREF(m);
6419 return (__Pyx_RefNannyAPIStruct *)r;
6420 }
6421 #endif
6422
6423 /* GetBuiltinName */
__Pyx_GetBuiltinName(PyObject * name)6424 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
6425 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
6426 if (unlikely(!result)) {
6427 PyErr_Format(PyExc_NameError,
6428 #if PY_MAJOR_VERSION >= 3
6429 "name '%U' is not defined", name);
6430 #else
6431 "name '%.200s' is not defined", PyString_AS_STRING(name));
6432 #endif
6433 }
6434 return result;
6435 }
6436
6437 /* RaiseArgTupleInvalid */
__Pyx_RaiseArgtupleInvalid(const char * func_name,int exact,Py_ssize_t num_min,Py_ssize_t num_max,Py_ssize_t num_found)6438 static void __Pyx_RaiseArgtupleInvalid(
6439 const char* func_name,
6440 int exact,
6441 Py_ssize_t num_min,
6442 Py_ssize_t num_max,
6443 Py_ssize_t num_found)
6444 {
6445 Py_ssize_t num_expected;
6446 const char *more_or_less;
6447 if (num_found < num_min) {
6448 num_expected = num_min;
6449 more_or_less = "at least";
6450 } else {
6451 num_expected = num_max;
6452 more_or_less = "at most";
6453 }
6454 if (exact) {
6455 more_or_less = "exactly";
6456 }
6457 PyErr_Format(PyExc_TypeError,
6458 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
6459 func_name, more_or_less, num_expected,
6460 (num_expected == 1) ? "" : "s", num_found);
6461 }
6462
6463 /* RaiseDoubleKeywords */
__Pyx_RaiseDoubleKeywordsError(const char * func_name,PyObject * kw_name)6464 static void __Pyx_RaiseDoubleKeywordsError(
6465 const char* func_name,
6466 PyObject* kw_name)
6467 {
6468 PyErr_Format(PyExc_TypeError,
6469 #if PY_MAJOR_VERSION >= 3
6470 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
6471 #else
6472 "%s() got multiple values for keyword argument '%s'", func_name,
6473 PyString_AsString(kw_name));
6474 #endif
6475 }
6476
6477 /* ParseKeywords */
__Pyx_ParseOptionalKeywords(PyObject * kwds,PyObject ** argnames[],PyObject * kwds2,PyObject * values[],Py_ssize_t num_pos_args,const char * function_name)6478 static int __Pyx_ParseOptionalKeywords(
6479 PyObject *kwds,
6480 PyObject **argnames[],
6481 PyObject *kwds2,
6482 PyObject *values[],
6483 Py_ssize_t num_pos_args,
6484 const char* function_name)
6485 {
6486 PyObject *key = 0, *value = 0;
6487 Py_ssize_t pos = 0;
6488 PyObject*** name;
6489 PyObject*** first_kw_arg = argnames + num_pos_args;
6490 while (PyDict_Next(kwds, &pos, &key, &value)) {
6491 name = first_kw_arg;
6492 while (*name && (**name != key)) name++;
6493 if (*name) {
6494 values[name-argnames] = value;
6495 continue;
6496 }
6497 name = first_kw_arg;
6498 #if PY_MAJOR_VERSION < 3
6499 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
6500 while (*name) {
6501 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
6502 && _PyString_Eq(**name, key)) {
6503 values[name-argnames] = value;
6504 break;
6505 }
6506 name++;
6507 }
6508 if (*name) continue;
6509 else {
6510 PyObject*** argname = argnames;
6511 while (argname != first_kw_arg) {
6512 if ((**argname == key) || (
6513 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
6514 && _PyString_Eq(**argname, key))) {
6515 goto arg_passed_twice;
6516 }
6517 argname++;
6518 }
6519 }
6520 } else
6521 #endif
6522 if (likely(PyUnicode_Check(key))) {
6523 while (*name) {
6524 int cmp = (**name == key) ? 0 :
6525 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
6526 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
6527 #endif
6528 PyUnicode_Compare(**name, key);
6529 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
6530 if (cmp == 0) {
6531 values[name-argnames] = value;
6532 break;
6533 }
6534 name++;
6535 }
6536 if (*name) continue;
6537 else {
6538 PyObject*** argname = argnames;
6539 while (argname != first_kw_arg) {
6540 int cmp = (**argname == key) ? 0 :
6541 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
6542 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
6543 #endif
6544 PyUnicode_Compare(**argname, key);
6545 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
6546 if (cmp == 0) goto arg_passed_twice;
6547 argname++;
6548 }
6549 }
6550 } else
6551 goto invalid_keyword_type;
6552 if (kwds2) {
6553 if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
6554 } else {
6555 goto invalid_keyword;
6556 }
6557 }
6558 return 0;
6559 arg_passed_twice:
6560 __Pyx_RaiseDoubleKeywordsError(function_name, key);
6561 goto bad;
6562 invalid_keyword_type:
6563 PyErr_Format(PyExc_TypeError,
6564 "%.200s() keywords must be strings", function_name);
6565 goto bad;
6566 invalid_keyword:
6567 PyErr_Format(PyExc_TypeError,
6568 #if PY_MAJOR_VERSION < 3
6569 "%.200s() got an unexpected keyword argument '%.200s'",
6570 function_name, PyString_AsString(key));
6571 #else
6572 "%s() got an unexpected keyword argument '%U'",
6573 function_name, key);
6574 #endif
6575 bad:
6576 return -1;
6577 }
6578
6579 /* None */
__Pyx_div_int(int a,int b)6580 static CYTHON_INLINE int __Pyx_div_int(int a, int b) {
6581 int q = a / b;
6582 int r = a - q*b;
6583 q -= ((r != 0) & ((r ^ b) < 0));
6584 return q;
6585 }
6586
6587 /* None */
__Pyx_mod_int(int a,int b)6588 static CYTHON_INLINE int __Pyx_mod_int(int a, int b) {
6589 int r = a % b;
6590 r += ((r != 0) & ((r ^ b) < 0)) * b;
6591 return r;
6592 }
6593
6594 /* PyObjectCall */
6595 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_Call(PyObject * func,PyObject * arg,PyObject * kw)6596 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
6597 PyObject *result;
6598 ternaryfunc call = func->ob_type->tp_call;
6599 if (unlikely(!call))
6600 return PyObject_Call(func, arg, kw);
6601 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
6602 return NULL;
6603 result = (*call)(func, arg, kw);
6604 Py_LeaveRecursiveCall();
6605 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
6606 PyErr_SetString(
6607 PyExc_SystemError,
6608 "NULL result without error in PyObject_Call");
6609 }
6610 return result;
6611 }
6612 #endif
6613
6614 /* PyErrFetchRestore */
6615 #if CYTHON_FAST_THREAD_STATE
__Pyx_ErrRestoreInState(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)6616 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
6617 PyObject *tmp_type, *tmp_value, *tmp_tb;
6618 tmp_type = tstate->curexc_type;
6619 tmp_value = tstate->curexc_value;
6620 tmp_tb = tstate->curexc_traceback;
6621 tstate->curexc_type = type;
6622 tstate->curexc_value = value;
6623 tstate->curexc_traceback = tb;
6624 Py_XDECREF(tmp_type);
6625 Py_XDECREF(tmp_value);
6626 Py_XDECREF(tmp_tb);
6627 }
__Pyx_ErrFetchInState(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)6628 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
6629 *type = tstate->curexc_type;
6630 *value = tstate->curexc_value;
6631 *tb = tstate->curexc_traceback;
6632 tstate->curexc_type = 0;
6633 tstate->curexc_value = 0;
6634 tstate->curexc_traceback = 0;
6635 }
6636 #endif
6637
6638 /* RaiseException */
6639 #if PY_MAJOR_VERSION < 3
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,CYTHON_UNUSED PyObject * cause)6640 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
6641 CYTHON_UNUSED PyObject *cause) {
6642 __Pyx_PyThreadState_declare
6643 Py_XINCREF(type);
6644 if (!value || value == Py_None)
6645 value = NULL;
6646 else
6647 Py_INCREF(value);
6648 if (!tb || tb == Py_None)
6649 tb = NULL;
6650 else {
6651 Py_INCREF(tb);
6652 if (!PyTraceBack_Check(tb)) {
6653 PyErr_SetString(PyExc_TypeError,
6654 "raise: arg 3 must be a traceback or None");
6655 goto raise_error;
6656 }
6657 }
6658 if (PyType_Check(type)) {
6659 #if CYTHON_COMPILING_IN_PYPY
6660 if (!value) {
6661 Py_INCREF(Py_None);
6662 value = Py_None;
6663 }
6664 #endif
6665 PyErr_NormalizeException(&type, &value, &tb);
6666 } else {
6667 if (value) {
6668 PyErr_SetString(PyExc_TypeError,
6669 "instance exception may not have a separate value");
6670 goto raise_error;
6671 }
6672 value = type;
6673 type = (PyObject*) Py_TYPE(type);
6674 Py_INCREF(type);
6675 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
6676 PyErr_SetString(PyExc_TypeError,
6677 "raise: exception class must be a subclass of BaseException");
6678 goto raise_error;
6679 }
6680 }
6681 __Pyx_PyThreadState_assign
6682 __Pyx_ErrRestore(type, value, tb);
6683 return;
6684 raise_error:
6685 Py_XDECREF(value);
6686 Py_XDECREF(type);
6687 Py_XDECREF(tb);
6688 return;
6689 }
6690 #else
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,PyObject * cause)6691 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
6692 PyObject* owned_instance = NULL;
6693 if (tb == Py_None) {
6694 tb = 0;
6695 } else if (tb && !PyTraceBack_Check(tb)) {
6696 PyErr_SetString(PyExc_TypeError,
6697 "raise: arg 3 must be a traceback or None");
6698 goto bad;
6699 }
6700 if (value == Py_None)
6701 value = 0;
6702 if (PyExceptionInstance_Check(type)) {
6703 if (value) {
6704 PyErr_SetString(PyExc_TypeError,
6705 "instance exception may not have a separate value");
6706 goto bad;
6707 }
6708 value = type;
6709 type = (PyObject*) Py_TYPE(value);
6710 } else if (PyExceptionClass_Check(type)) {
6711 PyObject *instance_class = NULL;
6712 if (value && PyExceptionInstance_Check(value)) {
6713 instance_class = (PyObject*) Py_TYPE(value);
6714 if (instance_class != type) {
6715 int is_subclass = PyObject_IsSubclass(instance_class, type);
6716 if (!is_subclass) {
6717 instance_class = NULL;
6718 } else if (unlikely(is_subclass == -1)) {
6719 goto bad;
6720 } else {
6721 type = instance_class;
6722 }
6723 }
6724 }
6725 if (!instance_class) {
6726 PyObject *args;
6727 if (!value)
6728 args = PyTuple_New(0);
6729 else if (PyTuple_Check(value)) {
6730 Py_INCREF(value);
6731 args = value;
6732 } else
6733 args = PyTuple_Pack(1, value);
6734 if (!args)
6735 goto bad;
6736 owned_instance = PyObject_Call(type, args, NULL);
6737 Py_DECREF(args);
6738 if (!owned_instance)
6739 goto bad;
6740 value = owned_instance;
6741 if (!PyExceptionInstance_Check(value)) {
6742 PyErr_Format(PyExc_TypeError,
6743 "calling %R should have returned an instance of "
6744 "BaseException, not %R",
6745 type, Py_TYPE(value));
6746 goto bad;
6747 }
6748 }
6749 } else {
6750 PyErr_SetString(PyExc_TypeError,
6751 "raise: exception class must be a subclass of BaseException");
6752 goto bad;
6753 }
6754 #if PY_VERSION_HEX >= 0x03030000
6755 if (cause) {
6756 #else
6757 if (cause && cause != Py_None) {
6758 #endif
6759 PyObject *fixed_cause;
6760 if (cause == Py_None) {
6761 fixed_cause = NULL;
6762 } else if (PyExceptionClass_Check(cause)) {
6763 fixed_cause = PyObject_CallObject(cause, NULL);
6764 if (fixed_cause == NULL)
6765 goto bad;
6766 } else if (PyExceptionInstance_Check(cause)) {
6767 fixed_cause = cause;
6768 Py_INCREF(fixed_cause);
6769 } else {
6770 PyErr_SetString(PyExc_TypeError,
6771 "exception causes must derive from "
6772 "BaseException");
6773 goto bad;
6774 }
6775 PyException_SetCause(value, fixed_cause);
6776 }
6777 PyErr_SetObject(type, value);
6778 if (tb) {
6779 #if CYTHON_COMPILING_IN_PYPY
6780 PyObject *tmp_type, *tmp_value, *tmp_tb;
6781 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
6782 Py_INCREF(tb);
6783 PyErr_Restore(tmp_type, tmp_value, tb);
6784 Py_XDECREF(tmp_tb);
6785 #else
6786 PyThreadState *tstate = PyThreadState_GET();
6787 PyObject* tmp_tb = tstate->curexc_traceback;
6788 if (tb != tmp_tb) {
6789 Py_INCREF(tb);
6790 tstate->curexc_traceback = tb;
6791 Py_XDECREF(tmp_tb);
6792 }
6793 #endif
6794 }
6795 bad:
6796 Py_XDECREF(owned_instance);
6797 return;
6798 }
6799 #endif
6800
6801 /* GetModuleGlobalName */
6802 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
6803 PyObject *result;
6804 #if !CYTHON_AVOID_BORROWED_REFS
6805 result = PyDict_GetItem(__pyx_d, name);
6806 if (likely(result)) {
6807 Py_INCREF(result);
6808 } else {
6809 #else
6810 result = PyObject_GetItem(__pyx_d, name);
6811 if (!result) {
6812 PyErr_Clear();
6813 #endif
6814 result = __Pyx_GetBuiltinName(name);
6815 }
6816 return result;
6817 }
6818
6819 /* PyFunctionFastCall */
6820 #if CYTHON_FAST_PYCALL
6821 #include "frameobject.h"
6822 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
6823 PyObject *globals) {
6824 PyFrameObject *f;
6825 PyThreadState *tstate = PyThreadState_GET();
6826 PyObject **fastlocals;
6827 Py_ssize_t i;
6828 PyObject *result;
6829 assert(globals != NULL);
6830 /* XXX Perhaps we should create a specialized
6831 PyFrame_New() that doesn't take locals, but does
6832 take builtins without sanity checking them.
6833 */
6834 assert(tstate != NULL);
6835 f = PyFrame_New(tstate, co, globals, NULL);
6836 if (f == NULL) {
6837 return NULL;
6838 }
6839 fastlocals = f->f_localsplus;
6840 for (i = 0; i < na; i++) {
6841 Py_INCREF(*args);
6842 fastlocals[i] = *args++;
6843 }
6844 result = PyEval_EvalFrameEx(f,0);
6845 ++tstate->recursion_depth;
6846 Py_DECREF(f);
6847 --tstate->recursion_depth;
6848 return result;
6849 }
6850 #if 1 || PY_VERSION_HEX < 0x030600B1
6851 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
6852 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
6853 PyObject *globals = PyFunction_GET_GLOBALS(func);
6854 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
6855 PyObject *closure;
6856 #if PY_MAJOR_VERSION >= 3
6857 PyObject *kwdefs;
6858 #endif
6859 PyObject *kwtuple, **k;
6860 PyObject **d;
6861 Py_ssize_t nd;
6862 Py_ssize_t nk;
6863 PyObject *result;
6864 assert(kwargs == NULL || PyDict_Check(kwargs));
6865 nk = kwargs ? PyDict_Size(kwargs) : 0;
6866 if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
6867 return NULL;
6868 }
6869 if (
6870 #if PY_MAJOR_VERSION >= 3
6871 co->co_kwonlyargcount == 0 &&
6872 #endif
6873 likely(kwargs == NULL || nk == 0) &&
6874 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
6875 if (argdefs == NULL && co->co_argcount == nargs) {
6876 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
6877 goto done;
6878 }
6879 else if (nargs == 0 && argdefs != NULL
6880 && co->co_argcount == Py_SIZE(argdefs)) {
6881 /* function called with no arguments, but all parameters have
6882 a default value: use default values as arguments .*/
6883 args = &PyTuple_GET_ITEM(argdefs, 0);
6884 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
6885 goto done;
6886 }
6887 }
6888 if (kwargs != NULL) {
6889 Py_ssize_t pos, i;
6890 kwtuple = PyTuple_New(2 * nk);
6891 if (kwtuple == NULL) {
6892 result = NULL;
6893 goto done;
6894 }
6895 k = &PyTuple_GET_ITEM(kwtuple, 0);
6896 pos = i = 0;
6897 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
6898 Py_INCREF(k[i]);
6899 Py_INCREF(k[i+1]);
6900 i += 2;
6901 }
6902 nk = i / 2;
6903 }
6904 else {
6905 kwtuple = NULL;
6906 k = NULL;
6907 }
6908 closure = PyFunction_GET_CLOSURE(func);
6909 #if PY_MAJOR_VERSION >= 3
6910 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
6911 #endif
6912 if (argdefs != NULL) {
6913 d = &PyTuple_GET_ITEM(argdefs, 0);
6914 nd = Py_SIZE(argdefs);
6915 }
6916 else {
6917 d = NULL;
6918 nd = 0;
6919 }
6920 #if PY_MAJOR_VERSION >= 3
6921 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
6922 args, nargs,
6923 k, (int)nk,
6924 d, (int)nd, kwdefs, closure);
6925 #else
6926 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
6927 args, nargs,
6928 k, (int)nk,
6929 d, (int)nd, closure);
6930 #endif
6931 Py_XDECREF(kwtuple);
6932 done:
6933 Py_LeaveRecursiveCall();
6934 return result;
6935 }
6936 #endif // CPython < 3.6
6937 #endif // CYTHON_FAST_PYCALL
6938
6939 /* PyCFunctionFastCall */
6940 #if CYTHON_FAST_PYCCALL
6941 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
6942 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
6943 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
6944 PyObject *self = PyCFunction_GET_SELF(func);
6945 assert(PyCFunction_Check(func));
6946 assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
6947 assert(nargs >= 0);
6948 assert(nargs == 0 || args != NULL);
6949 /* _PyCFunction_FastCallDict() must not be called with an exception set,
6950 because it may clear it (directly or indirectly) and so the
6951 caller loses its exception */
6952 assert(!PyErr_Occurred());
6953 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
6954 }
6955 #endif // CYTHON_FAST_PYCCALL
6956
6957 /* ExtTypeTest */
6958 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
6959 if (unlikely(!type)) {
6960 PyErr_SetString(PyExc_SystemError, "Missing type object");
6961 return 0;
6962 }
6963 if (likely(PyObject_TypeCheck(obj, type)))
6964 return 1;
6965 PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
6966 Py_TYPE(obj)->tp_name, type->tp_name);
6967 return 0;
6968 }
6969
6970 /* PyObjectCallMethO */
6971 #if CYTHON_COMPILING_IN_CPYTHON
6972 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
6973 PyObject *self, *result;
6974 PyCFunction cfunc;
6975 cfunc = PyCFunction_GET_FUNCTION(func);
6976 self = PyCFunction_GET_SELF(func);
6977 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
6978 return NULL;
6979 result = cfunc(self, arg);
6980 Py_LeaveRecursiveCall();
6981 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
6982 PyErr_SetString(
6983 PyExc_SystemError,
6984 "NULL result without error in PyObject_Call");
6985 }
6986 return result;
6987 }
6988 #endif
6989
6990 /* PyObjectCallOneArg */
6991 #if CYTHON_COMPILING_IN_CPYTHON
6992 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
6993 PyObject *result;
6994 PyObject *args = PyTuple_New(1);
6995 if (unlikely(!args)) return NULL;
6996 Py_INCREF(arg);
6997 PyTuple_SET_ITEM(args, 0, arg);
6998 result = __Pyx_PyObject_Call(func, args, NULL);
6999 Py_DECREF(args);
7000 return result;
7001 }
7002 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
7003 #if CYTHON_FAST_PYCALL
7004 if (PyFunction_Check(func)) {
7005 return __Pyx_PyFunction_FastCall(func, &arg, 1);
7006 }
7007 #endif
7008 #ifdef __Pyx_CyFunction_USED
7009 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
7010 #else
7011 if (likely(PyCFunction_Check(func))) {
7012 #endif
7013 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
7014 return __Pyx_PyObject_CallMethO(func, arg);
7015 #if CYTHON_FAST_PYCCALL
7016 } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
7017 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
7018 #endif
7019 }
7020 }
7021 return __Pyx__PyObject_CallOneArg(func, arg);
7022 }
7023 #else
7024 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
7025 PyObject *result;
7026 PyObject *args = PyTuple_Pack(1, arg);
7027 if (unlikely(!args)) return NULL;
7028 result = __Pyx_PyObject_Call(func, args, NULL);
7029 Py_DECREF(args);
7030 return result;
7031 }
7032 #endif
7033
7034 /* GetItemInt */
7035 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
7036 PyObject *r;
7037 if (!j) return NULL;
7038 r = PyObject_GetItem(o, j);
7039 Py_DECREF(j);
7040 return r;
7041 }
7042 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
7043 CYTHON_NCP_UNUSED int wraparound,
7044 CYTHON_NCP_UNUSED int boundscheck) {
7045 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7046 if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
7047 if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
7048 PyObject *r = PyList_GET_ITEM(o, i);
7049 Py_INCREF(r);
7050 return r;
7051 }
7052 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
7053 #else
7054 return PySequence_GetItem(o, i);
7055 #endif
7056 }
7057 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
7058 CYTHON_NCP_UNUSED int wraparound,
7059 CYTHON_NCP_UNUSED int boundscheck) {
7060 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7061 if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
7062 if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
7063 PyObject *r = PyTuple_GET_ITEM(o, i);
7064 Py_INCREF(r);
7065 return r;
7066 }
7067 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
7068 #else
7069 return PySequence_GetItem(o, i);
7070 #endif
7071 }
7072 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
7073 CYTHON_NCP_UNUSED int wraparound,
7074 CYTHON_NCP_UNUSED int boundscheck) {
7075 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
7076 if (is_list || PyList_CheckExact(o)) {
7077 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
7078 if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
7079 PyObject *r = PyList_GET_ITEM(o, n);
7080 Py_INCREF(r);
7081 return r;
7082 }
7083 }
7084 else if (PyTuple_CheckExact(o)) {
7085 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
7086 if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
7087 PyObject *r = PyTuple_GET_ITEM(o, n);
7088 Py_INCREF(r);
7089 return r;
7090 }
7091 } else {
7092 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
7093 if (likely(m && m->sq_item)) {
7094 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
7095 Py_ssize_t l = m->sq_length(o);
7096 if (likely(l >= 0)) {
7097 i += l;
7098 } else {
7099 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
7100 return NULL;
7101 PyErr_Clear();
7102 }
7103 }
7104 return m->sq_item(o, i);
7105 }
7106 }
7107 #else
7108 if (is_list || PySequence_Check(o)) {
7109 return PySequence_GetItem(o, i);
7110 }
7111 #endif
7112 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
7113 }
7114
7115 /* RaiseTooManyValuesToUnpack */
7116 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
7117 PyErr_Format(PyExc_ValueError,
7118 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
7119 }
7120
7121 /* RaiseNeedMoreValuesToUnpack */
7122 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
7123 PyErr_Format(PyExc_ValueError,
7124 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
7125 index, (index == 1) ? "" : "s");
7126 }
7127
7128 /* RaiseNoneIterError */
7129 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
7130 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
7131 }
7132
7133 /* SaveResetException */
7134 #if CYTHON_FAST_THREAD_STATE
7135 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
7136 *type = tstate->exc_type;
7137 *value = tstate->exc_value;
7138 *tb = tstate->exc_traceback;
7139 Py_XINCREF(*type);
7140 Py_XINCREF(*value);
7141 Py_XINCREF(*tb);
7142 }
7143 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
7144 PyObject *tmp_type, *tmp_value, *tmp_tb;
7145 tmp_type = tstate->exc_type;
7146 tmp_value = tstate->exc_value;
7147 tmp_tb = tstate->exc_traceback;
7148 tstate->exc_type = type;
7149 tstate->exc_value = value;
7150 tstate->exc_traceback = tb;
7151 Py_XDECREF(tmp_type);
7152 Py_XDECREF(tmp_value);
7153 Py_XDECREF(tmp_tb);
7154 }
7155 #endif
7156
7157 /* PyErrExceptionMatches */
7158 #if CYTHON_FAST_THREAD_STATE
7159 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
7160 PyObject *exc_type = tstate->curexc_type;
7161 if (exc_type == err) return 1;
7162 if (unlikely(!exc_type)) return 0;
7163 return PyErr_GivenExceptionMatches(exc_type, err);
7164 }
7165 #endif
7166
7167 /* GetException */
7168 #if CYTHON_FAST_THREAD_STATE
7169 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
7170 #else
7171 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
7172 #endif
7173 PyObject *local_type, *local_value, *local_tb;
7174 #if CYTHON_FAST_THREAD_STATE
7175 PyObject *tmp_type, *tmp_value, *tmp_tb;
7176 local_type = tstate->curexc_type;
7177 local_value = tstate->curexc_value;
7178 local_tb = tstate->curexc_traceback;
7179 tstate->curexc_type = 0;
7180 tstate->curexc_value = 0;
7181 tstate->curexc_traceback = 0;
7182 #else
7183 PyErr_Fetch(&local_type, &local_value, &local_tb);
7184 #endif
7185 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
7186 #if CYTHON_FAST_THREAD_STATE
7187 if (unlikely(tstate->curexc_type))
7188 #else
7189 if (unlikely(PyErr_Occurred()))
7190 #endif
7191 goto bad;
7192 #if PY_MAJOR_VERSION >= 3
7193 if (local_tb) {
7194 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
7195 goto bad;
7196 }
7197 #endif
7198 Py_XINCREF(local_tb);
7199 Py_XINCREF(local_type);
7200 Py_XINCREF(local_value);
7201 *type = local_type;
7202 *value = local_value;
7203 *tb = local_tb;
7204 #if CYTHON_FAST_THREAD_STATE
7205 tmp_type = tstate->exc_type;
7206 tmp_value = tstate->exc_value;
7207 tmp_tb = tstate->exc_traceback;
7208 tstate->exc_type = local_type;
7209 tstate->exc_value = local_value;
7210 tstate->exc_traceback = local_tb;
7211 Py_XDECREF(tmp_type);
7212 Py_XDECREF(tmp_value);
7213 Py_XDECREF(tmp_tb);
7214 #else
7215 PyErr_SetExcInfo(local_type, local_value, local_tb);
7216 #endif
7217 return 0;
7218 bad:
7219 *type = 0;
7220 *value = 0;
7221 *tb = 0;
7222 Py_XDECREF(local_type);
7223 Py_XDECREF(local_value);
7224 Py_XDECREF(local_tb);
7225 return -1;
7226 }
7227
7228 /* Import */
7229 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
7230 PyObject *empty_list = 0;
7231 PyObject *module = 0;
7232 PyObject *global_dict = 0;
7233 PyObject *empty_dict = 0;
7234 PyObject *list;
7235 #if PY_VERSION_HEX < 0x03030000
7236 PyObject *py_import;
7237 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
7238 if (!py_import)
7239 goto bad;
7240 #endif
7241 if (from_list)
7242 list = from_list;
7243 else {
7244 empty_list = PyList_New(0);
7245 if (!empty_list)
7246 goto bad;
7247 list = empty_list;
7248 }
7249 global_dict = PyModule_GetDict(__pyx_m);
7250 if (!global_dict)
7251 goto bad;
7252 empty_dict = PyDict_New();
7253 if (!empty_dict)
7254 goto bad;
7255 {
7256 #if PY_MAJOR_VERSION >= 3
7257 if (level == -1) {
7258 if (strchr(__Pyx_MODULE_NAME, '.')) {
7259 #if PY_VERSION_HEX < 0x03030000
7260 PyObject *py_level = PyInt_FromLong(1);
7261 if (!py_level)
7262 goto bad;
7263 module = PyObject_CallFunctionObjArgs(py_import,
7264 name, global_dict, empty_dict, list, py_level, NULL);
7265 Py_DECREF(py_level);
7266 #else
7267 module = PyImport_ImportModuleLevelObject(
7268 name, global_dict, empty_dict, list, 1);
7269 #endif
7270 if (!module) {
7271 if (!PyErr_ExceptionMatches(PyExc_ImportError))
7272 goto bad;
7273 PyErr_Clear();
7274 }
7275 }
7276 level = 0;
7277 }
7278 #endif
7279 if (!module) {
7280 #if PY_VERSION_HEX < 0x03030000
7281 PyObject *py_level = PyInt_FromLong(level);
7282 if (!py_level)
7283 goto bad;
7284 module = PyObject_CallFunctionObjArgs(py_import,
7285 name, global_dict, empty_dict, list, py_level, NULL);
7286 Py_DECREF(py_level);
7287 #else
7288 module = PyImport_ImportModuleLevelObject(
7289 name, global_dict, empty_dict, list, level);
7290 #endif
7291 }
7292 }
7293 bad:
7294 #if PY_VERSION_HEX < 0x03030000
7295 Py_XDECREF(py_import);
7296 #endif
7297 Py_XDECREF(empty_list);
7298 Py_XDECREF(empty_dict);
7299 return module;
7300 }
7301
7302 /* CodeObjectCache */
7303 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
7304 int start = 0, mid = 0, end = count - 1;
7305 if (end >= 0 && code_line > entries[end].code_line) {
7306 return count;
7307 }
7308 while (start < end) {
7309 mid = start + (end - start) / 2;
7310 if (code_line < entries[mid].code_line) {
7311 end = mid;
7312 } else if (code_line > entries[mid].code_line) {
7313 start = mid + 1;
7314 } else {
7315 return mid;
7316 }
7317 }
7318 if (code_line <= entries[mid].code_line) {
7319 return mid;
7320 } else {
7321 return mid + 1;
7322 }
7323 }
7324 static PyCodeObject *__pyx_find_code_object(int code_line) {
7325 PyCodeObject* code_object;
7326 int pos;
7327 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
7328 return NULL;
7329 }
7330 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
7331 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
7332 return NULL;
7333 }
7334 code_object = __pyx_code_cache.entries[pos].code_object;
7335 Py_INCREF(code_object);
7336 return code_object;
7337 }
7338 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
7339 int pos, i;
7340 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
7341 if (unlikely(!code_line)) {
7342 return;
7343 }
7344 if (unlikely(!entries)) {
7345 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
7346 if (likely(entries)) {
7347 __pyx_code_cache.entries = entries;
7348 __pyx_code_cache.max_count = 64;
7349 __pyx_code_cache.count = 1;
7350 entries[0].code_line = code_line;
7351 entries[0].code_object = code_object;
7352 Py_INCREF(code_object);
7353 }
7354 return;
7355 }
7356 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
7357 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
7358 PyCodeObject* tmp = entries[pos].code_object;
7359 entries[pos].code_object = code_object;
7360 Py_DECREF(tmp);
7361 return;
7362 }
7363 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
7364 int new_max = __pyx_code_cache.max_count + 64;
7365 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
7366 __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
7367 if (unlikely(!entries)) {
7368 return;
7369 }
7370 __pyx_code_cache.entries = entries;
7371 __pyx_code_cache.max_count = new_max;
7372 }
7373 for (i=__pyx_code_cache.count; i>pos; i--) {
7374 entries[i] = entries[i-1];
7375 }
7376 entries[pos].code_line = code_line;
7377 entries[pos].code_object = code_object;
7378 __pyx_code_cache.count++;
7379 Py_INCREF(code_object);
7380 }
7381
7382 /* AddTraceback */
7383 #include "compile.h"
7384 #include "frameobject.h"
7385 #include "traceback.h"
7386 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
7387 const char *funcname, int c_line,
7388 int py_line, const char *filename) {
7389 PyCodeObject *py_code = 0;
7390 PyObject *py_srcfile = 0;
7391 PyObject *py_funcname = 0;
7392 #if PY_MAJOR_VERSION < 3
7393 py_srcfile = PyString_FromString(filename);
7394 #else
7395 py_srcfile = PyUnicode_FromString(filename);
7396 #endif
7397 if (!py_srcfile) goto bad;
7398 if (c_line) {
7399 #if PY_MAJOR_VERSION < 3
7400 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
7401 #else
7402 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
7403 #endif
7404 }
7405 else {
7406 #if PY_MAJOR_VERSION < 3
7407 py_funcname = PyString_FromString(funcname);
7408 #else
7409 py_funcname = PyUnicode_FromString(funcname);
7410 #endif
7411 }
7412 if (!py_funcname) goto bad;
7413 py_code = __Pyx_PyCode_New(
7414 0,
7415 0,
7416 0,
7417 0,
7418 0,
7419 __pyx_empty_bytes, /*PyObject *code,*/
7420 __pyx_empty_tuple, /*PyObject *consts,*/
7421 __pyx_empty_tuple, /*PyObject *names,*/
7422 __pyx_empty_tuple, /*PyObject *varnames,*/
7423 __pyx_empty_tuple, /*PyObject *freevars,*/
7424 __pyx_empty_tuple, /*PyObject *cellvars,*/
7425 py_srcfile, /*PyObject *filename,*/
7426 py_funcname, /*PyObject *name,*/
7427 py_line,
7428 __pyx_empty_bytes /*PyObject *lnotab*/
7429 );
7430 Py_DECREF(py_srcfile);
7431 Py_DECREF(py_funcname);
7432 return py_code;
7433 bad:
7434 Py_XDECREF(py_srcfile);
7435 Py_XDECREF(py_funcname);
7436 return NULL;
7437 }
7438 static void __Pyx_AddTraceback(const char *funcname, int c_line,
7439 int py_line, const char *filename) {
7440 PyCodeObject *py_code = 0;
7441 PyFrameObject *py_frame = 0;
7442 py_code = __pyx_find_code_object(c_line ? c_line : py_line);
7443 if (!py_code) {
7444 py_code = __Pyx_CreateCodeObjectForTraceback(
7445 funcname, c_line, py_line, filename);
7446 if (!py_code) goto bad;
7447 __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
7448 }
7449 py_frame = PyFrame_New(
7450 PyThreadState_GET(), /*PyThreadState *tstate,*/
7451 py_code, /*PyCodeObject *code,*/
7452 __pyx_d, /*PyObject *globals,*/
7453 0 /*PyObject *locals*/
7454 );
7455 if (!py_frame) goto bad;
7456 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
7457 PyTraceBack_Here(py_frame);
7458 bad:
7459 Py_XDECREF(py_code);
7460 Py_XDECREF(py_frame);
7461 }
7462
7463 /* CIntFromPyVerify */
7464 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
7465 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
7466 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
7467 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
7468 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
7469 {\
7470 func_type value = func_value;\
7471 if (sizeof(target_type) < sizeof(func_type)) {\
7472 if (unlikely(value != (func_type) (target_type) value)) {\
7473 func_type zero = 0;\
7474 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
7475 return (target_type) -1;\
7476 if (is_unsigned && unlikely(value < zero))\
7477 goto raise_neg_overflow;\
7478 else\
7479 goto raise_overflow;\
7480 }\
7481 }\
7482 return (target_type) value;\
7483 }
7484
7485 /* CIntToPy */
7486 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
7487 const int neg_one = (int) -1, const_zero = (int) 0;
7488 const int is_unsigned = neg_one > const_zero;
7489 if (is_unsigned) {
7490 if (sizeof(int) < sizeof(long)) {
7491 return PyInt_FromLong((long) value);
7492 } else if (sizeof(int) <= sizeof(unsigned long)) {
7493 return PyLong_FromUnsignedLong((unsigned long) value);
7494 #ifdef HAVE_LONG_LONG
7495 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
7496 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
7497 #endif
7498 }
7499 } else {
7500 if (sizeof(int) <= sizeof(long)) {
7501 return PyInt_FromLong((long) value);
7502 #ifdef HAVE_LONG_LONG
7503 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
7504 return PyLong_FromLongLong((PY_LONG_LONG) value);
7505 #endif
7506 }
7507 }
7508 {
7509 int one = 1; int little = (int)*(unsigned char *)&one;
7510 unsigned char *bytes = (unsigned char *)&value;
7511 return _PyLong_FromByteArray(bytes, sizeof(int),
7512 little, !is_unsigned);
7513 }
7514 }
7515
7516 /* CIntToPy */
7517 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
7518 const long neg_one = (long) -1, const_zero = (long) 0;
7519 const int is_unsigned = neg_one > const_zero;
7520 if (is_unsigned) {
7521 if (sizeof(long) < sizeof(long)) {
7522 return PyInt_FromLong((long) value);
7523 } else if (sizeof(long) <= sizeof(unsigned long)) {
7524 return PyLong_FromUnsignedLong((unsigned long) value);
7525 #ifdef HAVE_LONG_LONG
7526 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
7527 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
7528 #endif
7529 }
7530 } else {
7531 if (sizeof(long) <= sizeof(long)) {
7532 return PyInt_FromLong((long) value);
7533 #ifdef HAVE_LONG_LONG
7534 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
7535 return PyLong_FromLongLong((PY_LONG_LONG) value);
7536 #endif
7537 }
7538 }
7539 {
7540 int one = 1; int little = (int)*(unsigned char *)&one;
7541 unsigned char *bytes = (unsigned char *)&value;
7542 return _PyLong_FromByteArray(bytes, sizeof(long),
7543 little, !is_unsigned);
7544 }
7545 }
7546
7547 /* Declarations */
7548 #if CYTHON_CCOMPLEX
7549 #ifdef __cplusplus
7550 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
7551 return ::std::complex< float >(x, y);
7552 }
7553 #else
7554 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
7555 return x + y*(__pyx_t_float_complex)_Complex_I;
7556 }
7557 #endif
7558 #else
7559 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
7560 __pyx_t_float_complex z;
7561 z.real = x;
7562 z.imag = y;
7563 return z;
7564 }
7565 #endif
7566
7567 /* Arithmetic */
7568 #if CYTHON_CCOMPLEX
7569 #else
7570 static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
7571 return (a.real == b.real) && (a.imag == b.imag);
7572 }
7573 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
7574 __pyx_t_float_complex z;
7575 z.real = a.real + b.real;
7576 z.imag = a.imag + b.imag;
7577 return z;
7578 }
7579 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
7580 __pyx_t_float_complex z;
7581 z.real = a.real - b.real;
7582 z.imag = a.imag - b.imag;
7583 return z;
7584 }
7585 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
7586 __pyx_t_float_complex z;
7587 z.real = a.real * b.real - a.imag * b.imag;
7588 z.imag = a.real * b.imag + a.imag * b.real;
7589 return z;
7590 }
7591 #if 1
7592 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
7593 if (b.imag == 0) {
7594 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
7595 } else if (fabsf(b.real) >= fabsf(b.imag)) {
7596 if (b.real == 0 && b.imag == 0) {
7597 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
7598 } else {
7599 float r = b.imag / b.real;
7600 float s = 1.0 / (b.real + b.imag * r);
7601 return __pyx_t_float_complex_from_parts(
7602 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
7603 }
7604 } else {
7605 float r = b.real / b.imag;
7606 float s = 1.0 / (b.imag + b.real * r);
7607 return __pyx_t_float_complex_from_parts(
7608 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
7609 }
7610 }
7611 #else
7612 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
7613 if (b.imag == 0) {
7614 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
7615 } else {
7616 float denom = b.real * b.real + b.imag * b.imag;
7617 return __pyx_t_float_complex_from_parts(
7618 (a.real * b.real + a.imag * b.imag) / denom,
7619 (a.imag * b.real - a.real * b.imag) / denom);
7620 }
7621 }
7622 #endif
7623 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
7624 __pyx_t_float_complex z;
7625 z.real = -a.real;
7626 z.imag = -a.imag;
7627 return z;
7628 }
7629 static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
7630 return (a.real == 0) && (a.imag == 0);
7631 }
7632 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
7633 __pyx_t_float_complex z;
7634 z.real = a.real;
7635 z.imag = -a.imag;
7636 return z;
7637 }
7638 #if 1
7639 static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
7640 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
7641 return sqrtf(z.real*z.real + z.imag*z.imag);
7642 #else
7643 return hypotf(z.real, z.imag);
7644 #endif
7645 }
7646 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
7647 __pyx_t_float_complex z;
7648 float r, lnr, theta, z_r, z_theta;
7649 if (b.imag == 0 && b.real == (int)b.real) {
7650 if (b.real < 0) {
7651 float denom = a.real * a.real + a.imag * a.imag;
7652 a.real = a.real / denom;
7653 a.imag = -a.imag / denom;
7654 b.real = -b.real;
7655 }
7656 switch ((int)b.real) {
7657 case 0:
7658 z.real = 1;
7659 z.imag = 0;
7660 return z;
7661 case 1:
7662 return a;
7663 case 2:
7664 z = __Pyx_c_prod_float(a, a);
7665 return __Pyx_c_prod_float(a, a);
7666 case 3:
7667 z = __Pyx_c_prod_float(a, a);
7668 return __Pyx_c_prod_float(z, a);
7669 case 4:
7670 z = __Pyx_c_prod_float(a, a);
7671 return __Pyx_c_prod_float(z, z);
7672 }
7673 }
7674 if (a.imag == 0) {
7675 if (a.real == 0) {
7676 return a;
7677 } else if (b.imag == 0) {
7678 z.real = powf(a.real, b.real);
7679 z.imag = 0;
7680 return z;
7681 } else if (a.real > 0) {
7682 r = a.real;
7683 theta = 0;
7684 } else {
7685 r = -a.real;
7686 theta = atan2f(0, -1);
7687 }
7688 } else {
7689 r = __Pyx_c_abs_float(a);
7690 theta = atan2f(a.imag, a.real);
7691 }
7692 lnr = logf(r);
7693 z_r = expf(lnr * b.real - theta * b.imag);
7694 z_theta = theta * b.real + lnr * b.imag;
7695 z.real = z_r * cosf(z_theta);
7696 z.imag = z_r * sinf(z_theta);
7697 return z;
7698 }
7699 #endif
7700 #endif
7701
7702 /* Declarations */
7703 #if CYTHON_CCOMPLEX
7704 #ifdef __cplusplus
7705 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
7706 return ::std::complex< double >(x, y);
7707 }
7708 #else
7709 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
7710 return x + y*(__pyx_t_double_complex)_Complex_I;
7711 }
7712 #endif
7713 #else
7714 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
7715 __pyx_t_double_complex z;
7716 z.real = x;
7717 z.imag = y;
7718 return z;
7719 }
7720 #endif
7721
7722 /* Arithmetic */
7723 #if CYTHON_CCOMPLEX
7724 #else
7725 static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
7726 return (a.real == b.real) && (a.imag == b.imag);
7727 }
7728 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
7729 __pyx_t_double_complex z;
7730 z.real = a.real + b.real;
7731 z.imag = a.imag + b.imag;
7732 return z;
7733 }
7734 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
7735 __pyx_t_double_complex z;
7736 z.real = a.real - b.real;
7737 z.imag = a.imag - b.imag;
7738 return z;
7739 }
7740 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
7741 __pyx_t_double_complex z;
7742 z.real = a.real * b.real - a.imag * b.imag;
7743 z.imag = a.real * b.imag + a.imag * b.real;
7744 return z;
7745 }
7746 #if 1
7747 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
7748 if (b.imag == 0) {
7749 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
7750 } else if (fabs(b.real) >= fabs(b.imag)) {
7751 if (b.real == 0 && b.imag == 0) {
7752 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
7753 } else {
7754 double r = b.imag / b.real;
7755 double s = 1.0 / (b.real + b.imag * r);
7756 return __pyx_t_double_complex_from_parts(
7757 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
7758 }
7759 } else {
7760 double r = b.real / b.imag;
7761 double s = 1.0 / (b.imag + b.real * r);
7762 return __pyx_t_double_complex_from_parts(
7763 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
7764 }
7765 }
7766 #else
7767 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
7768 if (b.imag == 0) {
7769 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
7770 } else {
7771 double denom = b.real * b.real + b.imag * b.imag;
7772 return __pyx_t_double_complex_from_parts(
7773 (a.real * b.real + a.imag * b.imag) / denom,
7774 (a.imag * b.real - a.real * b.imag) / denom);
7775 }
7776 }
7777 #endif
7778 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
7779 __pyx_t_double_complex z;
7780 z.real = -a.real;
7781 z.imag = -a.imag;
7782 return z;
7783 }
7784 static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
7785 return (a.real == 0) && (a.imag == 0);
7786 }
7787 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
7788 __pyx_t_double_complex z;
7789 z.real = a.real;
7790 z.imag = -a.imag;
7791 return z;
7792 }
7793 #if 1
7794 static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
7795 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
7796 return sqrt(z.real*z.real + z.imag*z.imag);
7797 #else
7798 return hypot(z.real, z.imag);
7799 #endif
7800 }
7801 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
7802 __pyx_t_double_complex z;
7803 double r, lnr, theta, z_r, z_theta;
7804 if (b.imag == 0 && b.real == (int)b.real) {
7805 if (b.real < 0) {
7806 double denom = a.real * a.real + a.imag * a.imag;
7807 a.real = a.real / denom;
7808 a.imag = -a.imag / denom;
7809 b.real = -b.real;
7810 }
7811 switch ((int)b.real) {
7812 case 0:
7813 z.real = 1;
7814 z.imag = 0;
7815 return z;
7816 case 1:
7817 return a;
7818 case 2:
7819 z = __Pyx_c_prod_double(a, a);
7820 return __Pyx_c_prod_double(a, a);
7821 case 3:
7822 z = __Pyx_c_prod_double(a, a);
7823 return __Pyx_c_prod_double(z, a);
7824 case 4:
7825 z = __Pyx_c_prod_double(a, a);
7826 return __Pyx_c_prod_double(z, z);
7827 }
7828 }
7829 if (a.imag == 0) {
7830 if (a.real == 0) {
7831 return a;
7832 } else if (b.imag == 0) {
7833 z.real = pow(a.real, b.real);
7834 z.imag = 0;
7835 return z;
7836 } else if (a.real > 0) {
7837 r = a.real;
7838 theta = 0;
7839 } else {
7840 r = -a.real;
7841 theta = atan2(0, -1);
7842 }
7843 } else {
7844 r = __Pyx_c_abs_double(a);
7845 theta = atan2(a.imag, a.real);
7846 }
7847 lnr = log(r);
7848 z_r = exp(lnr * b.real - theta * b.imag);
7849 z_theta = theta * b.real + lnr * b.imag;
7850 z.real = z_r * cos(z_theta);
7851 z.imag = z_r * sin(z_theta);
7852 return z;
7853 }
7854 #endif
7855 #endif
7856
7857 /* CIntToPy */
7858 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
7859 const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0;
7860 const int is_unsigned = neg_one > const_zero;
7861 if (is_unsigned) {
7862 if (sizeof(enum NPY_TYPES) < sizeof(long)) {
7863 return PyInt_FromLong((long) value);
7864 } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
7865 return PyLong_FromUnsignedLong((unsigned long) value);
7866 #ifdef HAVE_LONG_LONG
7867 } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
7868 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
7869 #endif
7870 }
7871 } else {
7872 if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
7873 return PyInt_FromLong((long) value);
7874 #ifdef HAVE_LONG_LONG
7875 } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
7876 return PyLong_FromLongLong((PY_LONG_LONG) value);
7877 #endif
7878 }
7879 }
7880 {
7881 int one = 1; int little = (int)*(unsigned char *)&one;
7882 unsigned char *bytes = (unsigned char *)&value;
7883 return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
7884 little, !is_unsigned);
7885 }
7886 }
7887
7888 /* CIntFromPy */
7889 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
7890 const int neg_one = (int) -1, const_zero = (int) 0;
7891 const int is_unsigned = neg_one > const_zero;
7892 #if PY_MAJOR_VERSION < 3
7893 if (likely(PyInt_Check(x))) {
7894 if (sizeof(int) < sizeof(long)) {
7895 __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
7896 } else {
7897 long val = PyInt_AS_LONG(x);
7898 if (is_unsigned && unlikely(val < 0)) {
7899 goto raise_neg_overflow;
7900 }
7901 return (int) val;
7902 }
7903 } else
7904 #endif
7905 if (likely(PyLong_Check(x))) {
7906 if (is_unsigned) {
7907 #if CYTHON_USE_PYLONG_INTERNALS
7908 const digit* digits = ((PyLongObject*)x)->ob_digit;
7909 switch (Py_SIZE(x)) {
7910 case 0: return (int) 0;
7911 case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
7912 case 2:
7913 if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
7914 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
7915 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7916 } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
7917 return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
7918 }
7919 }
7920 break;
7921 case 3:
7922 if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
7923 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
7924 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7925 } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
7926 return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
7927 }
7928 }
7929 break;
7930 case 4:
7931 if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
7932 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
7933 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7934 } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
7935 return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
7936 }
7937 }
7938 break;
7939 }
7940 #endif
7941 #if CYTHON_COMPILING_IN_CPYTHON
7942 if (unlikely(Py_SIZE(x) < 0)) {
7943 goto raise_neg_overflow;
7944 }
7945 #else
7946 {
7947 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
7948 if (unlikely(result < 0))
7949 return (int) -1;
7950 if (unlikely(result == 1))
7951 goto raise_neg_overflow;
7952 }
7953 #endif
7954 if (sizeof(int) <= sizeof(unsigned long)) {
7955 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
7956 #ifdef HAVE_LONG_LONG
7957 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
7958 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
7959 #endif
7960 }
7961 } else {
7962 #if CYTHON_USE_PYLONG_INTERNALS
7963 const digit* digits = ((PyLongObject*)x)->ob_digit;
7964 switch (Py_SIZE(x)) {
7965 case 0: return (int) 0;
7966 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
7967 case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
7968 case -2:
7969 if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
7970 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
7971 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7972 } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
7973 return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
7974 }
7975 }
7976 break;
7977 case 2:
7978 if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
7979 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
7980 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7981 } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
7982 return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
7983 }
7984 }
7985 break;
7986 case -3:
7987 if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
7988 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
7989 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7990 } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
7991 return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
7992 }
7993 }
7994 break;
7995 case 3:
7996 if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
7997 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
7998 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7999 } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
8000 return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
8001 }
8002 }
8003 break;
8004 case -4:
8005 if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
8006 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
8007 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
8008 } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
8009 return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
8010 }
8011 }
8012 break;
8013 case 4:
8014 if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
8015 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
8016 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
8017 } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
8018 return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
8019 }
8020 }
8021 break;
8022 }
8023 #endif
8024 if (sizeof(int) <= sizeof(long)) {
8025 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
8026 #ifdef HAVE_LONG_LONG
8027 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
8028 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
8029 #endif
8030 }
8031 }
8032 {
8033 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
8034 PyErr_SetString(PyExc_RuntimeError,
8035 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
8036 #else
8037 int val;
8038 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
8039 #if PY_MAJOR_VERSION < 3
8040 if (likely(v) && !PyLong_Check(v)) {
8041 PyObject *tmp = v;
8042 v = PyNumber_Long(tmp);
8043 Py_DECREF(tmp);
8044 }
8045 #endif
8046 if (likely(v)) {
8047 int one = 1; int is_little = (int)*(unsigned char *)&one;
8048 unsigned char *bytes = (unsigned char *)&val;
8049 int ret = _PyLong_AsByteArray((PyLongObject *)v,
8050 bytes, sizeof(val),
8051 is_little, !is_unsigned);
8052 Py_DECREF(v);
8053 if (likely(!ret))
8054 return val;
8055 }
8056 #endif
8057 return (int) -1;
8058 }
8059 } else {
8060 int val;
8061 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
8062 if (!tmp) return (int) -1;
8063 val = __Pyx_PyInt_As_int(tmp);
8064 Py_DECREF(tmp);
8065 return val;
8066 }
8067 raise_overflow:
8068 PyErr_SetString(PyExc_OverflowError,
8069 "value too large to convert to int");
8070 return (int) -1;
8071 raise_neg_overflow:
8072 PyErr_SetString(PyExc_OverflowError,
8073 "can't convert negative value to int");
8074 return (int) -1;
8075 }
8076
8077 /* CIntFromPy */
8078 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
8079 const long neg_one = (long) -1, const_zero = (long) 0;
8080 const int is_unsigned = neg_one > const_zero;
8081 #if PY_MAJOR_VERSION < 3
8082 if (likely(PyInt_Check(x))) {
8083 if (sizeof(long) < sizeof(long)) {
8084 __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
8085 } else {
8086 long val = PyInt_AS_LONG(x);
8087 if (is_unsigned && unlikely(val < 0)) {
8088 goto raise_neg_overflow;
8089 }
8090 return (long) val;
8091 }
8092 } else
8093 #endif
8094 if (likely(PyLong_Check(x))) {
8095 if (is_unsigned) {
8096 #if CYTHON_USE_PYLONG_INTERNALS
8097 const digit* digits = ((PyLongObject*)x)->ob_digit;
8098 switch (Py_SIZE(x)) {
8099 case 0: return (long) 0;
8100 case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
8101 case 2:
8102 if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
8103 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
8104 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
8105 } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
8106 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
8107 }
8108 }
8109 break;
8110 case 3:
8111 if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
8112 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
8113 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
8114 } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
8115 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
8116 }
8117 }
8118 break;
8119 case 4:
8120 if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
8121 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
8122 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
8123 } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
8124 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
8125 }
8126 }
8127 break;
8128 }
8129 #endif
8130 #if CYTHON_COMPILING_IN_CPYTHON
8131 if (unlikely(Py_SIZE(x) < 0)) {
8132 goto raise_neg_overflow;
8133 }
8134 #else
8135 {
8136 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
8137 if (unlikely(result < 0))
8138 return (long) -1;
8139 if (unlikely(result == 1))
8140 goto raise_neg_overflow;
8141 }
8142 #endif
8143 if (sizeof(long) <= sizeof(unsigned long)) {
8144 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
8145 #ifdef HAVE_LONG_LONG
8146 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
8147 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
8148 #endif
8149 }
8150 } else {
8151 #if CYTHON_USE_PYLONG_INTERNALS
8152 const digit* digits = ((PyLongObject*)x)->ob_digit;
8153 switch (Py_SIZE(x)) {
8154 case 0: return (long) 0;
8155 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
8156 case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
8157 case -2:
8158 if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
8159 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
8160 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
8161 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
8162 return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
8163 }
8164 }
8165 break;
8166 case 2:
8167 if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
8168 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
8169 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
8170 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
8171 return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
8172 }
8173 }
8174 break;
8175 case -3:
8176 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
8177 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
8178 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
8179 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
8180 return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
8181 }
8182 }
8183 break;
8184 case 3:
8185 if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
8186 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
8187 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
8188 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
8189 return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
8190 }
8191 }
8192 break;
8193 case -4:
8194 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
8195 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
8196 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
8197 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
8198 return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
8199 }
8200 }
8201 break;
8202 case 4:
8203 if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
8204 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
8205 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
8206 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
8207 return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
8208 }
8209 }
8210 break;
8211 }
8212 #endif
8213 if (sizeof(long) <= sizeof(long)) {
8214 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
8215 #ifdef HAVE_LONG_LONG
8216 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
8217 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
8218 #endif
8219 }
8220 }
8221 {
8222 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
8223 PyErr_SetString(PyExc_RuntimeError,
8224 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
8225 #else
8226 long val;
8227 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
8228 #if PY_MAJOR_VERSION < 3
8229 if (likely(v) && !PyLong_Check(v)) {
8230 PyObject *tmp = v;
8231 v = PyNumber_Long(tmp);
8232 Py_DECREF(tmp);
8233 }
8234 #endif
8235 if (likely(v)) {
8236 int one = 1; int is_little = (int)*(unsigned char *)&one;
8237 unsigned char *bytes = (unsigned char *)&val;
8238 int ret = _PyLong_AsByteArray((PyLongObject *)v,
8239 bytes, sizeof(val),
8240 is_little, !is_unsigned);
8241 Py_DECREF(v);
8242 if (likely(!ret))
8243 return val;
8244 }
8245 #endif
8246 return (long) -1;
8247 }
8248 } else {
8249 long val;
8250 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
8251 if (!tmp) return (long) -1;
8252 val = __Pyx_PyInt_As_long(tmp);
8253 Py_DECREF(tmp);
8254 return val;
8255 }
8256 raise_overflow:
8257 PyErr_SetString(PyExc_OverflowError,
8258 "value too large to convert to long");
8259 return (long) -1;
8260 raise_neg_overflow:
8261 PyErr_SetString(PyExc_OverflowError,
8262 "can't convert negative value to long");
8263 return (long) -1;
8264 }
8265
8266 /* CheckBinaryVersion */
8267 static int __Pyx_check_binary_version(void) {
8268 char ctversion[4], rtversion[4];
8269 PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
8270 PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
8271 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
8272 char message[200];
8273 PyOS_snprintf(message, sizeof(message),
8274 "compiletime version %s of module '%.100s' "
8275 "does not match runtime version %s",
8276 ctversion, __Pyx_MODULE_NAME, rtversion);
8277 return PyErr_WarnEx(NULL, message, 1);
8278 }
8279 return 0;
8280 }
8281
8282 /* ModuleImport */
8283 #ifndef __PYX_HAVE_RT_ImportModule
8284 #define __PYX_HAVE_RT_ImportModule
8285 static PyObject *__Pyx_ImportModule(const char *name) {
8286 PyObject *py_name = 0;
8287 PyObject *py_module = 0;
8288 py_name = __Pyx_PyIdentifier_FromString(name);
8289 if (!py_name)
8290 goto bad;
8291 py_module = PyImport_Import(py_name);
8292 Py_DECREF(py_name);
8293 return py_module;
8294 bad:
8295 Py_XDECREF(py_name);
8296 return 0;
8297 }
8298 #endif
8299
8300 /* TypeImport */
8301 #ifndef __PYX_HAVE_RT_ImportType
8302 #define __PYX_HAVE_RT_ImportType
8303 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
8304 size_t size, int strict)
8305 {
8306 PyObject *py_module = 0;
8307 PyObject *result = 0;
8308 PyObject *py_name = 0;
8309 char warning[200];
8310 Py_ssize_t basicsize;
8311 #ifdef Py_LIMITED_API
8312 PyObject *py_basicsize;
8313 #endif
8314 py_module = __Pyx_ImportModule(module_name);
8315 if (!py_module)
8316 goto bad;
8317 py_name = __Pyx_PyIdentifier_FromString(class_name);
8318 if (!py_name)
8319 goto bad;
8320 result = PyObject_GetAttr(py_module, py_name);
8321 Py_DECREF(py_name);
8322 py_name = 0;
8323 Py_DECREF(py_module);
8324 py_module = 0;
8325 if (!result)
8326 goto bad;
8327 if (!PyType_Check(result)) {
8328 PyErr_Format(PyExc_TypeError,
8329 "%.200s.%.200s is not a type object",
8330 module_name, class_name);
8331 goto bad;
8332 }
8333 #ifndef Py_LIMITED_API
8334 basicsize = ((PyTypeObject *)result)->tp_basicsize;
8335 #else
8336 py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
8337 if (!py_basicsize)
8338 goto bad;
8339 basicsize = PyLong_AsSsize_t(py_basicsize);
8340 Py_DECREF(py_basicsize);
8341 py_basicsize = 0;
8342 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
8343 goto bad;
8344 #endif
8345 if (!strict && (size_t)basicsize > size) {
8346 PyOS_snprintf(warning, sizeof(warning),
8347 "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd",
8348 module_name, class_name, basicsize, size);
8349 if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
8350 }
8351 else if ((size_t)basicsize != size) {
8352 PyErr_Format(PyExc_ValueError,
8353 "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd",
8354 module_name, class_name, basicsize, size);
8355 goto bad;
8356 }
8357 return (PyTypeObject *)result;
8358 bad:
8359 Py_XDECREF(py_module);
8360 Py_XDECREF(result);
8361 return NULL;
8362 }
8363 #endif
8364
8365 /* InitStrings */
8366 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
8367 while (t->p) {
8368 #if PY_MAJOR_VERSION < 3
8369 if (t->is_unicode) {
8370 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
8371 } else if (t->intern) {
8372 *t->p = PyString_InternFromString(t->s);
8373 } else {
8374 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
8375 }
8376 #else
8377 if (t->is_unicode | t->is_str) {
8378 if (t->intern) {
8379 *t->p = PyUnicode_InternFromString(t->s);
8380 } else if (t->encoding) {
8381 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
8382 } else {
8383 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
8384 }
8385 } else {
8386 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
8387 }
8388 #endif
8389 if (!*t->p)
8390 return -1;
8391 ++t;
8392 }
8393 return 0;
8394 }
8395
8396 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
8397 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
8398 }
8399 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
8400 Py_ssize_t ignore;
8401 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
8402 }
8403 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
8404 #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
8405 if (
8406 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
8407 __Pyx_sys_getdefaultencoding_not_ascii &&
8408 #endif
8409 PyUnicode_Check(o)) {
8410 #if PY_VERSION_HEX < 0x03030000
8411 char* defenc_c;
8412 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
8413 if (!defenc) return NULL;
8414 defenc_c = PyBytes_AS_STRING(defenc);
8415 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
8416 {
8417 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
8418 char* c;
8419 for (c = defenc_c; c < end; c++) {
8420 if ((unsigned char) (*c) >= 128) {
8421 PyUnicode_AsASCIIString(o);
8422 return NULL;
8423 }
8424 }
8425 }
8426 #endif
8427 *length = PyBytes_GET_SIZE(defenc);
8428 return defenc_c;
8429 #else
8430 if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
8431 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
8432 if (PyUnicode_IS_ASCII(o)) {
8433 *length = PyUnicode_GET_LENGTH(o);
8434 return PyUnicode_AsUTF8(o);
8435 } else {
8436 PyUnicode_AsASCIIString(o);
8437 return NULL;
8438 }
8439 #else
8440 return PyUnicode_AsUTF8AndSize(o, length);
8441 #endif
8442 #endif
8443 } else
8444 #endif
8445 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
8446 if (PyByteArray_Check(o)) {
8447 *length = PyByteArray_GET_SIZE(o);
8448 return PyByteArray_AS_STRING(o);
8449 } else
8450 #endif
8451 {
8452 char* result;
8453 int r = PyBytes_AsStringAndSize(o, &result, length);
8454 if (unlikely(r < 0)) {
8455 return NULL;
8456 } else {
8457 return result;
8458 }
8459 }
8460 }
8461 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
8462 int is_true = x == Py_True;
8463 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
8464 else return PyObject_IsTrue(x);
8465 }
8466 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
8467 #if CYTHON_USE_TYPE_SLOTS
8468 PyNumberMethods *m;
8469 #endif
8470 const char *name = NULL;
8471 PyObject *res = NULL;
8472 #if PY_MAJOR_VERSION < 3
8473 if (PyInt_Check(x) || PyLong_Check(x))
8474 #else
8475 if (PyLong_Check(x))
8476 #endif
8477 return __Pyx_NewRef(x);
8478 #if CYTHON_USE_TYPE_SLOTS
8479 m = Py_TYPE(x)->tp_as_number;
8480 #if PY_MAJOR_VERSION < 3
8481 if (m && m->nb_int) {
8482 name = "int";
8483 res = PyNumber_Int(x);
8484 }
8485 else if (m && m->nb_long) {
8486 name = "long";
8487 res = PyNumber_Long(x);
8488 }
8489 #else
8490 if (m && m->nb_int) {
8491 name = "int";
8492 res = PyNumber_Long(x);
8493 }
8494 #endif
8495 #else
8496 res = PyNumber_Int(x);
8497 #endif
8498 if (res) {
8499 #if PY_MAJOR_VERSION < 3
8500 if (!PyInt_Check(res) && !PyLong_Check(res)) {
8501 #else
8502 if (!PyLong_Check(res)) {
8503 #endif
8504 PyErr_Format(PyExc_TypeError,
8505 "__%.4s__ returned non-%.4s (type %.200s)",
8506 name, name, Py_TYPE(res)->tp_name);
8507 Py_DECREF(res);
8508 return NULL;
8509 }
8510 }
8511 else if (!PyErr_Occurred()) {
8512 PyErr_SetString(PyExc_TypeError,
8513 "an integer is required");
8514 }
8515 return res;
8516 }
8517 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
8518 Py_ssize_t ival;
8519 PyObject *x;
8520 #if PY_MAJOR_VERSION < 3
8521 if (likely(PyInt_CheckExact(b))) {
8522 if (sizeof(Py_ssize_t) >= sizeof(long))
8523 return PyInt_AS_LONG(b);
8524 else
8525 return PyInt_AsSsize_t(x);
8526 }
8527 #endif
8528 if (likely(PyLong_CheckExact(b))) {
8529 #if CYTHON_USE_PYLONG_INTERNALS
8530 const digit* digits = ((PyLongObject*)b)->ob_digit;
8531 const Py_ssize_t size = Py_SIZE(b);
8532 if (likely(__Pyx_sst_abs(size) <= 1)) {
8533 ival = likely(size) ? digits[0] : 0;
8534 if (size == -1) ival = -ival;
8535 return ival;
8536 } else {
8537 switch (size) {
8538 case 2:
8539 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
8540 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
8541 }
8542 break;
8543 case -2:
8544 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
8545 return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
8546 }
8547 break;
8548 case 3:
8549 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
8550 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
8551 }
8552 break;
8553 case -3:
8554 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
8555 return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
8556 }
8557 break;
8558 case 4:
8559 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
8560 return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
8561 }
8562 break;
8563 case -4:
8564 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
8565 return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
8566 }
8567 break;
8568 }
8569 }
8570 #endif
8571 return PyLong_AsSsize_t(b);
8572 }
8573 x = PyNumber_Index(b);
8574 if (!x) return -1;
8575 ival = PyInt_AsSsize_t(x);
8576 Py_DECREF(x);
8577 return ival;
8578 }
8579 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
8580 return PyInt_FromSize_t(ival);
8581 }
8582
8583
8584 #endif /* Py_PYTHON_H */
8585