[SCM] The Molecular Modelling Toolkit packaging branch, master, updated. debian/2.7.8-1-5-g8a6e929

Picca Frédéric-Emmanuel picca at debian.org
Sun Jun 16 12:38:35 UTC 2013


The following commit has been merged in the master branch:
commit cb69b215504b5cf2bc40035cf76407a54b33efa6
Author: Picca Frédéric-Emmanuel <picca at debian.org>
Date:   Sun Jun 16 12:40:22 2013 +0200

    Imported Upstream version 2.7.9

diff --git a/Doc/CHANGELOG b/Doc/CHANGELOG
index 790c246..52e8c78 100644
--- a/Doc/CHANGELOG
+++ b/Doc/CHANGELOG
@@ -1,3 +1,23 @@
+2.7.8 --> 2.7.9
+===============
+
+Improvements:
+
+- Allow a Collection to be constructed from a generator
+
+- Make Amber file parser more tolerant to accept more mod_files
+
+- More pdb_alternative atom names: GROMACS-style OC1/OC2 in
+  C-terminal peptide group
+
+- Compile C versions of extension modules if Cython is not installed
+
+Bug fixes:
+
+- Remove long delays when deallocating thread-based
+  energy evaluators
+
+
 2.7.7 --> 2.7.8
 ===============
 
diff --git a/MMTK/Collections.py b/MMTK/Collections.py
index 318c9ef..a5f1b05 100644
--- a/MMTK/Collections.py
+++ b/MMTK/Collections.py
@@ -14,7 +14,7 @@ from MMTK.Geometry import superpositionFit
 from Scientific.Geometry import Vector, Tensor, Objects3D
 from Scientific.Geometry import Transformation
 from Scientific import N
-import copy, itertools
+import copy, itertools, types
 
 #
 # This class defines groups of atoms. It is used as a base class
@@ -605,11 +605,16 @@ class Collection(GroupOfAtoms, Visualization.Viewable):
 
     def __init__(self, *objects):
         """
-        :param objects: a chemical object or a sequence of chemical objects that
-                        define the initial content of the collection.
+        :param objects: a chemical object or a sequence of or a generator
+                        yielding chemical objects that define the initial
+                        content of the collection.
         """
         self.objects = []
-        self.addObject(objects)
+        if len(objects) == 1 and isinstance(objects[0], types.GeneratorType):
+            for obj in objects[0]:
+                self.addObject(obj)
+        else:
+            self.addObject(objects)
 
     is_collection = 1
 
diff --git a/MMTK/Database/Groups/peptide_ct b/MMTK/Database/Groups/peptide_ct
index 7bc1756..765cc34 100644
--- a/MMTK/Database/Groups/peptide_ct
+++ b/MMTK/Database/Groups/peptide_ct
@@ -9,5 +9,5 @@ bonds = [Bond(N, H), Bond(N, C_alpha), Bond(C_alpha, H_alpha), Bond(C_alpha, C),
 pdbmap = [('', {'N': N, 'O': O, 'HA': H_alpha, 'CA': C_alpha, 'H': H, 'OXT': O_2, 'C': C, }, ), ]
 amber_atom_type = {C: 'C', H: 'H', H_alpha: 'H1', O: 'O2', C_alpha: 'CT', O_2: 'O2', N: 'N', }
 amber12_atom_type = {C: 'C', H: 'H', H_alpha: 'H1', O: 'O2', C_alpha: 'CX', O_2: 'O2', N: 'N', }
-pdb_alternative = {'O1': 'O', 'O2': 'OXT', 'HN': 'H', 'OT': 'OXT', 'OT2': 'OXT', 'OT1': 'O', "O'": 'O', "O''": 'OXT', 'HA2': 'HA', '2HA': 'HA'}
+pdb_alternative = {'O1': 'O', 'O2': 'OXT', 'OC1': 'O', 'OC2': 'OXT', 'HN': 'H', 'OT': 'OXT', 'OT2': 'OXT', 'OT1': 'O', "O'": 'O', "O''": 'OXT', 'HA2': 'HA', '2HA': 'HA'}
 name = 'peptide C terminus'
diff --git a/MMTK/Database/Groups/peptide_ct_noh b/MMTK/Database/Groups/peptide_ct_noh
index 64e5ac8..4aab58d 100644
--- a/MMTK/Database/Groups/peptide_ct_noh
+++ b/MMTK/Database/Groups/peptide_ct_noh
@@ -6,5 +6,5 @@ O_2 = Atom('O')
 bonds = [Bond(N, C_alpha), Bond(C_alpha, C), Bond(C, O), Bond(C, O_2), ]
 pdbmap = [('', {'C': C, 'O': O, 'CA': C_alpha, 'N': N, 'OXT': O_2, }, ), ]
 amber_atom_type = {C: 'C', N: 'N', O: 'O2', C_alpha: 'CT', O_2: 'O2', }
-pdb_alternative = {'O1': 'O', 'O2': 'OXT', 'HN': 'H', 'OT': 'OXT', 'OT2': 'OXT', 'OT1': 'O', }
+pdb_alternative = {'O1': 'O', 'O2': 'OXT', 'HN': 'H', 'OT': 'OXT', 'OT2': 'OXT', 'OT1': 'O', 'OC2': 'OXT', 'OC1': 'O', }
 name = 'peptide C terminus'
diff --git a/MMTK/Database/Groups/peptide_ct_uni b/MMTK/Database/Groups/peptide_ct_uni
index e805289..03b3461 100644
--- a/MMTK/Database/Groups/peptide_ct_uni
+++ b/MMTK/Database/Groups/peptide_ct_uni
@@ -9,5 +9,5 @@ pdbmap = [('', {'N': N, 'O': O, 'CA': C_alpha, 'C': C, 'H': H, 'OXT': O_2, }, ),
 amber91_atom_type = {C_alpha: 'CH', O: 'O2', N: 'N', C: 'C', O_2: 'O2', H: 'H', }
 opls_atom_type = {C_alpha: 'CH', O: 'O2', N: 'N', C: 'C', O_2: 'O2', H: 'H', }
 opls_charge = {C_alpha: .1, O: -.8, N: -.57, C: .7, O_2: -.8, H: .37, }
-pdb_alternative = {'O1': 'O', 'O2': 'OXT', 'HN': 'H', 'OT': 'OXT', 'OT2': 'OXT', 'OT1': 'O', }
+pdb_alternative = {'O1': 'O', 'O2': 'OXT', 'HN': 'H', 'OT': 'OXT', 'OT2': 'OXT', 'OT1': 'O', 'OC2': 'OXT', 'OC1': 'O', }
 name = 'peptide C terminus'
diff --git a/MMTK/Database/Groups/peptide_ct_uni2 b/MMTK/Database/Groups/peptide_ct_uni2
index c740777..9a091ec 100644
--- a/MMTK/Database/Groups/peptide_ct_uni2
+++ b/MMTK/Database/Groups/peptide_ct_uni2
@@ -7,5 +7,5 @@ O_2 = Atom('O')
 bonds = [Bond(N, H), Bond(N, C_alpha), Bond(C_alpha, C), Bond(C, O), Bond(C, O_2), ]
 pdbmap = [('', {'N': N, 'O': O, 'CA': C_alpha, 'C': C, 'H': H, 'OXT': O_2, }, ), ]
 amber91_atom_type = {C_alpha: 'CH', O: 'O2', N: 'N', O_2: 'O2', C: 'C', H: 'H', }
-pdb_alternative = {'O1': 'O', 'O2': 'OXT', 'HN': 'H', 'OT': 'OXT', 'OT2': 'OXT', 'OT1': 'O', }
+pdb_alternative = {'O1': 'O', 'O2': 'OXT', 'HN': 'H', 'OT': 'OXT', 'OT2': 'OXT', 'OT1': 'O', 'OC2': 'OXT', 'OC1': 'O', }
 name = 'peptide C terminus'
diff --git a/MMTK/Database/Groups/peptide_ct_uni3 b/MMTK/Database/Groups/peptide_ct_uni3
index e805289..03b3461 100644
--- a/MMTK/Database/Groups/peptide_ct_uni3
+++ b/MMTK/Database/Groups/peptide_ct_uni3
@@ -9,5 +9,5 @@ pdbmap = [('', {'N': N, 'O': O, 'CA': C_alpha, 'C': C, 'H': H, 'OXT': O_2, }, ),
 amber91_atom_type = {C_alpha: 'CH', O: 'O2', N: 'N', C: 'C', O_2: 'O2', H: 'H', }
 opls_atom_type = {C_alpha: 'CH', O: 'O2', N: 'N', C: 'C', O_2: 'O2', H: 'H', }
 opls_charge = {C_alpha: .1, O: -.8, N: -.57, C: .7, O_2: -.8, H: .37, }
-pdb_alternative = {'O1': 'O', 'O2': 'OXT', 'HN': 'H', 'OT': 'OXT', 'OT2': 'OXT', 'OT1': 'O', }
+pdb_alternative = {'O1': 'O', 'O2': 'OXT', 'HN': 'H', 'OT': 'OXT', 'OT2': 'OXT', 'OT1': 'O', 'OC2': 'OXT', 'OC1': 'O', }
 name = 'peptide C terminus'
diff --git a/MMTK/Database/Groups/peptide_nt_ct b/MMTK/Database/Groups/peptide_nt_ct
index 81c8b41..f89dabc 100644
--- a/MMTK/Database/Groups/peptide_nt_ct
+++ b/MMTK/Database/Groups/peptide_nt_ct
@@ -12,4 +12,4 @@ pdbmap = [('', {'N': N, 'O': O, '2HT': H_2, 'HA': H_alpha, 'CA': C_alpha, '1HT':
 name = 'peptide N terminus/C terminus'
 amber_atom_type = {H_3: 'H', C: 'C', O: 'O', H_alpha: 'HP', H_1: 'H', C_alpha: 'CT', H_2: 'H', N: 'N3', O_2: 'O2',}
 amber12_atom_type = {H_3: 'H', C: 'C', O: 'O', H_alpha: 'HP', H_1: 'H', C_alpha: 'CX', H_2: 'H', N: 'N3', O_2: 'O2',}
-pdb_alternative = {'HT1': '1HT', 'HT2': '2HT', 'HT3': '3HT', 'H1': '1HT', 'H3': '3HT', 'H2': '2HT', '2HA': 'HA', 'HA2': 'HA', 'O2': 'OXT', 'OT': 'OXT', 'OT2': 'OXT', 'OT1': 'O', "O'": 'O', "O''": 'OXT'}
+pdb_alternative = {'HT1': '1HT', 'HT2': '2HT', 'HT3': '3HT', 'H1': '1HT', 'H3': '3HT', 'H2': '2HT', '2HA': 'HA', 'HA2': 'HA', 'O2': 'OXT', 'OT': 'OXT', 'OT2': 'OXT', 'OT1': 'O', 'OC2': 'OXT', 'OC1': 'O', "O'": 'O', "O''": 'OXT'}
diff --git a/MMTK/ForceFields/Amber/AmberData.py b/MMTK/ForceFields/Amber/AmberData.py
index c17fb8f..71e7577 100644
--- a/MMTK/ForceFields/Amber/AmberData.py
+++ b/MMTK/ForceFields/Amber/AmberData.py
@@ -146,9 +146,6 @@ class AmberParameters(object):
             line = file.readline().rstrip()
             if not line: break
             names, params = line[:11], line[11:]
-            name1, name2, name3, name4 = [_normalizeName(n)
-                                          for n in names.split('-')]
-            name1, name2, name3, name4 = _sort4(name1, name2, name3, name4)
             params = params.strip().split()[:4]
             divf = int(params[0])
             k = float(params[1])
@@ -158,6 +155,9 @@ class AmberParameters(object):
                 append.addTerm(divf, k, delta, n)
                 if n >= 0: append = None
             else:
+                name1, name2, name3, name4 = [_normalizeName(name)
+                                              for name in names.split('-')]
+                name1, name2, name3, name4 = _sort4(name1, name2, name3, name4)
                 p = AmberDihedralParameters(self.atom_types[name1],
                                             self.atom_types[name2],
                                             self.atom_types[name3],
diff --git a/MMTK/Geometry.py b/MMTK/Geometry.py
index bac9c4d..cfcbed5 100644
--- a/MMTK/Geometry.py
+++ b/MMTK/Geometry.py
@@ -750,8 +750,8 @@ def superpositionFit(confs):
                   position for each atom
     :type confs: sequence of (float, Vector, Vector)
     :returns: the quaternion representing the rotation,
-              the center of mass in the alternate configuraton,
               the center of mass in the reference configuration,
+              the center of mass in the alternate configuraton,
               and the RMS distance after the optimal superposition
     """
     w_sum = 0.
diff --git a/MMTK/__pkginfo__.py b/MMTK/__pkginfo__.py
index a6a919c..cdda1d6 100644
--- a/MMTK/__pkginfo__.py
+++ b/MMTK/__pkginfo__.py
@@ -1,3 +1,3 @@
 # Data used both in the package and by setup.py
 
-__version__ = '2.7.8'
+__version__ = '2.7.9'
diff --git a/Src/MMTK_forcefield.c b/Src/MMTK_forcefield.c
index c73e726..f5e2f61 100644
--- a/Src/MMTK_forcefield.c
+++ b/Src/MMTK_forcefield.c
@@ -502,12 +502,24 @@ evaluator_dealloc(PyFFEvaluatorObject *self)
     for (i = 1; i < self->nthreads; i++) {
       int j = 50;
       tinfo->exit = 1;
+#if THREAD_DEBUG
+      printf("Releasing thread %d\n", tinfo->input.thread_id);
+#endif
       PyThread_release_lock(tinfo->lock);
       while (!tinfo->stop && j--) {
+#if THREAD_DEBUG
+        printf("evaluator_dealloc: Waiting for thread %d to stop (tinfo->stop is %d)\n",
+               tinfo->input.thread_id, tinfo->stop);
+#endif
 #ifdef MS_WINDOWS
-	Sleep(10);
+	Sleep(10);  /* 10 ms */
 #else
-	sleep(10);
+        {
+          struct timeval tv;
+          tv.tv_sec = 0;
+          tv.tv_usec = 10000;  /* 10 ms */
+          select(0, NULL, NULL, NULL, &tv);
+        }
 #endif
       }
       Py_XDECREF(tinfo->energy.gradients);
diff --git a/Src/MMTK_restraints.c b/Src/MMTK_restraints.c
index 00adaa7..9cdc0e5 100644
--- a/Src/MMTK_restraints.c
+++ b/Src/MMTK_restraints.c
@@ -1,4 +1,4 @@
-/* Generated by Cython 0.16 on Mon Jul  9 09:47:32 2012 */
+/* Generated by Cython 0.16 on Tue Oct 23 15:24:45 2012 */
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
diff --git a/Src/MMTK_trajectory_generator.c b/Src/MMTK_trajectory_generator.c
index 0d5c6ff..e84e34e 100644
--- a/Src/MMTK_trajectory_generator.c
+++ b/Src/MMTK_trajectory_generator.c
@@ -1,16 +1,16 @@
-/* Generated by Cython 0.15 on Wed Dec 14 16:44:42 2011 */
+/* Generated by Cython 0.17.3 on Thu May 23 17:58:18 2013 */
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
 #ifndef Py_PYTHON_H
     #error Python headers needed to compile C extensions, please install development version of Python.
+#elif PY_VERSION_HEX < 0x02040000
+    #error Cython requires Python 2.4+.
 #else
-
 #include <stddef.h> /* For offsetof */
 #ifndef offsetof
 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
 #endif
-
 #if !defined(WIN32) && !defined(MS_WINDOWS)
   #ifndef __stdcall
     #define __stdcall
@@ -22,36 +22,47 @@
     #define __fastcall
   #endif
 #endif
-
 #ifndef DL_IMPORT
   #define DL_IMPORT(t) t
 #endif
 #ifndef DL_EXPORT
   #define DL_EXPORT(t) t
 #endif
-
 #ifndef PY_LONG_LONG
   #define PY_LONG_LONG LONG_LONG
 #endif
-
-#if PY_VERSION_HEX < 0x02040000
-  #define METH_COEXIST 0
-  #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
-  #define PyDict_Contains(d,o)   PySequence_Contains(d,o)
+#ifndef Py_HUGE_VAL
+  #define Py_HUGE_VAL HUGE_VAL
+#endif
+#ifdef PYPY_VERSION
+#define CYTHON_COMPILING_IN_PYPY 1
+#define CYTHON_COMPILING_IN_CPYTHON 0
+#else
+#define CYTHON_COMPILING_IN_PYPY 0
+#define CYTHON_COMPILING_IN_CPYTHON 1
 #endif
-
 #if PY_VERSION_HEX < 0x02050000
   typedef int Py_ssize_t;
   #define PY_SSIZE_T_MAX INT_MAX
   #define PY_SSIZE_T_MIN INT_MIN
   #define PY_FORMAT_SIZE_T ""
+  #define CYTHON_FORMAT_SSIZE_T ""
   #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
   #define PyInt_AsSsize_t(o)   __Pyx_PyInt_AsInt(o)
-  #define PyNumber_Index(o)    PyNumber_Int(o)
-  #define PyIndex_Check(o)     PyNumber_Check(o)
+  #define PyNumber_Index(o)    ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
+                                (PyErr_Format(PyExc_TypeError, \
+                                              "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
+                                 (PyObject*)0))
+  #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
+                                  !PyComplex_Check(o))
+  #define PyIndex_Check __Pyx_PyIndex_Check
   #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
+  #define __PYX_BUILD_PY_SSIZE_T "i"
+#else
+  #define __PYX_BUILD_PY_SSIZE_T "n"
+  #define CYTHON_FORMAT_SSIZE_T "z"
+  #define __Pyx_PyIndex_Check PyIndex_Check
 #endif
-
 #if PY_VERSION_HEX < 0x02060000
   #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
   #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
@@ -59,7 +70,6 @@
   #define PyVarObject_HEAD_INIT(type, size) \
           PyObject_HEAD_INIT(type) size,
   #define PyType_Modified(t)
-
   typedef struct {
      void *buf;
      PyObject *obj;
@@ -73,7 +83,6 @@
      Py_ssize_t *suboffsets;
      void *internal;
   } Py_buffer;
-
   #define PyBUF_SIMPLE 0
   #define PyBUF_WRITABLE 0x0001
   #define PyBUF_FORMAT 0x0004
@@ -83,24 +92,44 @@
   #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
   #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
   #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
-
+  #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)
+  #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)
+  typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
+  typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
 #endif
-
 #if PY_MAJOR_VERSION < 3
   #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
+  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+          PyCode_New(a, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
 #else
   #define __Pyx_BUILTIN_MODULE_NAME "builtins"
+  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+#endif
+#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6
+  #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict")
 #endif
-
 #if PY_MAJOR_VERSION >= 3
   #define Py_TPFLAGS_CHECKTYPES 0
   #define Py_TPFLAGS_HAVE_INDEX 0
 #endif
-
 #if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
 #endif
-
+#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
+  #define CYTHON_PEP393_ENABLED 1
+  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ? \
+                                              0 : _PyUnicode_Ready((PyObject *)(op)))
+  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
+  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
+  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
+#else
+  #define CYTHON_PEP393_ENABLED 0
+  #define __Pyx_PyUnicode_READY(op)       (0)
+  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
+  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
+  #define __Pyx_PyUnicode_READ(k, d, i)   ((k=k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+#endif
 #if PY_MAJOR_VERSION >= 3
   #define PyBaseString_Type            PyUnicode_Type
   #define PyStringObject               PyUnicodeObject
@@ -108,7 +137,6 @@
   #define PyString_Check               PyUnicode_Check
   #define PyString_CheckExact          PyUnicode_CheckExact
 #endif
-
 #if PY_VERSION_HEX < 0x02060000
   #define PyBytesObject                PyStringObject
   #define PyBytes_Type                 PyString_Type
@@ -127,7 +155,6 @@
   #define PyBytes_Concat               PyString_Concat
   #define PyBytes_ConcatAndDel         PyString_ConcatAndDel
 #endif
-
 #if PY_VERSION_HEX < 0x02060000
   #define PySet_Check(obj)             PyObject_TypeCheck(obj, &PySet_Type)
   #define PyFrozenSet_Check(obj)       PyObject_TypeCheck(obj, &PyFrozenSet_Type)
@@ -135,9 +162,7 @@
 #ifndef PySet_CheckExact
   #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
 #endif
-
 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
-
 #if PY_MAJOR_VERSION >= 3
   #define PyIntObject                  PyLongObject
   #define PyInt_Type                   PyLong_Type
@@ -154,11 +179,9 @@
   #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
   #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
 #endif
-
 #if PY_MAJOR_VERSION >= 3
   #define PyBoolObject                 PyLongObject
 #endif
-
 #if PY_VERSION_HEX < 0x03020000
   typedef long Py_hash_t;
   #define __Pyx_PyInt_FromHash_t PyInt_FromLong
@@ -167,16 +190,6 @@
   #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
   #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
 #endif
-
-
-#if PY_MAJOR_VERSION >= 3
-  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
-  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
-#else
-  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
-  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
-#endif
-
 #if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
   #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
   #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
@@ -195,11 +208,9 @@
         (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
             (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
 #endif
-
 #if PY_MAJOR_VERSION >= 3
   #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
 #endif
-
 #if PY_VERSION_HEX < 0x02050000
   #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
   #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
@@ -209,7 +220,6 @@
   #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
   #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
 #endif
-
 #if PY_VERSION_HEX < 0x02050000
   #define __Pyx_NAMESTR(n) ((char *)(n))
   #define __Pyx_DOCSTR(n)  ((char *)(n))
@@ -218,6 +228,15 @@
   #define __Pyx_DOCSTR(n)  (n)
 #endif
 
+
+#if PY_MAJOR_VERSION >= 3
+  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
+  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
+#else
+  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
+  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
+#endif
+
 #ifndef __PYX_EXTERN_C
   #ifdef __cplusplus
     #define __PYX_EXTERN_C extern "C"
@@ -271,7 +290,7 @@
 #   else
 #     define CYTHON_UNUSED
 #   endif
-# elif defined(__ICC) || defined(__INTEL_COMPILER)
+# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
 #   define CYTHON_UNUSED __attribute__ ((__unused__))
 # else
 #   define CYTHON_UNUSED
@@ -295,8 +314,12 @@ static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
 static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
 
+#if CYTHON_COMPILING_IN_CPYTHON
 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
-
+#else
+#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
+#endif
+#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
 
 #ifdef __GNUC__
   /* Test for GCC > 2.95 */
@@ -321,7 +344,6 @@ static int __pyx_clineno = 0;
 static const char * __pyx_cfilenm= __FILE__;
 static const char *__pyx_filename;
 
-
 #if !defined(CYTHON_CCOMPLEX)
   #if defined(__cplusplus)
     #define CYTHON_CCOMPLEX 1
@@ -331,7 +353,6 @@ static const char *__pyx_filename;
     #define CYTHON_CCOMPLEX 0
   #endif
 #endif
-
 #if CYTHON_CCOMPLEX
   #ifdef __cplusplus
     #include <complex>
@@ -339,27 +360,56 @@ static const char *__pyx_filename;
     #include <complex.h>
   #endif
 #endif
-
 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
   #undef _Complex_I
   #define _Complex_I 1.0fj
 #endif
 
+
 static const char *__pyx_f[] = {
   "MMTK_trajectory_generator.pyx",
   "numpy.pxd",
   "numeric.pxi",
   "forcefield.pxi",
+  "type.pxd",
 };
+#define IS_UNSIGNED(type) (((type) -1) > 0)
+struct __Pyx_StructField_;
+#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
+typedef struct {
+  const char* name; /* for error messages only */
+  struct __Pyx_StructField_* fields;
+  size_t size;     /* sizeof(type) */
+  size_t arraysize[8]; /* length of array in each dimension */
+  int ndim;
+  char typegroup; /* _R_eal, _C_omplex, Signed _I_nt, _U_nsigned int, _S_truct, _P_ointer, _O_bject, c_H_ar */
+  char is_unsigned;
+  int flags;
+} __Pyx_TypeInfo;
+typedef struct __Pyx_StructField_ {
+  __Pyx_TypeInfo* type;
+  const char* name;
+  size_t offset;
+} __Pyx_StructField;
+typedef struct {
+  __Pyx_StructField* field;
+  size_t parent_offset;
+} __Pyx_BufFmt_StackElem;
+typedef struct {
+  __Pyx_StructField root;
+  __Pyx_BufFmt_StackElem* head;
+  size_t fmt_offset;
+  size_t new_count, enc_count;
+  size_t struct_alignment;
+  int is_complex;
+  char enc_type;
+  char new_packmode;
+  char enc_packmode;
+  char is_valid_array;
+} __Pyx_BufFmt_Context;
 
-static PyObject *__Pyx_Generator_Next(PyObject *self);
-static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value);
-static PyObject *__Pyx_Generator_Close(PyObject *self);
-static PyObject *__Pyx_Generator_Throw(PyObject *gen, PyObject *args, CYTHON_UNUSED PyObject *kwds);
-
-typedef PyObject *(*__pyx_generator_body_t)(PyObject *, PyObject *);
 
-/* "numpy.pxd":719
+/* "numpy.pxd":723
  * # in Cython to enable them only on the right systems.
  * 
  * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
@@ -368,7 +418,7 @@ typedef PyObject *(*__pyx_generator_body_t)(PyObject *, PyObject *);
  */
 typedef npy_int8 __pyx_t_5numpy_int8_t;
 
-/* "numpy.pxd":720
+/* "numpy.pxd":724
  * 
  * ctypedef npy_int8       int8_t
  * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
@@ -377,7 +427,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t;
  */
 typedef npy_int16 __pyx_t_5numpy_int16_t;
 
-/* "numpy.pxd":721
+/* "numpy.pxd":725
  * ctypedef npy_int8       int8_t
  * ctypedef npy_int16      int16_t
  * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
@@ -386,7 +436,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t;
  */
 typedef npy_int32 __pyx_t_5numpy_int32_t;
 
-/* "numpy.pxd":722
+/* "numpy.pxd":726
  * ctypedef npy_int16      int16_t
  * ctypedef npy_int32      int32_t
  * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
@@ -395,7 +445,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t;
  */
 typedef npy_int64 __pyx_t_5numpy_int64_t;
 
-/* "numpy.pxd":726
+/* "numpy.pxd":730
  * #ctypedef npy_int128     int128_t
  * 
  * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
@@ -404,7 +454,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t;
  */
 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
 
-/* "numpy.pxd":727
+/* "numpy.pxd":731
  * 
  * ctypedef npy_uint8      uint8_t
  * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
@@ -413,7 +463,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t;
  */
 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
 
-/* "numpy.pxd":728
+/* "numpy.pxd":732
  * ctypedef npy_uint8      uint8_t
  * ctypedef npy_uint16     uint16_t
  * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
@@ -422,7 +472,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t;
  */
 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
 
-/* "numpy.pxd":729
+/* "numpy.pxd":733
  * ctypedef npy_uint16     uint16_t
  * ctypedef npy_uint32     uint32_t
  * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
@@ -431,7 +481,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t;
  */
 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
 
-/* "numpy.pxd":733
+/* "numpy.pxd":737
  * #ctypedef npy_uint128    uint128_t
  * 
  * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
@@ -440,7 +490,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t;
  */
 typedef npy_float32 __pyx_t_5numpy_float32_t;
 
-/* "numpy.pxd":734
+/* "numpy.pxd":738
  * 
  * ctypedef npy_float32    float32_t
  * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
@@ -449,7 +499,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t;
  */
 typedef npy_float64 __pyx_t_5numpy_float64_t;
 
-/* "numpy.pxd":743
+/* "numpy.pxd":747
  * # The int types are mapped a bit surprising --
  * # numpy.int corresponds to 'l' and numpy.long to 'q'
  * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
@@ -458,7 +508,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t;
  */
 typedef npy_long __pyx_t_5numpy_int_t;
 
-/* "numpy.pxd":744
+/* "numpy.pxd":748
  * # numpy.int corresponds to 'l' and numpy.long to 'q'
  * ctypedef npy_long       int_t
  * ctypedef npy_longlong   long_t             # <<<<<<<<<<<<<<
@@ -467,7 +517,7 @@ typedef npy_long __pyx_t_5numpy_int_t;
  */
 typedef npy_longlong __pyx_t_5numpy_long_t;
 
-/* "numpy.pxd":745
+/* "numpy.pxd":749
  * ctypedef npy_long       int_t
  * ctypedef npy_longlong   long_t
  * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
@@ -476,7 +526,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t;
  */
 typedef npy_longlong __pyx_t_5numpy_longlong_t;
 
-/* "numpy.pxd":747
+/* "numpy.pxd":751
  * ctypedef npy_longlong   longlong_t
  * 
  * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
@@ -485,7 +535,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t;
  */
 typedef npy_ulong __pyx_t_5numpy_uint_t;
 
-/* "numpy.pxd":748
+/* "numpy.pxd":752
  * 
  * ctypedef npy_ulong      uint_t
  * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
@@ -494,7 +544,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t;
  */
 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
 
-/* "numpy.pxd":749
+/* "numpy.pxd":753
  * ctypedef npy_ulong      uint_t
  * ctypedef npy_ulonglong  ulong_t
  * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
@@ -503,7 +553,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
  */
 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
 
-/* "numpy.pxd":751
+/* "numpy.pxd":755
  * ctypedef npy_ulonglong  ulonglong_t
  * 
  * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
@@ -512,7 +562,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
  */
 typedef npy_intp __pyx_t_5numpy_intp_t;
 
-/* "numpy.pxd":752
+/* "numpy.pxd":756
  * 
  * ctypedef npy_intp       intp_t
  * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
@@ -521,7 +571,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t;
  */
 typedef npy_uintp __pyx_t_5numpy_uintp_t;
 
-/* "numpy.pxd":754
+/* "numpy.pxd":758
  * ctypedef npy_uintp      uintp_t
  * 
  * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
@@ -530,7 +580,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t;
  */
 typedef npy_double __pyx_t_5numpy_float_t;
 
-/* "numpy.pxd":755
+/* "numpy.pxd":759
  * 
  * ctypedef npy_double     float_t
  * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
@@ -539,7 +589,7 @@ typedef npy_double __pyx_t_5numpy_float_t;
  */
 typedef npy_double __pyx_t_5numpy_double_t;
 
-/* "numpy.pxd":756
+/* "numpy.pxd":760
  * ctypedef npy_double     float_t
  * ctypedef npy_double     double_t
  * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
@@ -547,7 +597,6 @@ typedef npy_double __pyx_t_5numpy_double_t;
  * ctypedef npy_cfloat      cfloat_t
  */
 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
-
 #if CYTHON_CCOMPLEX
   #ifdef __cplusplus
     typedef ::std::complex< float > __pyx_t_float_complex;
@@ -568,14 +617,14 @@ typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
     typedef struct { double real, imag; } __pyx_t_double_complex;
 #endif
 
+
 /*--- Type declarations ---*/
 struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator;
 struct __pyx_obj_25MMTK_trajectory_generator_EnergyBasedTrajectoryGenerator;
 struct __pyx_obj_25MMTK_trajectory_generator___pyx_scope_struct__optionString;
-struct __pyx_Generator_object;
 struct __pyx_obj_25MMTK_trajectory_generator___pyx_scope_struct_1_genexpr;
 
-/* "numpy.pxd":758
+/* "numpy.pxd":762
  * ctypedef npy_longdouble longdouble_t
  * 
  * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
@@ -584,7 +633,7 @@ struct __pyx_obj_25MMTK_trajectory_generator___pyx_scope_struct_1_genexpr;
  */
 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
 
-/* "numpy.pxd":759
+/* "numpy.pxd":763
  * 
  * ctypedef npy_cfloat      cfloat_t
  * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
@@ -593,7 +642,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
  */
 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
 
-/* "numpy.pxd":760
+/* "numpy.pxd":764
  * ctypedef npy_cfloat      cfloat_t
  * ctypedef npy_cdouble     cdouble_t
  * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
@@ -602,7 +651,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
  */
 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
 
-/* "numpy.pxd":762
+/* "numpy.pxd":766
  * ctypedef npy_clongdouble clongdouble_t
  * 
  * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
@@ -702,7 +751,7 @@ struct __pyx_obj_25MMTK_trajectory_generator_EnergyBasedTrajectoryGenerator {
 struct __pyx_obj_25MMTK_trajectory_generator___pyx_scope_struct__optionString {
   PyObject_HEAD
   PyObject *__pyx_v_options;
-  PyObject *__pyx_v_self;
+  struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *__pyx_v_self;
 };
 
 
@@ -713,18 +762,8 @@ struct __pyx_obj_25MMTK_trajectory_generator___pyx_scope_struct__optionString {
  *                    '')[:-2]
  * 
  */
-struct __pyx_Generator_object {
-  PyObject_HEAD
-  __pyx_generator_body_t body;
-  int is_running;
-  int resume_label;
-  PyObject *exc_type;
-  PyObject *exc_value;
-  PyObject *exc_traceback;
-};
-
 struct __pyx_obj_25MMTK_trajectory_generator___pyx_scope_struct_1_genexpr {
-  struct __pyx_Generator_object __pyx_base;
+  PyObject_HEAD
   struct __pyx_obj_25MMTK_trajectory_generator___pyx_scope_struct__optionString *__pyx_outer_scope;
   PyObject *__pyx_v_o;
   PyObject *__pyx_t_0;
@@ -774,12 +813,9 @@ struct __pyx_vtabstruct_25MMTK_trajectory_generator_EnergyBasedTrajectoryGenerat
   void (*calculateEnergies)(struct __pyx_obj_25MMTK_trajectory_generator_EnergyBasedTrajectoryGenerator *, PyArrayObject *, energy_data *, struct __pyx_opt_args_25MMTK_trajectory_generator_30EnergyBasedTrajectoryGenerator_calculateEnergies *__pyx_optional_args);
 };
 static struct __pyx_vtabstruct_25MMTK_trajectory_generator_EnergyBasedTrajectoryGenerator *__pyx_vtabptr_25MMTK_trajectory_generator_EnergyBasedTrajectoryGenerator;
-
-
 #ifndef CYTHON_REFNANNY
   #define CYTHON_REFNANNY 0
 #endif
-
 #if CYTHON_REFNANNY
   typedef struct {
     void (*INCREF)(void*, PyObject*, int);
@@ -792,8 +828,21 @@ static struct __pyx_vtabstruct_25MMTK_trajectory_generator_EnergyBasedTrajectory
   static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
   static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
   #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
-  #define __Pyx_RefNannySetupContext(name)           __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
-  #define __Pyx_RefNannyFinishContext()           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
+#ifdef WITH_THREAD
+  #define __Pyx_RefNannySetupContext(name, acquire_gil) \
+          if (acquire_gil) { \
+              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
+              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
+              PyGILState_Release(__pyx_gilstate_save); \
+          } else { \
+              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
+          }
+#else
+  #define __Pyx_RefNannySetupContext(name, acquire_gil) \
+          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
+#endif
+  #define __Pyx_RefNannyFinishContext() \
+          __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
   #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
   #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
   #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
@@ -804,7 +853,7 @@ static struct __pyx_vtabstruct_25MMTK_trajectory_generator_EnergyBasedTrajectory
   #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
 #else
   #define __Pyx_RefNannyDeclarations
-  #define __Pyx_RefNannySetupContext(name)
+  #define __Pyx_RefNannySetupContext(name, acquire_gil)
   #define __Pyx_RefNannyFinishContext()
   #define __Pyx_INCREF(r) Py_INCREF(r)
   #define __Pyx_DECREF(r) Py_DECREF(r)
@@ -815,19 +864,38 @@ static struct __pyx_vtabstruct_25MMTK_trajectory_generator_EnergyBasedTrajectory
   #define __Pyx_XGOTREF(r)
   #define __Pyx_XGIVEREF(r)
 #endif /* CYTHON_REFNANNY */
+#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
+#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
 
 static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
 
 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
     Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
 
-static void __Pyx_RaiseDoubleKeywordsError(
-    const char* func_name, PyObject* kw_name); /*proto*/
+static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/
 
-static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,     const char* function_name); /*proto*/
+static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
+    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
+    const char* function_name); /*proto*/
 
 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
 
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
+    PyListObject* L = (PyListObject*) list;
+    Py_ssize_t len = Py_SIZE(list);
+    if (likely(L->allocated > len)) {
+        Py_INCREF(x);
+        PyList_SET_ITEM(list, len, x);
+        Py_SIZE(list) = len+1;
+        return 0;
+    }
+    return PyList_Append(list, x);
+}
+#else
+#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
+#endif
+
 static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
 static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
 
@@ -835,16 +903,14 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
 
 static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);
 
-static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict,
-    const char* function_name, int kw_allowed); /*proto*/
+static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /*proto*/
 
 static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
     if (likely(PyList_CheckExact(L))) {
-        if (PyList_Append(L, x) < 0) return NULL;
+        if (unlikely(PyList_Append(L, x) < 0)) return NULL;
         Py_INCREF(Py_None);
         return Py_None; /* this is just to have an accurate signature */
-    }
-    else {
+    } else {
         PyObject *r, *m;
         m = __Pyx_GetAttrString(L, "append");
         if (!m) return NULL;
@@ -856,54 +922,52 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
 
 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
 
-/* Run-time type information about structs used with buffers */
-struct __Pyx_StructField_;
-
-typedef struct {
-  const char* name; /* for error messages only */
-  struct __Pyx_StructField_* fields;
-  size_t size;     /* sizeof(type) */
-  char typegroup; /* _R_eal, _C_omplex, Signed _I_nt, _U_nsigned int, _S_truct, _P_ointer, _O_bject */
-} __Pyx_TypeInfo;
-
-typedef struct __Pyx_StructField_ {
-  __Pyx_TypeInfo* type;
-  const char* name;
-  size_t offset;
-} __Pyx_StructField;
-
-typedef struct {
-  __Pyx_StructField* field;
-  size_t parent_offset;
-} __Pyx_BufFmt_StackElem;
-
-
-static CYTHON_INLINE int  __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
+static CYTHON_INLINE int  __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
+    __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
 static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
 
-static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
-
 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
 
+static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
+
 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
 
-static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /*proto*/
+static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/
+
+static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/
 
 static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
 static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
+
+typedef struct {
+  Py_ssize_t shape, strides, suboffsets;
+} __Pyx_Buf_DimInfo;
+typedef struct {
+  size_t refcount;
+  Py_buffer pybuffer;
+} __Pyx_Buffer;
+typedef struct {
+  __Pyx_Buffer *rcbuffer;
+  char *data;
+  __Pyx_Buf_DimInfo diminfo[8];
+} __Pyx_LocalBuf_ND;
+
 #if PY_MAJOR_VERSION < 3
-static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
-static void __Pyx_ReleaseBuffer(Py_buffer *view);
+    static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
+    static void __Pyx_ReleaseBuffer(Py_buffer *view);
 #else
-#define __Pyx_GetBuffer PyObject_GetBuffer
-#define __Pyx_ReleaseBuffer PyBuffer_Release
+    #define __Pyx_GetBuffer PyObject_GetBuffer
+    #define __Pyx_ReleaseBuffer PyBuffer_Release
 #endif
 
-Py_ssize_t __Pyx_zeros[] = {0, 0};
-Py_ssize_t __Pyx_minusones[] = {-1, -1};
+
+static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0};
+static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1};
 
 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level); /*proto*/
 
+static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name);
+
 #if CYTHON_CCOMPLEX
   #ifdef __cplusplus
     #define __Pyx_CREAL(z) ((z).real())
@@ -916,7 +980,6 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level);
     #define __Pyx_CREAL(z) ((z).real)
     #define __Pyx_CIMAG(z) ((z).imag)
 #endif
-
 #if defined(_WIN32) && defined(__cplusplus) && CYTHON_CCOMPLEX
     #define __Pyx_SET_CREAL(z,x) ((z).real(x))
     #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
@@ -1037,19 +1100,69 @@ static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *
 
 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
 
+#define __Pyx_Generator_USED
+#include <structmember.h>
+#include <frameobject.h>
+typedef PyObject *(*__pyx_generator_body_t)(PyObject *, PyObject *);
+typedef struct {
+    PyObject_HEAD
+    __pyx_generator_body_t body;
+    PyObject *closure;
+    PyObject *exc_type;
+    PyObject *exc_value;
+    PyObject *exc_traceback;
+    PyObject *gi_weakreflist;
+    PyObject *classobj;
+    PyObject *yieldfrom;
+    int resume_label;
+    char is_running;  // using T_BOOL for property below requires char value
+} __pyx_GeneratorObject;
+static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body,
+                                                  PyObject *closure);
+static int __pyx_Generator_init(void);
+static int __Pyx_Generator_clear(PyObject* self);
+#if 1 || PY_VERSION_HEX < 0x030300B0
+static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue);
+#else
+#define __Pyx_PyGen_FetchStopIterationValue(pvalue) PyGen_FetchStopIterationValue(pvalue)
+#endif
+
 static int __Pyx_check_binary_version(void);
 
-static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);  /*proto*/
+#if !defined(__Pyx_PyIdentifier_FromString)
+#if PY_MAJOR_VERSION < 3
+  #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
+#else
+  #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
+#endif
+#endif
 
 static PyObject *__Pyx_ImportModule(const char *name); /*proto*/
 
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);  /*proto*/
+
 static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
 
-static void __Pyx_AddTraceback(const char *funcname, int __pyx_clineno,
-                               int __pyx_lineno, const char *__pyx_filename); /*proto*/
+typedef struct {
+    int code_line;
+    PyCodeObject* code_object;
+} __Pyx_CodeObjectCacheEntry;
+struct __Pyx_CodeObjectCache {
+    int count;
+    int max_count;
+    __Pyx_CodeObjectCacheEntry* entries;
+};
+static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
+static PyCodeObject *__pyx_find_code_object(int code_line);
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
+
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+                               int py_line, const char *filename); /*proto*/
 
 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
 
+
 /* Module declarations from 'cpython.buffer' */
 
 /* Module declarations from 'cpython.ref' */
@@ -1058,6 +1171,11 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
 
 /* Module declarations from 'cpython.object' */
 
+/* Module declarations from '__builtin__' */
+
+/* Module declarations from 'cpython.type' */
+static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
+
 /* Module declarations from 'libc.stdlib' */
 
 /* Module declarations from 'numpy' */
@@ -1068,21 +1186,12 @@ static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
-static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *); /*proto*/
-static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *, PyObject *); /*proto*/
-static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *, PyObject *, PyObject *); /*proto*/
-static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/
-static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *, PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/
 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
-static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *, PyObject *); /*proto*/
-static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *); /*proto*/
 
 /* Module declarations from 'Scientific.N' */
 
 /* Module declarations from 'MMTK_forcefield' */
 
-/* Module declarations from 'cython.cython.view' */
-
 /* Module declarations from 'cython' */
 
 /* Module declarations from 'MMTK_trajectory_generator' */
@@ -1091,9 +1200,8 @@ static PyTypeObject *__pyx_ptype_25MMTK_trajectory_generator_EnergyTerm = 0;
 static PyTypeObject *__pyx_ptype_25MMTK_trajectory_generator_TrajectoryGenerator = 0;
 static PyTypeObject *__pyx_ptype_25MMTK_trajectory_generator_EnergyBasedTrajectoryGenerator = 0;
 static PyTypeObject *__pyx_ptype_25MMTK_trajectory_generator___pyx_scope_struct__optionString = 0;
-static PyTypeObject *__pyx_ptype_25MMTK_trajectory_generator___pyx_Generator = 0;
 static PyTypeObject *__pyx_ptype_25MMTK_trajectory_generator___pyx_scope_struct_1_genexpr = 0;
-static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), 'R' };
+static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
 #define __Pyx_MODULE_NAME "MMTK_trajectory_generator"
 int __pyx_module_is_main_MMTK_trajectory_generator = 0;
 
@@ -1104,6 +1212,27 @@ static PyObject *__pyx_builtin_sum;
 static PyObject *__pyx_builtin_MemoryError;
 static PyObject *__pyx_builtin_range;
 static PyObject *__pyx_builtin_RuntimeError;
+static int __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator___init__(struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *__pyx_v_self, PyObject *__pyx_v_universe, PyObject *__pyx_v_options, PyObject *__pyx_v_name); /* proto */
+static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_2setCallOptions(struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *__pyx_v_self, PyObject *__pyx_v_options); /* proto */
+static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_4getActions(struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6cleanupActions(struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_8getOption(struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *__pyx_v_self, PyObject *__pyx_v_option); /* proto */
+static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_12optionString_genexpr(PyObject *__pyx_self); /* proto */
+static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_10optionString(struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *__pyx_v_self, PyObject *__pyx_v_options); /* proto */
+static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_12__call__(struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *__pyx_v_self, PyObject *__pyx_v_options); /* proto */
+static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_14start_py(struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_8universe___get__(struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_7options___get__(struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_4name___get__(struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_12call_options___get__(struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_8features___get__(struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_7actions___get__(struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_14state_accessor___get__(struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *__pyx_v_self); /* proto */
+static int __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_14state_accessor_2__set__(struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
+static int __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_14state_accessor_4__del__(struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *__pyx_v_self); /* proto */
+static int __pyx_pf_25MMTK_trajectory_generator_30EnergyBasedTrajectoryGenerator___init__(struct __pyx_obj_25MMTK_trajectory_generator_EnergyBasedTrajectoryGenerator *__pyx_v_self, PyObject *__pyx_v_universe, PyObject *__pyx_v_options, PyObject *__pyx_v_name); /* proto */
+static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
+static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
 static char __pyx_k_2[] = "getSpecificationList";
 static char __pyx_k_3[] = "undefined option: ";
 static char __pyx_k_4[] = "=";
@@ -1243,67 +1372,57 @@ static PyObject *__pyx_k_tuple_26;
 static PyObject *__pyx_k_tuple_27;
 static PyObject *__pyx_k_tuple_29;
 
-/* "MMTK_trajectory_generator.pyx":33
- *     """
- * 
- *     def __init__(self, universe, options, name):             # <<<<<<<<<<<<<<
- *         self.universe = universe
- *         self.options = options
- */
-
-static int __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+/* Python wrapper */
+static int __pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_universe = 0;
   PyObject *__pyx_v_options = 0;
   PyObject *__pyx_v_name = 0;
   int __pyx_r;
   __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__universe,&__pyx_n_s__options,&__pyx_n_s__name,0};
-  __Pyx_RefNannySetupContext("__init__");
-  if (unlikely(__pyx_kwds)) {
-    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__universe,&__pyx_n_s__options,&__pyx_n_s__name,0};
     PyObject* values[3] = {0,0,0};
-    switch (PyTuple_GET_SIZE(__pyx_args)) {
-      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
-      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
-      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-      case  0: break;
-      default: goto __pyx_L5_argtuple_error;
-    }
-    switch (PyTuple_GET_SIZE(__pyx_args)) {
-      case  0:
-      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__universe);
-      if (likely(values[0])) kw_args--;
-      else goto __pyx_L5_argtuple_error;
-      case  1:
-      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__options);
-      if (likely(values[1])) kw_args--;
-      else {
-        __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
       }
-      case  2:
-      values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__name);
-      if (likely(values[2])) kw_args--;
-      else {
-        __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__universe)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        case  1:
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__options)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        }
+        case  2:
+        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__name)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        }
       }
-    }
-    if (unlikely(kw_args > 0)) {
-      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
     }
     __pyx_v_universe = values[0];
     __pyx_v_options = values[1];
     __pyx_v_name = values[2];
-  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
-    goto __pyx_L5_argtuple_error;
-  } else {
-    __pyx_v_universe = PyTuple_GET_ITEM(__pyx_args, 0);
-    __pyx_v_options = PyTuple_GET_ITEM(__pyx_args, 1);
-    __pyx_v_name = PyTuple_GET_ITEM(__pyx_args, 2);
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
@@ -1313,6 +1432,27 @@ static int __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator___init__(P
   __Pyx_RefNannyFinishContext();
   return -1;
   __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator___init__(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self), __pyx_v_universe, __pyx_v_options, __pyx_v_name);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* "MMTK_trajectory_generator.pyx":33
+ *     """
+ * 
+ *     def __init__(self, universe, options, name):             # <<<<<<<<<<<<<<
+ *         self.universe = universe
+ *         self.options = options
+ */
+
+static int __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator___init__(struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *__pyx_v_self, PyObject *__pyx_v_universe, PyObject *__pyx_v_options, PyObject *__pyx_v_name) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  PyObject *__pyx_t_1 = NULL;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
+  __Pyx_RefNannySetupContext("__init__", 0);
 
   /* "MMTK_trajectory_generator.pyx":34
  * 
@@ -1323,9 +1463,9 @@ static int __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator___init__(P
  */
   __Pyx_INCREF(__pyx_v_universe);
   __Pyx_GIVEREF(__pyx_v_universe);
-  __Pyx_GOTREF(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->universe);
-  __Pyx_DECREF(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->universe);
-  ((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->universe = __pyx_v_universe;
+  __Pyx_GOTREF(__pyx_v_self->universe);
+  __Pyx_DECREF(__pyx_v_self->universe);
+  __pyx_v_self->universe = __pyx_v_universe;
 
   /* "MMTK_trajectory_generator.pyx":35
  *     def __init__(self, universe, options, name):
@@ -1336,9 +1476,9 @@ static int __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator___init__(P
  */
   __Pyx_INCREF(__pyx_v_options);
   __Pyx_GIVEREF(__pyx_v_options);
-  __Pyx_GOTREF(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->options);
-  __Pyx_DECREF(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->options);
-  ((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->options = __pyx_v_options;
+  __Pyx_GOTREF(__pyx_v_self->options);
+  __Pyx_DECREF(__pyx_v_self->options);
+  __pyx_v_self->options = __pyx_v_options;
 
   /* "MMTK_trajectory_generator.pyx":36
  *         self.universe = universe
@@ -1349,9 +1489,9 @@ static int __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator___init__(P
  */
   __Pyx_INCREF(__pyx_v_name);
   __Pyx_GIVEREF(__pyx_v_name);
-  __Pyx_GOTREF(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->name);
-  __Pyx_DECREF(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->name);
-  ((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->name = __pyx_v_name;
+  __Pyx_GOTREF(__pyx_v_self->name);
+  __Pyx_DECREF(__pyx_v_self->name);
+  __pyx_v_self->name = __pyx_v_name;
 
   /* "MMTK_trajectory_generator.pyx":37
  *         self.options = options
@@ -1363,9 +1503,9 @@ static int __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator___init__(P
   __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
   __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
-  __Pyx_GOTREF(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->call_options);
-  __Pyx_DECREF(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->call_options);
-  ((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->call_options = ((PyObject *)__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->call_options);
+  __Pyx_DECREF(__pyx_v_self->call_options);
+  __pyx_v_self->call_options = ((PyObject *)__pyx_t_1);
   __pyx_t_1 = 0;
 
   /* "MMTK_trajectory_generator.pyx":38
@@ -1376,11 +1516,11 @@ static int __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator___init__(P
  *         self.tspec = NULL
  */
   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
+  __Pyx_GOTREF(__pyx_t_1);
   __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
-  __Pyx_GOTREF(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->features);
-  __Pyx_DECREF(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->features);
-  ((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->features = ((PyObject *)__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->features);
+  __Pyx_DECREF(__pyx_v_self->features);
+  __pyx_v_self->features = ((PyObject *)__pyx_t_1);
   __pyx_t_1 = 0;
 
   /* "MMTK_trajectory_generator.pyx":39
@@ -1390,7 +1530,7 @@ static int __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator___init__(P
  *         self.tspec = NULL
  * 
  */
-  ((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->tvars = NULL;
+  __pyx_v_self->tvars = NULL;
 
   /* "MMTK_trajectory_generator.pyx":40
  *         self.features = []
@@ -1399,7 +1539,7 @@ static int __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator___init__(P
  * 
  *     def setCallOptions(self, options):
  */
-  ((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->tspec = NULL;
+  __pyx_v_self->tspec = NULL;
 
   __pyx_r = 0;
   goto __pyx_L0;
@@ -1412,6 +1552,17 @@ static int __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator___init__(P
   return __pyx_r;
 }
 
+/* Python wrapper */
+static PyObject *__pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_3setCallOptions(PyObject *__pyx_v_self, PyObject *__pyx_v_options); /*proto*/
+static PyObject *__pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_3setCallOptions(PyObject *__pyx_v_self, PyObject *__pyx_v_options) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("setCallOptions (wrapper)", 0);
+  __pyx_r = __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_2setCallOptions(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self), ((PyObject *)__pyx_v_options));
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 /* "MMTK_trajectory_generator.pyx":42
  *         self.tspec = NULL
  * 
@@ -1420,11 +1571,10 @@ static int __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator___init__(P
  * 
  */
 
-static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_1setCallOptions(PyObject *__pyx_v_self, PyObject *__pyx_v_options); /*proto*/
-static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_1setCallOptions(PyObject *__pyx_v_self, PyObject *__pyx_v_options) {
+static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_2setCallOptions(struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *__pyx_v_self, PyObject *__pyx_v_options) {
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("setCallOptions");
+  __Pyx_RefNannySetupContext("setCallOptions", 0);
 
   /* "MMTK_trajectory_generator.pyx":43
  * 
@@ -1435,9 +1585,9 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_1set
  */
   __Pyx_INCREF(__pyx_v_options);
   __Pyx_GIVEREF(__pyx_v_options);
-  __Pyx_GOTREF(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->call_options);
-  __Pyx_DECREF(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->call_options);
-  ((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->call_options = __pyx_v_options;
+  __Pyx_GOTREF(__pyx_v_self->call_options);
+  __Pyx_DECREF(__pyx_v_self->call_options);
+  __pyx_v_self->call_options = __pyx_v_options;
 
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   __Pyx_XGIVEREF(__pyx_r);
@@ -1445,6 +1595,17 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_1set
   return __pyx_r;
 }
 
+/* Python wrapper */
+static PyObject *__pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_5getActions(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_5getActions(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("getActions (wrapper)", 0);
+  __pyx_r = __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_4getActions(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self));
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 /* "MMTK_trajectory_generator.pyx":45
  *         self.call_options = options
  * 
@@ -1453,8 +1614,7 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_1set
  *             steps = self.getOption('steps')
  */
 
-static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_2getActions(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_2getActions(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_4getActions(struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *__pyx_v_self) {
   PyObject *__pyx_v_steps = NULL;
   PyObject *__pyx_v_a = NULL;
   PyObject *__pyx_r = NULL;
@@ -1473,7 +1633,7 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_2get
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("getActions");
+  __Pyx_RefNannySetupContext("getActions", 0);
 
   /* "MMTK_trajectory_generator.pyx":46
  * 
@@ -1496,9 +1656,9 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_2get
  *         except ValueError:
  *             steps = None
  */
-      __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__getOption); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
+      __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__getOption); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
+      __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       __pyx_v_steps = __pyx_t_5;
@@ -1507,8 +1667,8 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_2get
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-    goto __pyx_L12_try_end;
-    __pyx_L5_error:;
+    goto __pyx_L10_try_end;
+    __pyx_L3_error:;
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
 
@@ -1522,7 +1682,7 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_2get
     __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
     if (__pyx_t_6) {
       __Pyx_AddTraceback("MMTK_trajectory_generator.TrajectoryGenerator.getActions", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
+      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_GOTREF(__pyx_t_7);
@@ -1540,20 +1700,20 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_2get
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      goto __pyx_L6_exception_handled;
+      goto __pyx_L4_exception_handled;
     }
-    __pyx_L7_except_error:;
+    __pyx_L5_except_error:;
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
     goto __pyx_L1_error;
-    __pyx_L6_exception_handled:;
+    __pyx_L4_exception_handled:;
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
-    __pyx_L12_try_end:;
+    __pyx_L10_try_end:;
   }
 
   /* "MMTK_trajectory_generator.pyx":50
@@ -1565,22 +1725,30 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_2get
  */
   __Pyx_XDECREF(__pyx_r);
   __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
-  if (PyList_CheckExact(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->actions) || PyTuple_CheckExact(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->actions)) {
-    __pyx_t_4 = ((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->actions; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0;
+  __Pyx_GOTREF(__pyx_t_7);
+  if (PyList_CheckExact(__pyx_v_self->actions) || PyTuple_CheckExact(__pyx_v_self->actions)) {
+    __pyx_t_4 = __pyx_v_self->actions; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0;
     __pyx_t_9 = NULL;
   } else {
-    __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->actions); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_self->actions); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext;
   }
   for (;;) {
-    if (PyList_CheckExact(__pyx_t_4)) {
+    if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_4)) {
       if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break;
-      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++;
-    } else if (PyTuple_CheckExact(__pyx_t_4)) {
+      #if CYTHON_COMPILING_IN_CPYTHON
+      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      #else
+      __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      #endif
+    } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_4)) {
       if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
-      __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++;
+      #if CYTHON_COMPILING_IN_CPYTHON
+      __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      #else
+      __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      #endif
     } else {
       __pyx_t_5 = __pyx_t_9(__pyx_t_4);
       if (unlikely(!__pyx_t_5)) {
@@ -1598,10 +1766,10 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_2get
     __pyx_t_5 = PyObject_GetAttr(__pyx_v_a, __pyx_n_s_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_5);
     __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_10));
-    __Pyx_INCREF(__pyx_v_self);
-    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_self);
-    __Pyx_GIVEREF(__pyx_v_self);
+    __Pyx_GOTREF(__pyx_t_10);
+    __Pyx_INCREF(((PyObject *)__pyx_v_self));
+    PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_v_self));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
     __Pyx_INCREF(__pyx_v_steps);
     PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_steps);
     __Pyx_GIVEREF(__pyx_v_steps);
@@ -1609,7 +1777,7 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_2get
     __Pyx_GOTREF(__pyx_t_11);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
-    if (unlikely(PyList_Append(__pyx_t_7, (PyObject*)__pyx_t_11))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(__Pyx_PyList_Append(__pyx_t_7, (PyObject*)__pyx_t_11))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
   }
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -1636,6 +1804,17 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_2get
   return __pyx_r;
 }
 
+/* Python wrapper */
+static PyObject *__pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_7cleanupActions(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_7cleanupActions(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("cleanupActions (wrapper)", 0);
+  __pyx_r = __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6cleanupActions(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self));
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 /* "MMTK_trajectory_generator.pyx":52
  *         return [a.getSpecificationList(self, steps) for a in self.actions]
  * 
@@ -1644,8 +1823,7 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_2get
  *             a.cleanup()
  */
 
-static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_3cleanupActions(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_3cleanupActions(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6cleanupActions(struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *__pyx_v_self) {
   PyObject *__pyx_v_a = NULL;
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
@@ -1657,7 +1835,7 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_3cle
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("cleanupActions");
+  __Pyx_RefNannySetupContext("cleanupActions", 0);
 
   /* "MMTK_trajectory_generator.pyx":53
  * 
@@ -1666,21 +1844,29 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_3cle
  *             a.cleanup()
  * 
  */
-  if (PyList_CheckExact(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->actions) || PyTuple_CheckExact(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->actions)) {
-    __pyx_t_1 = ((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->actions; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
+  if (PyList_CheckExact(__pyx_v_self->actions) || PyTuple_CheckExact(__pyx_v_self->actions)) {
+    __pyx_t_1 = __pyx_v_self->actions; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
     __pyx_t_3 = NULL;
   } else {
-    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->actions); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->actions); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
     __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
   }
   for (;;) {
-    if (PyList_CheckExact(__pyx_t_1)) {
+    if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
       if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
-      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++;
-    } else if (PyTuple_CheckExact(__pyx_t_1)) {
+      #if CYTHON_COMPILING_IN_CPYTHON
+      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      #else
+      __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      #endif
+    } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
       if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
-      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++;
+      #if CYTHON_COMPILING_IN_CPYTHON
+      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      #else
+      __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      #endif
     } else {
       __pyx_t_4 = __pyx_t_3(__pyx_t_1);
       if (unlikely(!__pyx_t_4)) {
@@ -1727,6 +1913,17 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_3cle
   return __pyx_r;
 }
 
+/* Python wrapper */
+static PyObject *__pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_9getOption(PyObject *__pyx_v_self, PyObject *__pyx_v_option); /*proto*/
+static PyObject *__pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_9getOption(PyObject *__pyx_v_self, PyObject *__pyx_v_option) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("getOption (wrapper)", 0);
+  __pyx_r = __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_8getOption(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self), ((PyObject *)__pyx_v_option));
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 /* "MMTK_trajectory_generator.pyx":56
  *             a.cleanup()
  * 
@@ -1735,8 +1932,7 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_3cle
  *             value = self.call_options[option]
  */
 
-static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_4getOption(PyObject *__pyx_v_self, PyObject *__pyx_v_option); /*proto*/
-static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_4getOption(PyObject *__pyx_v_self, PyObject *__pyx_v_option) {
+static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_8getOption(struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *__pyx_v_self, PyObject *__pyx_v_option) {
   PyObject *__pyx_v_value = NULL;
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
@@ -1764,7 +1960,7 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_4get
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("getOption");
+  __Pyx_RefNannySetupContext("getOption", 0);
 
   /* "MMTK_trajectory_generator.pyx":57
  * 
@@ -1787,7 +1983,7 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_4get
  *         except KeyError:
  *             try:
  */
-      __pyx_t_4 = PyObject_GetItem(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->call_options, __pyx_v_option); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
+      __pyx_t_4 = PyObject_GetItem(__pyx_v_self->call_options, __pyx_v_option); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       __Pyx_GOTREF(__pyx_t_4);
       __pyx_v_value = __pyx_t_4;
       __pyx_t_4 = 0;
@@ -1795,8 +1991,8 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_4get
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-    goto __pyx_L12_try_end;
-    __pyx_L5_error:;
+    goto __pyx_L10_try_end;
+    __pyx_L3_error:;
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
 
     /* "MMTK_trajectory_generator.pyx":59
@@ -1809,7 +2005,7 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_4get
     __pyx_t_5 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
     if (__pyx_t_5) {
       __Pyx_AddTraceback("MMTK_trajectory_generator.TrajectoryGenerator.getOption", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
+      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_GOTREF(__pyx_t_7);
@@ -1835,7 +2031,7 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_4get
  *             except KeyError:
  *                 try:
  */
-          __pyx_t_11 = PyObject_GetItem(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->options, __pyx_v_option); if (!__pyx_t_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L15_error;}
+          __pyx_t_11 = PyObject_GetItem(__pyx_v_self->options, __pyx_v_option); if (!__pyx_t_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
           __Pyx_GOTREF(__pyx_t_11);
           __Pyx_XDECREF(__pyx_v_value);
           __pyx_v_value = __pyx_t_11;
@@ -1844,8 +2040,8 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_4get
         __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
         __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
         __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
-        goto __pyx_L22_try_end;
-        __pyx_L15_error:;
+        goto __pyx_L20_try_end;
+        __pyx_L13_error:;
         __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
 
         /* "MMTK_trajectory_generator.pyx":62
@@ -1858,7 +2054,7 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_4get
         __pyx_t_5 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
         if (__pyx_t_5) {
           __Pyx_AddTraceback("MMTK_trajectory_generator.TrajectoryGenerator.getOption", __pyx_clineno, __pyx_lineno, __pyx_filename);
-          if (__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;}
+          if (__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;}
           __Pyx_GOTREF(__pyx_t_11);
           __Pyx_GOTREF(__pyx_t_12);
           __Pyx_GOTREF(__pyx_t_13);
@@ -1884,9 +2080,9 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_4get
  *                 except KeyError:
  *                     raise ValueError('undefined option: ' + option)
  */
-              __pyx_t_17 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__default_options); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
+              __pyx_t_17 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__default_options); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
               __Pyx_GOTREF(__pyx_t_17);
-              __pyx_t_18 = PyObject_GetItem(__pyx_t_17, __pyx_v_option); if (!__pyx_t_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
+              __pyx_t_18 = PyObject_GetItem(__pyx_t_17, __pyx_v_option); if (!__pyx_t_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
               __Pyx_GOTREF(__pyx_t_18);
               __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
               __Pyx_XDECREF(__pyx_v_value);
@@ -1896,8 +2092,8 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_4get
             __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
             __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
             __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
-            goto __pyx_L32_try_end;
-            __pyx_L25_error:;
+            goto __pyx_L30_try_end;
+            __pyx_L23_error:;
             __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
             __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
 
@@ -1911,7 +2107,7 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_4get
             __pyx_t_5 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
             if (__pyx_t_5) {
               __Pyx_AddTraceback("MMTK_trajectory_generator.TrajectoryGenerator.getOption", __pyx_clineno, __pyx_lineno, __pyx_filename);
-              if (__Pyx_GetException(&__pyx_t_18, &__pyx_t_17, &__pyx_t_19) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
+              if (__Pyx_GetException(&__pyx_t_18, &__pyx_t_17, &__pyx_t_19) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L25_except_error;}
               __Pyx_GOTREF(__pyx_t_18);
               __Pyx_GOTREF(__pyx_t_17);
               __Pyx_GOTREF(__pyx_t_19);
@@ -1923,72 +2119,72 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_4get
  *         return value
  * 
  */
-              __pyx_t_20 = PyNumber_Add(((PyObject *)__pyx_kp_s_3), __pyx_v_option); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
+              __pyx_t_20 = PyNumber_Add(((PyObject *)__pyx_kp_s_3), __pyx_v_option); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L25_except_error;}
               __Pyx_GOTREF(__pyx_t_20);
-              __pyx_t_21 = PyTuple_New(1); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
-              __Pyx_GOTREF(((PyObject *)__pyx_t_21));
+              __pyx_t_21 = PyTuple_New(1); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L25_except_error;}
+              __Pyx_GOTREF(__pyx_t_21);
               PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_20);
               __Pyx_GIVEREF(__pyx_t_20);
               __pyx_t_20 = 0;
-              __pyx_t_20 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_21), NULL); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
+              __pyx_t_20 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_21), NULL); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L25_except_error;}
               __Pyx_GOTREF(__pyx_t_20);
               __Pyx_DECREF(((PyObject *)__pyx_t_21)); __pyx_t_21 = 0;
               __Pyx_Raise(__pyx_t_20, 0, 0, 0);
               __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
-              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L27_except_error;}
+              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L25_except_error;}
               __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
               __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
               __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
-              goto __pyx_L26_exception_handled;
+              goto __pyx_L24_exception_handled;
             }
-            __pyx_L27_except_error:;
+            __pyx_L25_except_error:;
             __Pyx_XGIVEREF(__pyx_t_14);
             __Pyx_XGIVEREF(__pyx_t_15);
             __Pyx_XGIVEREF(__pyx_t_16);
             __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
-            goto __pyx_L17_except_error;
-            __pyx_L26_exception_handled:;
+            goto __pyx_L15_except_error;
+            __pyx_L24_exception_handled:;
             __Pyx_XGIVEREF(__pyx_t_14);
             __Pyx_XGIVEREF(__pyx_t_15);
             __Pyx_XGIVEREF(__pyx_t_16);
             __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
-            __pyx_L32_try_end:;
+            __pyx_L30_try_end:;
           }
           __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
           __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
           __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-          goto __pyx_L16_exception_handled;
+          goto __pyx_L14_exception_handled;
         }
-        __pyx_L17_except_error:;
+        __pyx_L15_except_error:;
         __Pyx_XGIVEREF(__pyx_t_8);
         __Pyx_XGIVEREF(__pyx_t_9);
         __Pyx_XGIVEREF(__pyx_t_10);
         __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
-        goto __pyx_L7_except_error;
-        __pyx_L16_exception_handled:;
+        goto __pyx_L5_except_error;
+        __pyx_L14_exception_handled:;
         __Pyx_XGIVEREF(__pyx_t_8);
         __Pyx_XGIVEREF(__pyx_t_9);
         __Pyx_XGIVEREF(__pyx_t_10);
         __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
-        __pyx_L22_try_end:;
+        __pyx_L20_try_end:;
       }
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      goto __pyx_L6_exception_handled;
+      goto __pyx_L4_exception_handled;
     }
-    __pyx_L7_except_error:;
+    __pyx_L5_except_error:;
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
     goto __pyx_L1_error;
-    __pyx_L6_exception_handled:;
+    __pyx_L4_exception_handled:;
     __Pyx_XGIVEREF(__pyx_t_1);
     __Pyx_XGIVEREF(__pyx_t_2);
     __Pyx_XGIVEREF(__pyx_t_3);
     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
-    __pyx_L12_try_end:;
+    __pyx_L10_try_end:;
   }
 
   /* "MMTK_trajectory_generator.pyx":67
@@ -2025,7 +2221,18 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_4get
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
-static PyObject *__pyx_gb_25MMTK_trajectory_generator_12optionString_1generator(struct __pyx_obj_25MMTK_trajectory_generator___pyx_scope_struct_1_genexpr *__pyx_cur_scope, PyObject *__pyx_sent_value); /* proto */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_11optionString(PyObject *__pyx_v_self, PyObject *__pyx_v_options); /*proto*/
+static PyObject *__pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_11optionString(PyObject *__pyx_v_self, PyObject *__pyx_v_options) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("optionString (wrapper)", 0);
+  __pyx_r = __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_10optionString(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self), ((PyObject *)__pyx_v_options));
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+static PyObject *__pyx_gb_25MMTK_trajectory_generator_19TrajectoryGenerator_12optionString_2generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
 
 /* "MMTK_trajectory_generator.pyx":70
  * 
@@ -2035,37 +2242,45 @@ static PyObject *__pyx_gb_25MMTK_trajectory_generator_12optionString_1generator(
  * 
  */
 
-static PyObject *__pyx_pf_25MMTK_trajectory_generator_12optionString_genexpr(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyObject *__pyx_pf_25MMTK_trajectory_generator_12optionString_genexpr(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_12optionString_genexpr(PyObject *__pyx_self) {
   struct __pyx_obj_25MMTK_trajectory_generator___pyx_scope_struct_1_genexpr *__pyx_cur_scope;
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("genexpr");
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
+  __Pyx_RefNannySetupContext("genexpr", 0);
   __pyx_cur_scope = (struct __pyx_obj_25MMTK_trajectory_generator___pyx_scope_struct_1_genexpr *)__pyx_ptype_25MMTK_trajectory_generator___pyx_scope_struct_1_genexpr->tp_new(__pyx_ptype_25MMTK_trajectory_generator___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL);
   if (unlikely(!__pyx_cur_scope)) {
     __Pyx_RefNannyFinishContext();
     return NULL;
   }
   __Pyx_GOTREF(__pyx_cur_scope);
-  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_25MMTK_trajectory_generator___pyx_scope_struct__optionString *)__pyx_self;
+  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_25MMTK_trajectory_generator___pyx_scope_struct__optionString *) __pyx_self;
   __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
   __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
-  __pyx_self = __pyx_self;
-  __pyx_cur_scope->__pyx_base.resume_label = 0;
-  __pyx_cur_scope->__pyx_base.body = (__pyx_generator_body_t) __pyx_gb_25MMTK_trajectory_generator_12optionString_1generator;
-  __Pyx_GIVEREF(__pyx_cur_scope);
-  __Pyx_RefNannyFinishContext();
-  return (PyObject *) __pyx_cur_scope;
+  {
+    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_25MMTK_trajectory_generator_19TrajectoryGenerator_12optionString_2generator, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_cur_scope);
+    __Pyx_RefNannyFinishContext();
+    return (PyObject *) gen;
+  }
 
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_AddTraceback("MMTK_trajectory_generator.TrajectoryGenerator.optionString.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
   __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
   __Pyx_XGIVEREF(__pyx_r);
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-static PyObject *__pyx_gb_25MMTK_trajectory_generator_12optionString_1generator(struct __pyx_obj_25MMTK_trajectory_generator___pyx_scope_struct_1_genexpr *__pyx_cur_scope, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_25MMTK_trajectory_generator_19TrajectoryGenerator_12optionString_2generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
 {
+  struct __pyx_obj_25MMTK_trajectory_generator___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_25MMTK_trajectory_generator___pyx_scope_struct_1_genexpr *)__pyx_generator->closure);
   PyObject *__pyx_r = NULL;
   PyObject *__pyx_t_1 = NULL;
   Py_ssize_t __pyx_t_2;
@@ -2075,8 +2290,8 @@ static PyObject *__pyx_gb_25MMTK_trajectory_generator_12optionString_1generator(
   PyObject *__pyx_t_6 = NULL;
   PyObject *__pyx_t_7 = NULL;
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("25MMTK_trajectory_generator_12optionString_1generator");
-  switch (__pyx_cur_scope->__pyx_base.resume_label) {
+  __Pyx_RefNannySetupContext("None", 0);
+  switch (__pyx_generator->resume_label) {
     case 0: goto __pyx_L3_first_run;
     case 1: goto __pyx_L6_resume_from_yield;
     default: /* CPython raises the right error here */
@@ -2085,7 +2300,8 @@ static PyObject *__pyx_gb_25MMTK_trajectory_generator_12optionString_1generator(
   }
   __pyx_L3_first_run:;
   if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_options)) { __Pyx_RaiseClosureNameError("options"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }if (PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_options) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_options)) {
+  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_options)) { __Pyx_RaiseClosureNameError("options"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+  if (PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_options) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_options)) {
     __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_options; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
     __pyx_t_3 = NULL;
   } else {
@@ -2094,12 +2310,20 @@ static PyObject *__pyx_gb_25MMTK_trajectory_generator_12optionString_1generator(
     __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
   }
   for (;;) {
-    if (PyList_CheckExact(__pyx_t_1)) {
+    if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
       if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
-      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++;
-    } else if (PyTuple_CheckExact(__pyx_t_1)) {
+      #if CYTHON_COMPILING_IN_CPYTHON
+      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      #else
+      __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      #endif
+    } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
       if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
-      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++;
+      #if CYTHON_COMPILING_IN_CPYTHON
+      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      #else
+      __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      #endif
     } else {
       __pyx_t_4 = __pyx_t_3(__pyx_t_1);
       if (unlikely(!__pyx_t_4)) {
@@ -2118,10 +2342,11 @@ static PyObject *__pyx_gb_25MMTK_trajectory_generator_12optionString_1generator(
     __pyx_t_4 = 0;
     __pyx_t_4 = PyNumber_Add(__pyx_cur_scope->__pyx_v_o, ((PyObject *)__pyx_kp_s_4)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }__pyx_t_5 = PyObject_GetAttr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s__getOption); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+    __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self), __pyx_n_s__getOption); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_5);
     __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
+    __Pyx_GOTREF(__pyx_t_6);
     __Pyx_INCREF(__pyx_cur_scope->__pyx_v_o);
     PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_cur_scope->__pyx_v_o);
     __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_o);
@@ -2148,7 +2373,7 @@ static PyObject *__pyx_gb_25MMTK_trajectory_generator_12optionString_1generator(
     __Pyx_XGIVEREF(__pyx_r);
     __Pyx_RefNannyFinishContext();
     /* return from generator, yielding value */
-    __pyx_cur_scope->__pyx_base.resume_label = 1;
+    __pyx_generator->resume_label = 1;
     return __pyx_r;
     __pyx_L6_resume_from_yield:;
     __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
@@ -2159,7 +2384,7 @@ static PyObject *__pyx_gb_25MMTK_trajectory_generator_12optionString_1generator(
     if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  PyErr_SetNone(PyExc_StopIteration); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  PyErr_SetNone(PyExc_StopIteration);
   goto __pyx_L0;
   __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
@@ -2170,7 +2395,8 @@ static PyObject *__pyx_gb_25MMTK_trajectory_generator_12optionString_1generator(
   __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_L0:;
   __Pyx_XDECREF(__pyx_r);
-  __pyx_cur_scope->__pyx_base.resume_label = -1;
+  __pyx_generator->resume_label = -1;
+  __Pyx_Generator_clear((PyObject*)__pyx_generator);
   __Pyx_RefNannyFinishContext();
   return NULL;
 }
@@ -2183,8 +2409,7 @@ static PyObject *__pyx_gb_25MMTK_trajectory_generator_12optionString_1generator(
  *                    '')[:-2]
  */
 
-static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_5optionString(PyObject *__pyx_v_self, PyObject *__pyx_v_options); /*proto*/
-static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_5optionString(PyObject *__pyx_v_self, PyObject *__pyx_v_options) {
+static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_10optionString(struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *__pyx_v_self, PyObject *__pyx_v_options) {
   struct __pyx_obj_25MMTK_trajectory_generator___pyx_scope_struct__optionString *__pyx_cur_scope;
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
@@ -2193,18 +2418,18 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_5opt
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("optionString");
+  __Pyx_RefNannySetupContext("optionString", 0);
   __pyx_cur_scope = (struct __pyx_obj_25MMTK_trajectory_generator___pyx_scope_struct__optionString *)__pyx_ptype_25MMTK_trajectory_generator___pyx_scope_struct__optionString->tp_new(__pyx_ptype_25MMTK_trajectory_generator___pyx_scope_struct__optionString, __pyx_empty_tuple, NULL);
   if (unlikely(!__pyx_cur_scope)) {
     __Pyx_RefNannyFinishContext();
     return NULL;
   }
   __Pyx_GOTREF(__pyx_cur_scope);
-  __Pyx_INCREF(__pyx_v_self);
   __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
-  __Pyx_INCREF(__pyx_v_options);
-  __pyx_cur_scope->__pyx_v_options = __pyx_v_options;
+  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
   __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
+  __pyx_cur_scope->__pyx_v_options = __pyx_v_options;
+  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_options);
   __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_options);
 
   /* "MMTK_trajectory_generator.pyx":70
@@ -2223,10 +2448,10 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_5opt
  * 
  *     def __call__(self, **options):
  */
-  __pyx_t_1 = __pyx_pf_25MMTK_trajectory_generator_12optionString_genexpr(((PyObject*)__pyx_cur_scope), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_12optionString_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
+  __Pyx_GOTREF(__pyx_t_2);
   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
@@ -2257,6 +2482,25 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_5opt
   return __pyx_r;
 }
 
+/* Python wrapper */
+static PyObject *__pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_13__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_13__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_options = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
+  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
+    __Pyx_RaiseArgtupleInvalid("__call__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
+  if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__call__", 1))) return NULL;
+  __pyx_v_options = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
+  if (unlikely(!__pyx_v_options)) return NULL;
+  __Pyx_GOTREF(__pyx_v_options);
+  __pyx_r = __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_12__call__(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self), __pyx_v_options);
+  __Pyx_XDECREF(__pyx_v_options);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 /* "MMTK_trajectory_generator.pyx":73
  *                    '')[:-2]
  * 
@@ -2265,9 +2509,7 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_5opt
  *         try:
  */
 
-static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_options = 0;
+static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_12__call__(struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *__pyx_v_self, PyObject *__pyx_v_options) {
   PyObject *__pyx_v_MMTK_state_accessor = NULL;
   PyObject *__pyx_v_configuration = NULL;
   PyObject *__pyx_v_masses = NULL;
@@ -2286,13 +2528,7 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6__c
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__call__");
-  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
-    __Pyx_RaiseArgtupleInvalid("__call__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
-  if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__call__", 1))) return NULL;
-  __pyx_v_options = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
-  if (unlikely(!__pyx_v_options)) return NULL;
-  __Pyx_GOTREF(__pyx_v_options);
+  __Pyx_RefNannySetupContext("__call__", 0);
 
   /* "MMTK_trajectory_generator.pyx":74
  * 
@@ -2301,10 +2537,10 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6__c
  *         try:
  *             self.actions = self.getOption('actions')
  */
-  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__setCallOptions); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__setCallOptions); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
+  __Pyx_GOTREF(__pyx_t_2);
   __Pyx_INCREF(((PyObject *)__pyx_v_options));
   PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_options));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_options));
@@ -2335,22 +2571,22 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6__c
  *         except ValueError:
  *             self.actions = []
  */
-      __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__getOption); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
+      __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__getOption); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_7), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
+      __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_7), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_GIVEREF(__pyx_t_2);
-      __Pyx_GOTREF(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->actions);
-      __Pyx_DECREF(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->actions);
-      ((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->actions = __pyx_t_2;
+      __Pyx_GOTREF(__pyx_v_self->actions);
+      __Pyx_DECREF(__pyx_v_self->actions);
+      __pyx_v_self->actions = __pyx_t_2;
       __pyx_t_2 = 0;
     }
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-    goto __pyx_L12_try_end;
-    __pyx_L5_error:;
+    goto __pyx_L10_try_end;
+    __pyx_L3_error:;
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -2365,7 +2601,7 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6__c
     __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
     if (__pyx_t_7) {
       __Pyx_AddTraceback("MMTK_trajectory_generator.TrajectoryGenerator.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
+      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_GOTREF(__pyx_t_1);
@@ -2377,30 +2613,30 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6__c
  *         try:
  *             if self.getOption('background'):
  */
-      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_8));
+      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+      __Pyx_GOTREF(__pyx_t_8);
       __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
-      __Pyx_GOTREF(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->actions);
-      __Pyx_DECREF(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->actions);
-      ((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->actions = ((PyObject *)__pyx_t_8);
+      __Pyx_GOTREF(__pyx_v_self->actions);
+      __Pyx_DECREF(__pyx_v_self->actions);
+      __pyx_v_self->actions = ((PyObject *)__pyx_t_8);
       __pyx_t_8 = 0;
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      goto __pyx_L6_exception_handled;
+      goto __pyx_L4_exception_handled;
     }
-    __pyx_L7_except_error:;
+    __pyx_L5_except_error:;
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_5);
     __Pyx_XGIVEREF(__pyx_t_6);
     __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
     goto __pyx_L1_error;
-    __pyx_L6_exception_handled:;
+    __pyx_L4_exception_handled:;
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_XGIVEREF(__pyx_t_5);
     __Pyx_XGIVEREF(__pyx_t_6);
     __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
-    __pyx_L12_try_end:;
+    __pyx_L10_try_end:;
   }
 
   /* "MMTK_trajectory_generator.pyx":79
@@ -2424,12 +2660,12 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6__c
  *                 import MMTK_state_accessor
  *                 self.state_accessor = MMTK_state_accessor.StateAccessor()
  */
-      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__getOption); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L15_error;}
+      __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__getOption); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
       __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_8), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L15_error;}
+      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_8), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L15_error;}
+      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       if (__pyx_t_9) {
 
@@ -2440,7 +2676,7 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6__c
  *                 self.state_accessor = MMTK_state_accessor.StateAccessor()
  *                 self.actions.append(self.state_accessor)
  */
-        __pyx_t_3 = __Pyx_Import(((PyObject *)__pyx_n_s__MMTK_state_accessor), 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L15_error;}
+        __pyx_t_3 = __Pyx_Import(((PyObject *)__pyx_n_s__MMTK_state_accessor), 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
         __Pyx_GOTREF(__pyx_t_3);
         __pyx_v_MMTK_state_accessor = __pyx_t_3;
         __pyx_t_3 = 0;
@@ -2452,15 +2688,15 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6__c
  *                 self.actions.append(self.state_accessor)
  *         except ValueError:
  */
-        __pyx_t_3 = PyObject_GetAttr(__pyx_v_MMTK_state_accessor, __pyx_n_s__StateAccessor); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L15_error;}
+        __pyx_t_3 = PyObject_GetAttr(__pyx_v_MMTK_state_accessor, __pyx_n_s__StateAccessor); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
         __Pyx_GOTREF(__pyx_t_3);
-        __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L15_error;}
+        __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
         __Pyx_GOTREF(__pyx_t_1);
         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
         __Pyx_GIVEREF(__pyx_t_1);
-        __Pyx_GOTREF(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->state_accessor);
-        __Pyx_DECREF(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->state_accessor);
-        ((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->state_accessor = __pyx_t_1;
+        __Pyx_GOTREF(__pyx_v_self->state_accessor);
+        __Pyx_DECREF(__pyx_v_self->state_accessor);
+        __pyx_v_self->state_accessor = __pyx_t_1;
         __pyx_t_1 = 0;
 
         /* "MMTK_trajectory_generator.pyx":83
@@ -2470,18 +2706,18 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6__c
  *         except ValueError:
  *             pass
  */
-        __pyx_t_1 = __Pyx_PyObject_Append(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->actions, ((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->state_accessor); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L15_error;}
+        __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_self->actions, __pyx_v_self->state_accessor); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
         __Pyx_GOTREF(__pyx_t_1);
         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        goto __pyx_L23;
+        goto __pyx_L21;
       }
-      __pyx_L23:;
+      __pyx_L21:;
     }
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-    goto __pyx_L22_try_end;
-    __pyx_L15_error:;
+    goto __pyx_L20_try_end;
+    __pyx_L13_error:;
     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -2497,19 +2733,19 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6__c
     __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
     if (__pyx_t_7) {
       PyErr_Restore(0,0,0);
-      goto __pyx_L16_exception_handled;
+      goto __pyx_L14_exception_handled;
     }
     __Pyx_XGIVEREF(__pyx_t_6);
     __Pyx_XGIVEREF(__pyx_t_5);
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_4);
     goto __pyx_L1_error;
-    __pyx_L16_exception_handled:;
+    __pyx_L14_exception_handled:;
     __Pyx_XGIVEREF(__pyx_t_6);
     __Pyx_XGIVEREF(__pyx_t_5);
     __Pyx_XGIVEREF(__pyx_t_4);
     __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_4);
-    __pyx_L22_try_end:;
+    __pyx_L20_try_end:;
   }
 
   /* "MMTK_trajectory_generator.pyx":86
@@ -2525,13 +2761,13 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6__c
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-  __Pyx_INCREF(__pyx_v_self);
-  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self);
-  __Pyx_GIVEREF(__pyx_v_self);
-  __Pyx_INCREF(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->universe);
-  PyTuple_SET_ITEM(__pyx_t_1, 1, ((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->universe);
-  __Pyx_GIVEREF(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->universe);
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  __Pyx_INCREF(__pyx_v_self->universe);
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->universe);
+  __Pyx_GIVEREF(__pyx_v_self->universe);
   __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -2545,7 +2781,7 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6__c
  *             free(self.tvars)
  *             self.tvars = NULL
  */
-  __pyx_t_9 = (((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->tvars != NULL);
+  __pyx_t_9 = (__pyx_v_self->tvars != NULL);
   if (__pyx_t_9) {
 
     /* "MMTK_trajectory_generator.pyx":88
@@ -2555,7 +2791,7 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6__c
  *             self.tvars = NULL
  *         configuration = self.universe.configuration()
  */
-    free(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->tvars);
+    free(__pyx_v_self->tvars);
 
     /* "MMTK_trajectory_generator.pyx":89
  *         if self.tvars != NULL:
@@ -2564,10 +2800,10 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6__c
  *         configuration = self.universe.configuration()
  *         self.conf_array = configuration.array
  */
-    ((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->tvars = NULL;
-    goto __pyx_L24;
+    __pyx_v_self->tvars = NULL;
+    goto __pyx_L22;
   }
-  __pyx_L24:;
+  __pyx_L22:;
 
   /* "MMTK_trajectory_generator.pyx":90
  *             free(self.tvars)
@@ -2576,7 +2812,7 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6__c
  *         self.conf_array = configuration.array
  *         self.declareTrajectoryVariable_array(self.conf_array,
  */
-  __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->universe, __pyx_n_s__configuration); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self->universe, __pyx_n_s__configuration); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
@@ -2595,9 +2831,9 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6__c
   __Pyx_GOTREF(__pyx_t_1);
   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GIVEREF(__pyx_t_1);
-  __Pyx_GOTREF(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->conf_array);
-  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->conf_array));
-  ((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->conf_array = ((PyArrayObject *)__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->conf_array);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->conf_array));
+  __pyx_v_self->conf_array = ((PyArrayObject *)__pyx_t_1);
   __pyx_t_1 = 0;
 
   /* "MMTK_trajectory_generator.pyx":92
@@ -2607,7 +2843,7 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6__c
  *                                              "configuration",
  *                                              "Configuration:\n",
  */
-  __pyx_t_1 = ((PyObject *)((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->conf_array);
+  __pyx_t_1 = ((PyObject *)__pyx_v_self->conf_array);
   __Pyx_INCREF(__pyx_t_1);
 
   /* "MMTK_trajectory_generator.pyx":96
@@ -2617,7 +2853,7 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6__c
  *         self.universe_spec = <PyUniverseSpecObject *>self.universe._spec
  *         if self.universe_spec.geometry_data_length > 0:
  */
-  ((struct __pyx_vtabstruct_25MMTK_trajectory_generator_TrajectoryGenerator *)((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->__pyx_vtab)->declareTrajectoryVariable_array(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self), ((PyArrayObject *)__pyx_t_1), __pyx_k__configuration, __pyx_k_9, length_unit_name, PyTrajectory_Configuration); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  ((struct __pyx_vtabstruct_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self->__pyx_vtab)->declareTrajectoryVariable_array(__pyx_v_self, ((PyArrayObject *)__pyx_t_1), __pyx_k__configuration, __pyx_k_9, length_unit_name, PyTrajectory_Configuration); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
   /* "MMTK_trajectory_generator.pyx":97
@@ -2627,9 +2863,9 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6__c
  *         if self.universe_spec.geometry_data_length > 0:
  *             self.declareTrajectoryVariable_box(
  */
-  __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->universe, __pyx_n_s___spec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->universe, __pyx_n_s___spec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  ((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->universe_spec = ((PyUniverseSpecObject *)__pyx_t_1);
+  __pyx_v_self->universe_spec = ((PyUniverseSpecObject *)__pyx_t_1);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
   /* "MMTK_trajectory_generator.pyx":98
@@ -2639,7 +2875,7 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6__c
  *             self.declareTrajectoryVariable_box(
  *                 self.universe_spec.geometry_data,
  */
-  __pyx_t_9 = (((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->universe_spec->geometry_data_length > 0);
+  __pyx_t_9 = (__pyx_v_self->universe_spec->geometry_data_length > 0);
   if (__pyx_t_9) {
 
     /* "MMTK_trajectory_generator.pyx":101
@@ -2649,10 +2885,10 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6__c
  *         masses = self.universe.masses()
  *         self.declareTrajectoryVariable_array(masses.array,
  */
-    ((struct __pyx_vtabstruct_25MMTK_trajectory_generator_TrajectoryGenerator *)((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->__pyx_vtab)->declareTrajectoryVariable_box(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self), ((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->universe_spec->geometry_data, ((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->universe_spec->geometry_data_length); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L25;
+    ((struct __pyx_vtabstruct_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self->__pyx_vtab)->declareTrajectoryVariable_box(__pyx_v_self, __pyx_v_self->universe_spec->geometry_data, __pyx_v_self->universe_spec->geometry_data_length); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    goto __pyx_L23;
   }
-  __pyx_L25:;
+  __pyx_L23:;
 
   /* "MMTK_trajectory_generator.pyx":102
  *                 self.universe_spec.geometry_data,
@@ -2661,7 +2897,7 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6__c
  *         self.declareTrajectoryVariable_array(masses.array,
  *                                              "masses",
  */
-  __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->universe, __pyx_n_s__masses); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->universe, __pyx_n_s__masses); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
@@ -2687,7 +2923,7 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6__c
  *         self.natoms = self.universe.numberOfAtoms()
  *         self.df = self.universe.degreesOfFreedom()
  */
-  ((struct __pyx_vtabstruct_25MMTK_trajectory_generator_TrajectoryGenerator *)((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->__pyx_vtab)->declareTrajectoryVariable_array(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self), ((PyArrayObject *)__pyx_t_2), __pyx_k__masses, __pyx_k_10, mass_unit_name, PyTrajectory_Internal); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  ((struct __pyx_vtabstruct_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self->__pyx_vtab)->declareTrajectoryVariable_array(__pyx_v_self, ((PyArrayObject *)__pyx_t_2), __pyx_k__masses, __pyx_k_10, mass_unit_name, PyTrajectory_Internal); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "MMTK_trajectory_generator.pyx":108
@@ -2697,14 +2933,14 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6__c
  *         self.df = self.universe.degreesOfFreedom()
  *         self.declareTrajectoryVariable_int(&self.df,
  */
-  __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->universe, __pyx_n_s__numberOfAtoms); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self->universe, __pyx_n_s__numberOfAtoms); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  ((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->natoms = __pyx_t_7;
+  __pyx_v_self->natoms = __pyx_t_7;
 
   /* "MMTK_trajectory_generator.pyx":109
  *                                              PyTrajectory_Internal)
@@ -2713,14 +2949,14 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6__c
  *         self.declareTrajectoryVariable_int(&self.df,
  *                                            "degrees_of_freedom",
  */
-  __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->universe, __pyx_n_s__degreesOfFreedom); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->universe, __pyx_n_s__degreesOfFreedom); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  ((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->df = __pyx_t_7;
+  __pyx_v_self->df = __pyx_t_7;
 
   /* "MMTK_trajectory_generator.pyx":113
  *                                            "degrees_of_freedom",
@@ -2729,7 +2965,7 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6__c
  *         if self.getOption('background'):
  *             from MMTK import ThreadManager
  */
-  ((struct __pyx_vtabstruct_25MMTK_trajectory_generator_TrajectoryGenerator *)((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->__pyx_vtab)->declareTrajectoryVariable_int(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self), (&((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->df), __pyx_k__degrees_of_freedom, __pyx_k_11, __pyx_k_6, PyTrajectory_Internal); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  ((struct __pyx_vtabstruct_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self->__pyx_vtab)->declareTrajectoryVariable_int(__pyx_v_self, (&__pyx_v_self->df), __pyx_k__degrees_of_freedom, __pyx_k_11, __pyx_k_6, PyTrajectory_Internal); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
   /* "MMTK_trajectory_generator.pyx":114
  *                                            "Degrees of freedom: %d\n",
@@ -2738,7 +2974,7 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6__c
  *             from MMTK import ThreadManager
  *             return ThreadManager.TrajectoryGeneratorThread(
  */
-  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__getOption); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__getOption); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_12), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
@@ -2755,14 +2991,18 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6__c
  *                 self.universe, self.start_py, (), self.state_accessor)
  */
     __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
+    __Pyx_GOTREF(__pyx_t_1);
     __Pyx_INCREF(((PyObject *)__pyx_n_s__ThreadManager));
     PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__ThreadManager));
     __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ThreadManager));
     __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__MMTK), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-    __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ThreadManager); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ThreadManager);
+    if (__pyx_t_1 == NULL) {
+      if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__ThreadManager);
+      if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_INCREF(__pyx_t_1);
     __pyx_v_ThreadManager = __pyx_t_1;
@@ -2787,21 +3027,21 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6__c
  *         else:
  *             self.start()
  */
-    __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__start_py); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__start_py); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
     __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
-    __Pyx_INCREF(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->universe);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, ((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->universe);
-    __Pyx_GIVEREF(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->universe);
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_INCREF(__pyx_v_self->universe);
+    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->universe);
+    __Pyx_GIVEREF(__pyx_v_self->universe);
     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
     __Pyx_GIVEREF(__pyx_t_1);
     __Pyx_INCREF(((PyObject *)__pyx_empty_tuple));
     PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_empty_tuple));
     __Pyx_GIVEREF(((PyObject *)__pyx_empty_tuple));
-    __Pyx_INCREF(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->state_accessor);
-    PyTuple_SET_ITEM(__pyx_t_3, 3, ((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->state_accessor);
-    __Pyx_GIVEREF(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->state_accessor);
+    __Pyx_INCREF(__pyx_v_self->state_accessor);
+    PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_self->state_accessor);
+    __Pyx_GIVEREF(__pyx_v_self->state_accessor);
     __pyx_t_1 = 0;
     __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
@@ -2810,7 +3050,7 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6__c
     __pyx_r = __pyx_t_1;
     __pyx_t_1 = 0;
     goto __pyx_L0;
-    goto __pyx_L26;
+    goto __pyx_L24;
   }
   /*else*/ {
 
@@ -2821,7 +3061,7 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6__c
  *             return None
  * 
  */
-    __pyx_t_1 = ((struct __pyx_vtabstruct_25MMTK_trajectory_generator_TrajectoryGenerator *)((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->__pyx_vtab)->start(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = ((struct __pyx_vtabstruct_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self->__pyx_vtab)->start(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
@@ -2837,7 +3077,7 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6__c
     __pyx_r = Py_None;
     goto __pyx_L0;
   }
-  __pyx_L26:;
+  __pyx_L24:;
 
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
@@ -2849,7 +3089,6 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6__c
   __Pyx_AddTraceback("MMTK_trajectory_generator.TrajectoryGenerator.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_options);
   __Pyx_XDECREF(__pyx_v_MMTK_state_accessor);
   __Pyx_XDECREF(__pyx_v_configuration);
   __Pyx_XDECREF(__pyx_v_masses);
@@ -2859,6 +3098,17 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6__c
   return __pyx_r;
 }
 
+/* Python wrapper */
+static PyObject *__pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_15start_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_15start_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("start_py (wrapper)", 0);
+  __pyx_r = __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_14start_py(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self));
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 /* "MMTK_trajectory_generator.pyx":122
  *             return None
  * 
@@ -2867,15 +3117,14 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6__c
  * 
  */
 
-static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_7start_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_7start_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_14start_py(struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *__pyx_v_self) {
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
   PyObject *__pyx_t_1 = NULL;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("start_py");
+  __Pyx_RefNannySetupContext("start_py", 0);
 
   /* "MMTK_trajectory_generator.pyx":123
  * 
@@ -2884,7 +3133,7 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_7sta
  * 
  *     cdef start(self):
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_25MMTK_trajectory_generator_TrajectoryGenerator *)((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->__pyx_vtab)->start(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = ((struct __pyx_vtabstruct_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self->__pyx_vtab)->start(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
@@ -2908,10 +3157,10 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_7sta
  * 
  */
 
-static PyObject *__pyx_f_25MMTK_trajectory_generator_19TrajectoryGenerator_start(struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *__pyx_v_self) {
+static PyObject *__pyx_f_25MMTK_trajectory_generator_19TrajectoryGenerator_start(CYTHON_UNUSED struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *__pyx_v_self) {
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("start");
+  __Pyx_RefNannySetupContext("start", 0);
 
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   __Pyx_XGIVEREF(__pyx_r);
@@ -2933,12 +3182,13 @@ static void __pyx_f_25MMTK_trajectory_generator_19TrajectoryGenerator__addTrajec
   int __pyx_v_n;
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
-  int __pyx_t_2;
+  PyTrajectoryVariable *__pyx_t_2;
   int __pyx_t_3;
+  int __pyx_t_4;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("_addTrajectoryVariable");
+  __Pyx_RefNannySetupContext("_addTrajectoryVariable", 0);
 
   /* "MMTK_trajectory_generator.pyx":131
  *         cdef PyTrajectoryVariable *tv
@@ -3018,7 +3268,8 @@ static void __pyx_f_25MMTK_trajectory_generator_19TrajectoryGenerator__addTrajec
  *             while tv.name != NULL:
  *                 n += 1
  */
-    __pyx_v_tv = __pyx_v_self->tvars;
+    __pyx_t_2 = __pyx_v_self->tvars;
+    __pyx_v_tv = __pyx_t_2;
 
     /* "MMTK_trajectory_generator.pyx":141
  *             n = 0
@@ -3088,9 +3339,9 @@ static void __pyx_f_25MMTK_trajectory_generator_19TrajectoryGenerator__addTrajec
  *                 tv[i] = self.tvars[i]
  *             tv[n] = v
  */
-    __pyx_t_2 = __pyx_v_n;
-    for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
-      __pyx_v_i = __pyx_t_3;
+    __pyx_t_3 = __pyx_v_n;
+    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+      __pyx_v_i = __pyx_t_4;
 
       /* "MMTK_trajectory_generator.pyx":149
  *                 raise MemoryError
@@ -3161,7 +3412,7 @@ static void __pyx_f_25MMTK_trajectory_generator_19TrajectoryGenerator_declareTra
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("declareTrajectoryVariable_double");
+  __Pyx_RefNannySetupContext("declareTrajectoryVariable_double", 0);
 
   /* "MMTK_trajectory_generator.pyx":159
  *                                                int data_class) except *:
@@ -3247,7 +3498,7 @@ static void __pyx_f_25MMTK_trajectory_generator_19TrajectoryGenerator_declareTra
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("declareTrajectoryVariable_int");
+  __Pyx_RefNannySetupContext("declareTrajectoryVariable_int", 0);
 
   /* "MMTK_trajectory_generator.pyx":171
  *                                             int data_class) except *:
@@ -3335,7 +3586,7 @@ static void __pyx_f_25MMTK_trajectory_generator_19TrajectoryGenerator_declareTra
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("declareTrajectoryVariable_array");
+  __Pyx_RefNannySetupContext("declareTrajectoryVariable_array", 0);
 
   /* "MMTK_trajectory_generator.pyx":183
  *                                               int data_class) except *:
@@ -3490,7 +3741,7 @@ static void __pyx_f_25MMTK_trajectory_generator_19TrajectoryGenerator_declareTra
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("declareTrajectoryVariable_box");
+  __Pyx_RefNannySetupContext("declareTrajectoryVariable_box", 0);
 
   /* "MMTK_trajectory_generator.pyx":199
  *     cdef void declareTrajectoryVariable_box(self, double * var, int l) except *:
@@ -3589,7 +3840,7 @@ static void __pyx_f_25MMTK_trajectory_generator_19TrajectoryGenerator_initialize
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("initializeTrajectoryActions");
+  __Pyx_RefNannySetupContext("initializeTrajectoryActions", 0);
 
   /* "MMTK_trajectory_generator.pyx":209
  * 
@@ -3686,7 +3937,7 @@ static void __pyx_f_25MMTK_trajectory_generator_19TrajectoryGenerator_finalizeTr
  */
   int __pyx_v_error = ((int)0);
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("finalizeTrajectoryActions");
+  __Pyx_RefNannySetupContext("finalizeTrajectoryActions", 0);
   if (__pyx_optional_args) {
     if (__pyx_optional_args->__pyx_n > 0) {
       __pyx_v_error = __pyx_optional_args->error;
@@ -3739,7 +3990,7 @@ static void __pyx_f_25MMTK_trajectory_generator_19TrajectoryGenerator_finalizeTr
 static int __pyx_f_25MMTK_trajectory_generator_19TrajectoryGenerator_trajectoryActions(struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *__pyx_v_self, int __pyx_v_step) {
   int __pyx_r;
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("trajectoryActions");
+  __Pyx_RefNannySetupContext("trajectoryActions", 0);
 
   /* "MMTK_trajectory_generator.pyx":224
  * 
@@ -3898,6 +4149,17 @@ static void __pyx_f_25MMTK_trajectory_generator_19TrajectoryGenerator_releaseWri
 
 }
 
+/* Python wrapper */
+static PyObject *__pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_8universe_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_8universe_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_8universe___get__(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self));
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 /* "MMTK_trajectory_generator.pxd":23
  * cdef class TrajectoryGenerator(object):
  * 
@@ -3906,14 +4168,13 @@ static void __pyx_f_25MMTK_trajectory_generator_19TrajectoryGenerator_releaseWri
  *     cdef readonly features
  */
 
-static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_8universe___get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_8universe___get__(PyObject *__pyx_v_self) {
+static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_8universe___get__(struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *__pyx_v_self) {
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__");
+  __Pyx_RefNannySetupContext("__get__", 0);
   __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->universe);
-  __pyx_r = ((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->universe;
+  __Pyx_INCREF(__pyx_v_self->universe);
+  __pyx_r = __pyx_v_self->universe;
   goto __pyx_L0;
 
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
@@ -3923,14 +4184,24 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_8uni
   return __pyx_r;
 }
 
-static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_7options___get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_7options___get__(PyObject *__pyx_v_self) {
+/* Python wrapper */
+static PyObject *__pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_7options_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_7options_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_7options___get__(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self));
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_7options___get__(struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *__pyx_v_self) {
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__");
+  __Pyx_RefNannySetupContext("__get__", 0);
   __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->options);
-  __pyx_r = ((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->options;
+  __Pyx_INCREF(__pyx_v_self->options);
+  __pyx_r = __pyx_v_self->options;
   goto __pyx_L0;
 
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
@@ -3940,14 +4211,24 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_7opt
   return __pyx_r;
 }
 
-static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_4name___get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_4name___get__(PyObject *__pyx_v_self) {
+/* Python wrapper */
+static PyObject *__pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_4name_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_4name___get__(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self));
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_4name___get__(struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *__pyx_v_self) {
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__");
+  __Pyx_RefNannySetupContext("__get__", 0);
   __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->name);
-  __pyx_r = ((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->name;
+  __Pyx_INCREF(__pyx_v_self->name);
+  __pyx_r = __pyx_v_self->name;
   goto __pyx_L0;
 
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
@@ -3957,6 +4238,17 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_4nam
   return __pyx_r;
 }
 
+/* Python wrapper */
+static PyObject *__pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_12call_options_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_12call_options_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_12call_options___get__(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self));
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 /* "MMTK_trajectory_generator.pxd":24
  * 
  *     cdef readonly universe, options, name
@@ -3965,14 +4257,13 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_4nam
  *     cdef readonly actions
  */
 
-static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_12call_options___get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_12call_options___get__(PyObject *__pyx_v_self) {
+static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_12call_options___get__(struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *__pyx_v_self) {
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__");
+  __Pyx_RefNannySetupContext("__get__", 0);
   __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->call_options);
-  __pyx_r = ((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->call_options;
+  __Pyx_INCREF(__pyx_v_self->call_options);
+  __pyx_r = __pyx_v_self->call_options;
   goto __pyx_L0;
 
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
@@ -3982,6 +4273,17 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_12ca
   return __pyx_r;
 }
 
+/* Python wrapper */
+static PyObject *__pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_8features_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_8features_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_8features___get__(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self));
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 /* "MMTK_trajectory_generator.pxd":25
  *     cdef readonly universe, options, name
  *     cdef readonly call_options
@@ -3990,14 +4292,13 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_12ca
  *     cdef public state_accessor
  */
 
-static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_8features___get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_8features___get__(PyObject *__pyx_v_self) {
+static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_8features___get__(struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *__pyx_v_self) {
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__");
+  __Pyx_RefNannySetupContext("__get__", 0);
   __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->features);
-  __pyx_r = ((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->features;
+  __Pyx_INCREF(__pyx_v_self->features);
+  __pyx_r = __pyx_v_self->features;
   goto __pyx_L0;
 
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
@@ -4007,6 +4308,17 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_8fea
   return __pyx_r;
 }
 
+/* Python wrapper */
+static PyObject *__pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_7actions_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_7actions_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_7actions___get__(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self));
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 /* "MMTK_trajectory_generator.pxd":26
  *     cdef readonly call_options
  *     cdef readonly features
@@ -4015,14 +4327,13 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_8fea
  *     cdef PyTrajectoryVariable *tvars
  */
 
-static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_7actions___get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_7actions___get__(PyObject *__pyx_v_self) {
+static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_7actions___get__(struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *__pyx_v_self) {
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__");
+  __Pyx_RefNannySetupContext("__get__", 0);
   __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->actions);
-  __pyx_r = ((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->actions;
+  __Pyx_INCREF(__pyx_v_self->actions);
+  __pyx_r = __pyx_v_self->actions;
   goto __pyx_L0;
 
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
@@ -4032,6 +4343,17 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_7act
   return __pyx_r;
 }
 
+/* Python wrapper */
+static PyObject *__pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_14state_accessor_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_14state_accessor_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_14state_accessor___get__(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self));
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 /* "MMTK_trajectory_generator.pxd":27
  *     cdef readonly features
  *     cdef readonly actions
@@ -4040,14 +4362,13 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_7act
  *     cdef PyTrajectoryOutputSpec *tspec
  */
 
-static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_14state_accessor___get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_14state_accessor___get__(PyObject *__pyx_v_self) {
+static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_14state_accessor___get__(struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *__pyx_v_self) {
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__");
+  __Pyx_RefNannySetupContext("__get__", 0);
   __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->state_accessor);
-  __pyx_r = ((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->state_accessor;
+  __Pyx_INCREF(__pyx_v_self->state_accessor);
+  __pyx_r = __pyx_v_self->state_accessor;
   goto __pyx_L0;
 
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
@@ -4057,101 +4378,109 @@ static PyObject *__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_14st
   return __pyx_r;
 }
 
-static int __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_14state_accessor_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
-static int __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_14state_accessor_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+/* Python wrapper */
+static int __pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_14state_accessor_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_14state_accessor_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_14state_accessor_2__set__(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_14state_accessor_2__set__(struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *__pyx_v_self, PyObject *__pyx_v_value) {
   int __pyx_r;
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__");
+  __Pyx_RefNannySetupContext("__set__", 0);
   __Pyx_INCREF(__pyx_v_value);
   __Pyx_GIVEREF(__pyx_v_value);
-  __Pyx_GOTREF(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->state_accessor);
-  __Pyx_DECREF(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->state_accessor);
-  ((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->state_accessor = __pyx_v_value;
+  __Pyx_GOTREF(__pyx_v_self->state_accessor);
+  __Pyx_DECREF(__pyx_v_self->state_accessor);
+  __pyx_v_self->state_accessor = __pyx_v_value;
 
   __pyx_r = 0;
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-static int __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_14state_accessor_2__del__(PyObject *__pyx_v_self); /*proto*/
-static int __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_14state_accessor_2__del__(PyObject *__pyx_v_self) {
+/* Python wrapper */
+static int __pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_14state_accessor_5__del__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_14state_accessor_5__del__(PyObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_14state_accessor_4__del__(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self));
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_14state_accessor_4__del__(struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *__pyx_v_self) {
   int __pyx_r;
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__del__");
+  __Pyx_RefNannySetupContext("__del__", 0);
   __Pyx_INCREF(Py_None);
   __Pyx_GIVEREF(Py_None);
-  __Pyx_GOTREF(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->state_accessor);
-  __Pyx_DECREF(((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->state_accessor);
-  ((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)__pyx_v_self)->state_accessor = Py_None;
+  __Pyx_GOTREF(__pyx_v_self->state_accessor);
+  __Pyx_DECREF(__pyx_v_self->state_accessor);
+  __pyx_v_self->state_accessor = Py_None;
 
   __pyx_r = 0;
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "MMTK_trajectory_generator.pyx":254
- * cdef class EnergyBasedTrajectoryGenerator(TrajectoryGenerator):
- * 
- *     def __init__(self, universe, options, name):             # <<<<<<<<<<<<<<
- *         TrajectoryGenerator.__init__(self, universe, options, name)
- *         self.evaluator_object = None
- */
-
-static int __pyx_pf_25MMTK_trajectory_generator_30EnergyBasedTrajectoryGenerator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pf_25MMTK_trajectory_generator_30EnergyBasedTrajectoryGenerator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+/* Python wrapper */
+static int __pyx_pw_25MMTK_trajectory_generator_30EnergyBasedTrajectoryGenerator_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_25MMTK_trajectory_generator_30EnergyBasedTrajectoryGenerator_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_universe = 0;
   PyObject *__pyx_v_options = 0;
   PyObject *__pyx_v_name = 0;
   int __pyx_r;
   __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__universe,&__pyx_n_s__options,&__pyx_n_s__name,0};
-  __Pyx_RefNannySetupContext("__init__");
-  if (unlikely(__pyx_kwds)) {
-    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__universe,&__pyx_n_s__options,&__pyx_n_s__name,0};
     PyObject* values[3] = {0,0,0};
-    switch (PyTuple_GET_SIZE(__pyx_args)) {
-      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
-      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
-      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-      case  0: break;
-      default: goto __pyx_L5_argtuple_error;
-    }
-    switch (PyTuple_GET_SIZE(__pyx_args)) {
-      case  0:
-      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__universe);
-      if (likely(values[0])) kw_args--;
-      else goto __pyx_L5_argtuple_error;
-      case  1:
-      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__options);
-      if (likely(values[1])) kw_args--;
-      else {
-        __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__universe)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        case  1:
+        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__options)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        }
+        case  2:
+        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__name)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        }
       }
-      case  2:
-      values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__name);
-      if (likely(values[2])) kw_args--;
-      else {
-        __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
-    }
-    if (unlikely(kw_args > 0)) {
-      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
     }
     __pyx_v_universe = values[0];
     __pyx_v_options = values[1];
     __pyx_v_name = values[2];
-  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
-    goto __pyx_L5_argtuple_error;
-  } else {
-    __pyx_v_universe = PyTuple_GET_ITEM(__pyx_args, 0);
-    __pyx_v_options = PyTuple_GET_ITEM(__pyx_args, 1);
-    __pyx_v_name = PyTuple_GET_ITEM(__pyx_args, 2);
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
@@ -4161,6 +4490,29 @@ static int __pyx_pf_25MMTK_trajectory_generator_30EnergyBasedTrajectoryGenerator
   __Pyx_RefNannyFinishContext();
   return -1;
   __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_25MMTK_trajectory_generator_30EnergyBasedTrajectoryGenerator___init__(((struct __pyx_obj_25MMTK_trajectory_generator_EnergyBasedTrajectoryGenerator *)__pyx_v_self), __pyx_v_universe, __pyx_v_options, __pyx_v_name);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* "MMTK_trajectory_generator.pyx":254
+ * cdef class EnergyBasedTrajectoryGenerator(TrajectoryGenerator):
+ * 
+ *     def __init__(self, universe, options, name):             # <<<<<<<<<<<<<<
+ *         TrajectoryGenerator.__init__(self, universe, options, name)
+ *         self.evaluator_object = None
+ */
+
+static int __pyx_pf_25MMTK_trajectory_generator_30EnergyBasedTrajectoryGenerator___init__(struct __pyx_obj_25MMTK_trajectory_generator_EnergyBasedTrajectoryGenerator *__pyx_v_self, PyObject *__pyx_v_universe, PyObject *__pyx_v_options, PyObject *__pyx_v_name) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  PyObject *__pyx_t_1 = NULL;
+  PyObject *__pyx_t_2 = NULL;
+  PyObject *__pyx_t_3 = NULL;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
+  __Pyx_RefNannySetupContext("__init__", 0);
 
   /* "MMTK_trajectory_generator.pyx":255
  * 
@@ -4172,10 +4524,10 @@ static int __pyx_pf_25MMTK_trajectory_generator_30EnergyBasedTrajectoryGenerator
   __pyx_t_1 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_25MMTK_trajectory_generator_TrajectoryGenerator)), __pyx_n_s____init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-  __Pyx_INCREF(__pyx_v_self);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self);
-  __Pyx_GIVEREF(__pyx_v_self);
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
   __Pyx_INCREF(__pyx_v_universe);
   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_universe);
   __Pyx_GIVEREF(__pyx_v_universe);
@@ -4200,9 +4552,9 @@ static int __pyx_pf_25MMTK_trajectory_generator_30EnergyBasedTrajectoryGenerator
  */
   __Pyx_INCREF(Py_None);
   __Pyx_GIVEREF(Py_None);
-  __Pyx_GOTREF(((struct __pyx_obj_25MMTK_trajectory_generator_EnergyBasedTrajectoryGenerator *)__pyx_v_self)->evaluator_object);
-  __Pyx_DECREF(((struct __pyx_obj_25MMTK_trajectory_generator_EnergyBasedTrajectoryGenerator *)__pyx_v_self)->evaluator_object);
-  ((struct __pyx_obj_25MMTK_trajectory_generator_EnergyBasedTrajectoryGenerator *)__pyx_v_self)->evaluator_object = Py_None;
+  __Pyx_GOTREF(__pyx_v_self->evaluator_object);
+  __Pyx_DECREF(__pyx_v_self->evaluator_object);
+  __pyx_v_self->evaluator_object = Py_None;
 
   /* "MMTK_trajectory_generator.pyx":257
  *         TrajectoryGenerator.__init__(self, universe, options, name)
@@ -4213,9 +4565,9 @@ static int __pyx_pf_25MMTK_trajectory_generator_30EnergyBasedTrajectoryGenerator
  */
   __Pyx_INCREF(Py_None);
   __Pyx_GIVEREF(Py_None);
-  __Pyx_GOTREF(((struct __pyx_obj_25MMTK_trajectory_generator_EnergyBasedTrajectoryGenerator *)__pyx_v_self)->c_evaluator_object);
-  __Pyx_DECREF(((struct __pyx_obj_25MMTK_trajectory_generator_EnergyBasedTrajectoryGenerator *)__pyx_v_self)->c_evaluator_object);
-  ((struct __pyx_obj_25MMTK_trajectory_generator_EnergyBasedTrajectoryGenerator *)__pyx_v_self)->c_evaluator_object = Py_None;
+  __Pyx_GOTREF(__pyx_v_self->c_evaluator_object);
+  __Pyx_DECREF(__pyx_v_self->c_evaluator_object);
+  __pyx_v_self->c_evaluator_object = Py_None;
 
   /* "MMTK_trajectory_generator.pyx":258
  *         self.evaluator_object = None
@@ -4224,7 +4576,7 @@ static int __pyx_pf_25MMTK_trajectory_generator_30EnergyBasedTrajectoryGenerator
  * 
  *     cdef void initializeTrajectoryActions(self) except *:
  */
-  ((struct __pyx_obj_25MMTK_trajectory_generator_EnergyBasedTrajectoryGenerator *)__pyx_v_self)->evaluator = NULL;
+  __pyx_v_self->evaluator = NULL;
 
   __pyx_r = 0;
   goto __pyx_L0;
@@ -4256,7 +4608,7 @@ static void __pyx_f_25MMTK_trajectory_generator_30EnergyBasedTrajectoryGenerator
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("initializeTrajectoryActions");
+  __Pyx_RefNannySetupContext("initializeTrajectoryActions", 0);
 
   /* "MMTK_trajectory_generator.pyx":261
  * 
@@ -4294,7 +4646,7 @@ static void __pyx_f_25MMTK_trajectory_generator_30EnergyBasedTrajectoryGenerator
   __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
   if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__threads), __pyx_v_nt) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
@@ -4365,7 +4717,7 @@ static void __pyx_f_25MMTK_trajectory_generator_30EnergyBasedTrajectoryGenerator
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("finalizeTrajectoryActions");
+  __Pyx_RefNannySetupContext("finalizeTrajectoryActions", 0);
   if (__pyx_optional_args) {
     if (__pyx_optional_args->__pyx_n > 0) {
       __pyx_v_error = __pyx_optional_args->error;
@@ -4438,7 +4790,7 @@ static int __pyx_f_25MMTK_trajectory_generator_30EnergyBasedTrajectoryGenerator_
   int __pyx_r;
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
-  __Pyx_RefNannySetupContext("trajectoryActions");
+  __Pyx_RefNannySetupContext("trajectoryActions", 0);
 
   /* "MMTK_trajectory_generator.pyx":278
  *     cdef int trajectoryActions(self, int step) except -1:
@@ -4537,29 +4889,28 @@ static int __pyx_f_25MMTK_trajectory_generator_30EnergyBasedTrajectoryGenerator_
 
 static void __pyx_f_25MMTK_trajectory_generator_30EnergyBasedTrajectoryGenerator_calculateEnergies(struct __pyx_obj_25MMTK_trajectory_generator_EnergyBasedTrajectoryGenerator *__pyx_v_self, PyArrayObject *__pyx_v_conf_array, energy_data *__pyx_v_energy, struct __pyx_opt_args_25MMTK_trajectory_generator_30EnergyBasedTrajectoryGenerator_calculateEnergies *__pyx_optional_args) {
   int __pyx_v_small_change = ((int)0);
-  Py_buffer __pyx_bstruct_conf_array;
-  Py_ssize_t __pyx_bstride_0_conf_array = 0;
-  Py_ssize_t __pyx_bstride_1_conf_array = 0;
-  Py_ssize_t __pyx_bshape_0_conf_array = 0;
-  Py_ssize_t __pyx_bshape_1_conf_array = 0;
+  __Pyx_LocalBuf_ND __pyx_pybuffernd_conf_array;
+  __Pyx_Buffer __pyx_pybuffer_conf_array;
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("calculateEnergies");
+  __Pyx_RefNannySetupContext("calculateEnergies", 0);
   if (__pyx_optional_args) {
     if (__pyx_optional_args->__pyx_n > 0) {
       __pyx_v_small_change = __pyx_optional_args->small_change;
     }
   }
-  __pyx_bstruct_conf_array.buf = NULL;
+  __pyx_pybuffer_conf_array.pybuffer.buf = NULL;
+  __pyx_pybuffer_conf_array.refcount = 0;
+  __pyx_pybuffernd_conf_array.data = NULL;
+  __pyx_pybuffernd_conf_array.rcbuffer = &__pyx_pybuffer_conf_array;
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_conf_array, (PyObject*)__pyx_v_conf_array, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_conf_array.rcbuffer->pybuffer, (PyObject*)__pyx_v_conf_array, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
-  __pyx_bstride_0_conf_array = __pyx_bstruct_conf_array.strides[0]; __pyx_bstride_1_conf_array = __pyx_bstruct_conf_array.strides[1];
-  __pyx_bshape_0_conf_array = __pyx_bstruct_conf_array.shape[0]; __pyx_bshape_1_conf_array = __pyx_bstruct_conf_array.shape[1];
+  __pyx_pybuffernd_conf_array.diminfo[0].strides = __pyx_pybuffernd_conf_array.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_conf_array.diminfo[0].shape = __pyx_pybuffernd_conf_array.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_conf_array.diminfo[1].strides = __pyx_pybuffernd_conf_array.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_conf_array.diminfo[1].shape = __pyx_pybuffernd_conf_array.rcbuffer->pybuffer.shape[1];
 
   /* "MMTK_trajectory_generator.pyx":291
  *                                 energy_data *energy, int small_change=0) \
@@ -4677,17 +5028,28 @@ static void __pyx_f_25MMTK_trajectory_generator_30EnergyBasedTrajectoryGenerator
   __pyx_L1_error:;
   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
-    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_conf_array);
+    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_conf_array.rcbuffer->pybuffer);
   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
   __Pyx_AddTraceback("MMTK_trajectory_generator.EnergyBasedTrajectoryGenerator.calculateEnergies", __pyx_clineno, __pyx_lineno, __pyx_filename);
   goto __pyx_L2;
   __pyx_L0:;
-  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_conf_array);
+  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_conf_array.rcbuffer->pybuffer);
   __pyx_L2:;
   __Pyx_RefNannyFinishContext();
 }
 
-/* "numpy.pxd":190
+/* Python wrapper */
+static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
+static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* "numpy.pxd":194
  *         # experimental exception made for __getbuffer__ and __releasebuffer__
  *         # -- the details of this may change.
  *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
@@ -4695,8 +5057,7 @@ static void __pyx_f_25MMTK_trajectory_generator_30EnergyBasedTrajectoryGenerator
  *             # requirements, and does not yet fullfill the PEP.
  */
 
-static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
-static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
+static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
   int __pyx_v_copy_shape;
   int __pyx_v_i;
   int __pyx_v_ndim;
@@ -4721,13 +5082,13 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__getbuffer__");
+  __Pyx_RefNannySetupContext("__getbuffer__", 0);
   if (__pyx_v_info != NULL) {
     __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
     __Pyx_GIVEREF(__pyx_v_info->obj);
   }
 
-  /* "numpy.pxd":196
+  /* "numpy.pxd":200
  *             # of flags
  * 
  *             if info == NULL: return             # <<<<<<<<<<<<<<
@@ -4738,11 +5099,11 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
   if (__pyx_t_1) {
     __pyx_r = 0;
     goto __pyx_L0;
-    goto __pyx_L5;
+    goto __pyx_L3;
   }
-  __pyx_L5:;
+  __pyx_L3:;
 
-  /* "numpy.pxd":199
+  /* "numpy.pxd":203
  * 
  *             cdef int copy_shape, i, ndim
  *             cdef int endian_detector = 1             # <<<<<<<<<<<<<<
@@ -4751,7 +5112,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
  */
   __pyx_v_endian_detector = 1;
 
-  /* "numpy.pxd":200
+  /* "numpy.pxd":204
  *             cdef int copy_shape, i, ndim
  *             cdef int endian_detector = 1
  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
@@ -4760,16 +5121,16 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
  */
   __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
 
-  /* "numpy.pxd":202
+  /* "numpy.pxd":206
  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
  * 
  *             ndim = PyArray_NDIM(self)             # <<<<<<<<<<<<<<
  * 
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
  */
-  __pyx_v_ndim = PyArray_NDIM(((PyArrayObject *)__pyx_v_self));
+  __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
 
-  /* "numpy.pxd":204
+  /* "numpy.pxd":208
  *             ndim = PyArray_NDIM(self)
  * 
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
@@ -4779,7 +5140,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
   __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t)));
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":205
+    /* "numpy.pxd":209
  * 
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
  *                 copy_shape = 1             # <<<<<<<<<<<<<<
@@ -4787,11 +5148,11 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
  *                 copy_shape = 0
  */
     __pyx_v_copy_shape = 1;
-    goto __pyx_L6;
+    goto __pyx_L4;
   }
   /*else*/ {
 
-    /* "numpy.pxd":207
+    /* "numpy.pxd":211
  *                 copy_shape = 1
  *             else:
  *                 copy_shape = 0             # <<<<<<<<<<<<<<
@@ -4800,9 +5161,9 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
  */
     __pyx_v_copy_shape = 0;
   }
-  __pyx_L6:;
+  __pyx_L4:;
 
-  /* "numpy.pxd":209
+  /* "numpy.pxd":213
  *                 copy_shape = 0
  * 
  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
@@ -4812,37 +5173,37 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
   __pyx_t_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":210
+    /* "numpy.pxd":214
  * 
  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):             # <<<<<<<<<<<<<<
  *                 raise ValueError(u"ndarray is not C contiguous")
  * 
  */
-    __pyx_t_2 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_C_CONTIGUOUS));
+    __pyx_t_2 = (!PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS));
     __pyx_t_3 = __pyx_t_2;
   } else {
     __pyx_t_3 = __pyx_t_1;
   }
   if (__pyx_t_3) {
 
-    /* "numpy.pxd":211
+    /* "numpy.pxd":215
  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
  * 
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  */
-    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_19), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_19), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_Raise(__pyx_t_4, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L7;
+    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    goto __pyx_L5;
   }
-  __pyx_L7:;
+  __pyx_L5:;
 
-  /* "numpy.pxd":213
+  /* "numpy.pxd":217
  *                 raise ValueError(u"ndarray is not C contiguous")
  * 
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
@@ -4852,46 +5213,46 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
   __pyx_t_3 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS);
   if (__pyx_t_3) {
 
-    /* "numpy.pxd":214
+    /* "numpy.pxd":218
  * 
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):             # <<<<<<<<<<<<<<
  *                 raise ValueError(u"ndarray is not Fortran contiguous")
  * 
  */
-    __pyx_t_1 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_F_CONTIGUOUS));
+    __pyx_t_1 = (!PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS));
     __pyx_t_2 = __pyx_t_1;
   } else {
     __pyx_t_2 = __pyx_t_3;
   }
   if (__pyx_t_2) {
 
-    /* "numpy.pxd":215
+    /* "numpy.pxd":219
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
  * 
  *             info.buf = PyArray_DATA(self)
  */
-    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_21), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_21), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_Raise(__pyx_t_4, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L8;
+    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    goto __pyx_L6;
   }
-  __pyx_L8:;
+  __pyx_L6:;
 
-  /* "numpy.pxd":217
+  /* "numpy.pxd":221
  *                 raise ValueError(u"ndarray is not Fortran contiguous")
  * 
  *             info.buf = PyArray_DATA(self)             # <<<<<<<<<<<<<<
  *             info.ndim = ndim
  *             if copy_shape:
  */
-  __pyx_v_info->buf = PyArray_DATA(((PyArrayObject *)__pyx_v_self));
+  __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
 
-  /* "numpy.pxd":218
+  /* "numpy.pxd":222
  * 
  *             info.buf = PyArray_DATA(self)
  *             info.ndim = ndim             # <<<<<<<<<<<<<<
@@ -4900,7 +5261,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
  */
   __pyx_v_info->ndim = __pyx_v_ndim;
 
-  /* "numpy.pxd":219
+  /* "numpy.pxd":223
  *             info.buf = PyArray_DATA(self)
  *             info.ndim = ndim
  *             if copy_shape:             # <<<<<<<<<<<<<<
@@ -4909,7 +5270,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
  */
   if (__pyx_v_copy_shape) {
 
-    /* "numpy.pxd":222
+    /* "numpy.pxd":226
  *                 # Allocate new buffer for strides and shape info.
  *                 # This is allocated as one block, strides first.
  *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)             # <<<<<<<<<<<<<<
@@ -4918,7 +5279,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
  */
     __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));
 
-    /* "numpy.pxd":223
+    /* "numpy.pxd":227
  *                 # This is allocated as one block, strides first.
  *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
  *                 info.shape = info.strides + ndim             # <<<<<<<<<<<<<<
@@ -4927,7 +5288,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
  */
     __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
 
-    /* "numpy.pxd":224
+    /* "numpy.pxd":228
  *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
  *                 info.shape = info.strides + ndim
  *                 for i in range(ndim):             # <<<<<<<<<<<<<<
@@ -4938,49 +5299,49 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
     for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
       __pyx_v_i = __pyx_t_6;
 
-      /* "numpy.pxd":225
+      /* "numpy.pxd":229
  *                 info.shape = info.strides + ndim
  *                 for i in range(ndim):
  *                     info.strides[i] = PyArray_STRIDES(self)[i]             # <<<<<<<<<<<<<<
  *                     info.shape[i] = PyArray_DIMS(self)[i]
  *             else:
  */
-      (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]);
+      (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
 
-      /* "numpy.pxd":226
+      /* "numpy.pxd":230
  *                 for i in range(ndim):
  *                     info.strides[i] = PyArray_STRIDES(self)[i]
  *                     info.shape[i] = PyArray_DIMS(self)[i]             # <<<<<<<<<<<<<<
  *             else:
  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  */
-      (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]);
+      (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
     }
-    goto __pyx_L9;
+    goto __pyx_L7;
   }
   /*else*/ {
 
-    /* "numpy.pxd":228
+    /* "numpy.pxd":232
  *                     info.shape[i] = PyArray_DIMS(self)[i]
  *             else:
  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  *             info.suboffsets = NULL
  */
-    __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(((PyArrayObject *)__pyx_v_self)));
+    __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
 
-    /* "numpy.pxd":229
+    /* "numpy.pxd":233
  *             else:
  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)             # <<<<<<<<<<<<<<
  *             info.suboffsets = NULL
  *             info.itemsize = PyArray_ITEMSIZE(self)
  */
-    __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(((PyArrayObject *)__pyx_v_self)));
+    __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
   }
-  __pyx_L9:;
+  __pyx_L7:;
 
-  /* "numpy.pxd":230
+  /* "numpy.pxd":234
  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
@@ -4989,25 +5350,25 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
  */
   __pyx_v_info->suboffsets = NULL;
 
-  /* "numpy.pxd":231
+  /* "numpy.pxd":235
  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  *             info.suboffsets = NULL
  *             info.itemsize = PyArray_ITEMSIZE(self)             # <<<<<<<<<<<<<<
  *             info.readonly = not PyArray_ISWRITEABLE(self)
  * 
  */
-  __pyx_v_info->itemsize = PyArray_ITEMSIZE(((PyArrayObject *)__pyx_v_self));
+  __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
 
-  /* "numpy.pxd":232
+  /* "numpy.pxd":236
  *             info.suboffsets = NULL
  *             info.itemsize = PyArray_ITEMSIZE(self)
  *             info.readonly = not PyArray_ISWRITEABLE(self)             # <<<<<<<<<<<<<<
  * 
  *             cdef int t
  */
-  __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(((PyArrayObject *)__pyx_v_self)));
+  __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(__pyx_v_self));
 
-  /* "numpy.pxd":235
+  /* "numpy.pxd":239
  * 
  *             cdef int t
  *             cdef char* f = NULL             # <<<<<<<<<<<<<<
@@ -5016,17 +5377,19 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
  */
   __pyx_v_f = NULL;
 
-  /* "numpy.pxd":236
+  /* "numpy.pxd":240
  *             cdef int t
  *             cdef char* f = NULL
  *             cdef dtype descr = self.descr             # <<<<<<<<<<<<<<
  *             cdef list stack
  *             cdef int offset
  */
-  __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_self)->descr));
-  __pyx_v_descr = ((PyArrayObject *)__pyx_v_self)->descr;
+  __pyx_t_4 = ((PyObject *)__pyx_v_self->descr);
+  __Pyx_INCREF(__pyx_t_4);
+  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4);
+  __pyx_t_4 = 0;
 
-  /* "numpy.pxd":240
+  /* "numpy.pxd":244
  *             cdef int offset
  * 
  *             cdef bint hasfields = PyDataType_HASFIELDS(descr)             # <<<<<<<<<<<<<<
@@ -5035,7 +5398,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
  */
   __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);
 
-  /* "numpy.pxd":242
+  /* "numpy.pxd":246
  *             cdef bint hasfields = PyDataType_HASFIELDS(descr)
  * 
  *             if not hasfields and not copy_shape:             # <<<<<<<<<<<<<<
@@ -5051,7 +5414,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
   }
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":244
+    /* "numpy.pxd":248
  *             if not hasfields and not copy_shape:
  *                 # do not call releasebuffer
  *                 info.obj = None             # <<<<<<<<<<<<<<
@@ -5063,49 +5426,50 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
     __Pyx_GOTREF(__pyx_v_info->obj);
     __Pyx_DECREF(__pyx_v_info->obj);
     __pyx_v_info->obj = Py_None;
-    goto __pyx_L12;
+    goto __pyx_L10;
   }
   /*else*/ {
 
-    /* "numpy.pxd":247
+    /* "numpy.pxd":251
  *             else:
  *                 # need to call releasebuffer
  *                 info.obj = self             # <<<<<<<<<<<<<<
  * 
  *             if not hasfields:
  */
-    __Pyx_INCREF(__pyx_v_self);
-    __Pyx_GIVEREF(__pyx_v_self);
+    __Pyx_INCREF(((PyObject *)__pyx_v_self));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
     __Pyx_GOTREF(__pyx_v_info->obj);
     __Pyx_DECREF(__pyx_v_info->obj);
-    __pyx_v_info->obj = __pyx_v_self;
+    __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
   }
-  __pyx_L12:;
+  __pyx_L10:;
 
-  /* "numpy.pxd":249
+  /* "numpy.pxd":253
  *                 info.obj = self
  * 
  *             if not hasfields:             # <<<<<<<<<<<<<<
  *                 t = descr.type_num
- *                 if ((descr.byteorder == '>' and little_endian) or
+ *                 if ((descr.byteorder == c'>' and little_endian) or
  */
   __pyx_t_1 = (!__pyx_v_hasfields);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":250
+    /* "numpy.pxd":254
  * 
  *             if not hasfields:
  *                 t = descr.type_num             # <<<<<<<<<<<<<<
- *                 if ((descr.byteorder == '>' and little_endian) or
- *                     (descr.byteorder == '<' and not little_endian)):
+ *                 if ((descr.byteorder == c'>' and little_endian) or
+ *                     (descr.byteorder == c'<' and not little_endian)):
  */
-    __pyx_v_t = __pyx_v_descr->type_num;
+    __pyx_t_5 = __pyx_v_descr->type_num;
+    __pyx_v_t = __pyx_t_5;
 
-    /* "numpy.pxd":251
+    /* "numpy.pxd":255
  *             if not hasfields:
  *                 t = descr.type_num
- *                 if ((descr.byteorder == '>' and little_endian) or             # <<<<<<<<<<<<<<
- *                     (descr.byteorder == '<' and not little_endian)):
+ *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
+ *                     (descr.byteorder == c'<' and not little_endian)):
  *                     raise ValueError(u"Non-native byte order not supported")
  */
     __pyx_t_1 = (__pyx_v_descr->byteorder == '>');
@@ -5116,10 +5480,10 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
     }
     if (!__pyx_t_2) {
 
-      /* "numpy.pxd":252
+      /* "numpy.pxd":256
  *                 t = descr.type_num
- *                 if ((descr.byteorder == '>' and little_endian) or
- *                     (descr.byteorder == '<' and not little_endian)):             # <<<<<<<<<<<<<<
+ *                 if ((descr.byteorder == c'>' and little_endian) or
+ *                     (descr.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
  *                     raise ValueError(u"Non-native byte order not supported")
  *                 if   t == NPY_BYTE:        f = "b"
  */
@@ -5136,24 +5500,24 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
     }
     if (__pyx_t_1) {
 
-      /* "numpy.pxd":253
- *                 if ((descr.byteorder == '>' and little_endian) or
- *                     (descr.byteorder == '<' and not little_endian)):
+      /* "numpy.pxd":257
+ *                 if ((descr.byteorder == c'>' and little_endian) or
+ *                     (descr.byteorder == c'<' and not little_endian)):
  *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
  *                 if   t == NPY_BYTE:        f = "b"
  *                 elif t == NPY_UBYTE:       f = "B"
  */
-      __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_23), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_23), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_Raise(__pyx_t_4, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L14;
+      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      goto __pyx_L12;
     }
-    __pyx_L14:;
+    __pyx_L12:;
 
-    /* "numpy.pxd":254
- *                     (descr.byteorder == '<' and not little_endian)):
+    /* "numpy.pxd":258
+ *                     (descr.byteorder == c'<' and not little_endian)):
  *                     raise ValueError(u"Non-native byte order not supported")
  *                 if   t == NPY_BYTE:        f = "b"             # <<<<<<<<<<<<<<
  *                 elif t == NPY_UBYTE:       f = "B"
@@ -5162,10 +5526,10 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
     __pyx_t_1 = (__pyx_v_t == NPY_BYTE);
     if (__pyx_t_1) {
       __pyx_v_f = __pyx_k__b;
-      goto __pyx_L15;
+      goto __pyx_L13;
     }
 
-    /* "numpy.pxd":255
+    /* "numpy.pxd":259
  *                     raise ValueError(u"Non-native byte order not supported")
  *                 if   t == NPY_BYTE:        f = "b"
  *                 elif t == NPY_UBYTE:       f = "B"             # <<<<<<<<<<<<<<
@@ -5175,10 +5539,10 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
     __pyx_t_1 = (__pyx_v_t == NPY_UBYTE);
     if (__pyx_t_1) {
       __pyx_v_f = __pyx_k__B;
-      goto __pyx_L15;
+      goto __pyx_L13;
     }
 
-    /* "numpy.pxd":256
+    /* "numpy.pxd":260
  *                 if   t == NPY_BYTE:        f = "b"
  *                 elif t == NPY_UBYTE:       f = "B"
  *                 elif t == NPY_SHORT:       f = "h"             # <<<<<<<<<<<<<<
@@ -5188,10 +5552,10 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
     __pyx_t_1 = (__pyx_v_t == NPY_SHORT);
     if (__pyx_t_1) {
       __pyx_v_f = __pyx_k__h;
-      goto __pyx_L15;
+      goto __pyx_L13;
     }
 
-    /* "numpy.pxd":257
+    /* "numpy.pxd":261
  *                 elif t == NPY_UBYTE:       f = "B"
  *                 elif t == NPY_SHORT:       f = "h"
  *                 elif t == NPY_USHORT:      f = "H"             # <<<<<<<<<<<<<<
@@ -5201,10 +5565,10 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
     __pyx_t_1 = (__pyx_v_t == NPY_USHORT);
     if (__pyx_t_1) {
       __pyx_v_f = __pyx_k__H;
-      goto __pyx_L15;
+      goto __pyx_L13;
     }
 
-    /* "numpy.pxd":258
+    /* "numpy.pxd":262
  *                 elif t == NPY_SHORT:       f = "h"
  *                 elif t == NPY_USHORT:      f = "H"
  *                 elif t == NPY_INT:         f = "i"             # <<<<<<<<<<<<<<
@@ -5214,10 +5578,10 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
     __pyx_t_1 = (__pyx_v_t == NPY_INT);
     if (__pyx_t_1) {
       __pyx_v_f = __pyx_k__i;
-      goto __pyx_L15;
+      goto __pyx_L13;
     }
 
-    /* "numpy.pxd":259
+    /* "numpy.pxd":263
  *                 elif t == NPY_USHORT:      f = "H"
  *                 elif t == NPY_INT:         f = "i"
  *                 elif t == NPY_UINT:        f = "I"             # <<<<<<<<<<<<<<
@@ -5227,10 +5591,10 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
     __pyx_t_1 = (__pyx_v_t == NPY_UINT);
     if (__pyx_t_1) {
       __pyx_v_f = __pyx_k__I;
-      goto __pyx_L15;
+      goto __pyx_L13;
     }
 
-    /* "numpy.pxd":260
+    /* "numpy.pxd":264
  *                 elif t == NPY_INT:         f = "i"
  *                 elif t == NPY_UINT:        f = "I"
  *                 elif t == NPY_LONG:        f = "l"             # <<<<<<<<<<<<<<
@@ -5240,10 +5604,10 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
     __pyx_t_1 = (__pyx_v_t == NPY_LONG);
     if (__pyx_t_1) {
       __pyx_v_f = __pyx_k__l;
-      goto __pyx_L15;
+      goto __pyx_L13;
     }
 
-    /* "numpy.pxd":261
+    /* "numpy.pxd":265
  *                 elif t == NPY_UINT:        f = "I"
  *                 elif t == NPY_LONG:        f = "l"
  *                 elif t == NPY_ULONG:       f = "L"             # <<<<<<<<<<<<<<
@@ -5253,10 +5617,10 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
     __pyx_t_1 = (__pyx_v_t == NPY_ULONG);
     if (__pyx_t_1) {
       __pyx_v_f = __pyx_k__L;
-      goto __pyx_L15;
+      goto __pyx_L13;
     }
 
-    /* "numpy.pxd":262
+    /* "numpy.pxd":266
  *                 elif t == NPY_LONG:        f = "l"
  *                 elif t == NPY_ULONG:       f = "L"
  *                 elif t == NPY_LONGLONG:    f = "q"             # <<<<<<<<<<<<<<
@@ -5266,10 +5630,10 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
     __pyx_t_1 = (__pyx_v_t == NPY_LONGLONG);
     if (__pyx_t_1) {
       __pyx_v_f = __pyx_k__q;
-      goto __pyx_L15;
+      goto __pyx_L13;
     }
 
-    /* "numpy.pxd":263
+    /* "numpy.pxd":267
  *                 elif t == NPY_ULONG:       f = "L"
  *                 elif t == NPY_LONGLONG:    f = "q"
  *                 elif t == NPY_ULONGLONG:   f = "Q"             # <<<<<<<<<<<<<<
@@ -5279,10 +5643,10 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
     __pyx_t_1 = (__pyx_v_t == NPY_ULONGLONG);
     if (__pyx_t_1) {
       __pyx_v_f = __pyx_k__Q;
-      goto __pyx_L15;
+      goto __pyx_L13;
     }
 
-    /* "numpy.pxd":264
+    /* "numpy.pxd":268
  *                 elif t == NPY_LONGLONG:    f = "q"
  *                 elif t == NPY_ULONGLONG:   f = "Q"
  *                 elif t == NPY_FLOAT:       f = "f"             # <<<<<<<<<<<<<<
@@ -5292,10 +5656,10 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
     __pyx_t_1 = (__pyx_v_t == NPY_FLOAT);
     if (__pyx_t_1) {
       __pyx_v_f = __pyx_k__f;
-      goto __pyx_L15;
+      goto __pyx_L13;
     }
 
-    /* "numpy.pxd":265
+    /* "numpy.pxd":269
  *                 elif t == NPY_ULONGLONG:   f = "Q"
  *                 elif t == NPY_FLOAT:       f = "f"
  *                 elif t == NPY_DOUBLE:      f = "d"             # <<<<<<<<<<<<<<
@@ -5305,10 +5669,10 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
     __pyx_t_1 = (__pyx_v_t == NPY_DOUBLE);
     if (__pyx_t_1) {
       __pyx_v_f = __pyx_k__d;
-      goto __pyx_L15;
+      goto __pyx_L13;
     }
 
-    /* "numpy.pxd":266
+    /* "numpy.pxd":270
  *                 elif t == NPY_FLOAT:       f = "f"
  *                 elif t == NPY_DOUBLE:      f = "d"
  *                 elif t == NPY_LONGDOUBLE:  f = "g"             # <<<<<<<<<<<<<<
@@ -5318,10 +5682,10 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
     __pyx_t_1 = (__pyx_v_t == NPY_LONGDOUBLE);
     if (__pyx_t_1) {
       __pyx_v_f = __pyx_k__g;
-      goto __pyx_L15;
+      goto __pyx_L13;
     }
 
-    /* "numpy.pxd":267
+    /* "numpy.pxd":271
  *                 elif t == NPY_DOUBLE:      f = "d"
  *                 elif t == NPY_LONGDOUBLE:  f = "g"
  *                 elif t == NPY_CFLOAT:      f = "Zf"             # <<<<<<<<<<<<<<
@@ -5331,10 +5695,10 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
     __pyx_t_1 = (__pyx_v_t == NPY_CFLOAT);
     if (__pyx_t_1) {
       __pyx_v_f = __pyx_k__Zf;
-      goto __pyx_L15;
+      goto __pyx_L13;
     }
 
-    /* "numpy.pxd":268
+    /* "numpy.pxd":272
  *                 elif t == NPY_LONGDOUBLE:  f = "g"
  *                 elif t == NPY_CFLOAT:      f = "Zf"
  *                 elif t == NPY_CDOUBLE:     f = "Zd"             # <<<<<<<<<<<<<<
@@ -5344,10 +5708,10 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
     __pyx_t_1 = (__pyx_v_t == NPY_CDOUBLE);
     if (__pyx_t_1) {
       __pyx_v_f = __pyx_k__Zd;
-      goto __pyx_L15;
+      goto __pyx_L13;
     }
 
-    /* "numpy.pxd":269
+    /* "numpy.pxd":273
  *                 elif t == NPY_CFLOAT:      f = "Zf"
  *                 elif t == NPY_CDOUBLE:     f = "Zd"
  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"             # <<<<<<<<<<<<<<
@@ -5357,10 +5721,10 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
     __pyx_t_1 = (__pyx_v_t == NPY_CLONGDOUBLE);
     if (__pyx_t_1) {
       __pyx_v_f = __pyx_k__Zg;
-      goto __pyx_L15;
+      goto __pyx_L13;
     }
 
-    /* "numpy.pxd":270
+    /* "numpy.pxd":274
  *                 elif t == NPY_CDOUBLE:     f = "Zd"
  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
  *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
@@ -5370,37 +5734,37 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
     __pyx_t_1 = (__pyx_v_t == NPY_OBJECT);
     if (__pyx_t_1) {
       __pyx_v_f = __pyx_k__O;
-      goto __pyx_L15;
+      goto __pyx_L13;
     }
     /*else*/ {
 
-      /* "numpy.pxd":272
+      /* "numpy.pxd":276
  *                 elif t == NPY_OBJECT:      f = "O"
  *                 else:
  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
  *                 info.format = f
  *                 return
  */
-      __pyx_t_4 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_24), __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_24), __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(((PyObject *)__pyx_t_8));
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
+      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_4);
       PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_8));
       __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
       __pyx_t_8 = 0;
-      __pyx_t_8 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_8 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_8);
       __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     }
-    __pyx_L15:;
+    __pyx_L13:;
 
-    /* "numpy.pxd":273
+    /* "numpy.pxd":277
  *                 else:
  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  *                 info.format = f             # <<<<<<<<<<<<<<
@@ -5409,7 +5773,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
  */
     __pyx_v_info->format = __pyx_v_f;
 
-    /* "numpy.pxd":274
+    /* "numpy.pxd":278
  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  *                 info.format = f
  *                 return             # <<<<<<<<<<<<<<
@@ -5418,57 +5782,57 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
  */
     __pyx_r = 0;
     goto __pyx_L0;
-    goto __pyx_L13;
+    goto __pyx_L11;
   }
   /*else*/ {
 
-    /* "numpy.pxd":276
+    /* "numpy.pxd":280
  *                 return
  *             else:
  *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)             # <<<<<<<<<<<<<<
- *                 info.format[0] = '^' # Native data types, manual alignment
+ *                 info.format[0] = c'^' # Native data types, manual alignment
  *                 offset = 0
  */
     __pyx_v_info->format = ((char *)malloc(255));
 
-    /* "numpy.pxd":277
+    /* "numpy.pxd":281
  *             else:
  *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
- *                 info.format[0] = '^' # Native data types, manual alignment             # <<<<<<<<<<<<<<
+ *                 info.format[0] = c'^' # Native data types, manual alignment             # <<<<<<<<<<<<<<
  *                 offset = 0
  *                 f = _util_dtypestring(descr, info.format + 1,
  */
     (__pyx_v_info->format[0]) = '^';
 
-    /* "numpy.pxd":278
+    /* "numpy.pxd":282
  *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
- *                 info.format[0] = '^' # Native data types, manual alignment
+ *                 info.format[0] = c'^' # Native data types, manual alignment
  *                 offset = 0             # <<<<<<<<<<<<<<
  *                 f = _util_dtypestring(descr, info.format + 1,
  *                                       info.format + _buffer_format_string_len,
  */
     __pyx_v_offset = 0;
 
-    /* "numpy.pxd":281
+    /* "numpy.pxd":285
  *                 f = _util_dtypestring(descr, info.format + 1,
  *                                       info.format + _buffer_format_string_len,
  *                                       &offset)             # <<<<<<<<<<<<<<
- *                 f[0] = 0 # Terminate format string
+ *                 f[0] = c'\0' # Terminate format string
  * 
  */
-    __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __pyx_v_f = __pyx_t_9;
 
-    /* "numpy.pxd":282
+    /* "numpy.pxd":286
  *                                       info.format + _buffer_format_string_len,
  *                                       &offset)
- *                 f[0] = 0 # Terminate format string             # <<<<<<<<<<<<<<
+ *                 f[0] = c'\0' # Terminate format string             # <<<<<<<<<<<<<<
  * 
  *         def __releasebuffer__(ndarray self, Py_buffer* info):
  */
-    (__pyx_v_f[0]) = 0;
+    (__pyx_v_f[0]) = '\x00';
   }
-  __pyx_L13:;
+  __pyx_L11:;
 
   __pyx_r = 0;
   goto __pyx_L0;
@@ -5493,31 +5857,39 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_
   return __pyx_r;
 }
 
-/* "numpy.pxd":284
- *                 f[0] = 0 # Terminate format string
+/* Python wrapper */
+static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
+static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
+  __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
+  __Pyx_RefNannyFinishContext();
+}
+
+/* "numpy.pxd":288
+ *                 f[0] = c'\0' # Terminate format string
  * 
  *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
  *             if PyArray_HASFIELDS(self):
  *                 stdlib.free(info.format)
  */
 
-static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray_1__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
-static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray_1__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
+static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
-  __Pyx_RefNannySetupContext("__releasebuffer__");
+  __Pyx_RefNannySetupContext("__releasebuffer__", 0);
 
-  /* "numpy.pxd":285
+  /* "numpy.pxd":289
  * 
  *         def __releasebuffer__(ndarray self, Py_buffer* info):
  *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
  *                 stdlib.free(info.format)
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
  */
-  __pyx_t_1 = PyArray_HASFIELDS(((PyArrayObject *)__pyx_v_self));
+  __pyx_t_1 = PyArray_HASFIELDS(__pyx_v_self);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":286
+    /* "numpy.pxd":290
  *         def __releasebuffer__(ndarray self, Py_buffer* info):
  *             if PyArray_HASFIELDS(self):
  *                 stdlib.free(info.format)             # <<<<<<<<<<<<<<
@@ -5525,11 +5897,11 @@ static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray_1__releasebuffer__(PyObject *
  *                 stdlib.free(info.strides)
  */
     free(__pyx_v_info->format);
-    goto __pyx_L5;
+    goto __pyx_L3;
   }
-  __pyx_L5:;
+  __pyx_L3:;
 
-  /* "numpy.pxd":287
+  /* "numpy.pxd":291
  *             if PyArray_HASFIELDS(self):
  *                 stdlib.free(info.format)
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
@@ -5539,7 +5911,7 @@ static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray_1__releasebuffer__(PyObject *
   __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t)));
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":288
+    /* "numpy.pxd":292
  *                 stdlib.free(info.format)
  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
  *                 stdlib.free(info.strides)             # <<<<<<<<<<<<<<
@@ -5547,14 +5919,14 @@ static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray_1__releasebuffer__(PyObject *
  * 
  */
     free(__pyx_v_info->strides);
-    goto __pyx_L6;
+    goto __pyx_L4;
   }
-  __pyx_L6:;
+  __pyx_L4:;
 
   __Pyx_RefNannyFinishContext();
 }
 
-/* "numpy.pxd":764
+/* "numpy.pxd":768
  * ctypedef npy_cdouble     complex_t
  * 
  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
@@ -5569,9 +5941,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1");
+  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
 
-  /* "numpy.pxd":765
+  /* "numpy.pxd":769
  * 
  * cdef inline object PyArray_MultiIterNew1(a):
  *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
@@ -5579,7 +5951,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
  * cdef inline object PyArray_MultiIterNew2(a, b):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -5597,7 +5969,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":767
+/* "numpy.pxd":771
  *     return PyArray_MultiIterNew(1, <void*>a)
  * 
  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
@@ -5612,9 +5984,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2");
+  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
 
-  /* "numpy.pxd":768
+  /* "numpy.pxd":772
  * 
  * cdef inline object PyArray_MultiIterNew2(a, b):
  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
@@ -5622,7 +5994,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
  * cdef inline object PyArray_MultiIterNew3(a, b, c):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -5640,7 +6012,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":770
+/* "numpy.pxd":774
  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  * 
  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
@@ -5655,9 +6027,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3");
+  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
 
-  /* "numpy.pxd":771
+  /* "numpy.pxd":775
  * 
  * cdef inline object PyArray_MultiIterNew3(a, b, c):
  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
@@ -5665,7 +6037,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -5683,7 +6055,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":773
+/* "numpy.pxd":777
  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  * 
  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
@@ -5698,9 +6070,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4");
+  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
 
-  /* "numpy.pxd":774
+  /* "numpy.pxd":778
  * 
  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
@@ -5708,7 +6080,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
  */
   __Pyx_XDECREF(__pyx_r);
-  __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_filename = __pyx_f[1]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __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_filename = __pyx_f[1]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -5726,7 +6098,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":776
+/* "numpy.pxd":780
  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  * 
  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
@@ -5741,9 +6113,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5");
+  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
 
-  /* "numpy.pxd":777
+  /* "numpy.pxd":781
  * 
  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
@@ -5751,7 +6123,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
  */
   __Pyx_XDECREF(__pyx_r);
-  __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_filename = __pyx_f[1]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __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_filename = __pyx_f[1]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -5769,7 +6141,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
   return __pyx_r;
 }
 
-/* "numpy.pxd":779
+/* "numpy.pxd":783
  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  * 
  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
@@ -5792,18 +6164,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
   PyObject *__pyx_t_3 = NULL;
   PyObject *__pyx_t_4 = NULL;
   PyObject *__pyx_t_5 = NULL;
-  int __pyx_t_6;
+  PyObject *(*__pyx_t_6)(PyObject *);
   int __pyx_t_7;
   int __pyx_t_8;
   int __pyx_t_9;
-  long __pyx_t_10;
-  char *__pyx_t_11;
+  int __pyx_t_10;
+  long __pyx_t_11;
+  char *__pyx_t_12;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("_util_dtypestring");
+  __Pyx_RefNannySetupContext("_util_dtypestring", 0);
 
-  /* "numpy.pxd":786
+  /* "numpy.pxd":790
  *     cdef int delta_offset
  *     cdef tuple i
  *     cdef int endian_detector = 1             # <<<<<<<<<<<<<<
@@ -5812,7 +6185,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  */
   __pyx_v_endian_detector = 1;
 
-  /* "numpy.pxd":787
+  /* "numpy.pxd":791
  *     cdef tuple i
  *     cdef int endian_detector = 1
  *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
@@ -5821,7 +6194,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  */
   __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
 
-  /* "numpy.pxd":790
+  /* "numpy.pxd":794
  *     cdef tuple fields
  * 
  *     for childname in descr.names:             # <<<<<<<<<<<<<<
@@ -5829,31 +6202,36 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  *         child, new_offset = fields
  */
   if (unlikely(((PyObject *)__pyx_v_descr->names) == Py_None)) {
-    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   __pyx_t_1 = ((PyObject *)__pyx_v_descr->names); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
   for (;;) {
     if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
-    __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++;
+    #if CYTHON_COMPILING_IN_CPYTHON
+    __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_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    #else
+    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    #endif
     __Pyx_XDECREF(__pyx_v_childname);
     __pyx_v_childname = __pyx_t_3;
     __pyx_t_3 = 0;
 
-    /* "numpy.pxd":791
+    /* "numpy.pxd":795
  * 
  *     for childname in descr.names:
  *         fields = descr.fields[childname]             # <<<<<<<<<<<<<<
  *         child, new_offset = fields
  * 
  */
-    __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_XDECREF(((PyObject *)__pyx_v_fields));
     __pyx_v_fields = ((PyObject*)__pyx_t_3);
     __pyx_t_3 = 0;
 
-    /* "numpy.pxd":792
+    /* "numpy.pxd":796
  *     for childname in descr.names:
  *         fields = descr.fields[childname]
  *         child, new_offset = fields             # <<<<<<<<<<<<<<
@@ -5862,20 +6240,49 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  */
     if (likely(PyTuple_CheckExact(((PyObject *)__pyx_v_fields)))) {
       PyObject* sequence = ((PyObject *)__pyx_v_fields);
-      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
-        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
-        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
-        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      #if CYTHON_COMPILING_IN_CPYTHON
+      Py_ssize_t size = Py_SIZE(sequence);
+      #else
+      Py_ssize_t size = PySequence_Size(sequence);
+      #endif
+      if (unlikely(size != 2)) {
+        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
+      #if CYTHON_COMPILING_IN_CPYTHON
       __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
       __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
       __Pyx_INCREF(__pyx_t_3);
       __Pyx_INCREF(__pyx_t_4);
-    } else {
-      __Pyx_UnpackTupleError(((PyObject *)__pyx_v_fields), 2);
-      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      #else
+      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      #endif
+    } else if (1) {
+      __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    } else
+    {
+      Py_ssize_t index = -1;
+      __pyx_t_5 = PyObject_GetIter(((PyObject *)__pyx_v_fields)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
+      index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_3);
+      index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_4);
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_6 = NULL;
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      goto __pyx_L6_unpacking_done;
+      __pyx_L5_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_t_6 = NULL;
+      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
+      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_L6_unpacking_done:;
     }
-    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_XDECREF(((PyObject *)__pyx_v_child));
     __pyx_v_child = ((PyArray_Descr *)__pyx_t_3);
     __pyx_t_3 = 0;
@@ -5883,99 +6290,98 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
     __pyx_v_new_offset = __pyx_t_4;
     __pyx_t_4 = 0;
 
-    /* "numpy.pxd":794
+    /* "numpy.pxd":798
  *         child, new_offset = fields
  * 
  *         if (end - f) - (new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  * 
  */
-    __pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    if (__pyx_t_6) {
+    if (__pyx_t_7) {
 
-      /* "numpy.pxd":795
+      /* "numpy.pxd":799
  * 
  *         if (end - f) - (new_offset - offset[0]) < 15:
  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
  * 
- *         if ((child.byteorder == '>' and little_endian) or
+ *         if ((child.byteorder == c'>' and little_endian) or
  */
-      __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_26), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_26), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_Raise(__pyx_t_5, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L5;
+      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      goto __pyx_L7;
     }
-    __pyx_L5:;
+    __pyx_L7:;
 
-    /* "numpy.pxd":797
+    /* "numpy.pxd":801
  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  * 
- *         if ((child.byteorder == '>' and little_endian) or             # <<<<<<<<<<<<<<
- *             (child.byteorder == '<' and not little_endian)):
+ *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
+ *             (child.byteorder == c'<' and not little_endian)):
  *             raise ValueError(u"Non-native byte order not supported")
  */
-    __pyx_t_6 = (__pyx_v_child->byteorder == '>');
-    if (__pyx_t_6) {
-      __pyx_t_7 = __pyx_v_little_endian;
+    __pyx_t_7 = (__pyx_v_child->byteorder == '>');
+    if (__pyx_t_7) {
+      __pyx_t_8 = __pyx_v_little_endian;
     } else {
-      __pyx_t_7 = __pyx_t_6;
+      __pyx_t_8 = __pyx_t_7;
     }
-    if (!__pyx_t_7) {
+    if (!__pyx_t_8) {
 
-      /* "numpy.pxd":798
+      /* "numpy.pxd":802
  * 
- *         if ((child.byteorder == '>' and little_endian) or
- *             (child.byteorder == '<' and not little_endian)):             # <<<<<<<<<<<<<<
+ *         if ((child.byteorder == c'>' and little_endian) or
+ *             (child.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
  *             raise ValueError(u"Non-native byte order not supported")
  *             # One could encode it in the format string and have Cython
  */
-      __pyx_t_6 = (__pyx_v_child->byteorder == '<');
-      if (__pyx_t_6) {
-        __pyx_t_8 = (!__pyx_v_little_endian);
-        __pyx_t_9 = __pyx_t_8;
+      __pyx_t_7 = (__pyx_v_child->byteorder == '<');
+      if (__pyx_t_7) {
+        __pyx_t_9 = (!__pyx_v_little_endian);
+        __pyx_t_10 = __pyx_t_9;
       } else {
-        __pyx_t_9 = __pyx_t_6;
+        __pyx_t_10 = __pyx_t_7;
       }
-      __pyx_t_6 = __pyx_t_9;
+      __pyx_t_7 = __pyx_t_10;
     } else {
-      __pyx_t_6 = __pyx_t_7;
+      __pyx_t_7 = __pyx_t_8;
     }
-    if (__pyx_t_6) {
+    if (__pyx_t_7) {
 
-      /* "numpy.pxd":799
- *         if ((child.byteorder == '>' and little_endian) or
- *             (child.byteorder == '<' and not little_endian)):
+      /* "numpy.pxd":803
+ *         if ((child.byteorder == c'>' and little_endian) or
+ *             (child.byteorder == c'<' and not little_endian)):
  *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
  *             # One could encode it in the format string and have Cython
  *             # complain instead, BUT: < and > in format strings also imply
  */
-      __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_27), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_27), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_Raise(__pyx_t_5, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L6;
+      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      goto __pyx_L8;
     }
-    __pyx_L6:;
+    __pyx_L8:;
 
-    /* "numpy.pxd":809
+    /* "numpy.pxd":813
  * 
  *         # Output padding bytes
  *         while offset[0] < new_offset:             # <<<<<<<<<<<<<<
@@ -5983,16 +6389,15 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  *             f += 1
  */
     while (1) {
-      __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (!__pyx_t_6) break;
+      if (!__pyx_t_7) break;
 
-      /* "numpy.pxd":810
+      /* "numpy.pxd":814
  *         # Output padding bytes
  *         while offset[0] < new_offset:
  *             f[0] = 120 # "x"; pad byte             # <<<<<<<<<<<<<<
@@ -6001,7 +6406,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  */
       (__pyx_v_f[0]) = 120;
 
-      /* "numpy.pxd":811
+      /* "numpy.pxd":815
  *         while offset[0] < new_offset:
  *             f[0] = 120 # "x"; pad byte
  *             f += 1             # <<<<<<<<<<<<<<
@@ -6010,430 +6415,413 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  */
       __pyx_v_f = (__pyx_v_f + 1);
 
-      /* "numpy.pxd":812
+      /* "numpy.pxd":816
  *             f[0] = 120 # "x"; pad byte
  *             f += 1
  *             offset[0] += 1             # <<<<<<<<<<<<<<
  * 
  *         offset[0] += child.itemsize
  */
-      __pyx_t_10 = 0;
-      (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1);
+      __pyx_t_11 = 0;
+      (__pyx_v_offset[__pyx_t_11]) = ((__pyx_v_offset[__pyx_t_11]) + 1);
     }
 
-    /* "numpy.pxd":814
+    /* "numpy.pxd":818
  *             offset[0] += 1
  * 
  *         offset[0] += child.itemsize             # <<<<<<<<<<<<<<
  * 
  *         if not PyDataType_HASFIELDS(child):
  */
-    __pyx_t_10 = 0;
-    (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize);
+    __pyx_t_11 = 0;
+    (__pyx_v_offset[__pyx_t_11]) = ((__pyx_v_offset[__pyx_t_11]) + __pyx_v_child->elsize);
 
-    /* "numpy.pxd":816
+    /* "numpy.pxd":820
  *         offset[0] += child.itemsize
  * 
  *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
  *             t = child.type_num
  *             if end - f < 5:
  */
-    __pyx_t_6 = (!PyDataType_HASFIELDS(__pyx_v_child));
-    if (__pyx_t_6) {
+    __pyx_t_7 = (!PyDataType_HASFIELDS(__pyx_v_child));
+    if (__pyx_t_7) {
 
-      /* "numpy.pxd":817
+      /* "numpy.pxd":821
  * 
  *         if not PyDataType_HASFIELDS(child):
  *             t = child.type_num             # <<<<<<<<<<<<<<
  *             if end - f < 5:
  *                 raise RuntimeError(u"Format string allocated too short.")
  */
-      __pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_XDECREF(__pyx_v_t);
       __pyx_v_t = __pyx_t_3;
       __pyx_t_3 = 0;
 
-      /* "numpy.pxd":818
+      /* "numpy.pxd":822
  *         if not PyDataType_HASFIELDS(child):
  *             t = child.type_num
  *             if end - f < 5:             # <<<<<<<<<<<<<<
  *                 raise RuntimeError(u"Format string allocated too short.")
  * 
  */
-      __pyx_t_6 = ((__pyx_v_end - __pyx_v_f) < 5);
-      if (__pyx_t_6) {
+      __pyx_t_7 = ((__pyx_v_end - __pyx_v_f) < 5);
+      if (__pyx_t_7) {
 
-        /* "numpy.pxd":819
+        /* "numpy.pxd":823
  *             t = child.type_num
  *             if end - f < 5:
  *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
  * 
  *             # Until ticket #99 is fixed, use integers to avoid warnings
  */
-        __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_29), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_29), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_3);
         __Pyx_Raise(__pyx_t_3, 0, 0, 0);
         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        goto __pyx_L10;
+        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        goto __pyx_L12;
       }
-      __pyx_L10:;
+      __pyx_L12:;
 
-      /* "numpy.pxd":822
+      /* "numpy.pxd":826
  * 
  *             # Until ticket #99 is fixed, use integers to avoid warnings
  *             if   t == NPY_BYTE:        f[0] =  98 #"b"             # <<<<<<<<<<<<<<
  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_6) {
+      if (__pyx_t_7) {
         (__pyx_v_f[0]) = 98;
-        goto __pyx_L11;
+        goto __pyx_L13;
       }
 
-      /* "numpy.pxd":823
+      /* "numpy.pxd":827
  *             # Until ticket #99 is fixed, use integers to avoid warnings
  *             if   t == NPY_BYTE:        f[0] =  98 #"b"
  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"             # <<<<<<<<<<<<<<
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_5 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_6) {
+      if (__pyx_t_7) {
         (__pyx_v_f[0]) = 66;
-        goto __pyx_L11;
+        goto __pyx_L13;
       }
 
-      /* "numpy.pxd":824
+      /* "numpy.pxd":828
  *             if   t == NPY_BYTE:        f[0] =  98 #"b"
  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"             # <<<<<<<<<<<<<<
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
  *             elif t == NPY_INT:         f[0] = 105 #"i"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_6) {
+      if (__pyx_t_7) {
         (__pyx_v_f[0]) = 104;
-        goto __pyx_L11;
+        goto __pyx_L13;
       }
 
-      /* "numpy.pxd":825
+      /* "numpy.pxd":829
  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"             # <<<<<<<<<<<<<<
  *             elif t == NPY_INT:         f[0] = 105 #"i"
  *             elif t == NPY_UINT:        f[0] =  73 #"I"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_5 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_6) {
+      if (__pyx_t_7) {
         (__pyx_v_f[0]) = 72;
-        goto __pyx_L11;
+        goto __pyx_L13;
       }
 
-      /* "numpy.pxd":826
+      /* "numpy.pxd":830
  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
  *             elif t == NPY_INT:         f[0] = 105 #"i"             # <<<<<<<<<<<<<<
  *             elif t == NPY_UINT:        f[0] =  73 #"I"
  *             elif t == NPY_LONG:        f[0] = 108 #"l"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_6) {
+      if (__pyx_t_7) {
         (__pyx_v_f[0]) = 105;
-        goto __pyx_L11;
+        goto __pyx_L13;
       }
 
-      /* "numpy.pxd":827
+      /* "numpy.pxd":831
  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
  *             elif t == NPY_INT:         f[0] = 105 #"i"
  *             elif t == NPY_UINT:        f[0] =  73 #"I"             # <<<<<<<<<<<<<<
  *             elif t == NPY_LONG:        f[0] = 108 #"l"
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_5 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_6) {
+      if (__pyx_t_7) {
         (__pyx_v_f[0]) = 73;
-        goto __pyx_L11;
+        goto __pyx_L13;
       }
 
-      /* "numpy.pxd":828
+      /* "numpy.pxd":832
  *             elif t == NPY_INT:         f[0] = 105 #"i"
  *             elif t == NPY_UINT:        f[0] =  73 #"I"
  *             elif t == NPY_LONG:        f[0] = 108 #"l"             # <<<<<<<<<<<<<<
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_6) {
+      if (__pyx_t_7) {
         (__pyx_v_f[0]) = 108;
-        goto __pyx_L11;
+        goto __pyx_L13;
       }
 
-      /* "numpy.pxd":829
+      /* "numpy.pxd":833
  *             elif t == NPY_UINT:        f[0] =  73 #"I"
  *             elif t == NPY_LONG:        f[0] = 108 #"l"
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"             # <<<<<<<<<<<<<<
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_5 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_6) {
+      if (__pyx_t_7) {
         (__pyx_v_f[0]) = 76;
-        goto __pyx_L11;
+        goto __pyx_L13;
       }
 
-      /* "numpy.pxd":830
+      /* "numpy.pxd":834
  *             elif t == NPY_LONG:        f[0] = 108 #"l"
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"             # <<<<<<<<<<<<<<
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_6) {
+      if (__pyx_t_7) {
         (__pyx_v_f[0]) = 113;
-        goto __pyx_L11;
+        goto __pyx_L13;
       }
 
-      /* "numpy.pxd":831
+      /* "numpy.pxd":835
  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"             # <<<<<<<<<<<<<<
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_5 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_6) {
+      if (__pyx_t_7) {
         (__pyx_v_f[0]) = 81;
-        goto __pyx_L11;
+        goto __pyx_L13;
       }
 
-      /* "numpy.pxd":832
+      /* "numpy.pxd":836
  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"             # <<<<<<<<<<<<<<
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_6) {
+      if (__pyx_t_7) {
         (__pyx_v_f[0]) = 102;
-        goto __pyx_L11;
+        goto __pyx_L13;
       }
 
-      /* "numpy.pxd":833
+      /* "numpy.pxd":837
  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"             # <<<<<<<<<<<<<<
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_5 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_6) {
+      if (__pyx_t_7) {
         (__pyx_v_f[0]) = 100;
-        goto __pyx_L11;
+        goto __pyx_L13;
       }
 
-      /* "numpy.pxd":834
+      /* "numpy.pxd":838
  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"             # <<<<<<<<<<<<<<
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_6) {
+      if (__pyx_t_7) {
         (__pyx_v_f[0]) = 103;
-        goto __pyx_L11;
+        goto __pyx_L13;
       }
 
-      /* "numpy.pxd":835
+      /* "numpy.pxd":839
  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf             # <<<<<<<<<<<<<<
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_5 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_6) {
+      if (__pyx_t_7) {
         (__pyx_v_f[0]) = 90;
         (__pyx_v_f[1]) = 102;
         __pyx_v_f = (__pyx_v_f + 1);
-        goto __pyx_L11;
+        goto __pyx_L13;
       }
 
-      /* "numpy.pxd":836
+      /* "numpy.pxd":840
  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd             # <<<<<<<<<<<<<<
  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_6) {
+      if (__pyx_t_7) {
         (__pyx_v_f[0]) = 90;
         (__pyx_v_f[1]) = 100;
         __pyx_v_f = (__pyx_v_f + 1);
-        goto __pyx_L11;
+        goto __pyx_L13;
       }
 
-      /* "numpy.pxd":837
+      /* "numpy.pxd":841
  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg             # <<<<<<<<<<<<<<
  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
  *             else:
  */
-      __pyx_t_5 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_5 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_6) {
+      if (__pyx_t_7) {
         (__pyx_v_f[0]) = 90;
         (__pyx_v_f[1]) = 103;
         __pyx_v_f = (__pyx_v_f + 1);
-        goto __pyx_L11;
+        goto __pyx_L13;
       }
 
-      /* "numpy.pxd":838
+      /* "numpy.pxd":842
  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"             # <<<<<<<<<<<<<<
  *             else:
  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  */
-      __pyx_t_3 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_3 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_6) {
+      if (__pyx_t_7) {
         (__pyx_v_f[0]) = 79;
-        goto __pyx_L11;
+        goto __pyx_L13;
       }
       /*else*/ {
 
-        /* "numpy.pxd":840
+        /* "numpy.pxd":844
  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
  *             else:
  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
  *             f += 1
  *         else:
  */
-        __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_24), __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_24), __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __Pyx_GOTREF(__pyx_t_3);
         PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_5));
         __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
         __pyx_t_5 = 0;
-        __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         __Pyx_GOTREF(__pyx_t_5);
         __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
         __Pyx_Raise(__pyx_t_5, 0, 0, 0);
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
-      __pyx_L11:;
+      __pyx_L13:;
 
-      /* "numpy.pxd":841
+      /* "numpy.pxd":845
  *             else:
  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  *             f += 1             # <<<<<<<<<<<<<<
@@ -6441,25 +6829,25 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
  *             # Cython ignores struct boundary information ("T{...}"),
  */
       __pyx_v_f = (__pyx_v_f + 1);
-      goto __pyx_L9;
+      goto __pyx_L11;
     }
     /*else*/ {
 
-      /* "numpy.pxd":845
+      /* "numpy.pxd":849
  *             # Cython ignores struct boundary information ("T{...}"),
  *             # so don't output it
  *             f = _util_dtypestring(child, f, end, offset)             # <<<<<<<<<<<<<<
  *     return f
  * 
  */
-      __pyx_t_11 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_v_f = __pyx_t_11;
+      __pyx_t_12 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_v_f = __pyx_t_12;
     }
-    __pyx_L9:;
+    __pyx_L11:;
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "numpy.pxd":846
+  /* "numpy.pxd":850
  *             # so don't output it
  *             f = _util_dtypestring(child, f, end, offset)
  *     return f             # <<<<<<<<<<<<<<
@@ -6488,7 +6876,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
   return __pyx_r;
 }
 
-/* "numpy.pxd":961
+/* "numpy.pxd":965
  * 
  * 
  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
@@ -6500,9 +6888,9 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
   PyObject *__pyx_v_baseptr;
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
-  __Pyx_RefNannySetupContext("set_array_base");
+  __Pyx_RefNannySetupContext("set_array_base", 0);
 
-  /* "numpy.pxd":963
+  /* "numpy.pxd":967
  * cdef inline void set_array_base(ndarray arr, object base):
  *      cdef PyObject* baseptr
  *      if base is None:             # <<<<<<<<<<<<<<
@@ -6512,7 +6900,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
   __pyx_t_1 = (__pyx_v_base == Py_None);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":964
+    /* "numpy.pxd":968
  *      cdef PyObject* baseptr
  *      if base is None:
  *          baseptr = NULL             # <<<<<<<<<<<<<<
@@ -6524,7 +6912,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
   }
   /*else*/ {
 
-    /* "numpy.pxd":966
+    /* "numpy.pxd":970
  *          baseptr = NULL
  *      else:
  *          Py_INCREF(base) # important to do this before decref below!             # <<<<<<<<<<<<<<
@@ -6533,7 +6921,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
  */
     Py_INCREF(__pyx_v_base);
 
-    /* "numpy.pxd":967
+    /* "numpy.pxd":971
  *      else:
  *          Py_INCREF(base) # important to do this before decref below!
  *          baseptr = <PyObject*>base             # <<<<<<<<<<<<<<
@@ -6544,7 +6932,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
   }
   __pyx_L3:;
 
-  /* "numpy.pxd":968
+  /* "numpy.pxd":972
  *          Py_INCREF(base) # important to do this before decref below!
  *          baseptr = <PyObject*>base
  *      Py_XDECREF(arr.base)             # <<<<<<<<<<<<<<
@@ -6553,7 +6941,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
  */
   Py_XDECREF(__pyx_v_arr->base);
 
-  /* "numpy.pxd":969
+  /* "numpy.pxd":973
  *          baseptr = <PyObject*>base
  *      Py_XDECREF(arr.base)
  *      arr.base = baseptr             # <<<<<<<<<<<<<<
@@ -6565,7 +6953,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
   __Pyx_RefNannyFinishContext();
 }
 
-/* "numpy.pxd":971
+/* "numpy.pxd":975
  *      arr.base = baseptr
  * 
  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
@@ -6577,9 +6965,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
-  __Pyx_RefNannySetupContext("get_array_base");
+  __Pyx_RefNannySetupContext("get_array_base", 0);
 
-  /* "numpy.pxd":972
+  /* "numpy.pxd":976
  * 
  * cdef inline object get_array_base(ndarray arr):
  *     if arr.base is NULL:             # <<<<<<<<<<<<<<
@@ -6589,7 +6977,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
   __pyx_t_1 = (__pyx_v_arr->base == NULL);
   if (__pyx_t_1) {
 
-    /* "numpy.pxd":973
+    /* "numpy.pxd":977
  * cdef inline object get_array_base(ndarray arr):
  *     if arr.base is NULL:
  *         return None             # <<<<<<<<<<<<<<
@@ -6604,7 +6992,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
   }
   /*else*/ {
 
-    /* "numpy.pxd":975
+    /* "numpy.pxd":979
  *         return None
  *     else:
  *         return <object>arr.base             # <<<<<<<<<<<<<<
@@ -6624,7 +7012,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
 }
 static struct __pyx_vtabstruct_25MMTK_trajectory_generator_TrajectoryGenerator __pyx_vtable_25MMTK_trajectory_generator_TrajectoryGenerator;
 
-static PyObject *__pyx_tp_new_25MMTK_trajectory_generator_TrajectoryGenerator(PyTypeObject *t, PyObject *a, PyObject *k) {
+static PyObject *__pyx_tp_new_25MMTK_trajectory_generator_TrajectoryGenerator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
   struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *p;
   PyObject *o = (*t->tp_alloc)(t, 0);
   if (!o) return 0;
@@ -6643,14 +7031,14 @@ static PyObject *__pyx_tp_new_25MMTK_trajectory_generator_TrajectoryGenerator(Py
 
 static void __pyx_tp_dealloc_25MMTK_trajectory_generator_TrajectoryGenerator(PyObject *o) {
   struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *p = (struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)o;
-  Py_XDECREF(p->universe);
-  Py_XDECREF(p->options);
-  Py_XDECREF(p->name);
-  Py_XDECREF(p->call_options);
-  Py_XDECREF(p->features);
-  Py_XDECREF(p->actions);
-  Py_XDECREF(p->state_accessor);
-  Py_XDECREF(((PyObject *)p->conf_array));
+  Py_CLEAR(p->universe);
+  Py_CLEAR(p->options);
+  Py_CLEAR(p->name);
+  Py_CLEAR(p->call_options);
+  Py_CLEAR(p->features);
+  Py_CLEAR(p->actions);
+  Py_CLEAR(p->state_accessor);
+  Py_CLEAR(p->conf_array);
   (*Py_TYPE(o)->tp_free)(o);
 }
 
@@ -6714,50 +7102,50 @@ static int __pyx_tp_clear_25MMTK_trajectory_generator_TrajectoryGenerator(PyObje
   return 0;
 }
 
-static PyObject *__pyx_getprop_25MMTK_trajectory_generator_19TrajectoryGenerator_universe(PyObject *o, void *x) {
-  return __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_8universe___get__(o);
+static PyObject *__pyx_getprop_25MMTK_trajectory_generator_19TrajectoryGenerator_universe(PyObject *o, CYTHON_UNUSED void *x) {
+  return __pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_8universe_1__get__(o);
 }
 
-static PyObject *__pyx_getprop_25MMTK_trajectory_generator_19TrajectoryGenerator_options(PyObject *o, void *x) {
-  return __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_7options___get__(o);
+static PyObject *__pyx_getprop_25MMTK_trajectory_generator_19TrajectoryGenerator_options(PyObject *o, CYTHON_UNUSED void *x) {
+  return __pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_7options_1__get__(o);
 }
 
-static PyObject *__pyx_getprop_25MMTK_trajectory_generator_19TrajectoryGenerator_name(PyObject *o, void *x) {
-  return __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_4name___get__(o);
+static PyObject *__pyx_getprop_25MMTK_trajectory_generator_19TrajectoryGenerator_name(PyObject *o, CYTHON_UNUSED void *x) {
+  return __pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_4name_1__get__(o);
 }
 
-static PyObject *__pyx_getprop_25MMTK_trajectory_generator_19TrajectoryGenerator_call_options(PyObject *o, void *x) {
-  return __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_12call_options___get__(o);
+static PyObject *__pyx_getprop_25MMTK_trajectory_generator_19TrajectoryGenerator_call_options(PyObject *o, CYTHON_UNUSED void *x) {
+  return __pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_12call_options_1__get__(o);
 }
 
-static PyObject *__pyx_getprop_25MMTK_trajectory_generator_19TrajectoryGenerator_features(PyObject *o, void *x) {
-  return __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_8features___get__(o);
+static PyObject *__pyx_getprop_25MMTK_trajectory_generator_19TrajectoryGenerator_features(PyObject *o, CYTHON_UNUSED void *x) {
+  return __pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_8features_1__get__(o);
 }
 
-static PyObject *__pyx_getprop_25MMTK_trajectory_generator_19TrajectoryGenerator_actions(PyObject *o, void *x) {
-  return __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_7actions___get__(o);
+static PyObject *__pyx_getprop_25MMTK_trajectory_generator_19TrajectoryGenerator_actions(PyObject *o, CYTHON_UNUSED void *x) {
+  return __pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_7actions_1__get__(o);
 }
 
-static PyObject *__pyx_getprop_25MMTK_trajectory_generator_19TrajectoryGenerator_state_accessor(PyObject *o, void *x) {
-  return __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_14state_accessor___get__(o);
+static PyObject *__pyx_getprop_25MMTK_trajectory_generator_19TrajectoryGenerator_state_accessor(PyObject *o, CYTHON_UNUSED void *x) {
+  return __pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_14state_accessor_1__get__(o);
 }
 
-static int __pyx_setprop_25MMTK_trajectory_generator_19TrajectoryGenerator_state_accessor(PyObject *o, PyObject *v, void *x) {
+static int __pyx_setprop_25MMTK_trajectory_generator_19TrajectoryGenerator_state_accessor(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
   if (v) {
-    return __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_14state_accessor_1__set__(o, v);
+    return __pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_14state_accessor_3__set__(o, v);
   }
   else {
-    return __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_14state_accessor_2__del__(o);
+    return __pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_14state_accessor_5__del__(o);
   }
 }
 
 static PyMethodDef __pyx_methods_25MMTK_trajectory_generator_TrajectoryGenerator[] = {
-  {__Pyx_NAMESTR("setCallOptions"), (PyCFunction)__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_1setCallOptions, METH_O, __Pyx_DOCSTR(0)},
-  {__Pyx_NAMESTR("getActions"), (PyCFunction)__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_2getActions, METH_NOARGS, __Pyx_DOCSTR(0)},
-  {__Pyx_NAMESTR("cleanupActions"), (PyCFunction)__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_3cleanupActions, METH_NOARGS, __Pyx_DOCSTR(0)},
-  {__Pyx_NAMESTR("getOption"), (PyCFunction)__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_4getOption, METH_O, __Pyx_DOCSTR(0)},
-  {__Pyx_NAMESTR("optionString"), (PyCFunction)__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_5optionString, METH_O, __Pyx_DOCSTR(0)},
-  {__Pyx_NAMESTR("start_py"), (PyCFunction)__pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_7start_py, METH_NOARGS, __Pyx_DOCSTR(0)},
+  {__Pyx_NAMESTR("setCallOptions"), (PyCFunction)__pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_3setCallOptions, METH_O, __Pyx_DOCSTR(0)},
+  {__Pyx_NAMESTR("getActions"), (PyCFunction)__pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_5getActions, METH_NOARGS, __Pyx_DOCSTR(0)},
+  {__Pyx_NAMESTR("cleanupActions"), (PyCFunction)__pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_7cleanupActions, METH_NOARGS, __Pyx_DOCSTR(0)},
+  {__Pyx_NAMESTR("getOption"), (PyCFunction)__pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_9getOption, METH_O, __Pyx_DOCSTR(0)},
+  {__Pyx_NAMESTR("optionString"), (PyCFunction)__pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_11optionString, METH_O, __Pyx_DOCSTR(0)},
+  {__Pyx_NAMESTR("start_py"), (PyCFunction)__pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_15start_py, METH_NOARGS, __Pyx_DOCSTR(0)},
   {0, 0, 0, 0}
 };
 
@@ -6889,7 +7277,7 @@ static PyTypeObject __pyx_type_25MMTK_trajectory_generator_TrajectoryGenerator =
   &__pyx_tp_as_sequence_TrajectoryGenerator, /*tp_as_sequence*/
   &__pyx_tp_as_mapping_TrajectoryGenerator, /*tp_as_mapping*/
   0, /*tp_hash*/
-  __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator_6__call__, /*tp_call*/
+  __pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_13__call__, /*tp_call*/
   0, /*tp_str*/
   0, /*tp_getattro*/
   0, /*tp_setattro*/
@@ -6910,7 +7298,7 @@ static PyTypeObject __pyx_type_25MMTK_trajectory_generator_TrajectoryGenerator =
   0, /*tp_descr_get*/
   0, /*tp_descr_set*/
   0, /*tp_dictoffset*/
-  __pyx_pf_25MMTK_trajectory_generator_19TrajectoryGenerator___init__, /*tp_init*/
+  __pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_1__init__, /*tp_init*/
   0, /*tp_alloc*/
   __pyx_tp_new_25MMTK_trajectory_generator_TrajectoryGenerator, /*tp_new*/
   0, /*tp_free*/
@@ -6940,8 +7328,8 @@ static PyObject *__pyx_tp_new_25MMTK_trajectory_generator_EnergyBasedTrajectoryG
 
 static void __pyx_tp_dealloc_25MMTK_trajectory_generator_EnergyBasedTrajectoryGenerator(PyObject *o) {
   struct __pyx_obj_25MMTK_trajectory_generator_EnergyBasedTrajectoryGenerator *p = (struct __pyx_obj_25MMTK_trajectory_generator_EnergyBasedTrajectoryGenerator *)o;
-  Py_XDECREF(p->evaluator_object);
-  Py_XDECREF(p->c_evaluator_object);
+  Py_CLEAR(p->evaluator_object);
+  Py_CLEAR(p->c_evaluator_object);
   __pyx_tp_dealloc_25MMTK_trajectory_generator_TrajectoryGenerator(o);
 }
 
@@ -7092,7 +7480,11 @@ static PyTypeObject __pyx_type_25MMTK_trajectory_generator_EnergyBasedTrajectory
   &__pyx_tp_as_sequence_EnergyBasedTrajectoryGenerator, /*tp_as_sequence*/
   &__pyx_tp_as_mapping_EnergyBasedTrajectoryGenerator, /*tp_as_mapping*/
   0, /*tp_hash*/
+  #if CYTHON_COMPILING_IN_PYPY
+  __pyx_pw_25MMTK_trajectory_generator_19TrajectoryGenerator_13__call__, /*tp_call*/
+  #else
   0, /*tp_call*/
+  #endif
   0, /*tp_str*/
   0, /*tp_getattro*/
   0, /*tp_setattro*/
@@ -7113,7 +7505,7 @@ static PyTypeObject __pyx_type_25MMTK_trajectory_generator_EnergyBasedTrajectory
   0, /*tp_descr_get*/
   0, /*tp_descr_set*/
   0, /*tp_dictoffset*/
-  __pyx_pf_25MMTK_trajectory_generator_30EnergyBasedTrajectoryGenerator___init__, /*tp_init*/
+  __pyx_pw_25MMTK_trajectory_generator_30EnergyBasedTrajectoryGenerator_1__init__, /*tp_init*/
   0, /*tp_alloc*/
   __pyx_tp_new_25MMTK_trajectory_generator_EnergyBasedTrajectoryGenerator, /*tp_new*/
   0, /*tp_free*/
@@ -7129,7 +7521,7 @@ static PyTypeObject __pyx_type_25MMTK_trajectory_generator_EnergyBasedTrajectory
   #endif
 };
 
-static PyObject *__pyx_tp_new_25MMTK_trajectory_generator___pyx_scope_struct__optionString(PyTypeObject *t, PyObject *a, PyObject *k) {
+static PyObject *__pyx_tp_new_25MMTK_trajectory_generator___pyx_scope_struct__optionString(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
   struct __pyx_obj_25MMTK_trajectory_generator___pyx_scope_struct__optionString *p;
   PyObject *o = (*t->tp_alloc)(t, 0);
   if (!o) return 0;
@@ -7141,8 +7533,8 @@ static PyObject *__pyx_tp_new_25MMTK_trajectory_generator___pyx_scope_struct__op
 
 static void __pyx_tp_dealloc_25MMTK_trajectory_generator___pyx_scope_struct__optionString(PyObject *o) {
   struct __pyx_obj_25MMTK_trajectory_generator___pyx_scope_struct__optionString *p = (struct __pyx_obj_25MMTK_trajectory_generator___pyx_scope_struct__optionString *)o;
-  Py_XDECREF(p->__pyx_v_options);
-  Py_XDECREF(((PyObject *)p->__pyx_v_self));
+  Py_CLEAR(p->__pyx_v_options);
+  Py_CLEAR(p->__pyx_v_self);
   (*Py_TYPE(o)->tp_free)(o);
 }
 
@@ -7165,7 +7557,7 @@ static int __pyx_tp_clear_25MMTK_trajectory_generator___pyx_scope_struct__option
   p->__pyx_v_options = Py_None; Py_INCREF(Py_None);
   Py_XDECREF(tmp);
   tmp = ((PyObject*)p->__pyx_v_self);
-  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
+  p->__pyx_v_self = ((struct __pyx_obj_25MMTK_trajectory_generator_TrajectoryGenerator *)Py_None); Py_INCREF(Py_None);
   Py_XDECREF(tmp);
   return 0;
 }
@@ -7328,219 +7720,9 @@ static PyTypeObject __pyx_type_25MMTK_trajectory_generator___pyx_scope_struct__o
   #endif
 };
 
-static PyObject *__pyx_tp_new_25MMTK_trajectory_generator___pyx_Generator(PyTypeObject *t, PyObject *a, PyObject *k) {
-  struct __pyx_Generator_object *p;
-  PyObject *o = (*t->tp_alloc)(t, 0);
-  if (!o) return 0;
-  p = ((struct __pyx_Generator_object *)o);
-  p->exc_type = 0;
-  p->exc_value = 0;
-  p->exc_traceback = 0;
-  return o;
-}
-
-static void __pyx_tp_dealloc_25MMTK_trajectory_generator___pyx_Generator(PyObject *o) {
-  struct __pyx_Generator_object *p = (struct __pyx_Generator_object *)o;
-  Py_XDECREF(p->exc_type);
-  Py_XDECREF(p->exc_value);
-  Py_XDECREF(p->exc_traceback);
-  (*Py_TYPE(o)->tp_free)(o);
-}
-
-static int __pyx_tp_traverse_25MMTK_trajectory_generator___pyx_Generator(PyObject *o, visitproc v, void *a) {
-  int e;
-  struct __pyx_Generator_object *p = (struct __pyx_Generator_object *)o;
-  if (p->exc_type) {
-    e = (*v)(p->exc_type, a); if (e) return e;
-  }
-  if (p->exc_value) {
-    e = (*v)(p->exc_value, a); if (e) return e;
-  }
-  if (p->exc_traceback) {
-    e = (*v)(p->exc_traceback, a); if (e) return e;
-  }
-  return 0;
-}
-
-static int __pyx_tp_clear_25MMTK_trajectory_generator___pyx_Generator(PyObject *o) {
-  struct __pyx_Generator_object *p = (struct __pyx_Generator_object *)o;
-  PyObject* tmp;
-  tmp = ((PyObject*)p->exc_type);
-  p->exc_type = Py_None; Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  tmp = ((PyObject*)p->exc_value);
-  p->exc_value = Py_None; Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  tmp = ((PyObject*)p->exc_traceback);
-  p->exc_traceback = Py_None; Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  return 0;
-}
-
-static PyMethodDef __pyx_methods_25MMTK_trajectory_generator___pyx_Generator[] = {
-  {__Pyx_NAMESTR("send"), (PyCFunction)__Pyx_Generator_Send, METH_O, __Pyx_DOCSTR(0)},
-  {__Pyx_NAMESTR("close"), (PyCFunction)__Pyx_Generator_Close, METH_NOARGS, __Pyx_DOCSTR(0)},
-  {__Pyx_NAMESTR("throw"), (PyCFunction)__Pyx_Generator_Throw, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
-  {0, 0, 0, 0}
-};
-
-static PyNumberMethods __pyx_tp_as_number___pyx_Generator = {
-  0, /*nb_add*/
-  0, /*nb_subtract*/
-  0, /*nb_multiply*/
-  #if PY_MAJOR_VERSION < 3
-  0, /*nb_divide*/
-  #endif
-  0, /*nb_remainder*/
-  0, /*nb_divmod*/
-  0, /*nb_power*/
-  0, /*nb_negative*/
-  0, /*nb_positive*/
-  0, /*nb_absolute*/
-  0, /*nb_nonzero*/
-  0, /*nb_invert*/
-  0, /*nb_lshift*/
-  0, /*nb_rshift*/
-  0, /*nb_and*/
-  0, /*nb_xor*/
-  0, /*nb_or*/
-  #if PY_MAJOR_VERSION < 3
-  0, /*nb_coerce*/
-  #endif
-  0, /*nb_int*/
-  #if PY_MAJOR_VERSION < 3
-  0, /*nb_long*/
-  #else
-  0, /*reserved*/
-  #endif
-  0, /*nb_float*/
-  #if PY_MAJOR_VERSION < 3
-  0, /*nb_oct*/
-  #endif
-  #if PY_MAJOR_VERSION < 3
-  0, /*nb_hex*/
-  #endif
-  0, /*nb_inplace_add*/
-  0, /*nb_inplace_subtract*/
-  0, /*nb_inplace_multiply*/
-  #if PY_MAJOR_VERSION < 3
-  0, /*nb_inplace_divide*/
-  #endif
-  0, /*nb_inplace_remainder*/
-  0, /*nb_inplace_power*/
-  0, /*nb_inplace_lshift*/
-  0, /*nb_inplace_rshift*/
-  0, /*nb_inplace_and*/
-  0, /*nb_inplace_xor*/
-  0, /*nb_inplace_or*/
-  0, /*nb_floor_divide*/
-  0, /*nb_true_divide*/
-  0, /*nb_inplace_floor_divide*/
-  0, /*nb_inplace_true_divide*/
-  #if PY_VERSION_HEX >= 0x02050000
-  0, /*nb_index*/
-  #endif
-};
-
-static PySequenceMethods __pyx_tp_as_sequence___pyx_Generator = {
-  0, /*sq_length*/
-  0, /*sq_concat*/
-  0, /*sq_repeat*/
-  0, /*sq_item*/
-  0, /*sq_slice*/
-  0, /*sq_ass_item*/
-  0, /*sq_ass_slice*/
-  0, /*sq_contains*/
-  0, /*sq_inplace_concat*/
-  0, /*sq_inplace_repeat*/
-};
-
-static PyMappingMethods __pyx_tp_as_mapping___pyx_Generator = {
-  0, /*mp_length*/
-  0, /*mp_subscript*/
-  0, /*mp_ass_subscript*/
-};
-
-static PyBufferProcs __pyx_tp_as_buffer___pyx_Generator = {
-  #if PY_MAJOR_VERSION < 3
-  0, /*bf_getreadbuffer*/
-  #endif
-  #if PY_MAJOR_VERSION < 3
-  0, /*bf_getwritebuffer*/
-  #endif
-  #if PY_MAJOR_VERSION < 3
-  0, /*bf_getsegcount*/
-  #endif
-  #if PY_MAJOR_VERSION < 3
-  0, /*bf_getcharbuffer*/
-  #endif
-  #if PY_VERSION_HEX >= 0x02060000
-  0, /*bf_getbuffer*/
-  #endif
-  #if PY_VERSION_HEX >= 0x02060000
-  0, /*bf_releasebuffer*/
-  #endif
-};
-
-static PyTypeObject __pyx_Generator_type = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("MMTK_trajectory_generator.__pyx_Generator"), /*tp_name*/
-  sizeof(struct __pyx_Generator_object), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_25MMTK_trajectory_generator___pyx_Generator, /*tp_dealloc*/
-  0, /*tp_print*/
-  0, /*tp_getattr*/
-  0, /*tp_setattr*/
-  #if PY_MAJOR_VERSION < 3
-  0, /*tp_compare*/
-  #else
-  0, /*reserved*/
-  #endif
-  0, /*tp_repr*/
-  &__pyx_tp_as_number___pyx_Generator, /*tp_as_number*/
-  &__pyx_tp_as_sequence___pyx_Generator, /*tp_as_sequence*/
-  &__pyx_tp_as_mapping___pyx_Generator, /*tp_as_mapping*/
-  0, /*tp_hash*/
-  0, /*tp_call*/
-  0, /*tp_str*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  &__pyx_tp_as_buffer___pyx_Generator, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  0, /*tp_doc*/
-  __pyx_tp_traverse_25MMTK_trajectory_generator___pyx_Generator, /*tp_traverse*/
-  __pyx_tp_clear_25MMTK_trajectory_generator___pyx_Generator, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  PyObject_SelfIter, /*tp_iter*/
-  __Pyx_Generator_Next, /*tp_iternext*/
-  __pyx_methods_25MMTK_trajectory_generator___pyx_Generator, /*tp_methods*/
-  0, /*tp_members*/
-  0, /*tp_getset*/
-  0, /*tp_base*/
-  0, /*tp_dict*/
-  0, /*tp_descr_get*/
-  0, /*tp_descr_set*/
-  0, /*tp_dictoffset*/
-  0, /*tp_init*/
-  0, /*tp_alloc*/
-  __pyx_tp_new_25MMTK_trajectory_generator___pyx_Generator, /*tp_new*/
-  0, /*tp_free*/
-  0, /*tp_is_gc*/
-  0, /*tp_bases*/
-  0, /*tp_mro*/
-  0, /*tp_cache*/
-  0, /*tp_subclasses*/
-  0, /*tp_weaklist*/
-  0, /*tp_del*/
-  #if PY_VERSION_HEX >= 0x02060000
-  0, /*tp_version_tag*/
-  #endif
-};
-
-static PyObject *__pyx_tp_new_25MMTK_trajectory_generator___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k) {
+static PyObject *__pyx_tp_new_25MMTK_trajectory_generator___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
   struct __pyx_obj_25MMTK_trajectory_generator___pyx_scope_struct_1_genexpr *p;
-  PyObject *o = __pyx_tp_new_25MMTK_trajectory_generator___pyx_Generator(t, a, k);
+  PyObject *o = (*t->tp_alloc)(t, 0);
   if (!o) return 0;
   p = ((struct __pyx_obj_25MMTK_trajectory_generator___pyx_scope_struct_1_genexpr *)o);
   p->__pyx_outer_scope = 0;
@@ -7551,16 +7733,15 @@ static PyObject *__pyx_tp_new_25MMTK_trajectory_generator___pyx_scope_struct_1_g
 
 static void __pyx_tp_dealloc_25MMTK_trajectory_generator___pyx_scope_struct_1_genexpr(PyObject *o) {
   struct __pyx_obj_25MMTK_trajectory_generator___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_25MMTK_trajectory_generator___pyx_scope_struct_1_genexpr *)o;
-  Py_XDECREF(((PyObject *)p->__pyx_outer_scope));
-  Py_XDECREF(p->__pyx_v_o);
-  Py_XDECREF(p->__pyx_t_0);
-  __pyx_tp_dealloc_25MMTK_trajectory_generator___pyx_Generator(o);
+  Py_CLEAR(p->__pyx_outer_scope);
+  Py_CLEAR(p->__pyx_v_o);
+  Py_CLEAR(p->__pyx_t_0);
+  (*Py_TYPE(o)->tp_free)(o);
 }
 
 static int __pyx_tp_traverse_25MMTK_trajectory_generator___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) {
   int e;
   struct __pyx_obj_25MMTK_trajectory_generator___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_25MMTK_trajectory_generator___pyx_scope_struct_1_genexpr *)o;
-  e = __pyx_tp_traverse_25MMTK_trajectory_generator___pyx_Generator(o, v, a); if (e) return e;
   if (p->__pyx_outer_scope) {
     e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
   }
@@ -7576,7 +7757,6 @@ static int __pyx_tp_traverse_25MMTK_trajectory_generator___pyx_scope_struct_1_ge
 static int __pyx_tp_clear_25MMTK_trajectory_generator___pyx_scope_struct_1_genexpr(PyObject *o) {
   struct __pyx_obj_25MMTK_trajectory_generator___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_25MMTK_trajectory_generator___pyx_scope_struct_1_genexpr *)o;
   PyObject* tmp;
-  __pyx_tp_clear_25MMTK_trajectory_generator___pyx_Generator(o);
   tmp = ((PyObject*)p->__pyx_outer_scope);
   p->__pyx_outer_scope = ((struct __pyx_obj_25MMTK_trajectory_generator___pyx_scope_struct__optionString *)Py_None); Py_INCREF(Py_None);
   Py_XDECREF(tmp);
@@ -7825,7 +8005,7 @@ static int __Pyx_InitCachedBuiltins(void) {
   __pyx_builtin_sum = __Pyx_GetName(__pyx_b, __pyx_n_s__sum); if (!__pyx_builtin_sum) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_builtin_MemoryError = __Pyx_GetName(__pyx_b, __pyx_n_s__MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   return 0;
   __pyx_L1_error:;
   return -1;
@@ -7833,7 +8013,7 @@ static int __Pyx_InitCachedBuiltins(void) {
 
 static int __Pyx_InitCachedConstants(void) {
   __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants");
+  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
 
   /* "MMTK_trajectory_generator.pyx":47
  *     def getActions(self):
@@ -7843,7 +8023,7 @@ static int __Pyx_InitCachedConstants(void) {
  *             steps = None
  */
   __pyx_k_tuple_1 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_1));
+  __Pyx_GOTREF(__pyx_k_tuple_1);
   __Pyx_INCREF(((PyObject *)__pyx_n_s__steps));
   PyTuple_SET_ITEM(__pyx_k_tuple_1, 0, ((PyObject *)__pyx_n_s__steps));
   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__steps));
@@ -7857,7 +8037,7 @@ static int __Pyx_InitCachedConstants(void) {
  *             self.actions = []
  */
   __pyx_k_tuple_7 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_7));
+  __Pyx_GOTREF(__pyx_k_tuple_7);
   __Pyx_INCREF(((PyObject *)__pyx_n_s__actions));
   PyTuple_SET_ITEM(__pyx_k_tuple_7, 0, ((PyObject *)__pyx_n_s__actions));
   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__actions));
@@ -7871,7 +8051,7 @@ static int __Pyx_InitCachedConstants(void) {
  *                 self.state_accessor = MMTK_state_accessor.StateAccessor()
  */
   __pyx_k_tuple_8 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_8));
+  __Pyx_GOTREF(__pyx_k_tuple_8);
   __Pyx_INCREF(((PyObject *)__pyx_n_s__background));
   PyTuple_SET_ITEM(__pyx_k_tuple_8, 0, ((PyObject *)__pyx_n_s__background));
   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__background));
@@ -7885,7 +8065,7 @@ static int __Pyx_InitCachedConstants(void) {
  *             return ThreadManager.TrajectoryGeneratorThread(
  */
   __pyx_k_tuple_12 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_12));
+  __Pyx_GOTREF(__pyx_k_tuple_12);
   __Pyx_INCREF(((PyObject *)__pyx_n_s__background));
   PyTuple_SET_ITEM(__pyx_k_tuple_12, 0, ((PyObject *)__pyx_n_s__background));
   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__background));
@@ -7899,7 +8079,7 @@ static int __Pyx_InitCachedConstants(void) {
  * 
  */
   __pyx_k_tuple_15 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_15));
+  __Pyx_GOTREF(__pyx_k_tuple_15);
   __Pyx_INCREF(((PyObject *)__pyx_kp_s_14));
   PyTuple_SET_ITEM(__pyx_k_tuple_15, 0, ((PyObject *)__pyx_kp_s_14));
   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
@@ -7913,91 +8093,91 @@ static int __Pyx_InitCachedConstants(void) {
  *         self.c_evaluator_object = self.evaluator_object.CEvaluator()
  */
   __pyx_k_tuple_17 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_17));
+  __Pyx_GOTREF(__pyx_k_tuple_17);
   __Pyx_INCREF(((PyObject *)__pyx_n_s__threads));
   PyTuple_SET_ITEM(__pyx_k_tuple_17, 0, ((PyObject *)__pyx_n_s__threads));
   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__threads));
   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_17));
 
-  /* "numpy.pxd":211
+  /* "numpy.pxd":215
  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
  * 
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  */
-  __pyx_k_tuple_19 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_19)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_19));
+  __pyx_k_tuple_19 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_19)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_k_tuple_19);
   __Pyx_INCREF(((PyObject *)__pyx_kp_u_18));
   PyTuple_SET_ITEM(__pyx_k_tuple_19, 0, ((PyObject *)__pyx_kp_u_18));
   __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_18));
   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_19));
 
-  /* "numpy.pxd":215
+  /* "numpy.pxd":219
  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
  *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
  * 
  *             info.buf = PyArray_DATA(self)
  */
-  __pyx_k_tuple_21 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_21)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_21));
+  __pyx_k_tuple_21 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_21)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_k_tuple_21);
   __Pyx_INCREF(((PyObject *)__pyx_kp_u_20));
   PyTuple_SET_ITEM(__pyx_k_tuple_21, 0, ((PyObject *)__pyx_kp_u_20));
   __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_20));
   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_21));
 
-  /* "numpy.pxd":253
- *                 if ((descr.byteorder == '>' and little_endian) or
- *                     (descr.byteorder == '<' and not little_endian)):
+  /* "numpy.pxd":257
+ *                 if ((descr.byteorder == c'>' and little_endian) or
+ *                     (descr.byteorder == c'<' and not little_endian)):
  *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
  *                 if   t == NPY_BYTE:        f = "b"
  *                 elif t == NPY_UBYTE:       f = "B"
  */
-  __pyx_k_tuple_23 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_23)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_23));
+  __pyx_k_tuple_23 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_23)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_k_tuple_23);
   __Pyx_INCREF(((PyObject *)__pyx_kp_u_22));
   PyTuple_SET_ITEM(__pyx_k_tuple_23, 0, ((PyObject *)__pyx_kp_u_22));
   __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_22));
   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_23));
 
-  /* "numpy.pxd":795
+  /* "numpy.pxd":799
  * 
  *         if (end - f) - (new_offset - offset[0]) < 15:
  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
  * 
- *         if ((child.byteorder == '>' and little_endian) or
+ *         if ((child.byteorder == c'>' and little_endian) or
  */
-  __pyx_k_tuple_26 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_26)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_26));
+  __pyx_k_tuple_26 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_26)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_k_tuple_26);
   __Pyx_INCREF(((PyObject *)__pyx_kp_u_25));
   PyTuple_SET_ITEM(__pyx_k_tuple_26, 0, ((PyObject *)__pyx_kp_u_25));
   __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_25));
   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_26));
 
-  /* "numpy.pxd":799
- *         if ((child.byteorder == '>' and little_endian) or
- *             (child.byteorder == '<' and not little_endian)):
+  /* "numpy.pxd":803
+ *         if ((child.byteorder == c'>' and little_endian) or
+ *             (child.byteorder == c'<' and not little_endian)):
  *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
  *             # One could encode it in the format string and have Cython
  *             # complain instead, BUT: < and > in format strings also imply
  */
-  __pyx_k_tuple_27 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_27)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_27));
+  __pyx_k_tuple_27 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_27)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_k_tuple_27);
   __Pyx_INCREF(((PyObject *)__pyx_kp_u_22));
   PyTuple_SET_ITEM(__pyx_k_tuple_27, 0, ((PyObject *)__pyx_kp_u_22));
   __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_22));
   __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_27));
 
-  /* "numpy.pxd":819
+  /* "numpy.pxd":823
  *             t = child.type_num
  *             if end - f < 5:
  *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
  * 
  *             # Until ticket #99 is fixed, use integers to avoid warnings
  */
-  __pyx_k_tuple_29 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_29)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_29));
+  __pyx_k_tuple_29 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_29)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_k_tuple_29);
   __Pyx_INCREF(((PyObject *)__pyx_kp_u_28));
   PyTuple_SET_ITEM(__pyx_k_tuple_29, 0, ((PyObject *)__pyx_kp_u_28));
   __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_28));
@@ -8037,12 +8217,18 @@ PyMODINIT_FUNC PyInit_MMTK_trajectory_generator(void)
           Py_FatalError("failed to import 'refnanny' module");
   }
   #endif
-  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_MMTK_trajectory_generator(void)");
+  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_MMTK_trajectory_generator(void)", 0);
   if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  #ifdef __pyx_binding_PyCFunctionType_USED
-  if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  #ifdef __Pyx_CyFunction_USED
+  if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  #endif
+  #ifdef __Pyx_FusedFunction_USED
+  if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  #endif
+  #ifdef __Pyx_Generator_USED
+  if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   #endif
   /*--- Library function declarations ---*/
   /*--- Threads initialization code ---*/
@@ -8053,16 +8239,23 @@ PyMODINIT_FUNC PyInit_MMTK_trajectory_generator(void)
   #endif
   /*--- Module creation code ---*/
   #if PY_MAJOR_VERSION < 3
-  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("MMTK_trajectory_generator"), __pyx_methods, 0, 0, PYTHON_API_VERSION);
+  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("MMTK_trajectory_generator"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
   #else
   __pyx_m = PyModule_Create(&__pyx_moduledef);
   #endif
-  if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  #if PY_MAJOR_VERSION < 3
-  Py_INCREF(__pyx_m);
+  if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  #if PY_MAJOR_VERSION >= 3
+  {
+    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (!PyDict_GetItemString(modules, "MMTK_trajectory_generator")) {
+      if (unlikely(PyDict_SetItemString(modules, "MMTK_trajectory_generator", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    }
+  }
+  #endif
+  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  #if CYTHON_COMPILING_IN_PYPY
+  Py_INCREF(__pyx_b);
   #endif
-  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
-  if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
   if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
   /*--- Initialize various global constants etc. ---*/
   if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
@@ -8111,17 +8304,21 @@ PyMODINIT_FUNC PyInit_MMTK_trajectory_generator(void)
   __pyx_ptype_25MMTK_trajectory_generator_EnergyBasedTrajectoryGenerator = &__pyx_type_25MMTK_trajectory_generator_EnergyBasedTrajectoryGenerator;
   if (PyType_Ready(&__pyx_type_25MMTK_trajectory_generator___pyx_scope_struct__optionString) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_ptype_25MMTK_trajectory_generator___pyx_scope_struct__optionString = &__pyx_type_25MMTK_trajectory_generator___pyx_scope_struct__optionString;
-  if (PyType_Ready(&__pyx_Generator_type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_25MMTK_trajectory_generator___pyx_Generator = &__pyx_Generator_type;
-  __pyx_type_25MMTK_trajectory_generator___pyx_scope_struct_1_genexpr.tp_base = __pyx_ptype_25MMTK_trajectory_generator___pyx_Generator;
   if (PyType_Ready(&__pyx_type_25MMTK_trajectory_generator___pyx_scope_struct_1_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_ptype_25MMTK_trajectory_generator___pyx_scope_struct_1_genexpr = &__pyx_type_25MMTK_trajectory_generator___pyx_scope_struct_1_genexpr;
   /*--- Type import code ---*/
-  __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", 
+  #if CYTHON_COMPILING_IN_PYPY
+  sizeof(PyTypeObject),
+  #else
+  sizeof(PyHeapTypeObject),
+  #endif
+  0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   /*--- Variable import code ---*/
   /*--- Function import code ---*/
   /*--- Execution code ---*/
@@ -8161,14 +8358,18 @@ PyMODINIT_FUNC PyInit_MMTK_trajectory_generator(void)
  * cimport numpy as N
  */
   __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
+  __Pyx_GOTREF(__pyx_t_1);
   __Pyx_INCREF(((PyObject *)__pyx_n_s__Features));
   PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__Features));
   __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Features));
   __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__MMTK), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__Features); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__Features);
+  if (__pyx_t_1 == NULL) {
+    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__Features);
+    if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  }
   __Pyx_GOTREF(__pyx_t_1);
   if (PyObject_SetAttr(__pyx_m, __pyx_n_s__Features, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -8196,7 +8397,7 @@ PyMODINIT_FUNC PyInit_MMTK_trajectory_generator(void)
   if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
 
-  /* "numpy.pxd":971
+  /* "numpy.pxd":975
  *      arr.base = baseptr
  * 
  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
@@ -8223,7 +8424,6 @@ PyMODINIT_FUNC PyInit_MMTK_trajectory_generator(void)
 }
 
 /* Runtime support code */
-
 #if CYTHON_REFNANNY
 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
     PyObject *m = NULL, *p = NULL;
@@ -8264,7 +8464,6 @@ static void __Pyx_RaiseArgtupleInvalid(
 {
     Py_ssize_t num_expected;
     const char *more_or_less;
-
     if (num_found < num_min) {
         num_expected = num_min;
         more_or_less = "at least";
@@ -8276,7 +8475,7 @@ static void __Pyx_RaiseArgtupleInvalid(
         more_or_less = "exactly";
     }
     PyErr_Format(PyExc_TypeError,
-                 "%s() takes %s %"PY_FORMAT_SIZE_T"d positional argument%s (%"PY_FORMAT_SIZE_T"d given)",
+                 "%s() takes %s %" CYTHON_FORMAT_SSIZE_T "d positional argument%s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                  func_name, more_or_less, num_expected,
                  (num_expected == 1) ? "" : "s", num_found);
 }
@@ -8290,7 +8489,7 @@ static void __Pyx_RaiseDoubleKeywordsError(
         "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
         #else
         "%s() got multiple values for keyword argument '%s'", func_name,
-        PyString_AS_STRING(kw_name));
+        PyString_AsString(kw_name));
         #endif
 }
 
@@ -8306,55 +8505,77 @@ static int __Pyx_ParseOptionalKeywords(
     Py_ssize_t pos = 0;
     PyObject*** name;
     PyObject*** first_kw_arg = argnames + num_pos_args;
-
     while (PyDict_Next(kwds, &pos, &key, &value)) {
         name = first_kw_arg;
         while (*name && (**name != key)) name++;
         if (*name) {
             values[name-argnames] = value;
-        } else {
-            #if PY_MAJOR_VERSION < 3
-            if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) {
-            #else
-            if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) {
-            #endif
-                goto invalid_keyword_type;
-            } else {
-                for (name = first_kw_arg; *name; name++) {
-                    #if PY_MAJOR_VERSION >= 3
-                    if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
-                        PyUnicode_Compare(**name, key) == 0) break;
-                    #else
-                    if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
-                        _PyString_Eq(**name, key)) break;
-                    #endif
-                }
-                if (*name) {
+            continue;
+        }
+        name = first_kw_arg;
+        #if PY_MAJOR_VERSION < 3
+        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
+            while (*name) {
+                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
+                        && _PyString_Eq(**name, key)) {
                     values[name-argnames] = value;
-                } else {
-                    /* unexpected keyword found */
-                    for (name=argnames; name != first_kw_arg; name++) {
-                        if (**name == key) goto arg_passed_twice;
-                        #if PY_MAJOR_VERSION >= 3
-                        if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
-                            PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice;
-                        #else
-                        if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
-                            _PyString_Eq(**name, key)) goto arg_passed_twice;
-                        #endif
-                    }
-                    if (kwds2) {
-                        if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
-                    } else {
-                        goto invalid_keyword;
+                    break;
+                }
+                name++;
+            }
+            if (*name) continue;
+            else {
+                PyObject*** argname = argnames;
+                while (argname != first_kw_arg) {
+                    if ((**argname == key) || (
+                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
+                             && _PyString_Eq(**argname, key))) {
+                        goto arg_passed_twice;
                     }
+                    argname++;
+                }
+            }
+        } else
+        #endif
+        if (likely(PyUnicode_Check(key))) {
+            while (*name) {
+                int cmp = (**name == key) ? 0 :
+                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
+                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
+                #endif
+                    PyUnicode_Compare(**name, key);
+                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
+                if (cmp == 0) {
+                    values[name-argnames] = value;
+                    break;
                 }
+                name++;
             }
+            if (*name) continue;
+            else {
+                PyObject*** argname = argnames;
+                while (argname != first_kw_arg) {
+                    int cmp = (**argname == key) ? 0 :
+                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
+                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
+                    #endif
+                        PyUnicode_Compare(**argname, key);
+                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
+                    if (cmp == 0) goto arg_passed_twice;
+                    argname++;
+                }
+            }
+        } else
+            goto invalid_keyword_type;
+        if (kwds2) {
+            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
+        } else {
+            goto invalid_keyword;
         }
     }
     return 0;
 arg_passed_twice:
-    __Pyx_RaiseDoubleKeywordsError(function_name, **name);
+    __Pyx_RaiseDoubleKeywordsError(function_name, key);
     goto bad;
 invalid_keyword_type:
     PyErr_Format(PyExc_TypeError,
@@ -8375,6 +8596,7 @@ bad:
 
 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
     PyObject *local_type, *local_value, *local_tb;
+#if CYTHON_COMPILING_IN_CPYTHON
     PyObject *tmp_type, *tmp_value, *tmp_tb;
     PyThreadState *tstate = PyThreadState_GET();
     local_type = tstate->curexc_type;
@@ -8383,19 +8605,27 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
     tstate->curexc_type = 0;
     tstate->curexc_value = 0;
     tstate->curexc_traceback = 0;
+#else
+    PyErr_Fetch(&local_type, &local_value, &local_tb);
+#endif
     PyErr_NormalizeException(&local_type, &local_value, &local_tb);
+#if CYTHON_COMPILING_IN_CPYTHON
     if (unlikely(tstate->curexc_type))
+#else
+    if (unlikely(PyErr_Occurred()))
+#endif
         goto bad;
     #if PY_MAJOR_VERSION >= 3
     if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
         goto bad;
     #endif
-    *type = local_type;
-    *value = local_value;
-    *tb = local_tb;
     Py_INCREF(local_type);
     Py_INCREF(local_value);
     Py_INCREF(local_tb);
+    *type = local_type;
+    *value = local_value;
+    *tb = local_tb;
+#if CYTHON_COMPILING_IN_CPYTHON
     tmp_type = tstate->exc_type;
     tmp_value = tstate->exc_value;
     tmp_tb = tstate->exc_traceback;
@@ -8403,10 +8633,13 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
     tstate->exc_value = local_value;
     tstate->exc_traceback = local_tb;
     /* Make sure tstate is in a consistent state when we XDECREF
-       these objects (XDECREF may run arbitrary code). */
+       these objects (DECREF may run arbitrary code). */
     Py_XDECREF(tmp_type);
     Py_XDECREF(tmp_value);
     Py_XDECREF(tmp_tb);
+#else
+    PyErr_SetExcInfo(local_type, local_value, local_tb);
+#endif
     return 0;
 bad:
     *type = 0;
@@ -8418,11 +8651,10 @@ bad:
     return -1;
 }
 
-
 static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
+#if CYTHON_COMPILING_IN_CPYTHON
     PyObject *tmp_type, *tmp_value, *tmp_tb;
     PyThreadState *tstate = PyThreadState_GET();
-
     tmp_type = tstate->curexc_type;
     tmp_value = tstate->curexc_value;
     tmp_tb = tstate->curexc_traceback;
@@ -8432,55 +8664,60 @@ static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyOb
     Py_XDECREF(tmp_type);
     Py_XDECREF(tmp_value);
     Py_XDECREF(tmp_tb);
+#else
+    PyErr_Restore(type, value, tb);
+#endif
 }
-
 static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
+#if CYTHON_COMPILING_IN_CPYTHON
     PyThreadState *tstate = PyThreadState_GET();
     *type = tstate->curexc_type;
     *value = tstate->curexc_value;
     *tb = tstate->curexc_traceback;
-
     tstate->curexc_type = 0;
     tstate->curexc_value = 0;
     tstate->curexc_traceback = 0;
+#else
+    PyErr_Fetch(type, value, tb);
+#endif
 }
 
-
 #if PY_MAJOR_VERSION < 3
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
-    /* cause is unused */
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
+                        CYTHON_UNUSED PyObject *cause) {
     Py_XINCREF(type);
-    Py_XINCREF(value);
-    Py_XINCREF(tb);
-    /* First, check the traceback argument, replacing None with NULL. */
-    if (tb == Py_None) {
-        Py_DECREF(tb);
-        tb = 0;
-    }
-    else if (tb != NULL && !PyTraceBack_Check(tb)) {
-        PyErr_SetString(PyExc_TypeError,
-            "raise: arg 3 must be a traceback or None");
-        goto raise_error;
-    }
-    /* Next, replace a missing value with None */
-    if (value == NULL) {
-        value = Py_None;
+    if (!value || value == Py_None)
+        value = NULL;
+    else
         Py_INCREF(value);
+    if (!tb || tb == Py_None)
+        tb = NULL;
+    else {
+        Py_INCREF(tb);
+        if (!PyTraceBack_Check(tb)) {
+            PyErr_SetString(PyExc_TypeError,
+                "raise: arg 3 must be a traceback or None");
+            goto raise_error;
+        }
     }
     #if PY_VERSION_HEX < 0x02050000
-    if (!PyClass_Check(type))
+    if (PyClass_Check(type)) {
     #else
-    if (!PyType_Check(type))
+    if (PyType_Check(type)) {
     #endif
-    {
-        /* Raising an instance.  The value should be a dummy. */
-        if (value != Py_None) {
+#if CYTHON_COMPILING_IN_PYPY
+        if (!value) {
+            Py_INCREF(Py_None);
+            value = Py_None;
+        }
+#endif
+        PyErr_NormalizeException(&type, &value, &tb);
+    } else {
+        if (value) {
             PyErr_SetString(PyExc_TypeError,
                 "instance exception may not have a separate value");
             goto raise_error;
         }
-        /* Normalize to raise <class>, <instance> */
-        Py_DECREF(value);
         value = type;
         #if PY_VERSION_HEX < 0x02050000
             if (PyInstance_Check(type)) {
@@ -8503,7 +8740,6 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
             }
         #endif
     }
-
     __Pyx_ErrRestore(type, value, tb);
     return;
 raise_error:
@@ -8512,10 +8748,9 @@ raise_error:
     Py_XDECREF(tb);
     return;
 }
-
 #else /* Python 3+ */
-
 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
+    PyObject* owned_instance = NULL;
     if (tb == Py_None) {
         tb = 0;
     } else if (tb && !PyTraceBack_Check(tb)) {
@@ -8525,7 +8760,6 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
     }
     if (value == Py_None)
         value = 0;
-
     if (PyExceptionInstance_Check(type)) {
         if (value) {
             PyErr_SetString(PyExc_TypeError,
@@ -8534,13 +8768,36 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
         }
         value = type;
         type = (PyObject*) Py_TYPE(value);
-    } else if (!PyExceptionClass_Check(type)) {
+    } else if (PyExceptionClass_Check(type)) {
+        PyObject *args;
+        if (!value)
+            args = PyTuple_New(0);
+        else if (PyTuple_Check(value)) {
+            Py_INCREF(value);
+            args = value;
+        }
+        else
+            args = PyTuple_Pack(1, value);
+        if (!args)
+            goto bad;
+        owned_instance = PyEval_CallObject(type, args);
+        Py_DECREF(args);
+        if (!owned_instance)
+            goto bad;
+        value = owned_instance;
+        if (!PyExceptionInstance_Check(value)) {
+            PyErr_Format(PyExc_TypeError,
+                         "calling %R should have returned an instance of "
+                         "BaseException, not %R",
+                         type, Py_TYPE(value));
+            goto bad;
+        }
+    } else {
         PyErr_SetString(PyExc_TypeError,
             "raise: exception class must be a subclass of BaseException");
         goto bad;
     }
-
-    if (cause) {
+    if (cause && cause != Py_None) {
         PyObject *fixed_cause;
         if (PyExceptionClass_Check(cause)) {
             fixed_cause = PyObject_CallObject(cause, NULL);
@@ -8557,14 +8814,9 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
                             "BaseException");
             goto bad;
         }
-        if (!value) {
-            value = PyObject_CallObject(type, NULL);
-        }
         PyException_SetCause(value, fixed_cause);
     }
-
     PyErr_SetObject(type, value);
-
     if (tb) {
         PyThreadState *tstate = PyThreadState_GET();
         PyObject* tmp_tb = tstate->curexc_traceback;
@@ -8574,8 +8826,8 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
             Py_XDECREF(tmp_tb);
         }
     }
-
 bad:
+    Py_XDECREF(owned_instance);
     return;
 }
 #endif
@@ -8591,13 +8843,17 @@ static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
 {
     PyObject* key = 0;
     Py_ssize_t pos = 0;
+#if CPYTHON_COMPILING_IN_PYPY
+    if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
+        goto invalid_keyword;
+    return 1;
+#else
     while (PyDict_Next(kwdict, &pos, &key, 0)) {
         #if PY_MAJOR_VERSION < 3
         if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
-        #else
-        if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key)))
         #endif
-            goto invalid_keyword_type;
+            if (unlikely(!PyUnicode_Check(key)))
+                goto invalid_keyword_type;
     }
     if ((!kw_allowed) && unlikely(key))
         goto invalid_keyword;
@@ -8606,6 +8862,7 @@ invalid_keyword_type:
     PyErr_Format(PyExc_TypeError,
         "%s() keywords must be strings", function_name);
     return 0;
+#endif
 invalid_keyword:
     PyErr_Format(PyExc_TypeError,
     #if PY_MAJOR_VERSION < 3
@@ -8634,18 +8891,6 @@ static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
   unsigned int n = 1;
   return *(unsigned char*)(&n) != 0;
 }
-
-typedef struct {
-  __Pyx_StructField root;
-  __Pyx_BufFmt_StackElem* head;
-  size_t fmt_offset;
-  size_t new_count, enc_count;
-  int is_complex;
-  char enc_type;
-  char new_packmode;
-  char enc_packmode;
-} __Pyx_BufFmt_Context;
-
 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
                               __Pyx_BufFmt_StackElem* stack,
                               __Pyx_TypeInfo* type) {
@@ -8664,6 +8909,8 @@ static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
   ctx->enc_count = 0;
   ctx->enc_type = 0;
   ctx->is_complex = 0;
+  ctx->is_valid_array = 0;
+  ctx->struct_alignment = 0;
   while (type->typegroup == 'S') {
     ++ctx->head;
     ctx->head->field = type->fields;
@@ -8671,7 +8918,6 @@ static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
     type = type->fields->type;
   }
 }
-
 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
     int count;
     const char* t = *ts;
@@ -8687,15 +8933,21 @@ static int __Pyx_BufFmt_ParseNumber(const char** ts) {
     *ts = t;
     return count;
 }
-
+static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
+    int number = __Pyx_BufFmt_ParseNumber(ts);
+    if (number == -1) /* First char was not a digit */
+        PyErr_Format(PyExc_ValueError,\
+                     "Does not understand character buffer dtype format string ('%c')", **ts);
+    return number;
+}
 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
   PyErr_Format(PyExc_ValueError,
                "Unexpected format string character: '%c'", ch);
 }
-
 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
   switch (ch) {
-    case 'b': return "'char'";
+    case 'c': return "'char'";
+    case 'b': return "'signed char'";
     case 'B': return "'unsigned char'";
     case 'h': return "'short'";
     case 'H': return "'unsigned short'";
@@ -8711,14 +8963,14 @@ static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
     case 'T': return "a struct";
     case 'O': return "Python object";
     case 'P': return "a pointer";
+    case 's': case 'p': return "a string";
     case 0: return "end";
     default: return "unparseable format string";
   }
 }
-
 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
   switch (ch) {
-    case '?': case 'c': case 'b': case 'B': return 1;
+    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
     case 'h': case 'H': return 2;
     case 'i': case 'I': case 'l': case 'L': return 4;
     case 'q': case 'Q': return 8;
@@ -8734,10 +8986,9 @@ static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
       return 0;
     }
 }
-
 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
   switch (ch) {
-    case 'c': case 'b': case 'B': return 1;
+    case 'c': case 'b': case 'B': case 's': case 'p': return 1;
     case 'h': case 'H': return sizeof(short);
     case 'i': case 'I': return sizeof(int);
     case 'l': case 'L': return sizeof(long);
@@ -8754,7 +9005,6 @@ static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
     }
   }
 }
-
 typedef struct { char c; short x; } __Pyx_st_short;
 typedef struct { char c; int x; } __Pyx_st_int;
 typedef struct { char c; long x; } __Pyx_st_long;
@@ -8765,10 +9015,9 @@ typedef struct { char c; void *x; } __Pyx_st_void_p;
 #ifdef HAVE_LONG_LONG
 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
 #endif
-
-static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, int is_complex) {
+static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
   switch (ch) {
-    case '?': case 'c': case 'b': case 'B': return 1;
+    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
     case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
     case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
     case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
@@ -8784,21 +9033,59 @@ static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, int is_complex) {
       return 0;
     }
 }
-
+/* These are for computing the padding at the end of the struct to align
+   on the first member of the struct. This will probably the same as above,
+   but we don't have any guarantees.
+ */
+typedef struct { short x; char c; } __Pyx_pad_short;
+typedef struct { int x; char c; } __Pyx_pad_int;
+typedef struct { long x; char c; } __Pyx_pad_long;
+typedef struct { float x; char c; } __Pyx_pad_float;
+typedef struct { double x; char c; } __Pyx_pad_double;
+typedef struct { long double x; char c; } __Pyx_pad_longdouble;
+typedef struct { void *x; char c; } __Pyx_pad_void_p;
+#ifdef HAVE_LONG_LONG
+typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
+#endif
+static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
+  switch (ch) {
+    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
+    case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
+    case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
+    case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
+#ifdef HAVE_LONG_LONG
+    case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
+#endif
+    case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
+    case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
+    case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
+    case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
+    default:
+      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
+      return 0;
+    }
+}
 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
   switch (ch) {
-    case 'c': case 'b': case 'h': case 'i': case 'l': case 'q': return 'I';
-    case 'B': case 'H': case 'I': case 'L': case 'Q': return 'U';
-    case 'f': case 'd': case 'g': return (is_complex ? 'C' : 'R');
-    case 'O': return 'O';
-    case 'P': return 'P';
+    case 'c':
+        return 'H';
+    case 'b': case 'h': case 'i':
+    case 'l': case 'q': case 's': case 'p':
+        return 'I';
+    case 'B': case 'H': case 'I': case 'L': case 'Q':
+        return 'U';
+    case 'f': case 'd': case 'g':
+        return (is_complex ? 'C' : 'R');
+    case 'O':
+        return 'O';
+    case 'P':
+        return 'P';
     default: {
       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
       return 0;
     }
   }
 }
-
 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
   if (ctx->head == NULL || ctx->head->field == &ctx->root) {
     const char* expected;
@@ -8823,16 +9110,37 @@ static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
                  parent->type->name, field->name);
   }
 }
-
 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
   char group;
-  size_t size, offset;
+  size_t size, offset, arraysize = 1;
   if (ctx->enc_type == 0) return 0;
+  if (ctx->head->field->type->arraysize[0]) {
+    int i, ndim = 0;
+    if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
+        ctx->is_valid_array = ctx->head->field->type->ndim == 1;
+        ndim = 1;
+        if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
+            PyErr_Format(PyExc_ValueError,
+                         "Expected a dimension of size %zu, got %zu",
+                         ctx->head->field->type->arraysize[0], ctx->enc_count);
+            return -1;
+        }
+    }
+    if (!ctx->is_valid_array) {
+      PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
+                   ctx->head->field->type->ndim, ndim);
+      return -1;
+    }
+    for (i = 0; i < ctx->head->field->type->ndim; i++) {
+      arraysize *= ctx->head->field->type->arraysize[i];
+    }
+    ctx->is_valid_array = 0;
+    ctx->enc_count = 1;
+  }
   group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
   do {
     __Pyx_StructField* field = ctx->head->field;
     __Pyx_TypeInfo* type = field->type;
-
     if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
       size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
     } else {
@@ -8844,35 +9152,35 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
       if (align_at == 0) return -1;
       align_mod_offset = ctx->fmt_offset % align_at;
       if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
+      if (ctx->struct_alignment == 0)
+          ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
+                                                                 ctx->is_complex);
     }
-
     if (type->size != size || type->typegroup != group) {
       if (type->typegroup == 'C' && type->fields != NULL) {
-        /* special case -- treat as struct rather than complex number */
         size_t parent_offset = ctx->head->parent_offset + field->offset;
         ++ctx->head;
         ctx->head->field = type->fields;
         ctx->head->parent_offset = parent_offset;
         continue;
       }
-
-      __Pyx_BufFmt_RaiseExpected(ctx);
-      return -1;
+      if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
+      } else {
+          __Pyx_BufFmt_RaiseExpected(ctx);
+          return -1;
+      }
     }
-
     offset = ctx->head->parent_offset + field->offset;
     if (ctx->fmt_offset != offset) {
       PyErr_Format(PyExc_ValueError,
-                   "Buffer dtype mismatch; next field is at offset %"PY_FORMAT_SIZE_T"d but %"PY_FORMAT_SIZE_T"d expected",
+                   "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
                    (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
       return -1;
     }
-
     ctx->fmt_offset += size;
-
+    if (arraysize)
+      ctx->fmt_offset += (arraysize - 1) * size;
     --ctx->enc_count; /* Consume from buffer string */
-
-    /* Done checking, move to next field, pushing or popping struct stack if needed */
     while (1) {
       if (field == &ctx->root) {
         ctx->head = NULL;
@@ -8904,7 +9212,48 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
   ctx->is_complex = 0;
   return 0;
 }
-
+static CYTHON_INLINE PyObject *
+__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
+{
+    const char *ts = *tsp;
+    int i = 0, number;
+    int ndim = ctx->head->field->type->ndim;
+;
+    ++ts;
+    if (ctx->new_count != 1) {
+        PyErr_SetString(PyExc_ValueError,
+                        "Cannot handle repeated arrays in format string");
+        return NULL;
+    }
+    if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+    while (*ts && *ts != ')') {
+        if (isspace(*ts))
+            continue;
+        number = __Pyx_BufFmt_ExpectNumber(&ts);
+        if (number == -1) return NULL;
+        if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
+            return PyErr_Format(PyExc_ValueError,
+                        "Expected a dimension of size %zu, got %d",
+                        ctx->head->field->type->arraysize[i], number);
+        if (*ts != ',' && *ts != ')')
+            return PyErr_Format(PyExc_ValueError,
+                                "Expected a comma in format string, got '%c'", *ts);
+        if (*ts == ',') ts++;
+        i++;
+    }
+    if (i != ndim)
+        return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
+                            ctx->head->field->type->ndim, i);
+    if (!*ts) {
+        PyErr_SetString(PyExc_ValueError,
+                        "Unexpected end of format string, expected ')'");
+        return NULL;
+    }
+    ctx->is_valid_array = 1;
+    ctx->new_count = 1;
+    *tsp = ++ts;
+    return Py_None;
+}
 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
   int got_Z = 0;
   while (1) {
@@ -8919,7 +9268,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
           __Pyx_BufFmt_RaiseExpected(ctx);
           return NULL;
         }
-        return ts;
+                return ts;
       case ' ':
       case 10:
       case 13:
@@ -8951,12 +9300,17 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
         {
           const char* ts_after_sub;
           size_t i, struct_count = ctx->new_count;
+          size_t struct_alignment = ctx->struct_alignment;
           ctx->new_count = 1;
           ++ts;
           if (*ts != '{') {
             PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
             return NULL;
           }
+          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+          ctx->enc_type = 0; /* Erase processed last struct element */
+          ctx->enc_count = 0;
+          ctx->struct_alignment = 0;
           ++ts;
           ts_after_sub = ts;
           for (i = 0; i != struct_count; ++i) {
@@ -8964,10 +9318,19 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
             if (!ts_after_sub) return NULL;
           }
           ts = ts_after_sub;
+          if (struct_alignment) ctx->struct_alignment = struct_alignment;
         }
         break;
       case '}': /* end of substruct; either repeat or move on */
-        ++ts;
+        {
+          size_t alignment = ctx->struct_alignment;
+          ++ts;
+          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+          ctx->enc_type = 0; /* Erase processed last struct element */
+          if (alignment && ctx->fmt_offset % alignment) {
+            ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
+          }
+        }
         return ts;
       case 'x':
         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
@@ -8988,13 +9351,11 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
       case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
       case 'l': case 'L': case 'q': case 'Q':
       case 'f': case 'd': case 'g':
-      case 'O':
+      case 'O': case 's': case 'p':
         if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
             ctx->enc_packmode == ctx->new_packmode) {
-          /* Continue pooling same type */
           ctx->enc_count += ctx->new_count;
         } else {
-          /* New type */
           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
           ctx->enc_count = ctx->new_count;
           ctx->enc_packmode = ctx->new_packmode;
@@ -9010,20 +9371,18 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
         while(*ts != ':') ++ts;
         ++ts;
         break;
+      case '(':
+        if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
+        break;
       default:
         {
-          int number = __Pyx_BufFmt_ParseNumber(&ts);
-          if (number == -1) { /* First char was not a digit */
-            PyErr_Format(PyExc_ValueError,
-                         "Does not understand character buffer dtype format string ('%c')", *ts);
-            return NULL;
-          }
-          ctx->new_count = (size_t)number; 
+          int number = __Pyx_BufFmt_ExpectNumber(&ts);
+          if (number == -1) return NULL;
+          ctx->new_count = (size_t)number;
         }
     }
   }
 }
-
 static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) {
   buf->buf = NULL;
   buf->obj = NULL;
@@ -9031,8 +9390,10 @@ static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) {
   buf->shape = __Pyx_zeros;
   buf->suboffsets = __Pyx_minusones;
 }
-
-static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack) {
+static CYTHON_INLINE int __Pyx_GetBufferAndValidate(
+        Py_buffer* buf, PyObject* obj,  __Pyx_TypeInfo* dtype, int flags,
+        int nd, int cast, __Pyx_BufFmt_StackElem* stack)
+{
   if (obj == Py_None || obj == NULL) {
     __Pyx_ZeroBuffer(buf);
     return 0;
@@ -9052,7 +9413,7 @@ static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* ob
   }
   if ((unsigned)buf->itemsize != dtype->size) {
     PyErr_Format(PyExc_ValueError,
-      "Item size of buffer (%"PY_FORMAT_SIZE_T"d byte%s) does not match size of '%s' (%"PY_FORMAT_SIZE_T"d byte%s)",
+      "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
       buf->itemsize, (buf->itemsize > 1) ? "s" : "",
       dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
     goto fail;
@@ -9063,39 +9424,74 @@ fail:;
   __Pyx_ZeroBuffer(buf);
   return -1;
 }
-
 static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
   if (info->buf == NULL) return;
   if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
   __Pyx_ReleaseBuffer(info);
 }
 
-static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
+static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
     PyErr_Format(PyExc_ValueError,
-                 "need more than %"PY_FORMAT_SIZE_T"d value%s to unpack",
-                 index, (index == 1) ? "" : "s");
+                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
 }
 
-static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
+static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
     PyErr_Format(PyExc_ValueError,
-                 "too many values to unpack (expected %"PY_FORMAT_SIZE_T"d)", expected);
+                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%s to unpack",
+                 index, (index == 1) ? "" : "s");
 }
 
 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
 }
 
-static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
-    if (t == Py_None) {
-      __Pyx_RaiseNoneNotIterableError();
-    } else if (PyTuple_GET_SIZE(t) < index) {
-      __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
+static CYTHON_INLINE int __Pyx_IterFinish(void) {
+#if CYTHON_COMPILING_IN_CPYTHON
+    PyThreadState *tstate = PyThreadState_GET();
+    PyObject* exc_type = tstate->curexc_type;
+    if (unlikely(exc_type)) {
+        if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
+            PyObject *exc_value, *exc_tb;
+            exc_value = tstate->curexc_value;
+            exc_tb = tstate->curexc_traceback;
+            tstate->curexc_type = 0;
+            tstate->curexc_value = 0;
+            tstate->curexc_traceback = 0;
+            Py_DECREF(exc_type);
+            Py_XDECREF(exc_value);
+            Py_XDECREF(exc_tb);
+            return 0;
+        } else {
+            return -1;
+        }
+    }
+    return 0;
+#else
+    if (unlikely(PyErr_Occurred())) {
+        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
+            PyErr_Clear();
+            return 0;
+        } else {
+            return -1;
+        }
+    }
+    return 0;
+#endif
+}
+
+static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
+    if (unlikely(retval)) {
+        Py_DECREF(retval);
+        __Pyx_RaiseTooManyValuesError(expected);
+        return -1;
     } else {
-      __Pyx_RaiseTooManyValuesError(index);
+        return __Pyx_IterFinish();
     }
+    return 0;
 }
 
 static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
+#if CYTHON_COMPILING_IN_CPYTHON
     PyThreadState *tstate = PyThreadState_GET();
     *type = tstate->exc_type;
     *value = tstate->exc_value;
@@ -9103,9 +9499,12 @@ static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value,
     Py_XINCREF(*type);
     Py_XINCREF(*value);
     Py_XINCREF(*tb);
+#else
+    PyErr_GetExcInfo(type, value, tb);
+#endif
 }
-
 static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
+#if CYTHON_COMPILING_IN_CPYTHON
     PyObject *tmp_type, *tmp_value, *tmp_tb;
     PyThreadState *tstate = PyThreadState_GET();
     tmp_type = tstate->exc_type;
@@ -9117,35 +9516,85 @@ static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb)
     Py_XDECREF(tmp_type);
     Py_XDECREF(tmp_value);
     Py_XDECREF(tmp_tb);
+#else
+    PyErr_SetExcInfo(type, value, tb);
+#endif
 }
 
 #if PY_MAJOR_VERSION < 3
 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
+    CYTHON_UNUSED PyObject *getbuffer_cobj;
   #if PY_VERSION_HEX >= 0x02060000
-  if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
+    if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
   #endif
-  if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pf_5numpy_7ndarray___getbuffer__(obj, view, flags);
-  else {
-  PyErr_Format(PyExc_TypeError, "'%100s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
-  return -1;
+        if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
+  #if PY_VERSION_HEX < 0x02060000
+    if (obj->ob_type->tp_dict &&
+        (getbuffer_cobj = PyMapping_GetItemString(obj->ob_type->tp_dict,
+                                             "__pyx_getbuffer"))) {
+        getbufferproc func;
+      #if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION == 0)
+        func = (getbufferproc) PyCapsule_GetPointer(getbuffer_cobj, "getbuffer(obj, view, flags)");
+      #else
+        func = (getbufferproc) PyCObject_AsVoidPtr(getbuffer_cobj);
+      #endif
+        Py_DECREF(getbuffer_cobj);
+        if (!func)
+            goto fail;
+        return func(obj, view, flags);
+    } else {
+        PyErr_Clear();
     }
+  #endif
+    PyErr_Format(PyExc_TypeError, "'%100s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
+#if PY_VERSION_HEX < 0x02060000
+fail:
+#endif
+    return -1;
 }
-
 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
-  PyObject* obj = view->obj;
-  if (obj) {
-    #if PY_VERSION_HEX >= 0x02060000
-    if (PyObject_CheckBuffer(obj)) {PyBuffer_Release(view); return;}
-    #endif
-    if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pf_5numpy_7ndarray_1__releasebuffer__(obj, view);
+    PyObject *obj = view->obj;
+    CYTHON_UNUSED PyObject *releasebuffer_cobj;
+    if (!obj) return;
+  #if PY_VERSION_HEX >= 0x02060000
+    if (PyObject_CheckBuffer(obj)) {
+        PyBuffer_Release(view);
+        return;
+    }
+  #endif
+        if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; }
+  #if PY_VERSION_HEX < 0x02060000
+    if (obj->ob_type->tp_dict &&
+        (releasebuffer_cobj = PyMapping_GetItemString(obj->ob_type->tp_dict,
+                                                      "__pyx_releasebuffer"))) {
+        releasebufferproc func;
+      #if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION == 0)
+        func = (releasebufferproc) PyCapsule_GetPointer(releasebuffer_cobj, "releasebuffer(obj, view)");
+      #else
+        func = (releasebufferproc) PyCObject_AsVoidPtr(releasebuffer_cobj);
+      #endif
+        Py_DECREF(releasebuffer_cobj);
+        if (!func)
+            goto fail;
+        func(obj, view);
+        return;
+    } else {
+        PyErr_Clear();
+    }
+  #endif
+    goto nofail;
+#if PY_VERSION_HEX < 0x02060000
+fail:
+#endif
+    PyErr_WriteUnraisable(obj);
+nofail:
     Py_DECREF(obj);
     view->obj = NULL;
-  }
 }
+#endif /*  PY_MAJOR_VERSION < 3 */
 
-#endif
 
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level) {
+    static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level) {
     PyObject *py_import = 0;
     PyObject *empty_list = 0;
     PyObject *module = 0;
@@ -9171,12 +9620,33 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level) {
         goto bad;
     #if PY_VERSION_HEX >= 0x02050000
     {
-        PyObject *py_level = PyInt_FromLong(level);
-        if (!py_level)
-            goto bad;
-        module = PyObject_CallFunctionObjArgs(py_import,
-            name, global_dict, empty_dict, list, py_level, NULL);
-        Py_DECREF(py_level);
+        #if PY_MAJOR_VERSION >= 3
+        if (level == -1) {
+            if (strchr(__Pyx_MODULE_NAME, '.')) {
+                /* try package relative import first */
+                PyObject *py_level = PyInt_FromLong(1);
+                if (!py_level)
+                    goto bad;
+                module = PyObject_CallFunctionObjArgs(py_import,
+                    name, global_dict, empty_dict, list, py_level, NULL);
+                Py_DECREF(py_level);
+                if (!module) {
+                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
+                        goto bad;
+                    PyErr_Clear();
+                }
+            }
+            level = 0; /* try absolute import on failure */
+        }
+        #endif
+        if (!module) {
+            PyObject *py_level = PyInt_FromLong(level);
+            if (!py_level)
+                goto bad;
+            module = PyObject_CallFunctionObjArgs(py_import,
+                name, global_dict, empty_dict, list, py_level, NULL);
+            Py_DECREF(py_level);
+        }
     }
     #else
     if (level>0) {
@@ -9193,6 +9663,15 @@ bad:
     return module;
 }
 
+static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name) {
+#if PY_MAJOR_VERSION < 3
+    PyErr_Format(PyExc_ImportError, "cannot import name %.230s",
+                 PyString_AsString(name));
+#else
+    PyErr_Format(PyExc_ImportError, "cannot import name %S", name);
+#endif
+}
+
 #if CYTHON_CCOMPLEX
   #ifdef __cplusplus
     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
@@ -9835,125 +10314,522 @@ static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject*
 
 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
     PyObject *tmp_type, *tmp_value, *tmp_tb;
+#if CYTHON_COMPILING_IN_CPYTHON
     PyThreadState *tstate = PyThreadState_GET();
-
     tmp_type = tstate->exc_type;
     tmp_value = tstate->exc_value;
     tmp_tb = tstate->exc_traceback;
-
     tstate->exc_type = *type;
     tstate->exc_value = *value;
     tstate->exc_traceback = *tb;
-
+#else
+    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
+    PyErr_SetExcInfo(*type, *value, *tb);
+#endif
     *type = tmp_type;
     *value = tmp_value;
     *tb = tmp_tb;
 }
 
-static CYTHON_INLINE void __Pyx_Generator_ExceptionClear(struct __pyx_Generator_object *self)
-{
-    Py_XDECREF(self->exc_type);
-    Py_XDECREF(self->exc_value);
-    Py_XDECREF(self->exc_traceback);
-
+static PyObject *__Pyx_Generator_Next(PyObject *self);
+static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value);
+static PyObject *__Pyx_Generator_Close(PyObject *self);
+static PyObject *__Pyx_Generator_Throw(PyObject *gen, PyObject *args);
+static PyTypeObject *__pyx_GeneratorType = 0;
+#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
+#define __Pyx_Generator_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
+#if 1 || PY_VERSION_HEX < 0x030300B0
+static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) {
+    PyObject *et, *ev, *tb;
+    PyObject *value = NULL;
+    __Pyx_ErrFetch(&et, &ev, &tb);
+    if (!et) {
+        Py_XDECREF(tb);
+        Py_XDECREF(ev);
+        Py_INCREF(Py_None);
+        *pvalue = Py_None;
+        return 0;
+    }
+    if (unlikely(et != PyExc_StopIteration) &&
+            unlikely(!PyErr_GivenExceptionMatches(et, PyExc_StopIteration))) {
+        __Pyx_ErrRestore(et, ev, tb);
+        return -1;
+    }
+    if (likely(et == PyExc_StopIteration)) {
+        if (likely(!ev) || !PyObject_IsInstance(ev, PyExc_StopIteration)) {
+            if (!ev) {
+                Py_INCREF(Py_None);
+                ev = Py_None;
+            }
+            Py_XDECREF(tb);
+            Py_DECREF(et);
+            *pvalue = ev;
+            return 0;
+        }
+    }
+    PyErr_NormalizeException(&et, &ev, &tb);
+    if (unlikely(!PyObject_IsInstance(ev, PyExc_StopIteration))) {
+        __Pyx_ErrRestore(et, ev, tb);
+        return -1;
+    }
+    Py_XDECREF(tb);
+    Py_DECREF(et);
+#if PY_VERSION_HEX >= 0x030300A0
+    value = ((PyStopIterationObject *)ev)->value;
+    Py_INCREF(value);
+    Py_DECREF(ev);
+#else
+    {
+        PyObject* args = PyObject_GetAttrString(ev, "args");
+        Py_DECREF(ev);
+        if (likely(args)) {
+            value = PyObject_GetItem(args, 0);
+            Py_DECREF(args);
+        }
+        if (unlikely(!value)) {
+            __Pyx_ErrRestore(NULL, NULL, NULL);
+            Py_INCREF(Py_None);
+            value = Py_None;
+        }
+    }
+#endif
+    *pvalue = value;
+    return 0;
+}
+#endif
+static CYTHON_INLINE
+void __Pyx_Generator_ExceptionClear(__pyx_GeneratorObject *self) {
+    PyObject *exc_type = self->exc_type;
+    PyObject *exc_value = self->exc_value;
+    PyObject *exc_traceback = self->exc_traceback;
     self->exc_type = NULL;
     self->exc_value = NULL;
     self->exc_traceback = NULL;
+    Py_XDECREF(exc_type);
+    Py_XDECREF(exc_value);
+    Py_XDECREF(exc_traceback);
 }
-
-static CYTHON_INLINE PyObject *__Pyx_Generator_SendEx(struct __pyx_Generator_object *self, PyObject *value)
-{
-    PyObject *retval;
-
-    if (self->is_running) {
+static CYTHON_INLINE
+int __Pyx_Generator_CheckRunning(__pyx_GeneratorObject *gen) {
+    if (unlikely(gen->is_running)) {
         PyErr_SetString(PyExc_ValueError,
                         "generator already executing");
-        return NULL;
+        return 1;
     }
-
-    if (self->resume_label == 0) {
-        if (value && value != Py_None) {
+    return 0;
+}
+static CYTHON_INLINE
+PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value) {
+    PyObject *retval;
+    assert(!self->is_running);
+    if (unlikely(self->resume_label == 0)) {
+        if (unlikely(value && value != Py_None)) {
             PyErr_SetString(PyExc_TypeError,
                             "can't send non-None value to a "
                             "just-started generator");
             return NULL;
         }
     }
-
-    if (self->resume_label == -1) {
+    if (unlikely(self->resume_label == -1)) {
         PyErr_SetNone(PyExc_StopIteration);
         return NULL;
     }
-
-
-    if (value)
-        __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value, &self->exc_traceback);
-    else
+    if (value) {
+#if CYTHON_COMPILING_IN_PYPY
+#else
+        /* Generators always return to their most recent caller, not
+         * necessarily their creator. */
+        if (self->exc_traceback) {
+            PyThreadState *tstate = PyThreadState_GET();
+            PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
+            PyFrameObject *f = tb->tb_frame;
+            Py_XINCREF(tstate->frame);
+            assert(f->f_back == NULL);
+            f->f_back = tstate->frame;
+        }
+#endif
+        __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
+                            &self->exc_traceback);
+    } else {
         __Pyx_Generator_ExceptionClear(self);
-
+    }
     self->is_running = 1;
     retval = self->body((PyObject *) self, value);
     self->is_running = 0;
-
-    if (retval)
-        __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value, &self->exc_traceback);
-    else
+    if (retval) {
+        __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
+                            &self->exc_traceback);
+#if CYTHON_COMPILING_IN_PYPY
+#else
+        /* Don't keep the reference to f_back any longer than necessary.  It
+         * may keep a chain of frames alive or it could create a reference
+         * cycle. */
+        if (self->exc_traceback) {
+            PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
+            PyFrameObject *f = tb->tb_frame;
+            Py_CLEAR(f->f_back);
+        }
+#endif
+    } else {
         __Pyx_Generator_ExceptionClear(self);
-
+    }
     return retval;
 }
-
-static PyObject *__Pyx_Generator_Next(PyObject *self)
-{
-    return __Pyx_Generator_SendEx((struct __pyx_Generator_object *) self, Py_None);
+static CYTHON_INLINE
+PyObject *__Pyx_Generator_FinishDelegation(__pyx_GeneratorObject *gen) {
+    PyObject *ret;
+    PyObject *val = NULL;
+    __Pyx_Generator_Undelegate(gen);
+    __Pyx_PyGen_FetchStopIterationValue(&val);
+    ret = __Pyx_Generator_SendEx(gen, val);
+    Py_XDECREF(val);
+    return ret;
+}
+static PyObject *__Pyx_Generator_Next(PyObject *self) {
+    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject*) self;
+    PyObject *yf = gen->yieldfrom;
+    if (unlikely(__Pyx_Generator_CheckRunning(gen)))
+        return NULL;
+    if (yf) {
+        PyObject *ret;
+        gen->is_running = 1;
+        ret = Py_TYPE(yf)->tp_iternext(yf);
+        gen->is_running = 0;
+        if (likely(ret)) {
+            return ret;
+        }
+        return __Pyx_Generator_FinishDelegation(gen);
+    }
+    return __Pyx_Generator_SendEx(gen, Py_None);
 }
-
-static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value)
-{
-    return __Pyx_Generator_SendEx((struct __pyx_Generator_object *) self, value);
+static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value) {
+    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject*) self;
+    PyObject *yf = gen->yieldfrom;
+    if (unlikely(__Pyx_Generator_CheckRunning(gen)))
+        return NULL;
+    if (yf) {
+        PyObject *ret;
+        gen->is_running = 1;
+        if (__Pyx_Generator_CheckExact(yf)) {
+            ret = __Pyx_Generator_Send(yf, value);
+        } else {
+            if (value == Py_None)
+                ret = PyIter_Next(yf);
+            else
+                ret = PyObject_CallMethod(yf, (char*)"send", (char*)"O", value);
+        }
+        gen->is_running = 0;
+        if (likely(ret)) {
+            return ret;
+        }
+        return __Pyx_Generator_FinishDelegation(gen);
+    }
+    return __Pyx_Generator_SendEx(gen, value);
 }
-
-static PyObject *__Pyx_Generator_Close(PyObject *self)
-{
-    struct __pyx_Generator_object *generator = (struct __pyx_Generator_object *) self;
-    PyObject *retval;
+static int __Pyx_Generator_CloseIter(__pyx_GeneratorObject *gen, PyObject *yf) {
+    PyObject *retval = NULL;
+    int err = 0;
+    if (__Pyx_Generator_CheckExact(yf)) {
+        retval = __Pyx_Generator_Close(yf);
+        if (!retval)
+            return -1;
+    } else {
+        PyObject *meth;
+        gen->is_running = 1;
+        meth = PyObject_GetAttrString(yf, "close");
+        if (unlikely(!meth)) {
+            if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
+                PyErr_WriteUnraisable(yf);
+            }
+            PyErr_Clear();
+        } else {
+            retval = PyObject_CallFunction(meth, NULL);
+            Py_DECREF(meth);
+            if (!retval)
+                err = -1;
+        }
+        gen->is_running = 0;
+    }
+    Py_XDECREF(retval);
+    return err;
+}
+static PyObject *__Pyx_Generator_Close(PyObject *self) {
+    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
+    PyObject *retval, *raised_exception;
+    PyObject *yf = gen->yieldfrom;
+    int err = 0;
+    if (unlikely(__Pyx_Generator_CheckRunning(gen)))
+        return NULL;
+    if (yf) {
+        Py_INCREF(yf);
+        err = __Pyx_Generator_CloseIter(gen, yf);
+        __Pyx_Generator_Undelegate(gen);
+        Py_DECREF(yf);
+    }
+    if (err == 0)
 #if PY_VERSION_HEX < 0x02050000
-    PyErr_SetNone(PyExc_StopIteration);
+        PyErr_SetNone(PyExc_StopIteration);
 #else
-    PyErr_SetNone(PyExc_GeneratorExit);
+        PyErr_SetNone(PyExc_GeneratorExit);
 #endif
-    retval = __Pyx_Generator_SendEx(generator, NULL);
+    retval = __Pyx_Generator_SendEx(gen, NULL);
     if (retval) {
         Py_DECREF(retval);
         PyErr_SetString(PyExc_RuntimeError,
                         "generator ignored GeneratorExit");
         return NULL;
     }
-#if PY_VERSION_HEX < 0x02050000
-    if (PyErr_ExceptionMatches(PyExc_StopIteration))
-#else
-    if (PyErr_ExceptionMatches(PyExc_StopIteration)
-        || PyErr_ExceptionMatches(PyExc_GeneratorExit))
+    raised_exception = PyErr_Occurred();
+    if (!raised_exception
+        || raised_exception == PyExc_StopIteration
+#if PY_VERSION_HEX >= 0x02050000
+        || raised_exception == PyExc_GeneratorExit
+        || PyErr_GivenExceptionMatches(raised_exception, PyExc_GeneratorExit)
 #endif
+        || PyErr_GivenExceptionMatches(raised_exception, PyExc_StopIteration))
     {
-        PyErr_Clear();          /* ignore these errors */
+        if (raised_exception) PyErr_Clear();      /* ignore these errors */
         Py_INCREF(Py_None);
         return Py_None;
     }
     return NULL;
 }
-
-static PyObject *__Pyx_Generator_Throw(PyObject *self, PyObject *args, CYTHON_UNUSED PyObject *kwds)
-{
-    struct __pyx_Generator_object *generator = (struct __pyx_Generator_object *) self;
+static PyObject *__Pyx_Generator_Throw(PyObject *self, PyObject *args) {
+    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
     PyObject *typ;
     PyObject *tb = NULL;
     PyObject *val = NULL;
-
+    PyObject *yf = gen->yieldfrom;
     if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
         return NULL;
+    if (unlikely(__Pyx_Generator_CheckRunning(gen)))
+        return NULL;
+    if (yf) {
+        PyObject *ret;
+        Py_INCREF(yf);
+#if PY_VERSION_HEX >= 0x02050000
+        if (PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit)) {
+            int err = __Pyx_Generator_CloseIter(gen, yf);
+            Py_DECREF(yf);
+            __Pyx_Generator_Undelegate(gen);
+            if (err < 0)
+                return __Pyx_Generator_SendEx(gen, NULL);
+            goto throw_here;
+        }
+#endif
+        gen->is_running = 1;
+        if (__Pyx_Generator_CheckExact(yf)) {
+            ret = __Pyx_Generator_Throw(yf, args);
+        } else {
+            PyObject *meth = PyObject_GetAttrString(yf, "throw");
+            if (unlikely(!meth)) {
+                Py_DECREF(yf);
+                if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
+                    gen->is_running = 0;
+                    return NULL;
+                }
+                PyErr_Clear();
+                __Pyx_Generator_Undelegate(gen);
+                gen->is_running = 0;
+                goto throw_here;
+            }
+            ret = PyObject_CallObject(meth, args);
+            Py_DECREF(meth);
+        }
+        gen->is_running = 0;
+        Py_DECREF(yf);
+        if (!ret) {
+            ret = __Pyx_Generator_FinishDelegation(gen);
+        }
+        return ret;
+    }
+throw_here:
     __Pyx_Raise(typ, val, tb, NULL);
-    return __Pyx_Generator_SendEx(generator, NULL);
+    return __Pyx_Generator_SendEx(gen, NULL);
+}
+static int __Pyx_Generator_traverse(PyObject *self, visitproc visit, void *arg) {
+    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
+    Py_VISIT(gen->closure);
+    Py_VISIT(gen->classobj);
+    Py_VISIT(gen->yieldfrom);
+    Py_VISIT(gen->exc_type);
+    Py_VISIT(gen->exc_value);
+    Py_VISIT(gen->exc_traceback);
+    return 0;
+}
+static int __Pyx_Generator_clear(PyObject *self) {
+    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
+    Py_CLEAR(gen->closure);
+    Py_CLEAR(gen->classobj);
+    Py_CLEAR(gen->yieldfrom);
+    Py_CLEAR(gen->exc_type);
+    Py_CLEAR(gen->exc_value);
+    Py_CLEAR(gen->exc_traceback);
+    return 0;
+}
+static void __Pyx_Generator_dealloc(PyObject *self) {
+    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
+    PyObject_GC_UnTrack(gen);
+    if (gen->gi_weakreflist != NULL)
+        PyObject_ClearWeakRefs(self);
+    PyObject_GC_Track(self);
+    if (gen->resume_label > 0) {
+        Py_TYPE(gen)->tp_del(self);
+        if (self->ob_refcnt > 0)
+            return;                     /* resurrected.  :( */
+    }
+    PyObject_GC_UnTrack(self);
+    __Pyx_Generator_clear(self);
+    PyObject_GC_Del(gen);
+}
+static void __Pyx_Generator_del(PyObject *self) {
+    PyObject *res;
+    PyObject *error_type, *error_value, *error_traceback;
+    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
+    if (gen->resume_label <= 0)
+        return ;
+    assert(self->ob_refcnt == 0);
+    self->ob_refcnt = 1;
+    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
+    res = __Pyx_Generator_Close(self);
+    if (res == NULL)
+        PyErr_WriteUnraisable(self);
+    else
+        Py_DECREF(res);
+    __Pyx_ErrRestore(error_type, error_value, error_traceback);
+    /* Undo the temporary resurrection; can't use DECREF here, it would
+     * cause a recursive call.
+     */
+    assert(self->ob_refcnt > 0);
+    if (--self->ob_refcnt == 0)
+        return; /* this is the normal path out */
+    /* close() resurrected it!  Make it look like the original Py_DECREF
+     * never happened.
+     */
+    {
+        Py_ssize_t refcnt = self->ob_refcnt;
+        _Py_NewReference(self);
+        self->ob_refcnt = refcnt;
+    }
+#if CYTHON_COMPILING_FOR_CPYTHON
+    assert(PyType_IS_GC(self->ob_type) &&
+           _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
+    /* If Py_REF_DEBUG, _Py_NewReference bumped _Py_RefTotal, so
+     * we need to undo that. */
+    _Py_DEC_REFTOTAL;
+#endif
+    /* If Py_TRACE_REFS, _Py_NewReference re-added self to the object
+     * chain, so no more to do there.
+     * If COUNT_ALLOCS, the original decref bumped tp_frees, and
+     * _Py_NewReference bumped tp_allocs:  both of those need to be
+     * undone.
+     */
+#ifdef COUNT_ALLOCS
+    --Py_TYPE(self)->tp_frees;
+    --Py_TYPE(self)->tp_allocs;
+#endif
+}
+static PyMemberDef __pyx_Generator_memberlist[] = {
+    {(char *) "gi_running",
+#if PY_VERSION_HEX >= 0x02060000
+     T_BOOL,
+#else
+     T_BYTE,
+#endif
+     offsetof(__pyx_GeneratorObject, is_running),
+     READONLY,
+     NULL},
+    {0, 0, 0, 0, 0}
+};
+static PyMethodDef __pyx_Generator_methods[] = {
+    {__Pyx_NAMESTR("send"), (PyCFunction) __Pyx_Generator_Send, METH_O, 0},
+    {__Pyx_NAMESTR("throw"), (PyCFunction) __Pyx_Generator_Throw, METH_VARARGS, 0},
+    {__Pyx_NAMESTR("close"), (PyCFunction) __Pyx_Generator_Close, METH_NOARGS, 0},
+    {0, 0, 0, 0}
+};
+static PyTypeObject __pyx_GeneratorType_type = {
+    PyVarObject_HEAD_INIT(0, 0)
+    __Pyx_NAMESTR("generator"),         /*tp_name*/
+    sizeof(__pyx_GeneratorObject),      /*tp_basicsize*/
+    0,                                  /*tp_itemsize*/
+    (destructor) __Pyx_Generator_dealloc,/*tp_dealloc*/
+    0,                                  /*tp_print*/
+    0,                                  /*tp_getattr*/
+    0,                                  /*tp_setattr*/
+#if PY_MAJOR_VERSION < 3
+    0,                                  /*tp_compare*/
+#else
+    0,                                  /*reserved*/
+#endif
+    0,                                   /*tp_repr*/
+    0,                                  /*tp_as_number*/
+    0,                                  /*tp_as_sequence*/
+    0,                                  /*tp_as_mapping*/
+    0,                                  /*tp_hash*/
+    0,                                  /*tp_call*/
+    0,                                  /*tp_str*/
+    0,                                  /*tp_getattro*/
+    0,                                  /*tp_setattro*/
+    0,                                  /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/
+    0,                                  /*tp_doc*/
+    (traverseproc) __Pyx_Generator_traverse,   /*tp_traverse*/
+    0,                                  /*tp_clear*/
+    0,                                  /*tp_richcompare*/
+    offsetof(__pyx_GeneratorObject, gi_weakreflist), /* tp_weaklistoffse */
+    0,                                  /*tp_iter*/
+    (iternextfunc) __Pyx_Generator_Next, /*tp_iternext*/
+    __pyx_Generator_methods,            /*tp_methods*/
+    __pyx_Generator_memberlist,         /*tp_members*/
+    0,                                  /*tp_getset*/
+    0,                                  /*tp_base*/
+    0,                                  /*tp_dict*/
+    0,                                  /*tp_descr_get*/
+    0,                                  /*tp_descr_set*/
+    0,                                  /*tp_dictoffset*/
+    0,                                  /*tp_init*/
+    0,                                  /*tp_alloc*/
+    0,                                  /*tp_new*/
+    0,                                  /*tp_free*/
+    0,                                  /*tp_is_gc*/
+    0,                                  /*tp_bases*/
+    0,                                  /*tp_mro*/
+    0,                                  /*tp_cache*/
+    0,                                  /*tp_subclasses*/
+    0,                                  /*tp_weaklist*/
+    __Pyx_Generator_del,                /*tp_del*/
+#if PY_VERSION_HEX >= 0x02060000
+    0,                                  /*tp_version_tag*/
+#endif
+};
+static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body,
+                                                  PyObject *closure) {
+    __pyx_GeneratorObject *gen =
+        PyObject_GC_New(__pyx_GeneratorObject, &__pyx_GeneratorType_type);
+    if (gen == NULL)
+        return NULL;
+    gen->body = body;
+    gen->closure = closure;
+    Py_XINCREF(closure);
+    gen->is_running = 0;
+    gen->resume_label = 0;
+    gen->classobj = NULL;
+    gen->yieldfrom = NULL;
+    gen->exc_type = NULL;
+    gen->exc_value = NULL;
+    gen->exc_traceback = NULL;
+    gen->gi_weakreflist = NULL;
+    PyObject_GC_Track(gen);
+    return gen;
+}
+static int __pyx_Generator_init(void) {
+    __pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr;
+    __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
+    if (PyType_Ready(&__pyx_GeneratorType_type)) {
+        return -1;
+    }
+    __pyx_GeneratorType = &__pyx_GeneratorType_type;
+    return 0;
 }
 
 static int __Pyx_check_binary_version(void) {
@@ -9975,6 +10851,23 @@ static int __Pyx_check_binary_version(void) {
     return 0;
 }
 
+#ifndef __PYX_HAVE_RT_ImportModule
+#define __PYX_HAVE_RT_ImportModule
+static PyObject *__Pyx_ImportModule(const char *name) {
+    PyObject *py_name = 0;
+    PyObject *py_module = 0;
+    py_name = __Pyx_PyIdentifier_FromString(name);
+    if (!py_name)
+        goto bad;
+    py_module = PyImport_Import(py_name);
+    Py_DECREF(py_name);
+    return py_module;
+bad:
+    Py_XDECREF(py_name);
+    return 0;
+}
+#endif
+
 #ifndef __PYX_HAVE_RT_ImportType
 #define __PYX_HAVE_RT_ImportType
 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
@@ -9984,15 +10877,10 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class
     PyObject *result = 0;
     PyObject *py_name = 0;
     char warning[200];
-
     py_module = __Pyx_ImportModule(module_name);
     if (!py_module)
         goto bad;
-    #if PY_MAJOR_VERSION < 3
-    py_name = PyString_FromString(class_name);
-    #else
-    py_name = PyUnicode_FromString(class_name);
-    #endif
+    py_name = __Pyx_PyIdentifier_FromString(class_name);
     if (!py_name)
         goto bad;
     result = PyObject_GetAttr(py_module, py_name);
@@ -10008,7 +10896,7 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class
             module_name, class_name);
         goto bad;
     }
-    if (!strict && ((PyTypeObject *)result)->tp_basicsize > (Py_ssize_t)size) {
+    if (!strict && (size_t)((PyTypeObject *)result)->tp_basicsize > size) {
         PyOS_snprintf(warning, sizeof(warning),
             "%s.%s size changed, may indicate binary incompatibility",
             module_name, class_name);
@@ -10018,7 +10906,7 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class
         if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
         #endif
     }
-    else if (((PyTypeObject *)result)->tp_basicsize != (Py_ssize_t)size) {
+    else if ((size_t)((PyTypeObject *)result)->tp_basicsize != size) {
         PyErr_Format(PyExc_ValueError,
             "%s.%s has the wrong size, try recompiling",
             module_name, class_name);
@@ -10032,28 +10920,6 @@ bad:
 }
 #endif
 
-#ifndef __PYX_HAVE_RT_ImportModule
-#define __PYX_HAVE_RT_ImportModule
-static PyObject *__Pyx_ImportModule(const char *name) {
-    PyObject *py_name = 0;
-    PyObject *py_module = 0;
-
-    #if PY_MAJOR_VERSION < 3
-    py_name = PyString_FromString(name);
-    #else
-    py_name = PyUnicode_FromString(name);
-    #endif
-    if (!py_name)
-        goto bad;
-    py_module = PyImport_Import(py_name);
-    Py_DECREF(py_name);
-    return py_module;
-bad:
-    Py_XDECREF(py_name);
-    return 0;
-}
-#endif
-
 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
 #if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
     PyObject *ob = PyCapsule_New(vtable, 0, 0);
@@ -10071,29 +10937,105 @@ bad:
     return -1;
 }
 
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
+    int start = 0, mid = 0, end = count - 1;
+    if (end >= 0 && code_line > entries[end].code_line) {
+        return count;
+    }
+    while (start < end) {
+        mid = (start + end) / 2;
+        if (code_line < entries[mid].code_line) {
+            end = mid;
+        } else if (code_line > entries[mid].code_line) {
+             start = mid + 1;
+        } else {
+            return mid;
+        }
+    }
+    if (code_line <= entries[mid].code_line) {
+        return mid;
+    } else {
+        return mid + 1;
+    }
+}
+static PyCodeObject *__pyx_find_code_object(int code_line) {
+    PyCodeObject* code_object;
+    int pos;
+    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
+        return NULL;
+    }
+    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
+        return NULL;
+    }
+    code_object = __pyx_code_cache.entries[pos].code_object;
+    Py_INCREF(code_object);
+    return code_object;
+}
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
+    int pos, i;
+    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
+    if (unlikely(!code_line)) {
+        return;
+    }
+    if (unlikely(!entries)) {
+        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
+        if (likely(entries)) {
+            __pyx_code_cache.entries = entries;
+            __pyx_code_cache.max_count = 64;
+            __pyx_code_cache.count = 1;
+            entries[0].code_line = code_line;
+            entries[0].code_object = code_object;
+            Py_INCREF(code_object);
+        }
+        return;
+    }
+    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
+        PyCodeObject* tmp = entries[pos].code_object;
+        entries[pos].code_object = code_object;
+        Py_DECREF(tmp);
+        return;
+    }
+    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
+        int new_max = __pyx_code_cache.max_count + 64;
+        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
+            __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry));
+        if (unlikely(!entries)) {
+            return;
+        }
+        __pyx_code_cache.entries = entries;
+        __pyx_code_cache.max_count = new_max;
+    }
+    for (i=__pyx_code_cache.count; i>pos; i--) {
+        entries[i] = entries[i-1];
+    }
+    entries[pos].code_line = code_line;
+    entries[pos].code_object = code_object;
+    __pyx_code_cache.count++;
+    Py_INCREF(code_object);
+}
+
 #include "compile.h"
 #include "frameobject.h"
 #include "traceback.h"
-
-static void __Pyx_AddTraceback(const char *funcname, int __pyx_clineno,
-                               int __pyx_lineno, const char *__pyx_filename) {
+static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
+            const char *funcname, int c_line,
+            int py_line, const char *filename) {
+    PyCodeObject *py_code = 0;
     PyObject *py_srcfile = 0;
     PyObject *py_funcname = 0;
-    PyObject *py_globals = 0;
-    PyCodeObject *py_code = 0;
-    PyFrameObject *py_frame = 0;
-
     #if PY_MAJOR_VERSION < 3
-    py_srcfile = PyString_FromString(__pyx_filename);
+    py_srcfile = PyString_FromString(filename);
     #else
-    py_srcfile = PyUnicode_FromString(__pyx_filename);
+    py_srcfile = PyUnicode_FromString(filename);
     #endif
     if (!py_srcfile) goto bad;
-    if (__pyx_clineno) {
+    if (c_line) {
         #if PY_MAJOR_VERSION < 3
-        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
+        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
         #else
-        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
+        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
         #endif
     }
     else {
@@ -10104,28 +11046,45 @@ static void __Pyx_AddTraceback(const char *funcname, int __pyx_clineno,
         #endif
     }
     if (!py_funcname) goto bad;
-    py_globals = PyModule_GetDict(__pyx_m);
-    if (!py_globals) goto bad;
-    py_code = PyCode_New(
+    py_code = __Pyx_PyCode_New(
         0,            /*int argcount,*/
-        #if PY_MAJOR_VERSION >= 3
         0,            /*int kwonlyargcount,*/
-        #endif
         0,            /*int nlocals,*/
         0,            /*int stacksize,*/
         0,            /*int flags,*/
         __pyx_empty_bytes, /*PyObject *code,*/
-        __pyx_empty_tuple,  /*PyObject *consts,*/
-        __pyx_empty_tuple,  /*PyObject *names,*/
-        __pyx_empty_tuple,  /*PyObject *varnames,*/
-        __pyx_empty_tuple,  /*PyObject *freevars,*/
-        __pyx_empty_tuple,  /*PyObject *cellvars,*/
+        __pyx_empty_tuple, /*PyObject *consts,*/
+        __pyx_empty_tuple, /*PyObject *names,*/
+        __pyx_empty_tuple, /*PyObject *varnames,*/
+        __pyx_empty_tuple, /*PyObject *freevars,*/
+        __pyx_empty_tuple, /*PyObject *cellvars,*/
         py_srcfile,   /*PyObject *filename,*/
         py_funcname,  /*PyObject *name,*/
-        __pyx_lineno,   /*int firstlineno,*/
+        py_line,      /*int firstlineno,*/
         __pyx_empty_bytes  /*PyObject *lnotab*/
     );
-    if (!py_code) goto bad;
+    Py_DECREF(py_srcfile);
+    Py_DECREF(py_funcname);
+    return py_code;
+bad:
+    Py_XDECREF(py_srcfile);
+    Py_XDECREF(py_funcname);
+    return NULL;
+}
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+                               int py_line, const char *filename) {
+    PyCodeObject *py_code = 0;
+    PyObject *py_globals = 0;
+    PyFrameObject *py_frame = 0;
+    py_code = __pyx_find_code_object(c_line ? c_line : py_line);
+    if (!py_code) {
+        py_code = __Pyx_CreateCodeObjectForTraceback(
+            funcname, c_line, py_line, filename);
+        if (!py_code) goto bad;
+        __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
+    }
+    py_globals = PyModule_GetDict(__pyx_m);
+    if (!py_globals) goto bad;
     py_frame = PyFrame_New(
         PyThreadState_GET(), /*PyThreadState *tstate,*/
         py_code,             /*PyCodeObject *code,*/
@@ -10133,11 +11092,9 @@ static void __Pyx_AddTraceback(const char *funcname, int __pyx_clineno,
         0                    /*PyObject *locals*/
     );
     if (!py_frame) goto bad;
-    py_frame->f_lineno = __pyx_lineno;
+    py_frame->f_lineno = py_line;
     PyTraceBack_Here(py_frame);
 bad:
-    Py_XDECREF(py_srcfile);
-    Py_XDECREF(py_funcname);
     Py_XDECREF(py_code);
     Py_XDECREF(py_frame);
 }
@@ -10172,6 +11129,7 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
     return 0;
 }
 
+
 /* Type Conversion Functions */
 
 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
diff --git a/Tools/add_amber12_atom_types.py b/Tools/add_amber12_atom_types.py
new file mode 100644
index 0000000..dc68c93
--- /dev/null
+++ b/Tools/add_amber12_atom_types.py
@@ -0,0 +1,181 @@
+import compiler
+import compiler.ast
+
+groups = ['ace_beginning_nt',
+          'adenine',
+          'ala_sidechain',
+          'alanine',
+          'alanine_ct',
+          'alanine_nt',
+          'arg_sidechain',
+          'arginine',
+          'arginine_ct',
+          'arginine_nt',
+          'asn_sidechain',
+          'asp_sidechain',
+          'asp_sidechain_neutral',
+          'asparagine',
+          'asparagine_ct',
+          'asparagine_nt',
+          'aspartic_acid',
+          'aspartic_acid_ct',
+          'aspartic_acid_neutral',
+          'aspartic_acid_nt',
+          'cym_sidechain',
+          'cys_sidechain',
+          'cysteine',
+          'cysteine_ct',
+          'cysteine_nt',
+          'cysteine_with_negative_charge',
+          'cystine_ss',
+          'cystine_ss_ct',
+          'cystine_ss_nt',
+          'cytosine',
+          'cyx_sidechain',
+          'd-adenosine',
+          'd-adenosine_3ter',
+          'd-adenosine_5ter',
+          'd-adenosine_5ter_3ter',
+          'd-cytosine',
+          'd-cytosine_3ter',
+          'd-cytosine_5ter',
+          'd-cytosine_5ter_3ter',
+          'd-guanosine',
+          'd-guanosine_3ter',
+          'd-guanosine_5ter',
+          'd-guanosine_5ter_3ter',
+          'd-thymine',
+          'd-thymine_3ter',
+          'd-thymine_5ter',
+          'd-thymine_5ter_3ter',
+          'desoxyribose',
+          'desoxyribose_3ter',
+          'desoxyribose_5ter',
+          'desoxyribose_5ter_3ter',
+          'gln_sidechain',
+          'glu_sidechain',
+          'glu_sidechain_neutral',
+          'glutamic_acid',
+          'glutamic_acid_ct',
+          'glutamic_acid_neutral',
+          'glutamic_acid_nt',
+          'glutamine',
+          'glutamine_ct',
+          'glutamine_nt',
+          'gly_nt_sidechain',
+          'gly_sidechain',
+          'glycine',
+          'glycine_ct',
+          'glycine_nt',
+          'guanine',
+          'hid_sidechain',
+          'hie_sidechain',
+          'hip_sidechain',
+          'histidine',
+          'histidine_ct',
+          'histidine_deltah',
+          'histidine_deltah_ct',
+          'histidine_deltah_nt',
+          'histidine_epsilonh',
+          'histidine_epsilonh_ct',
+          'histidine_epsilonh_nt',
+          'histidine_nt',
+          'histidine_plus',
+          'histidine_plus_ct',
+          'histidine_plus_nt',
+          'ile_sidechain',
+          'isoleucine',
+          'isoleucine_ct',
+          'isoleucine_nt',
+          'leu_sidechain',
+          'leucine',
+          'leucine_ct',
+          'leucine_nt',
+          'lys_sidechain',
+          'lys_sidechain_neutral',
+          'lysine',
+          'lysine_ct',
+          'lysine_neutral',
+          'lysine_neutral_ct',
+          'lysine_neutral_nt',
+          'lysine_nt',
+          'met_sidechain',
+          'methionine',
+          'methionine_ct',
+          'methionine_nt',
+          'na_phosphate',
+          'nmethyl_ct',
+          'peptide',
+          'peptide_ct',
+          'peptide_nt',
+          'peptide_nt_ct',
+          'peptide_proline',
+          'peptide_proline_ct',
+          'peptide_proline_nt',
+          'phe_sidechain',
+          'phenylalanine',
+          'phenylalanine_ct',
+          'phenylalanine_nt',
+          'pro_sidechain',
+          'pro_sidechain_nt',
+          'proline',
+          'proline_ct',
+          'proline_nt',
+          'r-adenosine',
+          'r-adenosine_3ter',
+          'r-adenosine_5ter',
+          'r-adenosine_5ter_3ter',
+          'r-cytosine',
+          'r-cytosine_3ter',
+          'r-cytosine_5ter',
+          'r-cytosine_5ter_3ter',
+          'r-guanosine',
+          'r-guanosine_3ter',
+          'r-guanosine_5ter',
+          'r-guanosine_5ter_3ter',
+          'r-uracil',
+          'r-uracil_3ter',
+          'r-uracil_5ter',
+          'r-uracil_5ter_3ter',
+          'ribose',
+          'ribose_3ter',
+          'ribose_5ter',
+          'ribose_5ter_3ter',
+          'ser_sidechain',
+          'serine',
+          'serine_ct',
+          'serine_nt',
+          'thr_sidechain',
+          'threonine',
+          'threonine_ct',
+          'threonine_nt',
+          'thymine',
+          'trp_sidechain',
+          'tryptophan',
+          'tryptophan_ct',
+          'tryptophan_nt',
+          'tyr_sidechain',
+          'tyrosine',
+          'tyrosine_ct',
+          'tyrosine_nt',
+          'uracil',
+          'val_sidechain',
+          'valine',
+          'valine_ct',
+          'valine_nt']
+
+for filename in groups:
+
+    ast = compiler.parse(file(filename).read())
+    stmts = ast.getChildren()[1].getChildren()
+
+    vars = set()
+    for stmt in stmts:
+        if isinstance(stmt, compiler.ast.Assign):
+            var_name = stmt.getChildren()[0].getChildren()[0]
+            vars.add(var_name)
+    if 'amber_atom_type' in vars \
+            and 'amber12_atom_type' not in vars:
+        print filename
+        with file(filename, 'a') as f:
+            f.write("amber12_atom_type = amber_atom_type\n")
diff --git a/Tools/fix_amber12.py b/Tools/fix_amber12.py
deleted file mode 100644
index 68f173d..0000000
--- a/Tools/fix_amber12.py
+++ /dev/null
@@ -1,20 +0,0 @@
-import compiler
-import compiler.ast
-
-for filename in file('amber12_fix'):
-
-    filename = filename.strip()
-
-    ast = compiler.parse(file(filename).read())
-    stmts = ast.getChildren()[1].getChildren()
-
-    vars = set()
-    for stmt in stmts:
-        if isinstance(stmt, compiler.ast.Assign):
-            var_name = stmt.getChildren()[0].getChildren()[0]
-            vars.add(var_name)
-    if 'amber_atom_type' in vars \
-            and 'amber12_atom_type' not in vars:
-        print filename
-        with file(filename, 'a') as f:
-            f.write("amber12_atom_type = amber_atom_type\n")
diff --git a/setup.py b/setup.py
index 85fc4e4..1a75e26 100644
--- a/setup.py
+++ b/setup.py
@@ -28,7 +28,7 @@ if use_cython:
         from Cython.Distutils import build_ext
         use_cython = True
     except ImportError:
-        pass
+        use_cython = False
 if not use_cython:
     from distutils.command.build_ext import build_ext
 src_ext = 'pyx' if use_cython else 'c'

-- 
The Molecular Modelling Toolkit packaging



More information about the debian-science-commits mailing list