/* Generated by Cython 0.18 on Tue May 31 14:34:04 2016 */

#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
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #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
#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_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)
  #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
  #define PyVarObject_HEAD_INIT(type, size) \
          PyObject_HEAD_INIT(type) size,
  #define PyType_Modified(t)
  typedef struct {
     void *buf;
     PyObject *obj;
     Py_ssize_t len;
     Py_ssize_t itemsize;
     int readonly;
     int ndim;
     char *format;
     Py_ssize_t *shape;
     Py_ssize_t *strides;
     Py_ssize_t *suboffsets;
     void *internal;
  } Py_buffer;
  #define PyBUF_SIMPLE 0
  #define PyBUF_WRITABLE 0x0001
  #define PyBUF_FORMAT 0x0004
  #define PyBUF_ND 0x0008
  #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
  #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
  #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
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#endif
#if PY_VERSION_HEX < 0x02060000
  #define PyBytesObject                PyStringObject
  #define PyBytes_Type                 PyString_Type
  #define PyBytes_Check                PyString_Check
  #define PyBytes_CheckExact           PyString_CheckExact
  #define PyBytes_FromString           PyString_FromString
  #define PyBytes_FromStringAndSize    PyString_FromStringAndSize
  #define PyBytes_FromFormat           PyString_FromFormat
  #define PyBytes_DecodeEscape         PyString_DecodeEscape
  #define PyBytes_AsString             PyString_AsString
  #define PyBytes_AsStringAndSize      PyString_AsStringAndSize
  #define PyBytes_Size                 PyString_Size
  #define PyBytes_AS_STRING            PyString_AS_STRING
  #define PyBytes_GET_SIZE             PyString_GET_SIZE
  #define PyBytes_Repr                 PyString_Repr
  #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)
#endif
#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
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #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
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#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)
  #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
#else
  #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
  #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
        (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))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
#else
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
  #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))
#else
  #define __Pyx_NAMESTR(n) (n)
  #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"
  #else
    #define __PYX_EXTERN_C extern
  #endif
#endif

#if defined(WIN32) || defined(MS_WINDOWS)
#define _USE_MATH_DEFINES
#endif
#include <math.h>
#define __PYX_HAVE__pyfmi__fmi
#define __PYX_HAVE_API__pyfmi__fmi
#include "string.h"
#include "stdio.h"
#include "stdlib.h"
#include "numpy/arrayobject.h"
#include "numpy/ufuncobject.h"
#include "stdarg.h"
#include "fmilib.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif

#ifndef CYTHON_INLINE
  #if defined(__GNUC__)
    #define CYTHON_INLINE __inline__
  #elif defined(_MSC_VER)
    #define CYTHON_INLINE __inline
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_INLINE inline
  #else
    #define CYTHON_INLINE
  #endif
#endif
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/

#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
#define __Pyx_PyBytes_AsUString(s)   ((unsigned char*) PyBytes_AsString(s))
#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
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 */
  #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
    #define likely(x)   __builtin_expect(!!(x), 1)
    #define unlikely(x) __builtin_expect(!!(x), 0)
  #else /* __GNUC__ > 2 ... */
    #define likely(x)   (x)
    #define unlikely(x) (x)
  #endif /* __GNUC__ > 2 ... */
#else /* __GNUC__ */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */
    
static PyObject *__pyx_m;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static int __pyx_lineno;
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
  #elif defined(_Complex_I)
    #define CYTHON_CCOMPLEX 1
  #else
    #define CYTHON_CCOMPLEX 0
  #endif
#endif
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    #include <complex>
  #else
    #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[] = {
  "fmi.pyx",
  "fmi.pxd",
  "numpy.pxd",
  "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;


/* "numpy.pxd":723
 * # in Cython to enable them only on the right systems.
 * 
 * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t
 */
typedef npy_int8 __pyx_t_5numpy_int8_t;

/* "numpy.pxd":724
 * 
 * ctypedef npy_int8       int8_t
 * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int32      int32_t
 * ctypedef npy_int64      int64_t
 */
typedef npy_int16 __pyx_t_5numpy_int16_t;

/* "numpy.pxd":725
 * ctypedef npy_int8       int8_t
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int64      int64_t
 * #ctypedef npy_int96      int96_t
 */
typedef npy_int32 __pyx_t_5numpy_int32_t;

/* "numpy.pxd":726
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t
 * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_int96      int96_t
 * #ctypedef npy_int128     int128_t
 */
typedef npy_int64 __pyx_t_5numpy_int64_t;

/* "numpy.pxd":730
 * #ctypedef npy_int128     int128_t
 * 
 * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t
 */
typedef npy_uint8 __pyx_t_5numpy_uint8_t;

/* "numpy.pxd":731
 * 
 * ctypedef npy_uint8      uint8_t
 * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint32     uint32_t
 * ctypedef npy_uint64     uint64_t
 */
typedef npy_uint16 __pyx_t_5numpy_uint16_t;

/* "numpy.pxd":732
 * ctypedef npy_uint8      uint8_t
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint64     uint64_t
 * #ctypedef npy_uint96     uint96_t
 */
typedef npy_uint32 __pyx_t_5numpy_uint32_t;

/* "numpy.pxd":733
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t
 * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_uint96     uint96_t
 * #ctypedef npy_uint128    uint128_t
 */
typedef npy_uint64 __pyx_t_5numpy_uint64_t;

/* "numpy.pxd":737
 * #ctypedef npy_uint128    uint128_t
 * 
 * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_float64    float64_t
 * #ctypedef npy_float80    float80_t
 */
typedef npy_float32 __pyx_t_5numpy_float32_t;

/* "numpy.pxd":738
 * 
 * ctypedef npy_float32    float32_t
 * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_float80    float80_t
 * #ctypedef npy_float128   float128_t
 */
typedef npy_float64 __pyx_t_5numpy_float64_t;

/* "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             # <<<<<<<<<<<<<<
 * ctypedef npy_longlong   long_t
 * ctypedef npy_longlong   longlong_t
 */
typedef npy_long __pyx_t_5numpy_int_t;

/* "numpy.pxd":748
 * # numpy.int corresponds to 'l' and numpy.long to 'q'
 * ctypedef npy_long       int_t
 * ctypedef npy_longlong   long_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longlong   longlong_t
 * 
 */
typedef npy_longlong __pyx_t_5numpy_long_t;

/* "numpy.pxd":749
 * ctypedef npy_long       int_t
 * ctypedef npy_longlong   long_t
 * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_ulong      uint_t
 */
typedef npy_longlong __pyx_t_5numpy_longlong_t;

/* "numpy.pxd":751
 * ctypedef npy_longlong   longlong_t
 * 
 * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
 * ctypedef npy_ulonglong  ulong_t
 * ctypedef npy_ulonglong  ulonglong_t
 */
typedef npy_ulong __pyx_t_5numpy_uint_t;

/* "numpy.pxd":752
 * 
 * ctypedef npy_ulong      uint_t
 * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 */
typedef npy_ulonglong __pyx_t_5numpy_ulong_t;

/* "numpy.pxd":753
 * ctypedef npy_ulong      uint_t
 * ctypedef npy_ulonglong  ulong_t
 * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_intp       intp_t
 */
typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;

/* "numpy.pxd":755
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uintp      uintp_t
 * 
 */
typedef npy_intp __pyx_t_5numpy_intp_t;

/* "numpy.pxd":756
 * 
 * ctypedef npy_intp       intp_t
 * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_double     float_t
 */
typedef npy_uintp __pyx_t_5numpy_uintp_t;

/* "numpy.pxd":758
 * ctypedef npy_uintp      uintp_t
 * 
 * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
 * ctypedef npy_double     double_t
 * ctypedef npy_longdouble longdouble_t
 */
typedef npy_double __pyx_t_5numpy_float_t;

/* "numpy.pxd":759
 * 
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longdouble longdouble_t
 * 
 */
typedef npy_double __pyx_t_5numpy_double_t;

/* "numpy.pxd":760
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t
 * ctypedef npy_longdouble longdouble_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;
  #else
    typedef float _Complex __pyx_t_float_complex;
  #endif
#else
    typedef struct { float real, imag; } __pyx_t_float_complex;
#endif

#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    typedef ::std::complex< double > __pyx_t_double_complex;
  #else
    typedef double _Complex __pyx_t_double_complex;
  #endif
#else
    typedef struct { double real, imag; } __pyx_t_double_complex;
#endif


/*--- Type declarations ---*/
struct __pyx_obj_5pyfmi_3fmi_ModelBase;
struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2;
struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2;
struct __pyx_obj_5pyfmi_3fmi_FMUModelBase;
struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1;
struct __pyx_obj_5pyfmi_3fmi_FMUState2;
struct __pyx_obj_5pyfmi_3fmi_FMUModelME2;
struct __pyx_obj_5pyfmi_3fmi_FMUModelME1;
struct __pyx_obj_5pyfmi_3fmi___pyx_scope_struct_1_genexpr;
struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2;
struct __pyx_obj_5pyfmi_3fmi___pyx_scope_struct__get_number_of_lines_log;
struct __pyx_obj_5pyfmi_3fmi_FMUModel;
struct __pyx_obj_5pyfmi_3fmi_ScalarVariable;

/* "numpy.pxd":762
 * ctypedef npy_longdouble longdouble_t
 * 
 * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
 * ctypedef npy_cdouble     cdouble_t
 * ctypedef npy_clongdouble clongdouble_t
 */
typedef npy_cfloat __pyx_t_5numpy_cfloat_t;

/* "numpy.pxd":763
 * 
 * ctypedef npy_cfloat      cfloat_t
 * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
 * ctypedef npy_clongdouble clongdouble_t
 * 
 */
typedef npy_cdouble __pyx_t_5numpy_cdouble_t;

/* "numpy.pxd":764
 * ctypedef npy_cfloat      cfloat_t
 * ctypedef npy_cdouble     cdouble_t
 * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_cdouble     complex_t
 */
typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;

/* "numpy.pxd":766
 * ctypedef npy_clongdouble clongdouble_t
 * 
 * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew1(a):
 */
typedef npy_cdouble __pyx_t_5numpy_complex_t;
struct __pyx_opt_args_5pyfmi_3fmi_11FMUModelCS2_do_step;

/* "pyfmi\fmi.pxd":198
 *     cpdef _get_time(self)
 *     cpdef _set_time(self, FMIL.fmi2_real_t t)
 *     cpdef int do_step(self, FMIL.fmi2_real_t current_t, FMIL.fmi2_real_t step_size, new_step=*)             # <<<<<<<<<<<<<<
 *     cdef int _set_input_derivatives(self, N.ndarray value_refs, N.ndarray values, N.ndarray orders)
 *     cdef int _get_output_derivatives(self, N.ndarray value_refs, N.ndarray values, N.ndarray orders)
 */
struct __pyx_opt_args_5pyfmi_3fmi_11FMUModelCS2_do_step {
  int __pyx_n;
  PyObject *new_step;
};

/* "pyfmi\fmi.pxd":34
 * cimport fmil_import as FMIL
 * 
 * cdef class ModelBase:             # <<<<<<<<<<<<<<
 *     """
 *     Abstract Model class containing base functionality.
 */
struct __pyx_obj_5pyfmi_3fmi_ModelBase {
  PyObject_HEAD
  struct __pyx_vtabstruct_5pyfmi_3fmi_ModelBase *__pyx_vtab;
  PyObject *_log;
  char *_fmu_log_name;
  struct jm_callbacks callbacks;
};


/* "pyfmi\fmi.pxd":131
 *     cpdef get_derivatives(self)
 * 
 * cdef class FMUModelBase2(ModelBase):             # <<<<<<<<<<<<<<
 *     """
 *     FMI Model loaded from a dll.
 */
struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 {
  struct __pyx_obj_5pyfmi_3fmi_ModelBase __pyx_base;
  fmi_import_context_t *_context;
  fmi2_callback_functions_t callBackFunctions;
  fmi2_import_t *_fmu;
  fmi2_fmu_kind_enu_t _fmu_kind;
  fmi_version_enu_t _version;
  jm_string last_error;
  size_t _nEventIndicators;
  size_t _nContinuousStates;
  size_t _nCategories;
  fmi2_event_info_t _eventInfo;
  PyObject *_fmu_full_path;
  PyObject *_enable_logging;
  int _allocated_dll;
  int _allocated_context;
  int _allocated_xml;
  int _allocated_fmu;
  PyObject *_modelId;
  PyObject *_modelName;
  PyObject *_categories;
  PyObject *_save_real_variables_val;
  PyObject *_save_int_variables_val;
  PyObject *_save_bool_variables_val;
  PyObject *__pyx___t;
  PyObject *_pyEventInfo;
  char *_fmu_temp_dir;
  PyObject *_states_references;
  PyObject *_inputs_references;
  PyObject *_outputs_references;
  PyObject *_derivatives_references;
  PyObject *_derivatives_states_dependencies;
  PyObject *_derivatives_inputs_dependencies;
  PyObject *_outputs_states_dependencies;
  PyObject *_outputs_inputs_dependencies;
  PyObject *_A;
  PyObject *_B;
  PyObject *_C;
  PyObject *_D;
  PyObject *_group_A;
  PyObject *_group_B;
  PyObject *_group_C;
  PyObject *_group_D;
  PyObject *_mask_A;
  PyObject *_A_row_ind;
  PyObject *_A_col_ind;
};


/* "pyfmi\fmi.pxd":194
 *     cpdef N.ndarray get_real(self, valueref)
 * 
 * cdef class FMUModelCS2(FMUModelBase2):             # <<<<<<<<<<<<<<
 * 
 *     cpdef _get_time(self)
 */
struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 {
  struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 __pyx_base;
};


/* "pyfmi\fmi.pxd":76
 *     cdef FMIL.fmi2_FMU_state_t fmu_state
 * 
 * cdef class FMUModelBase(ModelBase):             # <<<<<<<<<<<<<<
 *     """
 *     An FMI Model loaded from a DLL.
 */
struct __pyx_obj_5pyfmi_3fmi_FMUModelBase {
  struct __pyx_obj_5pyfmi_3fmi_ModelBase __pyx_base;
  fmi1_callback_functions_t callBackFunctions;
  fmi_import_context_t *context;
  fmi1_import_t *_fmu;
  fmi1_event_info_t _eventInfo;
  struct fmi1_import_variable_list_t *variable_list;
  enum fmi1_fmu_kind_enu_t fmu_kind;
  jm_status_enu_t jm_status;
  PyObject *__t;
  PyObject *_file_open;
  PyObject *_npoints;
  PyObject *_enable_logging;
  PyObject *_pyEventInfo;
  int _version;
  int _instantiated_fmu;
  int _allocated_dll;
  int _allocated_context;
  int _allocated_xml;
  int _allocated_fmu;
  PyObject *_allocated_list;
  PyObject *_modelid;
  PyObject *_modelname;
  unsigned int _nEventIndicators;
  unsigned int _nContinuousStates;
  PyObject *_save_real_variables_val;
  PyObject *_save_int_variables_val;
  PyObject *_save_bool_variables_val;
  int _fmu_kind;
  char *_fmu_temp_dir;
};


/* "pyfmi\fmi.pxd":120
 *     cpdef FMIL.fmi1_causality_enu_t get_variable_causality(self, variablename) except *
 * 
 * cdef class FMUModelCS1(FMUModelBase):             # <<<<<<<<<<<<<<
 * 
 *     cpdef _get_time(self)
 */
struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 {
  struct __pyx_obj_5pyfmi_3fmi_FMUModelBase __pyx_base;
};


/* "pyfmi\fmi.pxd":70
 *     cdef object _description #A characater pointer but we need an own reference and this is sufficient
 * 
 * cdef class FMUState2:             # <<<<<<<<<<<<<<
 *     """
 *     Class containing a pointer to a FMU-state.
 */
struct __pyx_obj_5pyfmi_3fmi_FMUState2 {
  PyObject_HEAD
  fmi2_FMU_state_t fmu_state;
};


/* "pyfmi\fmi.pxd":202
 *     cdef int _get_output_derivatives(self, N.ndarray value_refs, N.ndarray values, N.ndarray orders)
 * 
 * cdef class FMUModelME2(FMUModelBase2):             # <<<<<<<<<<<<<<
 * 
 *     cpdef _get_time(self)
 */
struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 {
  struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 __pyx_base;
  PyObject *force_finite_differences;
};


/* "pyfmi\fmi.pxd":125
 *     cpdef _set_time(self, FMIL.fmi1_real_t t)
 * 
 * cdef class FMUModelME1(FMUModelBase):             # <<<<<<<<<<<<<<
 * 
 *     cpdef _get_time(self)
 */
struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 {
  struct __pyx_obj_5pyfmi_3fmi_FMUModelBase __pyx_base;
};


/* "pyfmi\fmi.pyx":440
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'r') as file:
 *                 num_lines = sum(1 for line in file)             # <<<<<<<<<<<<<<
 *         return num_lines
 * 
 */
struct __pyx_obj_5pyfmi_3fmi___pyx_scope_struct_1_genexpr {
  PyObject_HEAD
  struct __pyx_obj_5pyfmi_3fmi___pyx_scope_struct__get_number_of_lines_log *__pyx_outer_scope;
  PyObject *__pyx_v_line;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "pyfmi\fmi.pxd":57
 *     cdef FMIL.fmi1_variable_alias_kind_enu_t _alias
 * 
 * cdef class ScalarVariable2:             # <<<<<<<<<<<<<<
 *     """
 *     Class defining data structure based on the XML element ScalarVariable.
 */
struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 {
  PyObject_HEAD
  fmi2_value_reference_t _value_reference;
  fmi2_base_type_enu_t _type;
  fmi2_variability_enu_t _variability;
  fmi2_causality_enu_t _causality;
  fmi2_variable_alias_kind_enu_t _alias;
  fmi2_initial_enu_t _initial;
  PyObject *_name;
  PyObject *_description;
};


/* "pyfmi\fmi.pyx":433
 *         return self._fmu_log_name
 * 
 *     def get_number_of_lines_log(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the number of lines in the log file.
 */
struct __pyx_obj_5pyfmi_3fmi___pyx_scope_struct__get_number_of_lines_log {
  PyObject_HEAD
  PyObject *__pyx_v_file;
};


/* "pyfmi\fmi.pyx":6719
 * 
 * #Temporary should be removed! (after a period)
 * cdef class FMUModel(FMUModelME1):             # <<<<<<<<<<<<<<
 *     def __init__(self, fmu, path='.', enable_logging=True):
 *         print "WARNING: This class is deprecated and has been superseded with FMUModelME1. The recommended entry-point for loading an FMU is now the function load_fmu."
 */
struct __pyx_obj_5pyfmi_3fmi_FMUModel {
  struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 __pyx_base;
};


/* "pyfmi\fmi.pxd":45
 * 
 * 
 * cdef class ScalarVariable:             # <<<<<<<<<<<<<<
 *     """
 *     Class defining data structure based on the XML element ScalarVariable.
 */
struct __pyx_obj_5pyfmi_3fmi_ScalarVariable {
  PyObject_HEAD
  PyObject *_name;
  fmi1_value_reference_t _value_reference;
  PyObject *_description;
  enum fmi1_base_type_enu_t _type;
  enum fmi1_variability_enu_t _variability;
  enum fmi1_causality_enu_t _causality;
  enum fmi1_variable_alias_kind_enu_t _alias;
};



/* "pyfmi\fmi.pyx":176
 *     print "FMU: fmiStatus = %d;  %s (%s): %s\n"%(status, instanceName, category, buf)
 * 
 * cdef class ModelBase:             # <<<<<<<<<<<<<<
 *     """
 *     Abstract Model class containing base functionality.
 */

struct __pyx_vtabstruct_5pyfmi_3fmi_ModelBase {
  PyObject *(*_logger)(struct __pyx_obj_5pyfmi_3fmi_ModelBase *, jm_string, int, jm_string);
};
static struct __pyx_vtabstruct_5pyfmi_3fmi_ModelBase *__pyx_vtabptr_5pyfmi_3fmi_ModelBase;


/* "pyfmi\fmi.pyx":790
 * 
 * 
 * cdef class FMUModelBase(ModelBase):             # <<<<<<<<<<<<<<
 *     """
 *     An FMI Model loaded from a DLL.
 */

struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase {
  struct __pyx_vtabstruct_5pyfmi_3fmi_ModelBase __pyx_base;
  PyObject *(*_internal_set_fmu_null)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, int __pyx_skip_dispatch);
  PyObject *(*get_variable_description)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, PyObject *, int __pyx_skip_dispatch);
  enum fmi1_base_type_enu_t (*get_variable_data_type)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, PyObject *, int __pyx_skip_dispatch);
  fmi1_value_reference_t (*get_variable_valueref)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*get_variable_fixed)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*get_variable_start)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*get_variable_max)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*get_variable_min)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, PyObject *, int __pyx_skip_dispatch);
  enum fmi1_variability_enu_t (*get_variable_variability)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, PyObject *, int __pyx_skip_dispatch);
  enum fmi1_causality_enu_t (*get_variable_causality)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, PyObject *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase *__pyx_vtabptr_5pyfmi_3fmi_FMUModelBase;


/* "pyfmi\fmi.pyx":2580
 *             self._instantiated_fmu = 0
 * 
 * cdef class FMUModelME1(FMUModelBase):             # <<<<<<<<<<<<<<
 *     """
 *     An FMI Model loaded from a DLL.
 */

struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelME1 {
  struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase __pyx_base;
  PyObject *(*_get_time)(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *, int __pyx_skip_dispatch);
  PyObject *(*_set_time)(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *, fmi1_real_t, int __pyx_skip_dispatch);
  PyObject *(*get_derivatives)(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelME1 *__pyx_vtabptr_5pyfmi_3fmi_FMUModelME1;


/* "pyfmi\fmi.pyx":6719
 * 
 * #Temporary should be removed! (after a period)
 * cdef class FMUModel(FMUModelME1):             # <<<<<<<<<<<<<<
 *     def __init__(self, fmu, path='.', enable_logging=True):
 *         print "WARNING: This class is deprecated and has been superseded with FMUModelME1. The recommended entry-point for loading an FMU is now the function load_fmu."
 */

struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModel {
  struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelME1 __pyx_base;
};
static struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModel *__pyx_vtabptr_5pyfmi_3fmi_FMUModel;


/* "pyfmi\fmi.pyx":3166
 * 
 * 
 * cdef class FMUModelBase2(ModelBase):             # <<<<<<<<<<<<<<
 *     """
 *     FMI Model loaded from a dll.
 */

struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 {
  struct __pyx_vtabstruct_5pyfmi_3fmi_ModelBase __pyx_base;
  fmi2_value_reference_t (*get_variable_valueref)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch);
  fmi2_base_type_enu_t (*get_variable_data_type)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*get_variable_description)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch);
  fmi2_variability_enu_t (*get_variable_variability)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch);
  fmi2_causality_enu_t (*get_variable_causality)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*get_output_dependencies)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, int __pyx_skip_dispatch);
  PyObject *(*get_derivatives_dependencies)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, int __pyx_skip_dispatch);
  PyObject *(*get_variable_start)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*get_variable_max)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*get_variable_min)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch);
  fmi2_initial_enu_t (*get_variable_initial)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*serialize_fmu_state)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*deserialize_fmu_state)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*serialized_fmu_state_size)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*_add_scalar_variables)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, fmi2_import_variable_list_t *);
  PyObject *(*_add_scalar_variable)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, fmi2_import_variable_t *);
  int (*_get_directional_derivative)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyArrayObject *, PyArrayObject *, PyArrayObject *, PyArrayObject *);
  PyObject *(*set_real)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  PyArrayObject *(*get_real)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *__pyx_vtabptr_5pyfmi_3fmi_FMUModelBase2;


/* "pyfmi\fmi.pyx":6119
 * 
 * 
 * cdef class FMUModelME2(FMUModelBase2):             # <<<<<<<<<<<<<<
 *     """
 *     Model-exchange model loaded from a dll
 */

struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelME2 {
  struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 __pyx_base;
  PyObject *(*_get_time)(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *, int __pyx_skip_dispatch);
  PyObject *(*_set_time)(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *, fmi2_real_t, int __pyx_skip_dispatch);
  PyObject *(*get_derivatives)(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelME2 *__pyx_vtabptr_5pyfmi_3fmi_FMUModelME2;


/* "pyfmi\fmi.pyx":2110
 *         return guid
 * 
 * cdef class FMUModelCS1(FMUModelBase):             # <<<<<<<<<<<<<<
 *     #First step only support fmi1_fmu_kind_enu_cs_standalone
 *     #stepFinished not supported
 */

struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS1 {
  struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase __pyx_base;
  PyObject *(*_get_time)(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *, int __pyx_skip_dispatch);
  PyObject *(*_set_time)(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *, fmi1_real_t, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS1 *__pyx_vtabptr_5pyfmi_3fmi_FMUModelCS1;


/* "pyfmi\fmi.pyx":5521
 * 
 * 
 * cdef class FMUModelCS2(FMUModelBase2):             # <<<<<<<<<<<<<<
 *     """
 *     Co-simulation model loaded from a dll
 */

struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS2 {
  struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 __pyx_base;
  PyObject *(*_get_time)(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *, int __pyx_skip_dispatch);
  PyObject *(*_set_time)(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *, fmi2_real_t, int __pyx_skip_dispatch);
  int (*do_step)(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *, fmi2_real_t, fmi2_real_t, int __pyx_skip_dispatch, struct __pyx_opt_args_5pyfmi_3fmi_11FMUModelCS2_do_step *__pyx_optional_args);
  int (*_set_input_derivatives)(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *, PyArrayObject *, PyArrayObject *, PyArrayObject *);
  int (*_get_output_derivatives)(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *, PyArrayObject *, PyArrayObject *, PyArrayObject *);
};
static struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS2 *__pyx_vtabptr_5pyfmi_3fmi_FMUModelCS2;
#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, int);
    void (*DECREF)(void*, PyObject*, int);
    void (*GOTREF)(void*, PyObject*, int);
    void (*GIVEREF)(void*, PyObject*, int);
    void* (*SetupContext)(const char*, int, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#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__)
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XINCREF(r) Py_XINCREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
  #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 CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
#define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_List_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) {
        PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_Tuple_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) {
        PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (PyList_CheckExact(o)) {
        Py_ssize_t n = (likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if (likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = (likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if (likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {  /* inlined PySequence_GetItem() */
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (unlikely(l < 0)) return NULL;
                i += l;
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/

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*/

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 int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
    const char* function_name); /*proto*/

static PyObject* __Pyx_Globals(void); /*proto*/

static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/

static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);

#ifndef __PYX_FORCE_INIT_THREADS
  #define __PYX_FORCE_INIT_THREADS 0
#endif

static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /*proto*/

static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/

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 PyObject* __Pyx_decode_c_string(
         const char* cstring, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));

#include <string.h>

#define __Pyx_SetItemInt(o, i, v, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_SetItemInt_Fast(o, i, v) : \
                                                    __Pyx_SetItemInt_Generic(o, to_py_func(i), v))
static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
    int r;
    if (!j) return -1;
    r = PyObject_SetItem(o, j, v);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (PyList_CheckExact(o)) {
        Py_ssize_t n = (likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if (likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
            PyObject* old = PyList_GET_ITEM(o, n);
            Py_INCREF(v);
            PyList_SET_ITEM(o, n, v);
            Py_DECREF(old);
            return 1;
        }
    } else {  /* inlined PySequence_SetItem() */
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_ass_item)) {
            if (unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (unlikely(l < 0)) return -1;
                i += l;
            }
            return m->sq_ass_item(o, i, v);
        }
    }
#else
#if CYTHON_COMPILING_IN_PYPY
    if (PySequence_Check(o) && !PyDict_Check(o)) {
#else
    if (PySequence_Check(o)) {
#endif
        return PySequence_SetItem(o, i, v);
    }
#endif
    return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
}

static void __Pyx_RaiseBufferFallbackError(void); /*proto*/

static void __Pyx_RaiseBufferIndexError(int axis); /*proto*/

#define __Pyx_BufPtrCContig1d(type, buf, i0, s0) ((type)buf + i0)
  static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact); /*proto*/

static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);

#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 int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) {
    int result = PySequence_Contains(seq, item);
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        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 {
        PyObject *r, *m;
        m = __Pyx_GetAttrString(L, "append");
        if (!m) return NULL;
        r = PyObject_CallFunctionObjArgs(m, x, NULL);
        Py_DECREF(m);
        return r;
    }
}

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/

static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/

static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name);

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);
#else
    #define __Pyx_GetBuffer PyObject_GetBuffer
    #define __Pyx_ReleaseBuffer PyBuffer_Release
#endif


  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_FindPy2Metaclass(PyObject *bases); /*proto*/

static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name,
                                   PyObject *qualname, PyObject *modname); /*proto*/

static CYTHON_INLINE fmi1_value_reference_t __Pyx_PyInt_from_py_fmi1_value_reference_t(PyObject *);

static CYTHON_INLINE fmi1_integer_t __Pyx_PyInt_from_py_fmi1_integer_t(PyObject *);

static CYTHON_INLINE fmi2_integer_t __Pyx_PyInt_from_py_fmi2_integer_t(PyObject *);

static int __Pyx_Print(PyObject*, PyObject *, int); /*proto*/
#if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3
static PyObject* __pyx_print = 0;
static PyObject* __pyx_print_kwargs = 0;
#endif

static int __Pyx_PrintOne(PyObject* stream, PyObject *o); /*proto*/

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_fmi1_value_reference_t(fmi1_value_reference_t);

static CYTHON_INLINE size_t __Pyx_PyInt_from_py_size_t(PyObject *);

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_size_t(size_t);

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_fmi1_boolean_t(fmi1_boolean_t);

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_fmi1_integer_t(fmi1_integer_t);

static CYTHON_INLINE fmi2_boolean_t __Pyx_PyInt_from_py_fmi2_boolean_t(PyObject *);

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_fmi2_boolean_t(fmi2_boolean_t);

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_fmi2_integer_t(fmi2_integer_t);

#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    #define __Pyx_CREAL(z) ((z).real())
    #define __Pyx_CIMAG(z) ((z).imag())
  #else
    #define __Pyx_CREAL(z) (__real__(z))
    #define __Pyx_CIMAG(z) (__imag__(z))
  #endif
#else
    #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))
#else
    #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
    #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
#endif

static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);

#if CYTHON_CCOMPLEX
    #define __Pyx_c_eqf(a, b)   ((a)==(b))
    #define __Pyx_c_sumf(a, b)  ((a)+(b))
    #define __Pyx_c_difff(a, b) ((a)-(b))
    #define __Pyx_c_prodf(a, b) ((a)*(b))
    #define __Pyx_c_quotf(a, b) ((a)/(b))
    #define __Pyx_c_negf(a)     (-(a))
  #ifdef __cplusplus
    #define __Pyx_c_is_zerof(z) ((z)==(float)0)
    #define __Pyx_c_conjf(z)    (::std::conj(z))
    #if 1
        #define __Pyx_c_absf(z)     (::std::abs(z))
        #define __Pyx_c_powf(a, b)  (::std::pow(a, b))
    #endif
  #else
    #define __Pyx_c_is_zerof(z) ((z)==0)
    #define __Pyx_c_conjf(z)    (conjf(z))
    #if 1
        #define __Pyx_c_absf(z)     (cabsf(z))
        #define __Pyx_c_powf(a, b)  (cpowf(a, b))
    #endif
 #endif
#else
    static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex);
    static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex);
    #if 1
        static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex);
        static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex);
    #endif
#endif

static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);

#if CYTHON_CCOMPLEX
    #define __Pyx_c_eq(a, b)   ((a)==(b))
    #define __Pyx_c_sum(a, b)  ((a)+(b))
    #define __Pyx_c_diff(a, b) ((a)-(b))
    #define __Pyx_c_prod(a, b) ((a)*(b))
    #define __Pyx_c_quot(a, b) ((a)/(b))
    #define __Pyx_c_neg(a)     (-(a))
  #ifdef __cplusplus
    #define __Pyx_c_is_zero(z) ((z)==(double)0)
    #define __Pyx_c_conj(z)    (::std::conj(z))
    #if 1
        #define __Pyx_c_abs(z)     (::std::abs(z))
        #define __Pyx_c_pow(a, b)  (::std::pow(a, b))
    #endif
  #else
    #define __Pyx_c_is_zero(z) ((z)==0)
    #define __Pyx_c_conj(z)    (conj(z))
    #if 1
        #define __Pyx_c_abs(z)     (cabs(z))
        #define __Pyx_c_pow(a, b)  (cpow(a, b))
    #endif
 #endif
#else
    static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex);
    static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex);
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex);
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex);
    #endif
#endif

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);

static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename); /*proto*/

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 int __Pyx_SetVtable(PyObject *dict, void *vtable); /*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*/

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' */

/* Module declarations from 'libc.string' */

/* Module declarations from 'libc.stdio' */

/* 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' */

/* Module declarations from 'numpy' */
static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
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 char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/

/* Module declarations from 'pyfmi.fmil_import' */

/* Module declarations from 'pyfmi.fmi' */
static PyTypeObject *__pyx_ptype_5pyfmi_3fmi_ModelBase = 0;
static PyTypeObject *__pyx_ptype_5pyfmi_3fmi_ScalarVariable = 0;
static PyTypeObject *__pyx_ptype_5pyfmi_3fmi_ScalarVariable2 = 0;
static PyTypeObject *__pyx_ptype_5pyfmi_3fmi_FMUState2 = 0;
static PyTypeObject *__pyx_ptype_5pyfmi_3fmi_FMUModelBase = 0;
static PyTypeObject *__pyx_ptype_5pyfmi_3fmi_FMUModelCS1 = 0;
static PyTypeObject *__pyx_ptype_5pyfmi_3fmi_FMUModelME1 = 0;
static PyTypeObject *__pyx_ptype_5pyfmi_3fmi_FMUModelBase2 = 0;
static PyTypeObject *__pyx_ptype_5pyfmi_3fmi_FMUModelCS2 = 0;
static PyTypeObject *__pyx_ptype_5pyfmi_3fmi_FMUModelME2 = 0;
static PyTypeObject *__pyx_ptype_5pyfmi_3fmi_FMUModel = 0;
static PyTypeObject *__pyx_ptype_5pyfmi_3fmi___pyx_scope_struct__get_number_of_lines_log = 0;
static PyTypeObject *__pyx_ptype_5pyfmi_3fmi___pyx_scope_struct_1_genexpr = 0;
static void __pyx_f_5pyfmi_3fmi_importlogger(struct jm_callbacks *, jm_string, int, jm_string); /*proto*/
static void __pyx_f_5pyfmi_3fmi_importlogger2(struct jm_callbacks *, jm_string, int, jm_string); /*proto*/
static void __pyx_f_5pyfmi_3fmi_importlogger_load_fmu(struct jm_callbacks *, jm_string, int, jm_string); /*proto*/
static __Pyx_TypeInfo __Pyx_TypeInfo_nn_fmi1_value_reference_t = { "fmi1_value_reference_t", NULL, sizeof(fmi1_value_reference_t), { 0 }, 0, IS_UNSIGNED(fmi1_value_reference_t) ? 'U' : 'I', IS_UNSIGNED(fmi1_value_reference_t), 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn_fmi1_real_t = { "fmi1_real_t", NULL, sizeof(fmi1_real_t), { 0 }, 0, 'R', 0, 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn_fmi1_integer_t = { "fmi1_integer_t", NULL, sizeof(fmi1_integer_t), { 0 }, 0, IS_UNSIGNED(fmi1_integer_t) ? 'U' : 'I', IS_UNSIGNED(fmi1_integer_t), 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn_fmi2_value_reference_t = { "fmi2_value_reference_t", NULL, sizeof(fmi2_value_reference_t), { 0 }, 0, IS_UNSIGNED(fmi2_value_reference_t) ? 'U' : 'I', IS_UNSIGNED(fmi2_value_reference_t), 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn_fmi2_real_t = { "fmi2_real_t", NULL, sizeof(fmi2_real_t), { 0 }, 0, 'R', 0, 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn_fmi2_integer_t = { "fmi2_integer_t", NULL, sizeof(fmi2_integer_t), { 0 }, 0, IS_UNSIGNED(fmi2_integer_t) ? 'U' : 'I', IS_UNSIGNED(fmi2_integer_t), 0 };
#define __Pyx_MODULE_NAME "pyfmi.fmi"
int __pyx_module_is_main_pyfmi__fmi = 0;

/* Implementation of 'pyfmi.fmi' */
static PyObject *__pyx_builtin_Exception;
static PyObject *__pyx_builtin_property;
static PyObject *__pyx_builtin_open;
static PyObject *__pyx_builtin_basestring;
static PyObject *__pyx_builtin_xrange;
static PyObject *__pyx_builtin___import__;
static PyObject *__pyx_builtin_sum;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_NotImplementedError;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_pf_5pyfmi_3fmi_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_2decode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_4encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_6decode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_9ModelBase_set(struct __pyx_obj_5pyfmi_3fmi_ModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_9ModelBase_2get(struct __pyx_obj_5pyfmi_3fmi_ModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_9ModelBase_4_exec_algorithm(struct __pyx_obj_5pyfmi_3fmi_ModelBase *__pyx_v_self, PyObject *__pyx_v_module, PyObject *__pyx_v_algorithm, PyObject *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_9ModelBase_6_exec_simulate_algorithm(struct __pyx_obj_5pyfmi_3fmi_ModelBase *__pyx_v_self, PyObject *__pyx_v_start_time, PyObject *__pyx_v_final_time, PyObject *__pyx_v_input, PyObject *__pyx_v_module, PyObject *__pyx_v_algorithm, PyObject *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_9ModelBase_8_exec_estimate_algorithm(struct __pyx_obj_5pyfmi_3fmi_ModelBase *__pyx_v_self, PyObject *__pyx_v_parameters, PyObject *__pyx_v_measurements, PyObject *__pyx_v_input, PyObject *__pyx_v_module, PyObject *__pyx_v_algorithm, PyObject *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_9ModelBase_10_default_options(struct __pyx_obj_5pyfmi_3fmi_ModelBase *__pyx_v_self, PyObject *__pyx_v_module, PyObject *__pyx_v_algorithm); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_9ModelBase_12estimate(struct __pyx_obj_5pyfmi_3fmi_ModelBase *__pyx_v_self, PyObject *__pyx_v_parameters, PyObject *__pyx_v_measurements, PyObject *__pyx_v_input, PyObject *__pyx_v_algorithm, PyObject *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_9ModelBase_14estimate_options(struct __pyx_obj_5pyfmi_3fmi_ModelBase *__pyx_v_self, PyObject *__pyx_v_algorithm); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_9ModelBase_16get_log_file_name(struct __pyx_obj_5pyfmi_3fmi_ModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_9ModelBase_23get_number_of_lines_log_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_9ModelBase_18get_number_of_lines_log(struct __pyx_obj_5pyfmi_3fmi_ModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_9ModelBase_20print_log(struct __pyx_obj_5pyfmi_3fmi_ModelBase *__pyx_v_self, PyObject *__pyx_v_start_lines, PyObject *__pyx_v_end_lines); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_9ModelBase_22get_log(struct __pyx_obj_5pyfmi_3fmi_ModelBase *__pyx_v_self, int __pyx_v_start_lines, int __pyx_v_end_lines); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_9ModelBase_24append_log_message(struct __pyx_obj_5pyfmi_3fmi_ModelBase *__pyx_v_self, PyObject *__pyx_v_module, PyObject *__pyx_v_log_level, PyObject *__pyx_v_message); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_9ModelBase_26set_log_level(struct __pyx_obj_5pyfmi_3fmi_ModelBase *__pyx_v_self, jm_log_level_enu_t __pyx_v_level); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_9ModelBase_28_convert_filter(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_ModelBase *__pyx_v_self, PyObject *__pyx_v_expression); /* proto */
static int __pyx_pf_5pyfmi_3fmi_14ScalarVariable___init__(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value_reference, PyObject *__pyx_v_type, PyObject *__pyx_v_description, PyObject *__pyx_v_variability, PyObject *__pyx_v_causality, PyObject *__pyx_v_alias); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_14ScalarVariable_2_get_name(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_14ScalarVariable_4_get_value_reference(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_14ScalarVariable_6_get_type(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_14ScalarVariable_8_get_description(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_14ScalarVariable_10_get_variability(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_14ScalarVariable_12_get_causality(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_14ScalarVariable_14_get_alias(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_15ScalarVariable2___init__(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value_reference, PyObject *__pyx_v_type, PyObject *__pyx_v_description, PyObject *__pyx_v_variability, PyObject *__pyx_v_causality, PyObject *__pyx_v_alias, PyObject *__pyx_v_initial); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_15ScalarVariable2_2_get_name(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_15ScalarVariable2_4_get_value_reference(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_15ScalarVariable2_6_get_type(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_15ScalarVariable2_8_get_description(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_15ScalarVariable2_10_get_variability(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_15ScalarVariable2_12_get_causality(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_15ScalarVariable2_14_get_alias(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_15ScalarVariable2_16_get_initial(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_9FMUState2___init__(struct __pyx_obj_5pyfmi_3fmi_FMUState2 *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase___init__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_fmu, PyObject *__pyx_v_path, PyObject *__pyx_v_enable_logging, PyObject *__pyx_v_log_file_name, PyObject *__pyx_v_log_level); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_2_internal_set_fmu_null(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_4_get_version(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_6get_ode_sizes(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_8get_real(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_valueref); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_10set_real(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_valueref, PyObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_12get_integer(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_valueref); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_14set_integer(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_valueref, PyObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_16get_boolean(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_valueref); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_18set_boolean(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_valueref, PyObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_20get_string(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_valueref); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_22set_string(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_valueref, PyObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_24set_debug_logging(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_26set_fmil_log_level(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, jm_log_level_enu_t __pyx_v_level); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_28_set(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_30_get(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_32get_variable_description(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_34get_variable_data_type(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_36get_variable_valueref(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_38get_variable_nominal(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name, PyObject *__pyx_v_valueref); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_40get_variable_fixed(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_42get_variable_start(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_44get_variable_max(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_46get_variable_min(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_48get_model_variables(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_type, PyObject *__pyx_v_include_alias, PyObject *__pyx_v_causality, PyObject *__pyx_v_variability, PyObject *__pyx_v_only_start, PyObject *__pyx_v_only_fixed, PyObject *__pyx_v_filter); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_50get_model_time_varying_value_references(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_filter); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_52get_variable_alias_base(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_54get_variable_alias(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_56get_variable_variability(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_58get_variable_by_valueref(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, fmi1_value_reference_t __pyx_v_valueref, PyObject *__pyx_v_type); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_60get_variable_causality(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_62get_name(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_64get_identifier(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_66get_author(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_68get_default_experiment_start_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_70get_default_experiment_stop_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_72get_default_experiment_tolerance(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_74get_description(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_76get_generation_tool(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_78get_guid(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_3__t___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_3__t_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_3__t_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_10_file_open___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_10_file_open_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_10_file_open_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_8_npoints___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_8_npoints_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_8_npoints_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_15_enable_logging___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_15_enable_logging_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_15_enable_logging_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_11FMUModelCS1___init__(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_fmu, PyObject *__pyx_v_path, PyObject *__pyx_v_enable_logging, PyObject *__pyx_v_log_file_name, PyObject *__pyx_v_log_level); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_2_get_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_4_set_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, fmi1_real_t __pyx_v_t); /* proto */
static void __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_6__dealloc__(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_8do_step(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, fmi1_real_t __pyx_v_current_t, fmi1_real_t __pyx_v_step_size, PyObject *__pyx_v_new_step); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_10cancel_step(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_12get_output_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_variables, fmi1_integer_t __pyx_v_order); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_14_get_types_platform(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_16get_real_status(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_status_kind); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_18set_input_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_values, PyObject *__pyx_v_orders); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_20simulate(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_start_time, PyObject *__pyx_v_final_time, PyObject *__pyx_v_input, PyObject *__pyx_v_algorithm, PyObject *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_22simulate_options(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_algorithm); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_24initialize(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_tStart, PyObject *__pyx_v_tStop, PyObject *__pyx_v_StopTimeDefined); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_26reset(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_28instantiate_slave(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_logging); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_30get_capability_flags(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_32terminate(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_34free_instance(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_11FMUModelME1___init__(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, PyObject *__pyx_v_fmu, PyObject *__pyx_v_path, PyObject *__pyx_v_enable_logging, PyObject *__pyx_v_log_file_name, PyObject *__pyx_v_log_level); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_2_get_model_types_platform(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_4reset(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self); /* proto */
static void __pyx_pf_5pyfmi_3fmi_11FMUModelME1_6__dealloc__(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_8_get_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_10_set_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, fmi1_real_t __pyx_v_t); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_12_get_continuous_states(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_14_set_continuous_states(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_16_get_nominal_continuous_states(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_18get_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_20get_event_indicators(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_22get_tolerances(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_24event_update(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, PyObject *__pyx_v_intermediateResult); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_26get_event_info(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_28get_state_value_references(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_30completed_integrator_step(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_32initialize(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, PyObject *__pyx_v_tolControlled, PyObject *__pyx_v_relativeTolerance); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_34instantiate_model(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_logging); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_36simulate(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, PyObject *__pyx_v_start_time, PyObject *__pyx_v_final_time, PyObject *__pyx_v_input, PyObject *__pyx_v_algorithm, PyObject *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_38simulate_options(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, PyObject *__pyx_v_algorithm); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_40terminate(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_42free_instance(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2___init__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_fmu, PyObject *__pyx_v_path, PyObject *__pyx_v_enable_logging, PyObject *__pyx_v_log_file_name, PyObject *__pyx_v_log_level); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_2get_real(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_valueref); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_4set_real(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_valueref, PyObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_6get_integer(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_valueref); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8set_integer(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_valueref, PyObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_10get_boolean(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_valueref); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_12set_boolean(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_valueref, PyObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_14get_string(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_valueref); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_16set_string(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_valueref, PyObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_18_set(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_20_get(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_22instantiate(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_visible); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_24setup_experiment(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_tolerance_defined, PyObject *__pyx_v_tolerance, PyObject *__pyx_v_start_time, PyObject *__pyx_v_stop_time_defined, PyObject *__pyx_v_stop_time); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_26reset(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_28terminate(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_30free_instance(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_32exit_initialization_mode(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_34enter_initialization_mode(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_36initialize(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_38set_fmil_log_level(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, jm_log_level_enu_t __pyx_v_level); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_40get_fmil_log_level(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_42set_debug_logging(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_logging_on, PyObject *__pyx_v_categories); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_44get_categories(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_46get_variable_nominal(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name, PyObject *__pyx_v_valueref); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_48get_variable_by_valueref(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_valueref, PyObject *__pyx_v_type); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_50get_variable_alias_base(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, char *__pyx_v_variablename); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_52get_variable_alias(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, char *__pyx_v_variablename); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_54get_model_time_varying_value_references(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_filter); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_56get_model_variables(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_type, PyObject *__pyx_v_include_alias, PyObject *__pyx_v_causality, PyObject *__pyx_v_variability, PyObject *__pyx_v_only_start, PyObject *__pyx_v_only_fixed, PyObject *__pyx_v_filter); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_58get_variable_references(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_60get_variable_valueref(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_62get_variable_data_type(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_64get_variable_description(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_66get_variable_variability(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_68get_variable_initial(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_70get_variable_causality(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_72get_variable_start(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_74get_variable_max(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_76get_variable_min(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_78get_fmu_state(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, struct __pyx_obj_5pyfmi_3fmi_FMUState2 *__pyx_v_state); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_80set_fmu_state(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, struct __pyx_obj_5pyfmi_3fmi_FMUState2 *__pyx_v_state); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_82free_fmu_state(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, struct __pyx_obj_5pyfmi_3fmi_FMUState2 *__pyx_v_state); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_84serialize_fmu_state(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_state); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_86deserialize_fmu_state(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_serialized_fmu); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_88serialized_fmu_state_size(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_state); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_90get_ode_sizes(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_92get_default_experiment_start_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_94get_default_experiment_stop_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_96get_default_experiment_tolerance(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_98get_default_experiment_step(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_100get_derivatives_list(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_102get_output_dependencies(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_104get_derivatives_dependencies(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_106_get_directional_proxy(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_var_ref, PyObject *__pyx_v_func_ref, PyObject *__pyx_v_group, PyObject *__pyx_v_add_diag); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_108_get_A(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_110_get_B(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_112_get_C(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_114_get_D(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_116get_state_space_representation(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_C, PyObject *__pyx_v_D); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_118get_states_list(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_120get_input_list(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_122get_output_list(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_124get_directional_derivative(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_var_ref, PyObject *__pyx_v_func_ref, PyObject *__pyx_v_v); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_126get_version(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_128get_model_version(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_130get_name(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_132get_author(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_134get_description(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_136get_copyright(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_138get_license(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_140get_generation_tool(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_142get_generation_date_and_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_144get_guid(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_146get_variable_naming_convention(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_148get_identifier(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_150get_model_types_platform(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_15_enable_logging___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_15_enable_logging_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_15_enable_logging_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_24_save_real_variables_val___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_24_save_real_variables_val_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_24_save_real_variables_val_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_23_save_int_variables_val___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_23_save_int_variables_val_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_23_save_int_variables_val_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_24_save_bool_variables_val___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_24_save_bool_variables_val_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_24_save_bool_variables_val_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_12_pyEventInfo___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_12_pyEventInfo_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_12_pyEventInfo_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8_group_A___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8_group_A_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8_group_A_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8_group_B___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8_group_B_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8_group_B_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8_group_C___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8_group_C_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8_group_C_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8_group_D___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8_group_D_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8_group_D_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_11FMUModelCS2___init__(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_fmu, PyObject *__pyx_v_path, PyObject *__pyx_v_enable_logging, PyObject *__pyx_v_log_file_name, PyObject *__pyx_v_log_level); /* proto */
static void __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_2__dealloc__(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_4_get_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_6_set_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, fmi2_real_t __pyx_v_t); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_8do_step(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, fmi2_real_t __pyx_v_current_t, fmi2_real_t __pyx_v_step_size, PyObject *__pyx_v_new_step); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_10cancel_step(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_12set_input_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_values, fmi2_integer_t __pyx_v_order); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_14get_output_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_variables, fmi2_integer_t __pyx_v_order); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_16get_status(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_status_kind); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_18get_real_status(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_status_kind); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_20get_integer_status(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_status_kind); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_22get_boolean_status(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_status_kind); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_24get_string_status(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_status_kind); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_26simulate(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_start_time, PyObject *__pyx_v_final_time, PyObject *__pyx_v_input, PyObject *__pyx_v_algorithm, PyObject *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_28simulate_options(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_algorithm); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_30get_capability_flags(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_32_provides_directional_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_34_supports_get_set_FMU_state(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_11FMUModelME2___init__(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, PyObject *__pyx_v_fmu, PyObject *__pyx_v_path, PyObject *__pyx_v_enable_logging, PyObject *__pyx_v_log_file_name, PyObject *__pyx_v_log_level); /* proto */
static void __pyx_pf_5pyfmi_3fmi_11FMUModelME2_2__dealloc__(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_4_get_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_6_set_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, fmi2_real_t __pyx_v_t); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_8get_event_info(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_10enter_event_mode(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_12enter_continuous_time_mode(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_14get_event_indicators(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_16event_update(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, PyObject *__pyx_v_intermediateResult); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_18get_tolerances(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_20completed_integrator_step(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, PyObject *__pyx_v_no_set_FMU_state_prior_to_current_point); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_22_get_continuous_states(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_24_set_continuous_states(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, PyArrayObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_26_get_nominal_continuous_states(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_28get_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_30simulate(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, PyObject *__pyx_v_start_time, PyObject *__pyx_v_final_time, PyObject *__pyx_v_input, PyObject *__pyx_v_algorithm, PyObject *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_32simulate_options(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, PyObject *__pyx_v_algorithm); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_34get_capability_flags(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_36_provides_directional_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_38_supports_get_set_FMU_state(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_40_get_directional_proxy(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, PyObject *__pyx_v_var_ref, PyObject *__pyx_v_func_ref, PyObject *__pyx_v_group, PyObject *__pyx_v_add_diag); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_42_estimate_directional_derivative(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, PyObject *__pyx_v_var_ref, PyObject *__pyx_v_func_ref, PyObject *__pyx_v_group, PyObject *__pyx_v_add_diag); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_24force_finite_differences___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_11FMUModelME2_24force_finite_differences_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5pyfmi_3fmi_11FMUModelME2_24force_finite_differences_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self); /* proto */
static int __pyx_pf_5pyfmi_3fmi_8FMUModel___init__(struct __pyx_obj_5pyfmi_3fmi_FMUModel *__pyx_v_self, PyObject *__pyx_v_fmu, PyObject *__pyx_v_path, PyObject *__pyx_v_enable_logging); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_8load_fmu_deprecated(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fmu, PyObject *__pyx_v_path, PyObject *__pyx_v_enable_logging, PyObject *__pyx_v_log_file_name); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_10_handle_load_fmu_exception(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_fmu, PyObject *__pyx_v_log_file); /* proto */
static PyObject *__pyx_pf_5pyfmi_3fmi_12load_fmu(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fmu, PyObject *__pyx_v_path, PyObject *__pyx_v_enable_logging, PyObject *__pyx_v_log_file_name, PyObject *__pyx_v_kind, PyObject *__pyx_v_log_level); /* 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_1[] = "FMIL: module = %s, log lovel = %d: %s";
static char __pyx_k_2[] = "FMIL: module = %s, log level = %d: %s\n";
static char __pyx_k_4[] = "FMU: fmiStatus = %d;  %s (%s): %s\n";
static char __pyx_k_5[] = "common.algorithm_drivers";
static char __pyx_k_6[] = " must be a subclass of common.algorithm_drivers.AlgorithmBase";
static char __pyx_k_8[] = "_exec_estimate_algorithm";
static char __pyx_k_9[] = "pyfmi.fmi_algorithm_drivers";
static char __pyx_k_11[] = "get_number_of_lines_log";
static char __pyx_k_12[] = "";
static char __pyx_k_13[] = "\n";
static char __pyx_k_18[] = "Invalid log level for FMI Library (0-7).";
static char __pyx_k_20[] = "|";
static char __pyx_k_21[] = "Unknown input.";
static char __pyx_k_30[] = ".";
static char __pyx_k_32[] = "The log level must be between %d and %d";
static char __pyx_k_33[] = "The attribute 'enable_logging' is deprecated. Please use 'log_level' instead. Setting 'log_level' to INFO...";
static char __pyx_k_35[] = ".fmu";
static char __pyx_k_37[] = "FMUModel must be instantiated with an FMU (.fmu) file.";
static char __pyx_k_39[] = "The FMU version could not be determined. ";
static char __pyx_k_40[] = "The FMU version could not be determined. Enable logging for possibly more information.";
static char __pyx_k_42[] = "This class only supports FMI 1.0 (Model Exchange and Co-Simulation).";
static char __pyx_k_44[] = "The XML file could not be parsed. ";
static char __pyx_k_45[] = "The XML file could not be parsed. Enable logging for possibly more information.";
static char __pyx_k_48[] = "FMI_REGISTER_GLOBALLY";
static char __pyx_k_49[] = "Error loading the binary. Enable logging for possibly more information.";
static char __pyx_k_51[] = "_log.txt";
static char __pyx_k_53[] = "_internal_set_fmu_null";
static char __pyx_k_54[] = "Failed to get the Real values.";
static char __pyx_k_56[] = "The length of valueref and values are inconsistent.";
static char __pyx_k_58[] = "Failed to set the Real values.";
static char __pyx_k_60[] = "Failed to get the Integer values.";
static char __pyx_k_63[] = "Failed to set the Integer values.";
static char __pyx_k_65[] = "Failed to get the Boolean values.";
static char __pyx_k_68[] = "Failed to set the Boolean values.";
static char __pyx_k_70[] = "Failed to get the String values.";
static char __pyx_k_72[] = "The values needs to be a list of values.";
static char __pyx_k_75[] = "Failed to set the String values.";
static char __pyx_k_77[] = "Failed to set the debugging option.";
static char __pyx_k_79[] = "The method 'set_fmil_log_level' is deprecated, use 'set_log_level' instead.";
static char __pyx_k_81[] = "The variable %s could not be found.";
static char __pyx_k_82[] = "Type not supported.";
static char __pyx_k_85[] = "get_variable_description";
static char __pyx_k_86[] = "get_variable_data_type";
static char __pyx_k_87[] = "get_variable_valueref";
static char __pyx_k_88[] = "The variable with value reference: %s, could not be found.";
static char __pyx_k_89[] = "Either provide value reference or variable name.";
static char __pyx_k_91[] = "The variable is not a real variable.";
static char __pyx_k_93[] = "The variable %s does not have a start value.";
static char __pyx_k_94[] = "Unknown variable type.";
static char __pyx_k_96[] = "The variable type does not have a maximum value.";
static char __pyx_k_98[] = "The variable type does not have a minimum value.";
static char __pyx_k__A[] = "A";
static char __pyx_k__B[] = "B";
static char __pyx_k__C[] = "C";
static char __pyx_k__D[] = "D";
static char __pyx_k__H[] = "H";
static char __pyx_k__I[] = "I";
static char __pyx_k__L[] = "L";
static char __pyx_k__N[] = "N";
static char __pyx_k__O[] = "O";
static char __pyx_k__Q[] = "Q";
static char __pyx_k__a[] = "a";
static char __pyx_k__b[] = "b";
static char __pyx_k__d[] = "d";
static char __pyx_k__f[] = "f";
static char __pyx_k__g[] = "g";
static char __pyx_k__h[] = "h";
static char __pyx_k__i[] = "i";
static char __pyx_k__l[] = "l";
static char __pyx_k__q[] = "q";
static char __pyx_k__r[] = "r";
static char __pyx_k__v[] = "v";
static char __pyx_k__w[] = "w";
static char __pyx_k__x[] = "x";
static char __pyx_k_103[] = "get_variable_variability";
static char __pyx_k_104[] = "The variable with the valuref %i could not be found.";
static char __pyx_k_105[] = "get_variable_causality";
static char __pyx_k_107[] = "This class only supports FMI 1.0 for Co-simulation.";
static char __pyx_k_110[] = "The order must be greater than zero and below the maximum output derivative support of the FMU (%d).";
static char __pyx_k_111[] = "The variables must either be a string or a list of strings";
static char __pyx_k_113[] = "Failed to get the Real output derivatives.";
static char __pyx_k_115[] = "Failed to retrieve the last successful time. See the log for possibly more information.";
static char __pyx_k_117[] = "Not supported status kind.";
static char __pyx_k_119[] = "The number of variables must be the same as the number of orders.";
static char __pyx_k_121[] = "The order must be greater than zero.";
static char __pyx_k_123[] = "The FMU does not support input derivatives.";
static char __pyx_k_126[] = "Failed to set the Real input derivatives.";
static char __pyx_k_129[] = "get_default_experiment_start_time";
static char __pyx_k_130[] = "get_default_experiment_stop_time";
static char __pyx_k_131[] = "_exec_simulate_algorithm";
static char __pyx_k_135[] = "The slave failed to initialize. See the log for possibly more information.";
static char __pyx_k_137[] = "Failed to reset the FMU.";
static char __pyx_k_140[] = "FMI_MIME_CS_STANDALONE";
static char __pyx_k_141[] = "Failed to instantiate the slave. See the log for possibly more information.";
static char __pyx_k_143[] = "Failed to set the debugging option. See the log for possibly more information.";
static char __pyx_k_145[] = "canHandleVariableCommunicationStepSize";
static char __pyx_k_146[] = "canInterpolateInputs";
static char __pyx_k_147[] = "maxOutputDerivativeOrder";
static char __pyx_k_148[] = "canRunAsynchronuously";
static char __pyx_k_149[] = "canBeInstantiatedOnlyOncePerProcess";
static char __pyx_k_150[] = "canNotUseMemoryManagementFunctions";
static char __pyx_k_152[] = "This class only supports FMI 1.0 for Model Exchange.";
static char __pyx_k_154[] = "The DLL could not be reloaded, check the log for more information.";
static char __pyx_k_156[] = "Failed to set the time.";
static char __pyx_k_158[] = "Failed to retrieve the continuous states.";
static char __pyx_k_160[] = "Failed to set the new continuous states. The number of values are not consistent with the number of continuous states.";
static char __pyx_k_162[] = "Failed to set the new continuous states.";
static char __pyx_k_164[] = "Failed to get the nominal values.";
static char __pyx_k_166[] = "Failed to get the derivative values at time: %E.";
static char __pyx_k_167[] = "Failed to get the event indicators.";
static char __pyx_k_169[] = "get_default_experiment_tolerance";
static char __pyx_k_170[] = "nominal_continuous_states";
static char __pyx_k_172[] = "Failed to update the events at time: %E.";
static char __pyx_k_173[] = "stateValueReferencesChanged";
static char __pyx_k_174[] = "Failed to get the continuous state reference values.";
static char __pyx_k_176[] = "Failed to call FMI Completed Step.";
static char __pyx_k_179[] = "Initialize returned with a warning. Check the log for information (FMUModel.get_log).";
static char __pyx_k_181[] = "Initialize returned with a warning. Enable logging for more information, (FMUModel(..., enable_logging=True)).";
static char __pyx_k_183[] = "Initialize returned with an error. Check the log for information (FMUModel.get_log).";
static char __pyx_k_185[] = "Initialize returned with an error. Enable logging for more information, (FMUModel(..., enable_logging=True)).";
static char __pyx_k_188[] = "Failed to instantiate the model. See the log for possibly more information.";
static char __pyx_k_196[] = "Could not locate the FMU in the specified directory.";
static char __pyx_k_199[] = "The FMU version is not supported by this class. ";
static char __pyx_k_200[] = "The FMU version is not supported by this class. Enable logging for possibly more information.";
static char __pyx_k_202[] = "The XML-could not be read. ";
static char __pyx_k_203[] = "The XML-could not be read. Enable logging for possible nore information.";
static char __pyx_k_205[] = "The FMU kind could not be determined. ";
static char __pyx_k_206[] = "The FMU kind could not be determined. Enable logging for possibly more information.";
static char __pyx_k_208[] = "FMUModelBase2 cannot be used directly, use FMUModelME2 or FMUModelCS2.";
static char __pyx_k_210[] = "Error loading the binary. ";
static char __pyx_k_230[] = "The instance is not curent an instance of an ME-model or a CS-model. Use load_fmu for correct loading.";
static char __pyx_k_235[] = "Failed to setup the experiment.";
static char __pyx_k_237[] = "An error occured when reseting the model, see the log for possible more information";
static char __pyx_k_239[] = "Exit Initialize returned with a warning. Check the log for information (FMUModel.get_log).";
static char __pyx_k_241[] = "Exit Initialize returned with a warning. Enable logging for more information, (FMUModel(..., enable_logging=True)).";
static char __pyx_k_243[] = "Exit Initialize returned with an error. Check the log for information (FMUModel.get_log).";
static char __pyx_k_245[] = "Exit Initialize returned with an error. Enable logging for more information, (FMUModel(..., enable_logging=True)).";
static char __pyx_k_247[] = "Setup Experiment has to be called prior to the initialization method.";
static char __pyx_k_249[] = "Enter Initialize returned with a warning. Check the log for information (FMUModel.get_log).";
static char __pyx_k_251[] = "Enter Initialize returned with a warning. Enable logging for more information, (FMUModel(..., enable_logging=True)).";
static char __pyx_k_253[] = "Enter Initialize returned with an error. Check the log for information (FMUModel.get_log).";
static char __pyx_k_255[] = "Enter Initialize returned with an error. Enable logging for more information, (FMUModel(..., enable_logging=True)).";
static char __pyx_k_257[] = "enter_initialization_mode";
static char __pyx_k_258[] = "exit_initialization_mode";
static char __pyx_k_260[] = "Logging is not enabled";
static char __pyx_k_263[] = "Currently the logging of categories is not availible. See the docstring for more information";
static char __pyx_k_271[] = "get_variable_initial";
static char __pyx_k_275[] = "_supports_get_set_FMU_state";
static char __pyx_k_276[] = "This FMU does not support get and set FMU-state";
static char __pyx_k_278[] = "An error occured while trying to get the FMU-state, see the log for possible more information";
static char __pyx_k_280[] = "This FMU dos not support get and set FMU-state";
static char __pyx_k_282[] = "An error occured while trying to set the FMU-state, see the log for possible more information";
static char __pyx_k_285[] = "FMU-state does not seem to be allocated.";
static char __pyx_k_286[] = "An error occured while trying to free the FMU-state, see the log for possible more information";
static char __pyx_k_288[] = "deserialize_fmu_state";
static char __pyx_k_289[] = "serialized_fmu_state_size";
static char __pyx_k_290[] = "Unknown variable. Please verify the correctness of the XML file and check the log.";
static char __pyx_k_292[] = "The returned states list is NULL.";
static char __pyx_k_294[] = "get_output_dependencies";
static char __pyx_k_295[] = "No dependency information for the outputs was found in the model description. Assuming complete dependency.";
static char __pyx_k_297[] = "get_derivatives_dependencies";
static char __pyx_k_298[] = "get_derivatives_list";
static char __pyx_k_299[] = "No dependency information for the derivatives was found in the model description. Assuming complete dependency.";
static char __pyx_k_302[] = "get_directional_derivative";
static char __pyx_k_303[] = "_get_directional_proxy";
static char __pyx_k_308[] = "The returned derivatives states list is NULL.";
static char __pyx_k_310[] = "The returned outputs list is NULL.";
static char __pyx_k_312[] = "_provides_directional_derivatives";
static char __pyx_k_313[] = "This FMU does not provide directional derivatives";
static char __pyx_k_315[] = "The length of the list with variables (var_ref) and the seed vector (V) are not equal";
static char __pyx_k_317[] = "An error occured while getting the directional derivative, see the log for possible more information";
static char __pyx_k_322[] = "This class only supports FMI 2.0 for Co-simulation.";
static char __pyx_k_324[] = "get_capability_flags";
static char __pyx_k_325[] = "Models that need an execution tool are not supported";
static char __pyx_k_328[] = "An error occured while canceling the step";
static char __pyx_k_336[] = "Status kind has to be between 0 and 3";
static char __pyx_k_338[] = "An error occured while retriving the status";
static char __pyx_k_349[] = "canGetAndSetFMUstate";
static char __pyx_k_350[] = "canSerializeFMUstate";
static char __pyx_k_351[] = "providesDirectionalDerivatives";
static char __pyx_k_354[] = "This class only supports FMI 2.0 for Model Exchange.";
static char __pyx_k_358[] = "newDiscreteStatesNeeded";
static char __pyx_k_359[] = "nominalsOfContinuousStatesChanged";
static char __pyx_k_360[] = "valuesOfContinuousStatesChanged";
static char __pyx_k_361[] = "nextEventTimeDefined";
static char __pyx_k_362[] = "Failed to enter event mode.";
static char __pyx_k_364[] = "Failed to enter continuous time mode.";
static char __pyx_k_368[] = "no_set_FMU_state_prior_to_current_point";
static char __pyx_k_376[] = "completedIntegratorStepNotNeeded";
static char __pyx_k_377[] = "completedEventIterationIsProvided";
static char __pyx_k_379[] = "_estimate_directional_derivative";
static char __pyx_k_381[] = "get_variable_nominal";
static char __pyx_k_383[] = "WARNING: This class is deprecated and has been superseded with FMUModelME1. The recommended entry-point for loading an FMU is now the function load_fmu.";
static char __pyx_k_388[] = "PyFMI currently only supports FMI 1.0.";
static char __pyx_k_398[] = "Input-argument \"kind\" can only be \"ME\", \"CS\" or \"auto\" (default) and not: ";
static char __pyx_k_400[] = "_handle_load_fmu_exception";
static char __pyx_k_402[] = "The FMU version is unsupported. ";
static char __pyx_k_403[] = "The FMU version is unsupported. Enable logging for possibly more information.";
static char __pyx_k_406[] = "PyFMI does not support co-simulation tool";
static char __pyx_k_408[] = "FMU is a ";
static char __pyx_k_409[] = " and not a ";
static char __pyx_k_412[] = "The FMU version is not found. ";
static char __pyx_k_413[] = "The FMU version is not found. Enable logging for possibly more information.";
static char __pyx_k_415[] = "ndarray is not C contiguous";
static char __pyx_k_417[] = "ndarray is not Fortran contiguous";
static char __pyx_k_419[] = "Non-native byte order not supported";
static char __pyx_k_421[] = "unknown dtype code in numpy.pxd (%d)";
static char __pyx_k_422[] = "Format string allocated too short, see comment in numpy.pxd";
static char __pyx_k_425[] = "Format string allocated too short.";
static char __pyx_k_427[] = "\nModule containing the FMI interface Python wrappers.\n";
static char __pyx_k_428[] = "scipy.sparse";
static char __pyx_k_429[] = "*";
static char __pyx_k_430[] = "pyfmi.common.core";
static char __pyx_k_431[] = "pyfmi.common";
static char __pyx_k_432[] = "pyfmi.fmi_util";
static char __pyx_k_435[] = "C:\\Development\\PyFMI\\branches\\PyFMI-2.3.x\\src\\pyfmi\\fmi.pyx";
static char __pyx_k_436[] = "pyfmi.fmi";
static char __pyx_k_443[] = "\001";
static char __pyx_k_444[] = "\000";
static char __pyx_k_445[] = "FMI1_LAST_SUCCESSFUL_TIME";
static char __pyx_k_446[] = "application/x-fmu-sharedlibrary";
static char __pyx_k_448[] = "FMI_DEFAULT_LOG_LEVEL";
static char __pyx_k_449[] = "FMI2_INITIAL_CALCULATED";
static char __pyx_k_450[] = "FMI2_INITIAL_UNKNOWN";
static char __pyx_k_451[] = "\n    An FMU exception.\n    ";
static char __pyx_k_452[] = "_get_value_reference";
static char __pyx_k_453[] = "\n    Property for accessing the current time of the simulation. Calls the\n    low-level FMI function: fmiSetTime.\n    ";
static char __pyx_k_454[] = "_get_model_types_platform";
static char __pyx_k_455[] = "model_types_platform";
static char __pyx_k_456[] = "_get_continuous_states";
static char __pyx_k_457[] = "_set_continuous_states";
static char __pyx_k_458[] = "\n    Property for accessing the current values of the continuous states. Calls\n    the low-level FMI function: fmiSetContinuousStates/fmiGetContinuousStates.\n    ";
static char __pyx_k_459[] = "_get_nominal_continuous_states";
static char __pyx_k_460[] = "\n    Property for accessing the nominal values of the continuous states. Calls\n    the low-level FMI function: fmiGetNominalContinuousStates.\n    ";
static char __pyx_k_461[] = "\n    Property for accessing the current time of the simulation. Calls the\n    low-level FMI function: fmiSetTime\n    ";
static char __pyx_k_462[] = "\n    Property for accessing the current values of the continuous states. Calls\n    the low-level FMI function: fmi2SetContinuousStates/fmi2GetContinuousStates.\n    ";
static char __pyx_k_463[] = "\n    Property for accessing the nominal values of the continuous states. Calls\n    the low-level FMI function: fmi2GetNominalContinuousStates.\n    ";
static char __pyx_k_468[] = "original_enable_logging";
static char __pyx_k__CS[] = "CS";
static char __pyx_k__ME[] = "ME";
static char __pyx_k__Zd[] = "Zd";
static char __pyx_k__Zf[] = "Zf";
static char __pyx_k__Zg[] = "Zg";
static char __pyx_k__os[] = "os";
static char __pyx_k__re[] = "re";
static char __pyx_k__sp[] = "sp";
static char __pyx_k__alg[] = "alg";
static char __pyx_k__doc[] = "doc";
static char __pyx_k__eps[] = "eps";
static char __pyx_k__fmu[] = "fmu";
static char __pyx_k__int[] = "int";
static char __pyx_k__log[] = "log";
static char __pyx_k__sum[] = "sum";
static char __pyx_k__sys[] = "sys";
static char __pyx_k___fmu[] = "_fmu";
static char __pyx_k___get[] = "_get";
static char __pyx_k___set[] = "_set";
static char __pyx_k__auto[] = "auto";
static char __pyx_k__fget[] = "fget";
static char __pyx_k__file[] = "file";
static char __pyx_k__flat[] = "flat";
static char __pyx_k__join[] = "join";
static char __pyx_k__keys[] = "keys";
static char __pyx_k__kind[] = "kind";
static char __pyx_k__line[] = "line";
static char __pyx_k__name[] = "name";
static char __pyx_k__open[] = "open";
static char __pyx_k__path[] = "path";
static char __pyx_k__prod[] = "prod";
static char __pyx_k__self[] = "self";
static char __pyx_k__size[] = "size";
static char __pyx_k__time[] = "time";
static char __pyx_k__type[] = "type";
static char __pyx_k__Model[] = "Model";
static char __pyx_k__Slave[] = "Slave";
static char __pyx_k__alias[] = "alias";
static char __pyx_k__array[] = "array";
static char __pyx_k__dtype[] = "dtype";
static char __pyx_k__empty[] = "empty";
static char __pyx_k__finfo[] = "finfo";
static char __pyx_k__float[] = "float";
static char __pyx_k__fmu_1[] = "fmu_1";
static char __pyx_k__fmu_2[] = "fmu_2";
static char __pyx_k__group[] = "group";
static char __pyx_k__input[] = "input";
static char __pyx_k__int32[] = "int32";
static char __pyx_k__lower[] = "lower";
static char __pyx_k__match[] = "match";
static char __pyx_k__model[] = "model";
static char __pyx_k__ndmin[] = "ndmin";
static char __pyx_k__numpy[] = "numpy";
static char __pyx_k__order[] = "order";
static char __pyx_k__range[] = "range";
static char __pyx_k__ravel[] = "ravel";
static char __pyx_k__solve[] = "solve";
static char __pyx_k__state[] = "state";
static char __pyx_k__strip[] = "strip";
static char __pyx_k__tStop[] = "tStop";
static char __pyx_k__upper[] = "upper";
static char __pyx_k__value[] = "value";
static char __pyx_k__write[] = "write";
static char __pyx_k__zeros[] = "zeros";
static char __pyx_k__FMI_ME[] = "FMI_ME";
static char __pyx_k__FMI_OK[] = "FMI_OK";
static char __pyx_k___get_A[] = "_get_A";
static char __pyx_k___get_B[] = "_get_B";
static char __pyx_k___get_C[] = "_get_C";
static char __pyx_k___get_D[] = "_get_D";
static char __pyx_k__codecs[] = "codecs";
static char __pyx_k__decode[] = "decode";
static char __pyx_k__double[] = "double";
static char __pyx_k__encode[] = "encode";
static char __pyx_k__extend[] = "extend";
static char __pyx_k__filter[] = "filter";
static char __pyx_k__isfile[] = "isfile";
static char __pyx_k__module[] = "module";
static char __pyx_k__orders[] = "orders";
static char __pyx_k__tStart[] = "tStart";
static char __pyx_k__uint32[] = "uint32";
static char __pyx_k__values[] = "values";
static char __pyx_k__xrange[] = "xrange";
static char __pyx_k__Default[] = "Default";
static char __pyx_k__abspath[] = "abspath";
static char __pyx_k__compile[] = "compile";
static char __pyx_k__context[] = "context";
static char __pyx_k__do_step[] = "do_step";
static char __pyx_k__flatten[] = "flatten";
static char __pyx_k__fnmatch[] = "fnmatch";
static char __pyx_k__get_log[] = "get_log";
static char __pyx_k__initial[] = "initial";
static char __pyx_k__logging[] = "logging";
static char __pyx_k__message[] = "message";
static char __pyx_k__options[] = "options";
static char __pyx_k__unknown[] = "unknown";
static char __pyx_k__var_ref[] = "var_ref";
static char __pyx_k__version[] = "version";
static char __pyx_k__visible[] = "visible";
static char __pyx_k__warning[] = "warning";
static char __pyx_k__FMICSAlg[] = "FMICSAlg";
static char __pyx_k__FMI_NONE[] = "FMI_NONE";
static char __pyx_k__FMI_REAL[] = "FMI_REAL";
static char __pyx_k__FMI_TRUE[] = "FMI_TRUE";
static char __pyx_k____exit__[] = "__exit__";
static char __pyx_k____init__[] = "__init__";
static char __pyx_k____main__[] = "__main__";
static char __pyx_k____test__[] = "__test__";
static char __pyx_k__add_diag[] = "add_diag";
static char __pyx_k__algdrive[] = "algdrive";
static char __pyx_k__cpr_seed[] = "cpr_seed";
static char __pyx_k__endswith[] = "endswith";
static char __pyx_k__fmu_kind[] = "fmu_kind";
static char __pyx_k__func_ref[] = "func_ref";
static char __pyx_k__get_real[] = "get_real";
static char __pyx_k__load_fmu[] = "load_fmu";
static char __pyx_k__log_file[] = "log_file";
static char __pyx_k__new_step[] = "new_step";
static char __pyx_k__property[] = "property";
static char __pyx_k__readline[] = "readline";
static char __pyx_k__set_real[] = "set_real";
static char __pyx_k__valueref[] = "valueref";
static char __pyx_k__Exception[] = "Exception";
static char __pyx_k__FMI2_REAL[] = "FMI2_REAL";
static char __pyx_k__FMI2_TRUE[] = "FMI2_TRUE";
static char __pyx_k__FMI_ALIAS[] = "FMI_ALIAS";
static char __pyx_k__FMI_ERROR[] = "FMI_ERROR";
static char __pyx_k__FMI_FALSE[] = "FMI_FALSE";
static char __pyx_k__FMI_FATAL[] = "FMI_FATAL";
static char __pyx_k__FMI_INPUT[] = "FMI_INPUT";
static char __pyx_k__SciEstAlg[] = "SciEstAlg";
static char __pyx_k____enter__[] = "__enter__";
static char __pyx_k___get_name[] = "_get_name";
static char __pyx_k___get_time[] = "_get_time";
static char __pyx_k___get_type[] = "_get_type";
static char __pyx_k___set_time[] = "_set_time";
static char __pyx_k__algorithm[] = "algorithm";
static char __pyx_k__base_path[] = "base_path";
static char __pyx_k__callbacks[] = "callbacks";
static char __pyx_k__causality[] = "causality";
static char __pyx_k__current_t[] = "current_t";
static char __pyx_k__end_lines[] = "end_lines";
static char __pyx_k__log_level[] = "log_level";
static char __pyx_k__step_size[] = "step_size";
static char __pyx_k__stop_time[] = "stop_time";
static char __pyx_k__tolerance[] = "tolerance";
static char __pyx_k__translate[] = "translate";
static char __pyx_k__variables[] = "variables";
static char __pyx_k__FMI2_FALSE[] = "FMI2_FALSE";
static char __pyx_k__FMI2_FIXED[] = "FMI2_FIXED";
static char __pyx_k__FMI2_INPUT[] = "FMI2_INPUT";
static char __pyx_k__FMI_INPUTS[] = "FMI_INPUTS";
static char __pyx_k__FMI_OUTPUT[] = "FMI_OUTPUT";
static char __pyx_k__FMI_STATES[] = "FMI_STATES";
static char __pyx_k__FMI_STRING[] = "FMI_STRING";
static char __pyx_k__ValueError[] = "ValueError";
static char __pyx_k____import__[] = "__import__";
static char __pyx_k___get_alias[] = "_get_alias";
static char __pyx_k__basestring[] = "basestring";
static char __pyx_k__categories[] = "categories";
static char __pyx_k__csc_matrix[] = "csc_matrix";
static char __pyx_k__final_time[] = "final_time";
static char __pyx_k__fmu_1_kind[] = "fmu_1_kind";
static char __pyx_k__fmu_2_kind[] = "fmu_2_kind";
static char __pyx_k__get_result[] = "get_result";
static char __pyx_k__get_string[] = "get_string";
static char __pyx_k__last_error[] = "last_error";
static char __pyx_k__log_file_c[] = "log_file_c";
static char __pyx_k__logging_on[] = "logging_on";
static char __pyx_k__only_fixed[] = "only_fixed";
static char __pyx_k__only_start[] = "only_start";
static char __pyx_k__parameters[] = "parameters";
static char __pyx_k__set_string[] = "set_string";
static char __pyx_k__start_time[] = "start_time";
static char __pyx_k__structured[] = "structured";
static char __pyx_k__FMI2_OUTPUT[] = "FMI2_OUTPUT";
static char __pyx_k__FMI2_STRING[] = "FMI2_STRING";
static char __pyx_k__FMI_BOOLEAN[] = "FMI_BOOLEAN";
static char __pyx_k__FMI_DISCARD[] = "FMI_DISCARD";
static char __pyx_k__FMI_INTEGER[] = "FMI_INTEGER";
static char __pyx_k__FMI_OUTPUTS[] = "FMI_OUTPUTS";
static char __pyx_k__FMI_PENDING[] = "FMI_PENDING";
static char __pyx_k__FMI_WARNING[] = "FMI_WARNING";
static char __pyx_k__OrderedDict[] = "OrderedDict";
static char __pyx_k__PyEventInfo[] = "PyEventInfo";
static char __pyx_k__collections[] = "collections";
static char __pyx_k__description[] = "description";
static char __pyx_k__get_boolean[] = "get_boolean";
static char __pyx_k__get_integer[] = "get_integer";
static char __pyx_k__instantiate[] = "instantiate";
static char __pyx_k__set_boolean[] = "set_boolean";
static char __pyx_k__set_integer[] = "set_integer";
static char __pyx_k__start_lines[] = "start_lines";
static char __pyx_k__variability[] = "variability";
static char __pyx_k__FMI2_BOOLEAN[] = "FMI2_BOOLEAN";
static char __pyx_k__FMI2_INTEGER[] = "FMI2_INTEGER";
static char __pyx_k__FMI2_TUNABLE[] = "FMI2_TUNABLE";
static char __pyx_k__FMI2_UNKNOWN[] = "FMI2_UNKNOWN";
static char __pyx_k__FMI_CONSTANT[] = "FMI_CONSTANT";
static char __pyx_k__FMI_DISCRETE[] = "FMI_DISCRETE";
static char __pyx_k__FMI_INTERNAL[] = "FMI_INTERNAL";
static char __pyx_k__FMI_NO_ALIAS[] = "FMI_NO_ALIAS";
static char __pyx_k__FMUException[] = "FMUException";
static char __pyx_k__RuntimeError[] = "RuntimeError";
static char __pyx_k___get_initial[] = "_get_initial";
static char __pyx_k___get_version[] = "_get_version";
static char __pyx_k__fmu_temp_dir[] = "fmu_temp_dir";
static char __pyx_k__measurements[] = "measurements";
static char __pyx_k__python3_flag[] = "python3_flag";
static char __pyx_k__AlgorithmBase[] = "AlgorithmBase";
static char __pyx_k__FMI2_CONSTANT[] = "FMI2_CONSTANT";
static char __pyx_k__FMI2_DISCRETE[] = "FMI2_DISCRETE";
static char __pyx_k__FMI_PARAMETER[] = "FMI_PARAMETER";
static char __pyx_k__allocated_xml[] = "allocated_xml";
static char __pyx_k__fmu_full_path[] = "fmu_full_path";
static char __pyx_k__include_alias[] = "include_alias";
static char __pyx_k__log_file_name[] = "log_file_name";
static char __pyx_k__nextEventTime[] = "nextEventTime";
static char __pyx_k__set_log_level[] = "set_log_level";
static char __pyx_k__tolControlled[] = "tolControlled";
static char __pyx_k__variable_name[] = "variable_name";
static char __pyx_k__AssimuloFMIAlg[] = "AssimuloFMIAlg";
static char __pyx_k__FMI_CONTINUOUS[] = "FMI_CONTINUOUS";
static char __pyx_k___get_causality[] = "_get_causality";
static char __pyx_k__canRejectSteps[] = "canRejectSteps";
static char __pyx_k__enable_logging[] = "enable_logging";
static char __pyx_k__get_input_list[] = "get_input_list";
static char __pyx_k__latin_1_encode[] = "latin_1_encode";
static char __pyx_k__types_platform[] = "types_platform";
static char __pyx_k__FMI2_CONTINUOUS[] = "FMI2_CONTINUOUS";
static char __pyx_k__FMI_DERIVATIVES[] = "FMI_DERIVATIVES";
static char __pyx_k__FMI_ENUMERATION[] = "FMI_ENUMERATION";
static char __pyx_k__StopTimeDefined[] = "StopTimeDefined";
static char __pyx_k___convert_filter[] = "_convert_filter";
static char __pyx_k__canHandleEvents[] = "canHandleEvents";
static char __pyx_k__canSignalEvents[] = "canSignalEvents";
static char __pyx_k__create_temp_dir[] = "create_temp_dir";
static char __pyx_k__delete_temp_dir[] = "delete_temp_dir";
static char __pyx_k__get_derivatives[] = "get_derivatives";
static char __pyx_k__get_output_list[] = "get_output_list";
static char __pyx_k__get_states_list[] = "get_states_list";
static char __pyx_k__value_reference[] = "value_reference";
static char __pyx_k__FMI2_ENUMERATION[] = "FMI2_ENUMERATION";
static char __pyx_k___default_options[] = "_default_options";
static char __pyx_k___get_description[] = "_get_description";
static char __pyx_k___get_variability[] = "_get_variability";
static char __pyx_k__create_temp_file[] = "create_temp_file";
static char __pyx_k__delete_temp_file[] = "delete_temp_file";
static char __pyx_k__get_variable_max[] = "get_variable_max";
static char __pyx_k__get_variable_min[] = "get_variable_min";
static char __pyx_k__FMI_CS_STANDALONE[] = "FMI_CS_STANDALONE";
static char __pyx_k__FMI_NEGATED_ALIAS[] = "FMI_NEGATED_ALIAS";
static char __pyx_k__algorithm_drivers[] = "algorithm_drivers";
static char __pyx_k__allocated_context[] = "allocated_context";
static char __pyx_k__callBackFunctions[] = "callBackFunctions";
static char __pyx_k__continuous_states[] = "continuous_states";
static char __pyx_k__instantiate_model[] = "instantiate_model";
static char __pyx_k__instantiate_slave[] = "instantiate_slave";
static char __pyx_k__relativeTolerance[] = "relativeTolerance";
static char __pyx_k__stop_time_defined[] = "stop_time_defined";
static char __pyx_k__tolerance_defined[] = "tolerance_defined";
static char __pyx_k__upcomingTimeEvent[] = "upcomingTimeEvent";
static char __pyx_k__FMI2_INITIAL_EXACT[] = "FMI2_INITIAL_EXACT";
static char __pyx_k__get_variable_fixed[] = "get_variable_fixed";
static char __pyx_k__get_variable_start[] = "get_variable_start";
static char __pyx_k__intermediateResult[] = "intermediateResult";
static char __pyx_k__iterationConverged[] = "iterationConverged";
static char __pyx_k__needsExecutionTool[] = "needsExecutionTool";
static char __pyx_k__stateValuesChanged[] = "stateValuesChanged";
static char __pyx_k__FMI1_DO_STEP_STATUS[] = "FMI1_DO_STEP_STATUS";
static char __pyx_k__FMI1_PENDING_STATUS[] = "FMI1_PENDING_STATUS";
static char __pyx_k__FMI2_INITIAL_APPROX[] = "FMI2_INITIAL_APPROX";
static char __pyx_k__NotImplementedError[] = "NotImplementedError";
static char __pyx_k___get_types_platform[] = "_get_types_platform";
static char __pyx_k__callBackFunctions_1[] = "callBackFunctions_1";
static char __pyx_k__callBackFunctions_2[] = "callBackFunctions_2";
static char __pyx_k__get_default_options[] = "get_default_options";
static char __pyx_k__get_model_variables[] = "get_model_variables";
static char __pyx_k__load_fmu_deprecated[] = "load_fmu_deprecated";
static char __pyx_k__serialize_fmu_state[] = "serialize_fmu_state";
static char __pyx_k__terminateSimulation[] = "terminateSimulation";
static PyObject *__pyx_kp_s_1;
static PyObject *__pyx_n_s_103;
static PyObject *__pyx_kp_s_104;
static PyObject *__pyx_n_s_105;
static PyObject *__pyx_kp_s_107;
static PyObject *__pyx_n_s_11;
static PyObject *__pyx_kp_s_110;
static PyObject *__pyx_kp_s_111;
static PyObject *__pyx_kp_s_113;
static PyObject *__pyx_kp_s_115;
static PyObject *__pyx_kp_s_117;
static PyObject *__pyx_kp_s_119;
static PyObject *__pyx_kp_s_12;
static PyObject *__pyx_kp_s_121;
static PyObject *__pyx_kp_s_123;
static PyObject *__pyx_kp_s_126;
static PyObject *__pyx_n_s_129;
static PyObject *__pyx_kp_s_13;
static PyObject *__pyx_n_s_130;
static PyObject *__pyx_n_s_131;
static PyObject *__pyx_kp_s_135;
static PyObject *__pyx_kp_s_137;
static PyObject *__pyx_n_s_140;
static PyObject *__pyx_kp_s_141;
static PyObject *__pyx_kp_s_143;
static PyObject *__pyx_n_s_145;
static PyObject *__pyx_n_s_146;
static PyObject *__pyx_n_s_147;
static PyObject *__pyx_n_s_148;
static PyObject *__pyx_n_s_149;
static PyObject *__pyx_n_s_150;
static PyObject *__pyx_kp_s_152;
static PyObject *__pyx_kp_s_154;
static PyObject *__pyx_kp_s_156;
static PyObject *__pyx_kp_s_158;
static PyObject *__pyx_kp_s_160;
static PyObject *__pyx_kp_s_162;
static PyObject *__pyx_kp_s_164;
static PyObject *__pyx_kp_s_166;
static PyObject *__pyx_kp_s_167;
static PyObject *__pyx_n_s_169;
static PyObject *__pyx_n_s_170;
static PyObject *__pyx_kp_s_172;
static PyObject *__pyx_n_s_173;
static PyObject *__pyx_kp_s_174;
static PyObject *__pyx_kp_s_176;
static PyObject *__pyx_kp_s_179;
static PyObject *__pyx_kp_s_18;
static PyObject *__pyx_kp_s_181;
static PyObject *__pyx_kp_s_183;
static PyObject *__pyx_kp_s_185;
static PyObject *__pyx_kp_s_188;
static PyObject *__pyx_kp_s_196;
static PyObject *__pyx_kp_s_199;
static PyObject *__pyx_kp_s_2;
static PyObject *__pyx_kp_s_20;
static PyObject *__pyx_kp_s_200;
static PyObject *__pyx_kp_s_202;
static PyObject *__pyx_kp_s_203;
static PyObject *__pyx_kp_s_205;
static PyObject *__pyx_kp_s_206;
static PyObject *__pyx_kp_s_208;
static PyObject *__pyx_kp_s_21;
static PyObject *__pyx_kp_s_210;
static PyObject *__pyx_kp_s_230;
static PyObject *__pyx_kp_s_235;
static PyObject *__pyx_kp_s_237;
static PyObject *__pyx_kp_s_239;
static PyObject *__pyx_kp_s_241;
static PyObject *__pyx_kp_s_243;
static PyObject *__pyx_kp_s_245;
static PyObject *__pyx_kp_s_247;
static PyObject *__pyx_kp_s_249;
static PyObject *__pyx_kp_s_251;
static PyObject *__pyx_kp_s_253;
static PyObject *__pyx_kp_s_255;
static PyObject *__pyx_n_s_257;
static PyObject *__pyx_n_s_258;
static PyObject *__pyx_kp_s_260;
static PyObject *__pyx_kp_s_263;
static PyObject *__pyx_n_s_271;
static PyObject *__pyx_n_s_275;
static PyObject *__pyx_kp_s_276;
static PyObject *__pyx_kp_s_278;
static PyObject *__pyx_kp_s_280;
static PyObject *__pyx_kp_s_282;
static PyObject *__pyx_kp_s_285;
static PyObject *__pyx_kp_s_286;
static PyObject *__pyx_n_s_288;
static PyObject *__pyx_n_s_289;
static PyObject *__pyx_kp_s_290;
static PyObject *__pyx_kp_s_292;
static PyObject *__pyx_n_s_294;
static PyObject *__pyx_kp_s_295;
static PyObject *__pyx_n_s_297;
static PyObject *__pyx_n_s_298;
static PyObject *__pyx_kp_s_299;
static PyObject *__pyx_kp_s_30;
static PyObject *__pyx_n_s_302;
static PyObject *__pyx_n_s_303;
static PyObject *__pyx_kp_s_308;
static PyObject *__pyx_kp_s_310;
static PyObject *__pyx_n_s_312;
static PyObject *__pyx_kp_s_313;
static PyObject *__pyx_kp_s_315;
static PyObject *__pyx_kp_s_317;
static PyObject *__pyx_kp_s_32;
static PyObject *__pyx_kp_s_322;
static PyObject *__pyx_n_s_324;
static PyObject *__pyx_kp_s_325;
static PyObject *__pyx_kp_s_328;
static PyObject *__pyx_kp_s_33;
static PyObject *__pyx_kp_s_336;
static PyObject *__pyx_kp_s_338;
static PyObject *__pyx_n_s_349;
static PyObject *__pyx_kp_s_35;
static PyObject *__pyx_n_s_350;
static PyObject *__pyx_n_s_351;
static PyObject *__pyx_kp_s_354;
static PyObject *__pyx_n_s_358;
static PyObject *__pyx_n_s_359;
static PyObject *__pyx_n_s_360;
static PyObject *__pyx_n_s_361;
static PyObject *__pyx_kp_s_362;
static PyObject *__pyx_kp_s_364;
static PyObject *__pyx_n_s_368;
static PyObject *__pyx_kp_s_37;
static PyObject *__pyx_n_s_376;
static PyObject *__pyx_n_s_377;
static PyObject *__pyx_n_s_379;
static PyObject *__pyx_n_s_381;
static PyObject *__pyx_kp_s_383;
static PyObject *__pyx_kp_s_388;
static PyObject *__pyx_kp_s_39;
static PyObject *__pyx_kp_s_398;
static PyObject *__pyx_kp_s_4;
static PyObject *__pyx_kp_s_40;
static PyObject *__pyx_n_s_400;
static PyObject *__pyx_kp_s_402;
static PyObject *__pyx_kp_s_403;
static PyObject *__pyx_kp_s_406;
static PyObject *__pyx_kp_s_408;
static PyObject *__pyx_kp_s_409;
static PyObject *__pyx_kp_s_412;
static PyObject *__pyx_kp_s_413;
static PyObject *__pyx_kp_u_415;
static PyObject *__pyx_kp_u_417;
static PyObject *__pyx_kp_u_419;
static PyObject *__pyx_kp_s_42;
static PyObject *__pyx_kp_u_421;
static PyObject *__pyx_kp_u_422;
static PyObject *__pyx_kp_u_425;
static PyObject *__pyx_n_s_428;
static PyObject *__pyx_n_s_429;
static PyObject *__pyx_n_s_430;
static PyObject *__pyx_n_s_431;
static PyObject *__pyx_n_s_432;
static PyObject *__pyx_kp_s_435;
static PyObject *__pyx_n_s_436;
static PyObject *__pyx_kp_s_44;
static PyObject *__pyx_kp_s_443;
static PyObject *__pyx_kp_s_444;
static PyObject *__pyx_n_s_445;
static PyObject *__pyx_kp_s_446;
static PyObject *__pyx_n_s_448;
static PyObject *__pyx_n_s_449;
static PyObject *__pyx_kp_s_45;
static PyObject *__pyx_n_s_450;
static PyObject *__pyx_kp_s_451;
static PyObject *__pyx_n_s_452;
static PyObject *__pyx_kp_s_453;
static PyObject *__pyx_n_s_454;
static PyObject *__pyx_n_s_455;
static PyObject *__pyx_n_s_456;
static PyObject *__pyx_n_s_457;
static PyObject *__pyx_kp_s_458;
static PyObject *__pyx_n_s_459;
static PyObject *__pyx_kp_s_460;
static PyObject *__pyx_kp_s_461;
static PyObject *__pyx_kp_s_462;
static PyObject *__pyx_kp_s_463;
static PyObject *__pyx_n_s_468;
static PyObject *__pyx_n_s_48;
static PyObject *__pyx_kp_s_49;
static PyObject *__pyx_kp_s_5;
static PyObject *__pyx_kp_s_51;
static PyObject *__pyx_n_s_53;
static PyObject *__pyx_kp_s_54;
static PyObject *__pyx_kp_s_56;
static PyObject *__pyx_kp_s_58;
static PyObject *__pyx_kp_s_6;
static PyObject *__pyx_kp_s_60;
static PyObject *__pyx_kp_s_63;
static PyObject *__pyx_kp_s_65;
static PyObject *__pyx_kp_s_68;
static PyObject *__pyx_kp_s_70;
static PyObject *__pyx_kp_s_72;
static PyObject *__pyx_kp_s_75;
static PyObject *__pyx_kp_s_77;
static PyObject *__pyx_kp_s_79;
static PyObject *__pyx_n_s_8;
static PyObject *__pyx_kp_s_81;
static PyObject *__pyx_kp_s_82;
static PyObject *__pyx_n_s_85;
static PyObject *__pyx_n_s_86;
static PyObject *__pyx_n_s_87;
static PyObject *__pyx_kp_s_88;
static PyObject *__pyx_kp_s_89;
static PyObject *__pyx_kp_s_9;
static PyObject *__pyx_kp_s_91;
static PyObject *__pyx_kp_s_93;
static PyObject *__pyx_kp_s_94;
static PyObject *__pyx_kp_s_96;
static PyObject *__pyx_kp_s_98;
static PyObject *__pyx_n_s__A;
static PyObject *__pyx_n_s__AlgorithmBase;
static PyObject *__pyx_n_s__AssimuloFMIAlg;
static PyObject *__pyx_n_s__B;
static PyObject *__pyx_n_s__C;
static PyObject *__pyx_n_s__CS;
static PyObject *__pyx_n_s__D;
static PyObject *__pyx_n_s__Default;
static PyObject *__pyx_n_s__Exception;
static PyObject *__pyx_n_s__FMI1_DO_STEP_STATUS;
static PyObject *__pyx_n_s__FMI1_PENDING_STATUS;
static PyObject *__pyx_n_s__FMI2_BOOLEAN;
static PyObject *__pyx_n_s__FMI2_CONSTANT;
static PyObject *__pyx_n_s__FMI2_CONTINUOUS;
static PyObject *__pyx_n_s__FMI2_DISCRETE;
static PyObject *__pyx_n_s__FMI2_ENUMERATION;
static PyObject *__pyx_n_s__FMI2_FALSE;
static PyObject *__pyx_n_s__FMI2_FIXED;
static PyObject *__pyx_n_s__FMI2_INITIAL_APPROX;
static PyObject *__pyx_n_s__FMI2_INITIAL_EXACT;
static PyObject *__pyx_n_s__FMI2_INPUT;
static PyObject *__pyx_n_s__FMI2_INTEGER;
static PyObject *__pyx_n_s__FMI2_OUTPUT;
static PyObject *__pyx_n_s__FMI2_REAL;
static PyObject *__pyx_n_s__FMI2_STRING;
static PyObject *__pyx_n_s__FMI2_TRUE;
static PyObject *__pyx_n_s__FMI2_TUNABLE;
static PyObject *__pyx_n_s__FMI2_UNKNOWN;
static PyObject *__pyx_n_s__FMICSAlg;
static PyObject *__pyx_n_s__FMI_ALIAS;
static PyObject *__pyx_n_s__FMI_BOOLEAN;
static PyObject *__pyx_n_s__FMI_CONSTANT;
static PyObject *__pyx_n_s__FMI_CONTINUOUS;
static PyObject *__pyx_n_s__FMI_CS_STANDALONE;
static PyObject *__pyx_n_s__FMI_DERIVATIVES;
static PyObject *__pyx_n_s__FMI_DISCARD;
static PyObject *__pyx_n_s__FMI_DISCRETE;
static PyObject *__pyx_n_s__FMI_ENUMERATION;
static PyObject *__pyx_n_s__FMI_ERROR;
static PyObject *__pyx_n_s__FMI_FALSE;
static PyObject *__pyx_n_s__FMI_FATAL;
static PyObject *__pyx_n_s__FMI_INPUT;
static PyObject *__pyx_n_s__FMI_INPUTS;
static PyObject *__pyx_n_s__FMI_INTEGER;
static PyObject *__pyx_n_s__FMI_INTERNAL;
static PyObject *__pyx_n_s__FMI_ME;
static PyObject *__pyx_n_s__FMI_NEGATED_ALIAS;
static PyObject *__pyx_n_s__FMI_NONE;
static PyObject *__pyx_n_s__FMI_NO_ALIAS;
static PyObject *__pyx_n_s__FMI_OK;
static PyObject *__pyx_n_s__FMI_OUTPUT;
static PyObject *__pyx_n_s__FMI_OUTPUTS;
static PyObject *__pyx_n_s__FMI_PARAMETER;
static PyObject *__pyx_n_s__FMI_PENDING;
static PyObject *__pyx_n_s__FMI_REAL;
static PyObject *__pyx_n_s__FMI_STATES;
static PyObject *__pyx_n_s__FMI_STRING;
static PyObject *__pyx_n_s__FMI_TRUE;
static PyObject *__pyx_n_s__FMI_WARNING;
static PyObject *__pyx_n_s__FMUException;
static PyObject *__pyx_n_s__ME;
static PyObject *__pyx_n_s__Model;
static PyObject *__pyx_n_s__N;
static PyObject *__pyx_n_s__NotImplementedError;
static PyObject *__pyx_n_s__OrderedDict;
static PyObject *__pyx_n_s__PyEventInfo;
static PyObject *__pyx_n_s__RuntimeError;
static PyObject *__pyx_n_s__SciEstAlg;
static PyObject *__pyx_n_s__Slave;
static PyObject *__pyx_n_s__StopTimeDefined;
static PyObject *__pyx_n_s__ValueError;
static PyObject *__pyx_n_s____enter__;
static PyObject *__pyx_n_s____exit__;
static PyObject *__pyx_n_s____import__;
static PyObject *__pyx_n_s____init__;
static PyObject *__pyx_n_s____main__;
static PyObject *__pyx_n_s____test__;
static PyObject *__pyx_n_s___convert_filter;
static PyObject *__pyx_n_s___default_options;
static PyObject *__pyx_n_s___fmu;
static PyObject *__pyx_n_s___get;
static PyObject *__pyx_n_s___get_A;
static PyObject *__pyx_n_s___get_B;
static PyObject *__pyx_n_s___get_C;
static PyObject *__pyx_n_s___get_D;
static PyObject *__pyx_n_s___get_alias;
static PyObject *__pyx_n_s___get_causality;
static PyObject *__pyx_n_s___get_description;
static PyObject *__pyx_n_s___get_initial;
static PyObject *__pyx_n_s___get_name;
static PyObject *__pyx_n_s___get_time;
static PyObject *__pyx_n_s___get_type;
static PyObject *__pyx_n_s___get_types_platform;
static PyObject *__pyx_n_s___get_variability;
static PyObject *__pyx_n_s___get_version;
static PyObject *__pyx_n_s___set;
static PyObject *__pyx_n_s___set_time;
static PyObject *__pyx_n_s__a;
static PyObject *__pyx_n_s__abspath;
static PyObject *__pyx_n_s__add_diag;
static PyObject *__pyx_n_s__alg;
static PyObject *__pyx_n_s__algdrive;
static PyObject *__pyx_n_s__algorithm;
static PyObject *__pyx_n_s__algorithm_drivers;
static PyObject *__pyx_n_s__alias;
static PyObject *__pyx_n_s__allocated_context;
static PyObject *__pyx_n_s__allocated_xml;
static PyObject *__pyx_n_s__array;
static PyObject *__pyx_n_s__auto;
static PyObject *__pyx_n_s__base_path;
static PyObject *__pyx_n_s__basestring;
static PyObject *__pyx_n_s__callBackFunctions;
static PyObject *__pyx_n_s__callBackFunctions_1;
static PyObject *__pyx_n_s__callBackFunctions_2;
static PyObject *__pyx_n_s__callbacks;
static PyObject *__pyx_n_s__canHandleEvents;
static PyObject *__pyx_n_s__canRejectSteps;
static PyObject *__pyx_n_s__canSignalEvents;
static PyObject *__pyx_n_s__categories;
static PyObject *__pyx_n_s__causality;
static PyObject *__pyx_n_s__codecs;
static PyObject *__pyx_n_s__collections;
static PyObject *__pyx_n_s__compile;
static PyObject *__pyx_n_s__context;
static PyObject *__pyx_n_s__continuous_states;
static PyObject *__pyx_n_s__cpr_seed;
static PyObject *__pyx_n_s__create_temp_dir;
static PyObject *__pyx_n_s__create_temp_file;
static PyObject *__pyx_n_s__csc_matrix;
static PyObject *__pyx_n_s__current_t;
static PyObject *__pyx_n_s__decode;
static PyObject *__pyx_n_s__delete_temp_dir;
static PyObject *__pyx_n_s__delete_temp_file;
static PyObject *__pyx_n_s__description;
static PyObject *__pyx_n_s__do_step;
static PyObject *__pyx_n_s__doc;
static PyObject *__pyx_n_s__double;
static PyObject *__pyx_n_s__dtype;
static PyObject *__pyx_n_s__empty;
static PyObject *__pyx_n_s__enable_logging;
static PyObject *__pyx_n_s__encode;
static PyObject *__pyx_n_s__end_lines;
static PyObject *__pyx_n_s__endswith;
static PyObject *__pyx_n_s__eps;
static PyObject *__pyx_n_s__extend;
static PyObject *__pyx_n_s__fget;
static PyObject *__pyx_n_s__file;
static PyObject *__pyx_n_s__filter;
static PyObject *__pyx_n_s__final_time;
static PyObject *__pyx_n_s__finfo;
static PyObject *__pyx_n_s__flat;
static PyObject *__pyx_n_s__flatten;
static PyObject *__pyx_n_s__float;
static PyObject *__pyx_n_s__fmu;
static PyObject *__pyx_n_s__fmu_1;
static PyObject *__pyx_n_s__fmu_1_kind;
static PyObject *__pyx_n_s__fmu_2;
static PyObject *__pyx_n_s__fmu_2_kind;
static PyObject *__pyx_n_s__fmu_full_path;
static PyObject *__pyx_n_s__fmu_kind;
static PyObject *__pyx_n_s__fmu_temp_dir;
static PyObject *__pyx_n_s__fnmatch;
static PyObject *__pyx_n_s__func_ref;
static PyObject *__pyx_n_s__get_boolean;
static PyObject *__pyx_n_s__get_default_options;
static PyObject *__pyx_n_s__get_derivatives;
static PyObject *__pyx_n_s__get_input_list;
static PyObject *__pyx_n_s__get_integer;
static PyObject *__pyx_n_s__get_log;
static PyObject *__pyx_n_s__get_model_variables;
static PyObject *__pyx_n_s__get_output_list;
static PyObject *__pyx_n_s__get_real;
static PyObject *__pyx_n_s__get_result;
static PyObject *__pyx_n_s__get_states_list;
static PyObject *__pyx_n_s__get_string;
static PyObject *__pyx_n_s__get_variable_fixed;
static PyObject *__pyx_n_s__get_variable_max;
static PyObject *__pyx_n_s__get_variable_min;
static PyObject *__pyx_n_s__get_variable_start;
static PyObject *__pyx_n_s__group;
static PyObject *__pyx_n_s__i;
static PyObject *__pyx_n_s__include_alias;
static PyObject *__pyx_n_s__initial;
static PyObject *__pyx_n_s__input;
static PyObject *__pyx_n_s__instantiate;
static PyObject *__pyx_n_s__instantiate_model;
static PyObject *__pyx_n_s__instantiate_slave;
static PyObject *__pyx_n_s__int;
static PyObject *__pyx_n_s__int32;
static PyObject *__pyx_n_s__intermediateResult;
static PyObject *__pyx_n_s__isfile;
static PyObject *__pyx_n_s__iterationConverged;
static PyObject *__pyx_n_s__join;
static PyObject *__pyx_n_s__keys;
static PyObject *__pyx_n_s__kind;
static PyObject *__pyx_n_s__last_error;
static PyObject *__pyx_n_s__latin_1_encode;
static PyObject *__pyx_n_s__line;
static PyObject *__pyx_n_s__load_fmu;
static PyObject *__pyx_n_s__load_fmu_deprecated;
static PyObject *__pyx_n_s__log;
static PyObject *__pyx_n_s__log_file;
static PyObject *__pyx_n_s__log_file_c;
static PyObject *__pyx_n_s__log_file_name;
static PyObject *__pyx_n_s__log_level;
static PyObject *__pyx_n_s__logging;
static PyObject *__pyx_n_s__logging_on;
static PyObject *__pyx_n_s__lower;
static PyObject *__pyx_n_s__match;
static PyObject *__pyx_n_s__measurements;
static PyObject *__pyx_n_s__message;
static PyObject *__pyx_n_s__model;
static PyObject *__pyx_n_s__module;
static PyObject *__pyx_n_s__name;
static PyObject *__pyx_n_s__ndmin;
static PyObject *__pyx_n_s__needsExecutionTool;
static PyObject *__pyx_n_s__new_step;
static PyObject *__pyx_n_s__nextEventTime;
static PyObject *__pyx_n_s__numpy;
static PyObject *__pyx_n_s__only_fixed;
static PyObject *__pyx_n_s__only_start;
static PyObject *__pyx_n_s__open;
static PyObject *__pyx_n_s__options;
static PyObject *__pyx_n_s__order;
static PyObject *__pyx_n_s__orders;
static PyObject *__pyx_n_s__os;
static PyObject *__pyx_n_s__parameters;
static PyObject *__pyx_n_s__path;
static PyObject *__pyx_n_s__prod;
static PyObject *__pyx_n_s__property;
static PyObject *__pyx_n_s__python3_flag;
static PyObject *__pyx_n_s__r;
static PyObject *__pyx_n_s__range;
static PyObject *__pyx_n_s__ravel;
static PyObject *__pyx_n_s__re;
static PyObject *__pyx_n_s__readline;
static PyObject *__pyx_n_s__relativeTolerance;
static PyObject *__pyx_n_s__self;
static PyObject *__pyx_n_s__serialize_fmu_state;
static PyObject *__pyx_n_s__set_boolean;
static PyObject *__pyx_n_s__set_integer;
static PyObject *__pyx_n_s__set_log_level;
static PyObject *__pyx_n_s__set_real;
static PyObject *__pyx_n_s__set_string;
static PyObject *__pyx_n_s__size;
static PyObject *__pyx_n_s__solve;
static PyObject *__pyx_n_s__sp;
static PyObject *__pyx_n_s__start_lines;
static PyObject *__pyx_n_s__start_time;
static PyObject *__pyx_n_s__state;
static PyObject *__pyx_n_s__stateValuesChanged;
static PyObject *__pyx_n_s__step_size;
static PyObject *__pyx_n_s__stop_time;
static PyObject *__pyx_n_s__stop_time_defined;
static PyObject *__pyx_n_s__strip;
static PyObject *__pyx_n_s__structured;
static PyObject *__pyx_n_s__sum;
static PyObject *__pyx_n_s__sys;
static PyObject *__pyx_n_s__tStart;
static PyObject *__pyx_n_s__tStop;
static PyObject *__pyx_n_s__terminateSimulation;
static PyObject *__pyx_n_s__time;
static PyObject *__pyx_n_s__tolControlled;
static PyObject *__pyx_n_s__tolerance;
static PyObject *__pyx_n_s__tolerance_defined;
static PyObject *__pyx_n_s__translate;
static PyObject *__pyx_n_s__type;
static PyObject *__pyx_n_s__types_platform;
static PyObject *__pyx_n_s__uint32;
static PyObject *__pyx_n_s__unknown;
static PyObject *__pyx_n_s__upcomingTimeEvent;
static PyObject *__pyx_n_s__upper;
static PyObject *__pyx_n_s__v;
static PyObject *__pyx_n_s__value;
static PyObject *__pyx_n_s__value_reference;
static PyObject *__pyx_n_s__valueref;
static PyObject *__pyx_n_s__values;
static PyObject *__pyx_n_s__var_ref;
static PyObject *__pyx_n_s__variability;
static PyObject *__pyx_n_s__variable_name;
static PyObject *__pyx_n_s__variables;
static PyObject *__pyx_n_s__version;
static PyObject *__pyx_n_s__visible;
static PyObject *__pyx_n_s__w;
static PyObject *__pyx_n_s__warning;
static PyObject *__pyx_n_s__write;
static PyObject *__pyx_n_s__x;
static PyObject *__pyx_n_s__xrange;
static PyObject *__pyx_n_s__zeros;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_3;
static PyObject *__pyx_int_4;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_int_15;
static PyObject *__pyx_k_7;
static PyObject *__pyx_k_23;
static PyObject *__pyx_k_24;
static PyObject *__pyx_k_25;
static PyObject *__pyx_k_26;
static PyObject *__pyx_k_27;
static PyObject *__pyx_k_28;
static PyObject *__pyx_k_29;
static PyObject *__pyx_k_31;
static PyObject *__pyx_k_100;
static PyObject *__pyx_k_101;
static PyObject *__pyx_k_102;
static PyObject *__pyx_k_106;
static PyObject *__pyx_k_109;
static PyObject *__pyx_k_128;
static PyObject *__pyx_k_132;
static PyObject *__pyx_k_133;
static PyObject *__pyx_k_134;
static PyObject *__pyx_k_139;
static PyObject *__pyx_k_151;
static PyObject *__pyx_k_171;
static PyObject *__pyx_k_178;
static PyObject *__pyx_k_187;
static PyObject *__pyx_k_191;
static PyObject *__pyx_k_192;
static PyObject *__pyx_k_229;
static PyObject *__pyx_k_233;
static PyObject *__pyx_k_234;
static PyObject *__pyx_k_262;
static PyObject *__pyx_k_268;
static PyObject *__pyx_k_269;
static PyObject *__pyx_k_270;
static PyObject *__pyx_k_301;
static PyObject *__pyx_k_304;
static PyObject *__pyx_k_305;
static PyObject *__pyx_k_306;
static PyObject *__pyx_k_307;
static PyObject *__pyx_k_320;
static PyObject *__pyx_k_321;
static PyObject *__pyx_k_327;
static PyObject *__pyx_k_348;
static PyObject *__pyx_k_352;
static PyObject *__pyx_k_353;
static PyObject *__pyx_k_367;
static PyObject *__pyx_k_369;
static PyObject *__pyx_k_375;
static PyObject *__pyx_k_378;
static PyObject *__pyx_k_380;
static PyObject *__pyx_k_382;
static PyObject *__pyx_k_384;
static PyObject *__pyx_k_394;
static PyObject *__pyx_k_tuple_3;
static PyObject *__pyx_k_tuple_10;
static PyObject *__pyx_k_tuple_14;
static PyObject *__pyx_k_tuple_15;
static PyObject *__pyx_k_tuple_16;
static PyObject *__pyx_k_tuple_17;
static PyObject *__pyx_k_tuple_19;
static PyObject *__pyx_k_tuple_22;
static PyObject *__pyx_k_tuple_34;
static PyObject *__pyx_k_tuple_36;
static PyObject *__pyx_k_tuple_38;
static PyObject *__pyx_k_tuple_41;
static PyObject *__pyx_k_tuple_43;
static PyObject *__pyx_k_tuple_46;
static PyObject *__pyx_k_tuple_47;
static PyObject *__pyx_k_tuple_50;
static PyObject *__pyx_k_tuple_52;
static PyObject *__pyx_k_tuple_55;
static PyObject *__pyx_k_tuple_57;
static PyObject *__pyx_k_tuple_59;
static PyObject *__pyx_k_tuple_61;
static PyObject *__pyx_k_tuple_62;
static PyObject *__pyx_k_tuple_64;
static PyObject *__pyx_k_tuple_66;
static PyObject *__pyx_k_tuple_67;
static PyObject *__pyx_k_tuple_69;
static PyObject *__pyx_k_tuple_71;
static PyObject *__pyx_k_tuple_73;
static PyObject *__pyx_k_tuple_74;
static PyObject *__pyx_k_tuple_76;
static PyObject *__pyx_k_tuple_78;
static PyObject *__pyx_k_tuple_80;
static PyObject *__pyx_k_tuple_83;
static PyObject *__pyx_k_tuple_84;
static PyObject *__pyx_k_tuple_90;
static PyObject *__pyx_k_tuple_92;
static PyObject *__pyx_k_tuple_95;
static PyObject *__pyx_k_tuple_97;
static PyObject *__pyx_k_tuple_99;
static PyObject *__pyx_k_tuple_108;
static PyObject *__pyx_k_tuple_112;
static PyObject *__pyx_k_tuple_114;
static PyObject *__pyx_k_tuple_116;
static PyObject *__pyx_k_tuple_118;
static PyObject *__pyx_k_tuple_120;
static PyObject *__pyx_k_tuple_122;
static PyObject *__pyx_k_tuple_124;
static PyObject *__pyx_k_tuple_125;
static PyObject *__pyx_k_tuple_127;
static PyObject *__pyx_k_tuple_136;
static PyObject *__pyx_k_tuple_138;
static PyObject *__pyx_k_tuple_142;
static PyObject *__pyx_k_tuple_144;
static PyObject *__pyx_k_tuple_153;
static PyObject *__pyx_k_tuple_155;
static PyObject *__pyx_k_tuple_157;
static PyObject *__pyx_k_tuple_159;
static PyObject *__pyx_k_tuple_161;
static PyObject *__pyx_k_tuple_163;
static PyObject *__pyx_k_tuple_165;
static PyObject *__pyx_k_tuple_168;
static PyObject *__pyx_k_tuple_175;
static PyObject *__pyx_k_tuple_177;
static PyObject *__pyx_k_tuple_180;
static PyObject *__pyx_k_tuple_182;
static PyObject *__pyx_k_tuple_184;
static PyObject *__pyx_k_tuple_186;
static PyObject *__pyx_k_tuple_189;
static PyObject *__pyx_k_tuple_190;
static PyObject *__pyx_k_tuple_193;
static PyObject *__pyx_k_tuple_194;
static PyObject *__pyx_k_tuple_195;
static PyObject *__pyx_k_tuple_197;
static PyObject *__pyx_k_tuple_198;
static PyObject *__pyx_k_tuple_201;
static PyObject *__pyx_k_tuple_204;
static PyObject *__pyx_k_tuple_207;
static PyObject *__pyx_k_tuple_209;
static PyObject *__pyx_k_tuple_211;
static PyObject *__pyx_k_tuple_212;
static PyObject *__pyx_k_tuple_213;
static PyObject *__pyx_k_tuple_214;
static PyObject *__pyx_k_tuple_215;
static PyObject *__pyx_k_tuple_216;
static PyObject *__pyx_k_tuple_217;
static PyObject *__pyx_k_tuple_218;
static PyObject *__pyx_k_tuple_219;
static PyObject *__pyx_k_tuple_220;
static PyObject *__pyx_k_tuple_221;
static PyObject *__pyx_k_tuple_222;
static PyObject *__pyx_k_tuple_223;
static PyObject *__pyx_k_tuple_224;
static PyObject *__pyx_k_tuple_225;
static PyObject *__pyx_k_tuple_226;
static PyObject *__pyx_k_tuple_227;
static PyObject *__pyx_k_tuple_228;
static PyObject *__pyx_k_tuple_231;
static PyObject *__pyx_k_tuple_232;
static PyObject *__pyx_k_tuple_236;
static PyObject *__pyx_k_tuple_238;
static PyObject *__pyx_k_tuple_240;
static PyObject *__pyx_k_tuple_242;
static PyObject *__pyx_k_tuple_244;
static PyObject *__pyx_k_tuple_246;
static PyObject *__pyx_k_tuple_248;
static PyObject *__pyx_k_tuple_250;
static PyObject *__pyx_k_tuple_252;
static PyObject *__pyx_k_tuple_254;
static PyObject *__pyx_k_tuple_256;
static PyObject *__pyx_k_tuple_259;
static PyObject *__pyx_k_tuple_261;
static PyObject *__pyx_k_tuple_264;
static PyObject *__pyx_k_tuple_265;
static PyObject *__pyx_k_tuple_266;
static PyObject *__pyx_k_tuple_267;
static PyObject *__pyx_k_tuple_272;
static PyObject *__pyx_k_tuple_273;
static PyObject *__pyx_k_tuple_274;
static PyObject *__pyx_k_tuple_277;
static PyObject *__pyx_k_tuple_279;
static PyObject *__pyx_k_tuple_281;
static PyObject *__pyx_k_tuple_283;
static PyObject *__pyx_k_tuple_284;
static PyObject *__pyx_k_tuple_287;
static PyObject *__pyx_k_tuple_291;
static PyObject *__pyx_k_tuple_293;
static PyObject *__pyx_k_tuple_296;
static PyObject *__pyx_k_tuple_300;
static PyObject *__pyx_k_tuple_309;
static PyObject *__pyx_k_tuple_311;
static PyObject *__pyx_k_tuple_314;
static PyObject *__pyx_k_tuple_316;
static PyObject *__pyx_k_tuple_318;
static PyObject *__pyx_k_tuple_319;
static PyObject *__pyx_k_tuple_323;
static PyObject *__pyx_k_tuple_326;
static PyObject *__pyx_k_tuple_329;
static PyObject *__pyx_k_tuple_330;
static PyObject *__pyx_k_tuple_331;
static PyObject *__pyx_k_tuple_332;
static PyObject *__pyx_k_tuple_333;
static PyObject *__pyx_k_tuple_334;
static PyObject *__pyx_k_tuple_335;
static PyObject *__pyx_k_tuple_337;
static PyObject *__pyx_k_tuple_339;
static PyObject *__pyx_k_tuple_340;
static PyObject *__pyx_k_tuple_341;
static PyObject *__pyx_k_tuple_342;
static PyObject *__pyx_k_tuple_343;
static PyObject *__pyx_k_tuple_344;
static PyObject *__pyx_k_tuple_345;
static PyObject *__pyx_k_tuple_346;
static PyObject *__pyx_k_tuple_347;
static PyObject *__pyx_k_tuple_355;
static PyObject *__pyx_k_tuple_356;
static PyObject *__pyx_k_tuple_357;
static PyObject *__pyx_k_tuple_363;
static PyObject *__pyx_k_tuple_365;
static PyObject *__pyx_k_tuple_366;
static PyObject *__pyx_k_tuple_370;
static PyObject *__pyx_k_tuple_371;
static PyObject *__pyx_k_tuple_372;
static PyObject *__pyx_k_tuple_373;
static PyObject *__pyx_k_tuple_374;
static PyObject *__pyx_k_tuple_385;
static PyObject *__pyx_k_tuple_386;
static PyObject *__pyx_k_tuple_387;
static PyObject *__pyx_k_tuple_389;
static PyObject *__pyx_k_tuple_390;
static PyObject *__pyx_k_tuple_391;
static PyObject *__pyx_k_tuple_392;
static PyObject *__pyx_k_tuple_393;
static PyObject *__pyx_k_tuple_395;
static PyObject *__pyx_k_tuple_396;
static PyObject *__pyx_k_tuple_397;
static PyObject *__pyx_k_tuple_399;
static PyObject *__pyx_k_tuple_401;
static PyObject *__pyx_k_tuple_404;
static PyObject *__pyx_k_tuple_405;
static PyObject *__pyx_k_tuple_407;
static PyObject *__pyx_k_tuple_410;
static PyObject *__pyx_k_tuple_411;
static PyObject *__pyx_k_tuple_414;
static PyObject *__pyx_k_tuple_416;
static PyObject *__pyx_k_tuple_418;
static PyObject *__pyx_k_tuple_420;
static PyObject *__pyx_k_tuple_423;
static PyObject *__pyx_k_tuple_424;
static PyObject *__pyx_k_tuple_426;
static PyObject *__pyx_k_tuple_433;
static PyObject *__pyx_k_tuple_437;
static PyObject *__pyx_k_tuple_439;
static PyObject *__pyx_k_tuple_441;
static PyObject *__pyx_k_tuple_447;
static PyObject *__pyx_k_tuple_464;
static PyObject *__pyx_k_tuple_466;
static PyObject *__pyx_k_tuple_469;
static PyObject *__pyx_k_codeobj_434;
static PyObject *__pyx_k_codeobj_438;
static PyObject *__pyx_k_codeobj_440;
static PyObject *__pyx_k_codeobj_442;
static PyObject *__pyx_k_codeobj_465;
static PyObject *__pyx_k_codeobj_467;
static PyObject *__pyx_k_codeobj_470;

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_1encode(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyMethodDef __pyx_mdef_5pyfmi_3fmi_1encode = {__Pyx_NAMESTR("encode"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_1encode, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_5pyfmi_3fmi_1encode(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("encode (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_encode(__pyx_self, ((PyObject *)__pyx_v_x));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":44
 * if python3_flag:
 *     import codecs
 *     def encode(x):             # <<<<<<<<<<<<<<
 *         return codecs.latin_1_encode(x)[0]
 *     def decode(x):
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __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("encode", 0);

  /* "pyfmi\fmi.pyx":45
 *     import codecs
 *     def encode(x):
 *         return codecs.latin_1_encode(x)[0]             # <<<<<<<<<<<<<<
 *     def decode(x):
 *         return x.decode()
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__codecs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__latin_1_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __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;
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_3decode(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyMethodDef __pyx_mdef_5pyfmi_3fmi_3decode = {__Pyx_NAMESTR("decode"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_3decode, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_5pyfmi_3fmi_3decode(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decode (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_2decode(__pyx_self, ((PyObject *)__pyx_v_x));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":46
 *     def encode(x):
 *         return codecs.latin_1_encode(x)[0]
 *     def decode(x):             # <<<<<<<<<<<<<<
 *         return x.decode()
 * else:
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_2decode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decode", 0);

  /* "pyfmi\fmi.pyx":47
 *         return codecs.latin_1_encode(x)[0]
 *     def decode(x):
 *         return x.decode()             # <<<<<<<<<<<<<<
 * else:
 *     def encode(x):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_x, __pyx_n_s__decode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __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 = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_5encode(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyMethodDef __pyx_mdef_5pyfmi_3fmi_5encode = {__Pyx_NAMESTR("encode"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_5encode, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_5pyfmi_3fmi_5encode(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("encode (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_4encode(__pyx_self, ((PyObject *)__pyx_v_x));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":49
 *         return x.decode()
 * else:
 *     def encode(x):             # <<<<<<<<<<<<<<
 *         return x
 *     def decode(x):
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_4encode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("encode", 0);

  /* "pyfmi\fmi.pyx":50
 * else:
 *     def encode(x):
 *         return x             # <<<<<<<<<<<<<<
 *     def decode(x):
 *         return x
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_x);
  __pyx_r = __pyx_v_x;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_7decode(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyMethodDef __pyx_mdef_5pyfmi_3fmi_7decode = {__Pyx_NAMESTR("decode"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_7decode, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_5pyfmi_3fmi_7decode(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decode (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_6decode(__pyx_self, ((PyObject *)__pyx_v_x));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":51
 *     def encode(x):
 *         return x
 *     def decode(x):             # <<<<<<<<<<<<<<
 *         return x
 * 
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_6decode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decode", 0);

  /* "pyfmi\fmi.pyx":52
 *         return x
 *     def decode(x):
 *         return x             # <<<<<<<<<<<<<<
 * 
 * int   = N.int32
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_x);
  __pyx_r = __pyx_v_x;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":143
 * 
 * #CALLBACKS
 * cdef void importlogger(FMIL.jm_callbacks* c, FMIL.jm_string module, int log_level, FMIL.jm_string message):             # <<<<<<<<<<<<<<
 *     #print "FMIL: module = %s, log level = %d: %s"%(module, log_level, message)
 *     if c.context != NULL:
 */

static void __pyx_f_5pyfmi_3fmi_importlogger(struct jm_callbacks *__pyx_v_c, jm_string __pyx_v_module, int __pyx_v_log_level, jm_string __pyx_v_message) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("importlogger", 0);

  /* "pyfmi\fmi.pyx":145
 * cdef void importlogger(FMIL.jm_callbacks* c, FMIL.jm_string module, int log_level, FMIL.jm_string message):
 *     #print "FMIL: module = %s, log level = %d: %s"%(module, log_level, message)
 *     if c.context != NULL:             # <<<<<<<<<<<<<<
 *         (<FMUModelBase>c.context)._logger(module,log_level,message)
 * 
 */
  __pyx_t_1 = (__pyx_v_c->context != NULL);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":146
 *     #print "FMIL: module = %s, log level = %d: %s"%(module, log_level, message)
 *     if c.context != NULL:
 *         (<FMUModelBase>c.context)._logger(module,log_level,message)             # <<<<<<<<<<<<<<
 * 
 * #CALLBACKS
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase *)((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_c->context)->__pyx_base.__pyx_vtab)->__pyx_base._logger(((struct __pyx_obj_5pyfmi_3fmi_ModelBase *)((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_c->context)), __pyx_v_module, __pyx_v_log_level, __pyx_v_message); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("pyfmi.fmi.importlogger", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyfmi\fmi.pyx":149
 * 
 * #CALLBACKS
 * cdef void importlogger2(FMIL.jm_callbacks* c, FMIL.jm_string module, int log_level, FMIL.jm_string message):             # <<<<<<<<<<<<<<
 *     #print "FMIL: module = %s, log lovel = %d: %s" %(module, log_level, message)
 *     if c.context != NULL:
 */

static void __pyx_f_5pyfmi_3fmi_importlogger2(struct jm_callbacks *__pyx_v_c, jm_string __pyx_v_module, int __pyx_v_log_level, jm_string __pyx_v_message) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("importlogger2", 0);

  /* "pyfmi\fmi.pyx":151
 * cdef void importlogger2(FMIL.jm_callbacks* c, FMIL.jm_string module, int log_level, FMIL.jm_string message):
 *     #print "FMIL: module = %s, log lovel = %d: %s" %(module, log_level, message)
 *     if c.context != NULL:             # <<<<<<<<<<<<<<
 *         (<FMUModelBase2>c.context)._logger(module, log_level, message)
 * 
 */
  __pyx_t_1 = (__pyx_v_c->context != NULL);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":152
 *     #print "FMIL: module = %s, log lovel = %d: %s" %(module, log_level, message)
 *     if c.context != NULL:
 *         (<FMUModelBase2>c.context)._logger(module, log_level, message)             # <<<<<<<<<<<<<<
 * 
 * cdef void  importlogger_fmi2(FMIL.fmi2_component_environment_t c, FMIL.fmi2_string_t instanceName, FMIL.fmi2_status_t status, FMIL.fmi2_string_t category, FMIL.fmi2_string_t message, ...):
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *)((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_c->context)->__pyx_base.__pyx_vtab)->__pyx_base._logger(((struct __pyx_obj_5pyfmi_3fmi_ModelBase *)((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_c->context)), __pyx_v_module, __pyx_v_log_level, __pyx_v_message); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("pyfmi.fmi.importlogger2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyfmi\fmi.pyx":154
 *         (<FMUModelBase2>c.context)._logger(module, log_level, message)
 * 
 * cdef void  importlogger_fmi2(FMIL.fmi2_component_environment_t c, FMIL.fmi2_string_t instanceName, FMIL.fmi2_status_t status, FMIL.fmi2_string_t category, FMIL.fmi2_string_t message, ...):             # <<<<<<<<<<<<<<
 *     print "FMIL: module = %s, log lovel = %d: %s" %(instanceName, status, category)
 *     #if c != NULL:
 */

static void __pyx_f_5pyfmi_3fmi_importlogger_fmi2(CYTHON_UNUSED fmi2_component_environment_t __pyx_v_c, fmi2_string_t __pyx_v_instanceName, fmi2_status_t __pyx_v_status, fmi2_string_t __pyx_v_category, CYTHON_UNUSED fmi2_string_t __pyx_v_message, ...) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("importlogger_fmi2", 0);

  /* "pyfmi\fmi.pyx":155
 * 
 * cdef void  importlogger_fmi2(FMIL.fmi2_component_environment_t c, FMIL.fmi2_string_t instanceName, FMIL.fmi2_status_t status, FMIL.fmi2_string_t category, FMIL.fmi2_string_t message, ...):
 *     print "FMIL: module = %s, log lovel = %d: %s" %(instanceName, status, category)             # <<<<<<<<<<<<<<
 *     #if c != NULL:
 *     #    (<FMUModelBase2>c)._logger(module, log_level, message)
 */
  __pyx_t_1 = PyBytes_FromString(__pyx_v_instanceName); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = PyInt_FromLong(__pyx_v_status); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyBytes_FromString(__pyx_v_category); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_t_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (__Pyx_PrintOne(0, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("pyfmi.fmi.importlogger_fmi2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyfmi\fmi.pyx":160
 * 
 * #CALLBACKS
 * cdef void importlogger_load_fmu(FMIL.jm_callbacks* c, FMIL.jm_string module, int log_level, FMIL.jm_string message):             # <<<<<<<<<<<<<<
 *     with open(<char*>c.context,'a') as file:
 *         file.write("FMIL: module = %s, log level = %d: %s\n"%(module, log_level, message))
 */

static void __pyx_f_5pyfmi_3fmi_importlogger_load_fmu(struct jm_callbacks *__pyx_v_c, jm_string __pyx_v_module, int __pyx_v_log_level, jm_string __pyx_v_message) {
  PyObject *__pyx_v_file = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("importlogger_load_fmu", 0);

  /* "pyfmi\fmi.pyx":161
 * #CALLBACKS
 * cdef void importlogger_load_fmu(FMIL.jm_callbacks* c, FMIL.jm_string module, int log_level, FMIL.jm_string message):
 *     with open(<char*>c.context,'a') as file:             # <<<<<<<<<<<<<<
 *         file.write("FMIL: module = %s, log level = %d: %s\n"%(module, log_level, message))
 *     #if log_level <= c.log_level:
 */
  /*with:*/ {
    __pyx_t_1 = PyBytes_FromString(((char *)__pyx_v_c->context)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
    __Pyx_INCREF(((PyObject *)__pyx_n_s__a));
    PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_n_s__a));
    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__a));
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_builtin_open, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____exit__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____enter__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /*try:*/ {
      {
        __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_5);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_7);
        /*try:*/ {
          __Pyx_INCREF(__pyx_t_4);
          __pyx_v_file = __pyx_t_4;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "pyfmi\fmi.pyx":162
 * cdef void importlogger_load_fmu(FMIL.jm_callbacks* c, FMIL.jm_string module, int log_level, FMIL.jm_string message):
 *     with open(<char*>c.context,'a') as file:
 *         file.write("FMIL: module = %s, log level = %d: %s\n"%(module, log_level, message))             # <<<<<<<<<<<<<<
 *     #if log_level <= c.log_level:
 *     #    print "FMIL: module = %s, log level = %d: %s"%(module, log_level, message)
 */
          __pyx_t_4 = PyObject_GetAttr(__pyx_v_file, __pyx_n_s__write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_1 = PyBytes_FromString(__pyx_v_module); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_1));
          __pyx_t_2 = PyInt_FromLong(__pyx_v_log_level); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_8 = PyBytes_FromString(__pyx_v_message); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_8));
          __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_t_1));
          __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
          PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_9, 2, ((PyObject *)__pyx_t_8));
          __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
          __pyx_t_1 = 0;
          __pyx_t_2 = 0;
          __pyx_t_8 = 0;
          __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_2), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_8));
          __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
          __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_t_8));
          __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
          __pyx_t_8 = 0;
          __pyx_t_8 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L14_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "pyfmi\fmi.pyx":161
 * #CALLBACKS
 * cdef void importlogger_load_fmu(FMIL.jm_callbacks* c, FMIL.jm_string module, int log_level, FMIL.jm_string message):
 *     with open(<char*>c.context,'a') as file:             # <<<<<<<<<<<<<<
 *         file.write("FMIL: module = %s, log level = %d: %s\n"%(module, log_level, message))
 *     #if log_level <= c.log_level:
 */
        /*except:*/ {
          __Pyx_AddTraceback("pyfmi.fmi.importlogger_load_fmu", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_9);
          PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_4);
          __pyx_t_11 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          __pyx_t_12 = (!__pyx_t_10);
          if (__pyx_t_12) {
            __Pyx_GIVEREF(__pyx_t_8);
            __Pyx_GIVEREF(__pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_4);
            __Pyx_ErrRestore(__pyx_t_8, __pyx_t_9, __pyx_t_4);
            __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_4 = 0; 
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
            goto __pyx_L18;
          }
          __pyx_L18:;
          __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
        __pyx_L14_try_end:;
      }
    }
    /*finally:*/ {
      if (__pyx_t_3) {
        __pyx_t_7 = PyObject_Call(__pyx_t_3, __pyx_k_tuple_3, NULL);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
    }
    goto __pyx_L19;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L1_error;
    __pyx_L19:;
  }

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_WriteUnraisable("pyfmi.fmi.importlogger_load_fmu", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_file);
  __Pyx_RefNannyFinishContext();
}

/* "pyfmi\fmi.pyx":168
 * 
 * #Old, use FMIL.fmi#_log_forwarding instead
 * cdef void fmilogger(FMIL.fmi1_component_t c, FMIL.fmi1_string_t instanceName, FMIL.fmi1_status_t status, FMIL.fmi1_string_t category, FMIL.fmi1_string_t message, ...):             # <<<<<<<<<<<<<<
 *     cdef char buf[1000]
 *     cdef FMIL.va_list args
 */

static void __pyx_f_5pyfmi_3fmi_fmilogger(CYTHON_UNUSED fmi1_component_t __pyx_v_c, fmi1_string_t __pyx_v_instanceName, fmi1_status_t __pyx_v_status, fmi1_string_t __pyx_v_category, fmi1_string_t __pyx_v_message, ...) {
  char __pyx_v_buf[1000];
  va_list __pyx_v_args;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fmilogger", 0);

  /* "pyfmi\fmi.pyx":171
 *     cdef char buf[1000]
 *     cdef FMIL.va_list args
 *     FMIL.va_start(args, message)             # <<<<<<<<<<<<<<
 *     FMIL.vsnprintf(buf, 1000, message, args)
 *     FMIL.va_end(args)
 */
  va_start(__pyx_v_args, __pyx_v_message);

  /* "pyfmi\fmi.pyx":172
 *     cdef FMIL.va_list args
 *     FMIL.va_start(args, message)
 *     FMIL.vsnprintf(buf, 1000, message, args)             # <<<<<<<<<<<<<<
 *     FMIL.va_end(args)
 *     print "FMU: fmiStatus = %d;  %s (%s): %s\n"%(status, instanceName, category, buf)
 */
  vsnprintf(__pyx_v_buf, 1000, __pyx_v_message, __pyx_v_args);

  /* "pyfmi\fmi.pyx":173
 *     FMIL.va_start(args, message)
 *     FMIL.vsnprintf(buf, 1000, message, args)
 *     FMIL.va_end(args)             # <<<<<<<<<<<<<<
 *     print "FMU: fmiStatus = %d;  %s (%s): %s\n"%(status, instanceName, category, buf)
 * 
 */
  va_end(__pyx_v_args);

  /* "pyfmi\fmi.pyx":174
 *     FMIL.vsnprintf(buf, 1000, message, args)
 *     FMIL.va_end(args)
 *     print "FMU: fmiStatus = %d;  %s (%s): %s\n"%(status, instanceName, category, buf)             # <<<<<<<<<<<<<<
 * 
 * cdef class ModelBase:
 */
  __pyx_t_1 = PyInt_FromLong(__pyx_v_status); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyBytes_FromString(__pyx_v_instanceName); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_3 = PyBytes_FromString(__pyx_v_category); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_4 = PyBytes_FromString(__pyx_v_buf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_t_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_t_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_4), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  if (__Pyx_PrintOne(0, ((PyObject *)__pyx_t_4)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("pyfmi.fmi.fmilogger", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_9ModelBase_1set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_9ModelBase_set[] = "\n        Sets the given value(s) to the specified variable name(s) into the\n        model. The method both accept a single variable and a list of variables.\n\n        Parameters::\n\n            variable_name --\n                The name of the variable(s) as string/list.\n\n            value --\n                The value(s) to set.\n\n        Example::\n\n            (FMU/JMU)Model.set('damper.d', 1.1)\n            (FMU/JMU)Model.set(['damper.d','gear.a'], [1.1, 10])\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_9ModelBase_1set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_variable_name = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__variable_name,&__pyx_n_s__value,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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__variable_name)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_variable_name = values[0];
    __pyx_v_value = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.ModelBase.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_9ModelBase_set(((struct __pyx_obj_5pyfmi_3fmi_ModelBase *)__pyx_v_self), __pyx_v_variable_name, __pyx_v_value);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":181
 *     """
 * 
 *     def set(self, variable_name, value):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the given value(s) to the specified variable name(s) into the
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_9ModelBase_set(struct __pyx_obj_5pyfmi_3fmi_ModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name, PyObject *__pyx_v_value) {
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set", 0);

  /* "pyfmi\fmi.pyx":199
 *             (FMU/JMU)Model.set(['damper.d','gear.a'], [1.1, 10])
 *         """
 *         if isinstance(variable_name, basestring):             # <<<<<<<<<<<<<<
 *             self._set(variable_name, value) #Scalar case
 *         else:
 */
  __pyx_t_1 = PyObject_IsInstance(__pyx_v_variable_name, __pyx_builtin_basestring); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":200
 *         """
 *         if isinstance(variable_name, basestring):
 *             self._set(variable_name, value) #Scalar case             # <<<<<<<<<<<<<<
 *         else:
 *             for i in xrange(len(variable_name)): #A list of variables
 */
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___set); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_variable_name);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_variable_name);
    __Pyx_GIVEREF(__pyx_v_variable_name);
    __Pyx_INCREF(__pyx_v_value);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_value);
    __Pyx_GIVEREF(__pyx_v_value);
    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":202
 *             self._set(variable_name, value) #Scalar case
 *         else:
 *             for i in xrange(len(variable_name)): #A list of variables             # <<<<<<<<<<<<<<
 *                 self._set(variable_name[i], value[i])
 * 
 */
    __pyx_t_5 = PyObject_Length(__pyx_v_variable_name); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_builtin_xrange, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
      __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    for (;;) {
      if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_3)) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_3)) {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_4 = __pyx_t_6(__pyx_t_3);
        if (unlikely(!__pyx_t_4)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XDECREF(__pyx_v_i);
      __pyx_v_i = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "pyfmi\fmi.pyx":203
 *         else:
 *             for i in xrange(len(variable_name)): #A list of variables
 *                 self._set(variable_name[i], value[i])             # <<<<<<<<<<<<<<
 * 
 *     def get(self, variable_name):
 */
      __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___set); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = PyObject_GetItem(__pyx_v_variable_name, __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = PyObject_GetItem(__pyx_v_value, __pyx_v_i); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      __pyx_t_2 = 0;
      __pyx_t_7 = 0;
      __pyx_t_7 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyfmi.fmi.ModelBase.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_9ModelBase_3get(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_9ModelBase_2get[] = "\n        Returns the value(s) of the specified variable(s). The method both\n        accept a single variable and a list of variables.\n\n        Parameters::\n\n            variable_name --\n                The name of the variable(s) as string/list.\n\n        Returns::\n\n            The value(s).\n\n        Example::\n\n            # Returns the variable d\n            (FMU/JMU)Model.get('damper.d')\n            # Returns a list of the variables\n            (FMU/JMU)Model.get(['damper.d','gear.a'])\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_9ModelBase_3get(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_9ModelBase_2get(((struct __pyx_obj_5pyfmi_3fmi_ModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":205
 *                 self._set(variable_name[i], value[i])
 * 
 *     def get(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the value(s) of the specified variable(s). The method both
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_9ModelBase_2get(struct __pyx_obj_5pyfmi_3fmi_ModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get", 0);

  /* "pyfmi\fmi.pyx":226
 *             (FMU/JMU)Model.get(['damper.d','gear.a'])
 *         """
 *         if isinstance(variable_name, basestring):             # <<<<<<<<<<<<<<
 *             return self._get(variable_name) #Scalar case
 *         else:
 */
  __pyx_t_1 = PyObject_IsInstance(__pyx_v_variable_name, __pyx_builtin_basestring); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":227
 *         """
 *         if isinstance(variable_name, basestring):
 *             return self._get(variable_name) #Scalar case             # <<<<<<<<<<<<<<
 *         else:
 *             ret = []
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___get); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_variable_name);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_variable_name);
    __Pyx_GIVEREF(__pyx_v_variable_name);
    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":229
 *             return self._get(variable_name) #Scalar case
 *         else:
 *             ret = []             # <<<<<<<<<<<<<<
 *             for i in xrange(len(variable_name)): #A list of variables
 *                 ret += [self._get(variable_name[i])]
 */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_ret = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyfmi\fmi.pyx":230
 *         else:
 *             ret = []
 *             for i in xrange(len(variable_name)): #A list of variables             # <<<<<<<<<<<<<<
 *                 ret += [self._get(variable_name[i])]
 *             return ret
 */
    __pyx_t_5 = PyObject_Length(__pyx_v_variable_name); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_builtin_xrange, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
      __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    for (;;) {
      if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_3)) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_3)) {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_4 = __pyx_t_6(__pyx_t_3);
        if (unlikely(!__pyx_t_4)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XDECREF(__pyx_v_i);
      __pyx_v_i = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "pyfmi\fmi.pyx":231
 *             ret = []
 *             for i in xrange(len(variable_name)): #A list of variables
 *                 ret += [self._get(variable_name[i])]             # <<<<<<<<<<<<<<
 *             return ret
 * 
 */
      __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___get); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = PyObject_GetItem(__pyx_v_variable_name, __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
      __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_ret), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_v_ret));
      __pyx_v_ret = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pyfmi\fmi.pyx":232
 *             for i in xrange(len(variable_name)): #A list of variables
 *                 ret += [self._get(variable_name[i])]
 *             return ret             # <<<<<<<<<<<<<<
 * 
 *     def _exec_algorithm(self, module, algorithm, options):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_ret));
    __pyx_r = ((PyObject *)__pyx_v_ret);
    goto __pyx_L0;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyfmi.fmi.ModelBase.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_9ModelBase_5_exec_algorithm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_9ModelBase_4_exec_algorithm[] = "\n        Helper function which performs all steps of an algorithm run which are\n        common to all initialize and optimize algorithms.\n\n        Raises::\n\n            Exception if algorithm is not a subclass of\n            common.algorithm_drivers.AlgorithmBase.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_9ModelBase_5_exec_algorithm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_module = 0;
  PyObject *__pyx_v_algorithm = 0;
  PyObject *__pyx_v_options = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_exec_algorithm (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__module,&__pyx_n_s__algorithm,&__pyx_n_s__options,0};
    PyObject* values[3] = {0,0,0};
    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__module)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__algorithm)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_exec_algorithm", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__options)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_exec_algorithm", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_exec_algorithm") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __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_module = values[0];
    __pyx_v_algorithm = values[1];
    __pyx_v_options = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_exec_algorithm", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.ModelBase._exec_algorithm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_9ModelBase_4_exec_algorithm(((struct __pyx_obj_5pyfmi_3fmi_ModelBase *)__pyx_v_self), __pyx_v_module, __pyx_v_algorithm, __pyx_v_options);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":234
 *             return ret
 * 
 *     def _exec_algorithm(self, module, algorithm, options):             # <<<<<<<<<<<<<<
 *         """
 *         Helper function which performs all steps of an algorithm run which are
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_9ModelBase_4_exec_algorithm(struct __pyx_obj_5pyfmi_3fmi_ModelBase *__pyx_v_self, PyObject *__pyx_v_module, PyObject *__pyx_v_algorithm, PyObject *__pyx_v_options) {
  PyObject *__pyx_v_base_path = NULL;
  PyObject *__pyx_v_algdrive = NULL;
  PyObject *__pyx_v_AlgorithmBase = NULL;
  PyObject *__pyx_v_alg = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_exec_algorithm", 0);
  __Pyx_INCREF(__pyx_v_module);
  __Pyx_INCREF(__pyx_v_algorithm);

  /* "pyfmi\fmi.pyx":244
 *             common.algorithm_drivers.AlgorithmBase.
 *         """
 *         base_path = 'common.algorithm_drivers'             # <<<<<<<<<<<<<<
 *         algdrive = __import__(base_path, globals(), locals(), [], -1)
 *         AlgorithmBase = getattr(getattr(algdrive,"algorithm_drivers"), 'AlgorithmBase')
 */
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
  __pyx_v_base_path = ((PyObject *)__pyx_kp_s_5);

  /* "pyfmi\fmi.pyx":245
 *         """
 *         base_path = 'common.algorithm_drivers'
 *         algdrive = __import__(base_path, globals(), locals(), [], -1)             # <<<<<<<<<<<<<<
 *         AlgorithmBase = getattr(getattr(algdrive,"algorithm_drivers"), 'AlgorithmBase')
 * 
 */
  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (__pyx_v_module) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__module), __pyx_v_module) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_algorithm) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__algorithm), __pyx_v_algorithm) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_alg) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__alg), __pyx_v_alg) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (((PyObject *)__pyx_v_self)) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__self), ((PyObject *)__pyx_v_self)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_AlgorithmBase) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__AlgorithmBase), __pyx_v_AlgorithmBase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_base_path) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__base_path), __pyx_v_base_path) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_algdrive) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__algdrive), __pyx_v_algdrive) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_options) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__options), __pyx_v_options) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_base_path);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_base_path);
  __Pyx_GIVEREF(__pyx_v_base_path);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_t_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_t_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(__pyx_int_neg_1);
  PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_int_neg_1);
  __Pyx_GIVEREF(__pyx_int_neg_1);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_builtin___import__, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_v_algdrive = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":246
 *         base_path = 'common.algorithm_drivers'
 *         algdrive = __import__(base_path, globals(), locals(), [], -1)
 *         AlgorithmBase = getattr(getattr(algdrive,"algorithm_drivers"), 'AlgorithmBase')             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(algorithm, basestring):
 */
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_algdrive, ((PyObject *)__pyx_n_s__algorithm_drivers)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, ((PyObject *)__pyx_n_s__AlgorithmBase)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_AlgorithmBase = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":248
 *         AlgorithmBase = getattr(getattr(algdrive,"algorithm_drivers"), 'AlgorithmBase')
 * 
 *         if isinstance(algorithm, basestring):             # <<<<<<<<<<<<<<
 *             module = __import__(module, globals(), locals(), [algorithm], -1)
 *             algorithm = getattr(module, algorithm)
 */
  __pyx_t_5 = PyObject_IsInstance(__pyx_v_algorithm, __pyx_builtin_basestring); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":249
 * 
 *         if isinstance(algorithm, basestring):
 *             module = __import__(module, globals(), locals(), [algorithm], -1)             # <<<<<<<<<<<<<<
 *             algorithm = getattr(module, algorithm)
 * 
 */
    __pyx_t_4 = __Pyx_Globals(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    if (__pyx_v_module) {
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__module), __pyx_v_module) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_algorithm) {
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__algorithm), __pyx_v_algorithm) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_alg) {
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__alg), __pyx_v_alg) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (((PyObject *)__pyx_v_self)) {
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__self), ((PyObject *)__pyx_v_self)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_AlgorithmBase) {
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__AlgorithmBase), __pyx_v_AlgorithmBase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_base_path) {
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__base_path), __pyx_v_base_path) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_algdrive) {
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__algdrive), __pyx_v_algdrive) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_options) {
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__options), __pyx_v_options) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_algorithm);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_algorithm);
    __Pyx_GIVEREF(__pyx_v_algorithm);
    __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_module);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_module);
    __Pyx_GIVEREF(__pyx_v_module);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
    PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __Pyx_INCREF(__pyx_int_neg_1);
    PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_int_neg_1);
    __Pyx_GIVEREF(__pyx_int_neg_1);
    __pyx_t_4 = 0;
    __pyx_t_3 = 0;
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_builtin___import__, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_v_module);
    __pyx_v_module = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyfmi\fmi.pyx":250
 *         if isinstance(algorithm, basestring):
 *             module = __import__(module, globals(), locals(), [algorithm], -1)
 *             algorithm = getattr(module, algorithm)             # <<<<<<<<<<<<<<
 * 
 *         if not issubclass(algorithm, AlgorithmBase):
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_module, __pyx_v_algorithm); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_v_algorithm);
    __pyx_v_algorithm = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":252
 *             algorithm = getattr(module, algorithm)
 * 
 *         if not issubclass(algorithm, AlgorithmBase):             # <<<<<<<<<<<<<<
 *             raise Exception(str(algorithm)+
 *             " must be a subclass of common.algorithm_drivers.AlgorithmBase")
 */
  __pyx_t_5 = PyObject_IsSubclass(__pyx_v_algorithm, __pyx_v_AlgorithmBase); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = (!__pyx_t_5);
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":253
 * 
 *         if not issubclass(algorithm, AlgorithmBase):
 *             raise Exception(str(algorithm)+             # <<<<<<<<<<<<<<
 *             " must be a subclass of common.algorithm_drivers.AlgorithmBase")
 * 
 */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_algorithm);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_algorithm);
    __Pyx_GIVEREF(__pyx_v_algorithm);
    __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Add(__pyx_t_1, ((PyObject *)__pyx_kp_s_6)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":257
 * 
 *         # initialize algorithm
 *         alg = algorithm(self, options)             # <<<<<<<<<<<<<<
 *         # solve optimization problem/initialize
 *         alg.solve()
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __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_options);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_options);
  __Pyx_GIVEREF(__pyx_v_options);
  __pyx_t_1 = PyObject_Call(__pyx_v_algorithm, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_alg = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":259
 *         alg = algorithm(self, options)
 *         # solve optimization problem/initialize
 *         alg.solve()             # <<<<<<<<<<<<<<
 *         # get and return result
 *         return alg.get_result()
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_alg, __pyx_n_s__solve); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __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 = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":261
 *         alg.solve()
 *         # get and return result
 *         return alg.get_result()             # <<<<<<<<<<<<<<
 * 
 *     def _exec_simulate_algorithm(self,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_alg, __pyx_n_s__get_result); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __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 = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyfmi.fmi.ModelBase._exec_algorithm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_base_path);
  __Pyx_XDECREF(__pyx_v_algdrive);
  __Pyx_XDECREF(__pyx_v_AlgorithmBase);
  __Pyx_XDECREF(__pyx_v_alg);
  __Pyx_XDECREF(__pyx_v_module);
  __Pyx_XDECREF(__pyx_v_algorithm);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_9ModelBase_7_exec_simulate_algorithm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_9ModelBase_6_exec_simulate_algorithm[] = "\n        Helper function which performs all steps of an algorithm run which are\n        common to all simulate algorithms.\n\n        Raises::\n\n            Exception if algorithm is not a subclass of\n            common.algorithm_drivers.AlgorithmBase.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_9ModelBase_7_exec_simulate_algorithm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start_time = 0;
  PyObject *__pyx_v_final_time = 0;
  PyObject *__pyx_v_input = 0;
  PyObject *__pyx_v_module = 0;
  PyObject *__pyx_v_algorithm = 0;
  PyObject *__pyx_v_options = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_exec_simulate_algorithm (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start_time,&__pyx_n_s__final_time,&__pyx_n_s__input,&__pyx_n_s__module,&__pyx_n_s__algorithm,&__pyx_n_s__options,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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__start_time)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__final_time)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_exec_simulate_algorithm", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__input)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_exec_simulate_algorithm", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__module)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_exec_simulate_algorithm", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__algorithm)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_exec_simulate_algorithm", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__options)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_exec_simulate_algorithm", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_exec_simulate_algorithm") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      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);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_start_time = values[0];
    __pyx_v_final_time = values[1];
    __pyx_v_input = values[2];
    __pyx_v_module = values[3];
    __pyx_v_algorithm = values[4];
    __pyx_v_options = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_exec_simulate_algorithm", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.ModelBase._exec_simulate_algorithm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_9ModelBase_6_exec_simulate_algorithm(((struct __pyx_obj_5pyfmi_3fmi_ModelBase *)__pyx_v_self), __pyx_v_start_time, __pyx_v_final_time, __pyx_v_input, __pyx_v_module, __pyx_v_algorithm, __pyx_v_options);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":263
 *         return alg.get_result()
 * 
 *     def _exec_simulate_algorithm(self,             # <<<<<<<<<<<<<<
 *                                  start_time,
 *                                  final_time,
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_9ModelBase_6_exec_simulate_algorithm(struct __pyx_obj_5pyfmi_3fmi_ModelBase *__pyx_v_self, PyObject *__pyx_v_start_time, PyObject *__pyx_v_final_time, PyObject *__pyx_v_input, PyObject *__pyx_v_module, PyObject *__pyx_v_algorithm, PyObject *__pyx_v_options) {
  PyObject *__pyx_v_base_path = NULL;
  PyObject *__pyx_v_algdrive = NULL;
  PyObject *__pyx_v_AlgorithmBase = NULL;
  PyObject *__pyx_v_alg = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_exec_simulate_algorithm", 0);
  __Pyx_INCREF(__pyx_v_module);
  __Pyx_INCREF(__pyx_v_algorithm);

  /* "pyfmi\fmi.pyx":279
 *             common.algorithm_drivers.AlgorithmBase.
 *         """
 *         base_path = 'common.algorithm_drivers'             # <<<<<<<<<<<<<<
 *         algdrive = __import__(base_path, globals(), locals(), [], 1)
 *         AlgorithmBase = getattr(getattr(algdrive,"algorithm_drivers"), 'AlgorithmBase')
 */
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
  __pyx_v_base_path = ((PyObject *)__pyx_kp_s_5);

  /* "pyfmi\fmi.pyx":280
 *         """
 *         base_path = 'common.algorithm_drivers'
 *         algdrive = __import__(base_path, globals(), locals(), [], 1)             # <<<<<<<<<<<<<<
 *         AlgorithmBase = getattr(getattr(algdrive,"algorithm_drivers"), 'AlgorithmBase')
 * 
 */
  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (__pyx_v_final_time) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__final_time), __pyx_v_final_time) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_algorithm) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__algorithm), __pyx_v_algorithm) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_alg) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__alg), __pyx_v_alg) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (((PyObject *)__pyx_v_self)) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__self), ((PyObject *)__pyx_v_self)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_AlgorithmBase) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__AlgorithmBase), __pyx_v_AlgorithmBase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_module) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__module), __pyx_v_module) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_options) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__options), __pyx_v_options) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_base_path) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__base_path), __pyx_v_base_path) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_input) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__input), __pyx_v_input) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_start_time) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__start_time), __pyx_v_start_time) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_algdrive) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__algdrive), __pyx_v_algdrive) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_base_path);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_base_path);
  __Pyx_GIVEREF(__pyx_v_base_path);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_t_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_t_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(__pyx_int_1);
  PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_builtin___import__, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_v_algdrive = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":281
 *         base_path = 'common.algorithm_drivers'
 *         algdrive = __import__(base_path, globals(), locals(), [], 1)
 *         AlgorithmBase = getattr(getattr(algdrive,"algorithm_drivers"), 'AlgorithmBase')             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(algorithm, basestring):
 */
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_algdrive, ((PyObject *)__pyx_n_s__algorithm_drivers)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, ((PyObject *)__pyx_n_s__AlgorithmBase)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_AlgorithmBase = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":283
 *         AlgorithmBase = getattr(getattr(algdrive,"algorithm_drivers"), 'AlgorithmBase')
 * 
 *         if isinstance(algorithm, basestring):             # <<<<<<<<<<<<<<
 *             module = __import__(module, globals(), locals(), [algorithm], 0)
 *             algorithm = getattr(module, algorithm)
 */
  __pyx_t_5 = PyObject_IsInstance(__pyx_v_algorithm, __pyx_builtin_basestring); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":284
 * 
 *         if isinstance(algorithm, basestring):
 *             module = __import__(module, globals(), locals(), [algorithm], 0)             # <<<<<<<<<<<<<<
 *             algorithm = getattr(module, algorithm)
 * 
 */
    __pyx_t_4 = __Pyx_Globals(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    if (__pyx_v_final_time) {
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__final_time), __pyx_v_final_time) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_algorithm) {
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__algorithm), __pyx_v_algorithm) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_alg) {
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__alg), __pyx_v_alg) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (((PyObject *)__pyx_v_self)) {
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__self), ((PyObject *)__pyx_v_self)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_AlgorithmBase) {
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__AlgorithmBase), __pyx_v_AlgorithmBase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_module) {
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__module), __pyx_v_module) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_options) {
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__options), __pyx_v_options) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_base_path) {
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__base_path), __pyx_v_base_path) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_input) {
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__input), __pyx_v_input) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_start_time) {
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__start_time), __pyx_v_start_time) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_algdrive) {
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__algdrive), __pyx_v_algdrive) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_algorithm);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_algorithm);
    __Pyx_GIVEREF(__pyx_v_algorithm);
    __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_module);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_module);
    __Pyx_GIVEREF(__pyx_v_module);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
    PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __Pyx_INCREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    __pyx_t_4 = 0;
    __pyx_t_3 = 0;
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_builtin___import__, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_v_module);
    __pyx_v_module = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyfmi\fmi.pyx":285
 *         if isinstance(algorithm, basestring):
 *             module = __import__(module, globals(), locals(), [algorithm], 0)
 *             algorithm = getattr(module, algorithm)             # <<<<<<<<<<<<<<
 * 
 *         if not issubclass(algorithm, AlgorithmBase):
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_module, __pyx_v_algorithm); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_v_algorithm);
    __pyx_v_algorithm = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":287
 *             algorithm = getattr(module, algorithm)
 * 
 *         if not issubclass(algorithm, AlgorithmBase):             # <<<<<<<<<<<<<<
 *             raise Exception(str(algorithm)+
 *             " must be a subclass of common.algorithm_drivers.AlgorithmBase")
 */
  __pyx_t_5 = PyObject_IsSubclass(__pyx_v_algorithm, __pyx_v_AlgorithmBase); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = (!__pyx_t_5);
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":288
 * 
 *         if not issubclass(algorithm, AlgorithmBase):
 *             raise Exception(str(algorithm)+             # <<<<<<<<<<<<<<
 *             " must be a subclass of common.algorithm_drivers.AlgorithmBase")
 * 
 */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_algorithm);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_algorithm);
    __Pyx_GIVEREF(__pyx_v_algorithm);
    __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Add(__pyx_t_1, ((PyObject *)__pyx_kp_s_6)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":292
 * 
 *         # initialize algorithm
 *         alg = algorithm(start_time, final_time, input, self, options)             # <<<<<<<<<<<<<<
 *         # simulate
 *         alg.solve()
 */
  __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_start_time);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_start_time);
  __Pyx_GIVEREF(__pyx_v_start_time);
  __Pyx_INCREF(__pyx_v_final_time);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_final_time);
  __Pyx_GIVEREF(__pyx_v_final_time);
  __Pyx_INCREF(__pyx_v_input);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_input);
  __Pyx_GIVEREF(__pyx_v_input);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_options);
  PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_options);
  __Pyx_GIVEREF(__pyx_v_options);
  __pyx_t_1 = PyObject_Call(__pyx_v_algorithm, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_alg = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":294
 *         alg = algorithm(start_time, final_time, input, self, options)
 *         # simulate
 *         alg.solve()             # <<<<<<<<<<<<<<
 *         # get and return result
 *         return alg.get_result()
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_alg, __pyx_n_s__solve); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __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 = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":296
 *         alg.solve()
 *         # get and return result
 *         return alg.get_result()             # <<<<<<<<<<<<<<
 * 
 *     def _exec_estimate_algorithm(self, parameters,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_alg, __pyx_n_s__get_result); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __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 = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyfmi.fmi.ModelBase._exec_simulate_algorithm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_base_path);
  __Pyx_XDECREF(__pyx_v_algdrive);
  __Pyx_XDECREF(__pyx_v_AlgorithmBase);
  __Pyx_XDECREF(__pyx_v_alg);
  __Pyx_XDECREF(__pyx_v_module);
  __Pyx_XDECREF(__pyx_v_algorithm);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_9ModelBase_9_exec_estimate_algorithm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_9ModelBase_8_exec_estimate_algorithm[] = "\n        Helper function which performs all steps of an algorithm run which are\n        common to all estimation algorithms.\n\n        Raises::\n\n            Exception if algorithm is not a subclass of\n            common.algorithm_drivers.AlgorithmBase.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_9ModelBase_9_exec_estimate_algorithm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_parameters = 0;
  PyObject *__pyx_v_measurements = 0;
  PyObject *__pyx_v_input = 0;
  PyObject *__pyx_v_module = 0;
  PyObject *__pyx_v_algorithm = 0;
  PyObject *__pyx_v_options = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_exec_estimate_algorithm (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__parameters,&__pyx_n_s__measurements,&__pyx_n_s__input,&__pyx_n_s__module,&__pyx_n_s__algorithm,&__pyx_n_s__options,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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__parameters)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__measurements)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_exec_estimate_algorithm", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__input)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_exec_estimate_algorithm", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__module)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_exec_estimate_algorithm", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__algorithm)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_exec_estimate_algorithm", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__options)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_exec_estimate_algorithm", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_exec_estimate_algorithm") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      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);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_parameters = values[0];
    __pyx_v_measurements = values[1];
    __pyx_v_input = values[2];
    __pyx_v_module = values[3];
    __pyx_v_algorithm = values[4];
    __pyx_v_options = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_exec_estimate_algorithm", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.ModelBase._exec_estimate_algorithm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_9ModelBase_8_exec_estimate_algorithm(((struct __pyx_obj_5pyfmi_3fmi_ModelBase *)__pyx_v_self), __pyx_v_parameters, __pyx_v_measurements, __pyx_v_input, __pyx_v_module, __pyx_v_algorithm, __pyx_v_options);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":298
 *         return alg.get_result()
 * 
 *     def _exec_estimate_algorithm(self, parameters,             # <<<<<<<<<<<<<<
 *                                        measurements,
 *                                        input,
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_9ModelBase_8_exec_estimate_algorithm(struct __pyx_obj_5pyfmi_3fmi_ModelBase *__pyx_v_self, PyObject *__pyx_v_parameters, PyObject *__pyx_v_measurements, PyObject *__pyx_v_input, PyObject *__pyx_v_module, PyObject *__pyx_v_algorithm, PyObject *__pyx_v_options) {
  PyObject *__pyx_v_base_path = NULL;
  PyObject *__pyx_v_algdrive = NULL;
  PyObject *__pyx_v_AlgorithmBase = NULL;
  PyObject *__pyx_v_alg = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_exec_estimate_algorithm", 0);
  __Pyx_INCREF(__pyx_v_module);
  __Pyx_INCREF(__pyx_v_algorithm);

  /* "pyfmi\fmi.pyx":313
 *             common.algorithm_drivers.AlgorithmBase.
 *         """
 *         base_path = 'common.algorithm_drivers'             # <<<<<<<<<<<<<<
 *         algdrive = __import__(base_path, globals(), locals(), [], 1)
 *         AlgorithmBase = getattr(getattr(algdrive,"algorithm_drivers"), 'AlgorithmBase')
 */
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
  __pyx_v_base_path = ((PyObject *)__pyx_kp_s_5);

  /* "pyfmi\fmi.pyx":314
 *         """
 *         base_path = 'common.algorithm_drivers'
 *         algdrive = __import__(base_path, globals(), locals(), [], 1)             # <<<<<<<<<<<<<<
 *         AlgorithmBase = getattr(getattr(algdrive,"algorithm_drivers"), 'AlgorithmBase')
 * 
 */
  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (__pyx_v_parameters) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__parameters), __pyx_v_parameters) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_algorithm) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__algorithm), __pyx_v_algorithm) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_alg) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__alg), __pyx_v_alg) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (((PyObject *)__pyx_v_self)) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__self), ((PyObject *)__pyx_v_self)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_measurements) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__measurements), __pyx_v_measurements) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_AlgorithmBase) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__AlgorithmBase), __pyx_v_AlgorithmBase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_module) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__module), __pyx_v_module) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_base_path) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__base_path), __pyx_v_base_path) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_input) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__input), __pyx_v_input) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_options) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__options), __pyx_v_options) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_algdrive) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__algdrive), __pyx_v_algdrive) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_base_path);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_base_path);
  __Pyx_GIVEREF(__pyx_v_base_path);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_t_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_t_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(__pyx_int_1);
  PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_builtin___import__, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_v_algdrive = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":315
 *         base_path = 'common.algorithm_drivers'
 *         algdrive = __import__(base_path, globals(), locals(), [], 1)
 *         AlgorithmBase = getattr(getattr(algdrive,"algorithm_drivers"), 'AlgorithmBase')             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(algorithm, basestring):
 */
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_algdrive, ((PyObject *)__pyx_n_s__algorithm_drivers)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, ((PyObject *)__pyx_n_s__AlgorithmBase)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_AlgorithmBase = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":317
 *         AlgorithmBase = getattr(getattr(algdrive,"algorithm_drivers"), 'AlgorithmBase')
 * 
 *         if isinstance(algorithm, basestring):             # <<<<<<<<<<<<<<
 *             module = __import__(module, globals(), locals(), [algorithm], 0)
 *             algorithm = getattr(module, algorithm)
 */
  __pyx_t_5 = PyObject_IsInstance(__pyx_v_algorithm, __pyx_builtin_basestring); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":318
 * 
 *         if isinstance(algorithm, basestring):
 *             module = __import__(module, globals(), locals(), [algorithm], 0)             # <<<<<<<<<<<<<<
 *             algorithm = getattr(module, algorithm)
 * 
 */
    __pyx_t_4 = __Pyx_Globals(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    if (__pyx_v_parameters) {
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__parameters), __pyx_v_parameters) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_algorithm) {
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__algorithm), __pyx_v_algorithm) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_alg) {
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__alg), __pyx_v_alg) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (((PyObject *)__pyx_v_self)) {
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__self), ((PyObject *)__pyx_v_self)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_measurements) {
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__measurements), __pyx_v_measurements) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_AlgorithmBase) {
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__AlgorithmBase), __pyx_v_AlgorithmBase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_module) {
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__module), __pyx_v_module) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_base_path) {
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__base_path), __pyx_v_base_path) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_input) {
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__input), __pyx_v_input) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_options) {
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__options), __pyx_v_options) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (__pyx_v_algdrive) {
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__algdrive), __pyx_v_algdrive) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_algorithm);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_algorithm);
    __Pyx_GIVEREF(__pyx_v_algorithm);
    __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_module);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_module);
    __Pyx_GIVEREF(__pyx_v_module);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
    PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __Pyx_INCREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    __pyx_t_4 = 0;
    __pyx_t_3 = 0;
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_builtin___import__, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_v_module);
    __pyx_v_module = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyfmi\fmi.pyx":319
 *         if isinstance(algorithm, basestring):
 *             module = __import__(module, globals(), locals(), [algorithm], 0)
 *             algorithm = getattr(module, algorithm)             # <<<<<<<<<<<<<<
 * 
 *         if not issubclass(algorithm, AlgorithmBase):
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_module, __pyx_v_algorithm); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_v_algorithm);
    __pyx_v_algorithm = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":321
 *             algorithm = getattr(module, algorithm)
 * 
 *         if not issubclass(algorithm, AlgorithmBase):             # <<<<<<<<<<<<<<
 *             raise Exception(str(algorithm)+
 *             " must be a subclass of common.algorithm_drivers.AlgorithmBase")
 */
  __pyx_t_5 = PyObject_IsSubclass(__pyx_v_algorithm, __pyx_v_AlgorithmBase); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = (!__pyx_t_5);
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":322
 * 
 *         if not issubclass(algorithm, AlgorithmBase):
 *             raise Exception(str(algorithm)+             # <<<<<<<<<<<<<<
 *             " must be a subclass of common.algorithm_drivers.AlgorithmBase")
 * 
 */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_algorithm);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_algorithm);
    __Pyx_GIVEREF(__pyx_v_algorithm);
    __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Add(__pyx_t_1, ((PyObject *)__pyx_kp_s_6)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":326
 * 
 *         # initialize algorithm
 *         alg = algorithm(parameters, measurements, input, self, options)             # <<<<<<<<<<<<<<
 *         # simulate
 *         alg.solve()
 */
  __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_parameters);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_parameters);
  __Pyx_GIVEREF(__pyx_v_parameters);
  __Pyx_INCREF(__pyx_v_measurements);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_measurements);
  __Pyx_GIVEREF(__pyx_v_measurements);
  __Pyx_INCREF(__pyx_v_input);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_input);
  __Pyx_GIVEREF(__pyx_v_input);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_options);
  PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_options);
  __Pyx_GIVEREF(__pyx_v_options);
  __pyx_t_1 = PyObject_Call(__pyx_v_algorithm, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_alg = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":328
 *         alg = algorithm(parameters, measurements, input, self, options)
 *         # simulate
 *         alg.solve()             # <<<<<<<<<<<<<<
 *         # get and return result
 *         return alg.get_result()
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_alg, __pyx_n_s__solve); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __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 = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":330
 *         alg.solve()
 *         # get and return result
 *         return alg.get_result()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_alg, __pyx_n_s__get_result); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __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 = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyfmi.fmi.ModelBase._exec_estimate_algorithm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_base_path);
  __Pyx_XDECREF(__pyx_v_algdrive);
  __Pyx_XDECREF(__pyx_v_AlgorithmBase);
  __Pyx_XDECREF(__pyx_v_alg);
  __Pyx_XDECREF(__pyx_v_module);
  __Pyx_XDECREF(__pyx_v_algorithm);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_9ModelBase_11_default_options(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_9ModelBase_10_default_options[] = "\n        Help method. Gets the options class for the algorithm specified in\n        'algorithm'.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_9ModelBase_11_default_options(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_module = 0;
  PyObject *__pyx_v_algorithm = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_default_options (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__module,&__pyx_n_s__algorithm,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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__module)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__algorithm)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_default_options", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_default_options") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_module = values[0];
    __pyx_v_algorithm = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_default_options", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.ModelBase._default_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_9ModelBase_10_default_options(((struct __pyx_obj_5pyfmi_3fmi_ModelBase *)__pyx_v_self), __pyx_v_module, __pyx_v_algorithm);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":333
 * 
 * 
 *     def _default_options(self, module, algorithm):             # <<<<<<<<<<<<<<
 *         """
 *         Help method. Gets the options class for the algorithm specified in
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_9ModelBase_10_default_options(struct __pyx_obj_5pyfmi_3fmi_ModelBase *__pyx_v_self, PyObject *__pyx_v_module, PyObject *__pyx_v_algorithm) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_default_options", 0);
  __Pyx_INCREF(__pyx_v_module);
  __Pyx_INCREF(__pyx_v_algorithm);

  /* "pyfmi\fmi.pyx":338
 *         'algorithm'.
 *         """
 *         module = __import__(module, globals(), locals(), [algorithm], 0)             # <<<<<<<<<<<<<<
 *         algorithm = getattr(module, algorithm)
 * 
 */
  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (((PyObject *)__pyx_v_self)) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__self), ((PyObject *)__pyx_v_self)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_algorithm) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__algorithm), __pyx_v_algorithm) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (__pyx_v_module) {
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__module), __pyx_v_module) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_algorithm);
  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_algorithm);
  __Pyx_GIVEREF(__pyx_v_algorithm);
  __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_module);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_module);
  __Pyx_GIVEREF(__pyx_v_module);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_t_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_t_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_builtin___import__, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_v_module);
  __pyx_v_module = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":339
 *         """
 *         module = __import__(module, globals(), locals(), [algorithm], 0)
 *         algorithm = getattr(module, algorithm)             # <<<<<<<<<<<<<<
 * 
 *         return algorithm.get_default_options()
 */
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_module, __pyx_v_algorithm); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_v_algorithm);
  __pyx_v_algorithm = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":341
 *         algorithm = getattr(module, algorithm)
 * 
 *         return algorithm.get_default_options()             # <<<<<<<<<<<<<<
 * 
 *     def estimate(self,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_algorithm, __pyx_n_s__get_default_options); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyfmi.fmi.ModelBase._default_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_module);
  __Pyx_XDECREF(__pyx_v_algorithm);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_9ModelBase_13estimate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_9ModelBase_12estimate[] = "\n        Compact function for model estimation.\n\n        The estimation method depends on which algorithm is used, this can be\n        set with the function argument 'algorithm'. Options for the algorithm\n        are passed as option classes or as pure dicts. See\n        model.estimate_options for more details.\n\n        The default algorithm for this function is SciEstAlg.\n\n        Parameters::\n\n            parameters --\n                The tunable parameters (required)\n\n            measurements --\n                The measurements data (name, data). Note that the measurements\n                needs to be distinct and equally spaced. (required)\n\n            input --\n                Input signal for the estimation. The input should be a 2-tuple\n                consisting of first the names of the input variable(s) and then\n                the data matrix.\n                Default: Empty tuple.\n\n            algorithm --\n                The algorithm which will be used for the estimation is specified\n                by passing the algorithm class as string or class object in this\n                argument. 'algorithm' can be any class which implements the\n                abstract class AlgorithmBase (found in algorithm_drivers.py). In\n                this way it is possible to write own algorithms and use them\n                with this function.\n                Default: 'SciEstAlg'\n\n            options --\n                The options that should be used in the algorithm. For details on\n                the options do:\n\n                    >> myModel = load_fmu(...)\n                    >> opts = myModel.estimate_options()\n                    >> opts?\n\n                Valid values are:\n                    - A dict which gives SciEstAlgOptions with\n                      default values on all options except the ones\n                      listed in the dict. Empty dict will thus give all\n                      options with default valu""es.\n                    - An options object.\n                Default: Empty dict\n\n        Returns::\n\n            Result object, subclass of common.algorithm_drivers.ResultBase.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_9ModelBase_13estimate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_parameters = 0;
  PyObject *__pyx_v_measurements = 0;
  PyObject *__pyx_v_input = 0;
  PyObject *__pyx_v_algorithm = 0;
  PyObject *__pyx_v_options = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("estimate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__parameters,&__pyx_n_s__measurements,&__pyx_n_s__input,&__pyx_n_s__algorithm,&__pyx_n_s__options,0};
    PyObject* values[5] = {0,0,0,0,0};

    /* "pyfmi\fmi.pyx":346
 *                  parameters,
 *                  measurements,
 *                  input=(),             # <<<<<<<<<<<<<<
 *                  algorithm='SciEstAlg',
 *                  options={}):
 */
    values[2] = ((PyObject *)__pyx_empty_tuple);
    values[3] = ((PyObject *)__pyx_n_s__SciEstAlg);
    values[4] = __pyx_k_7;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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__parameters)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__measurements)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("estimate", 0, 2, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__input);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__algorithm);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__options);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "estimate") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_parameters = values[0];
    __pyx_v_measurements = values[1];
    __pyx_v_input = values[2];
    __pyx_v_algorithm = values[3];
    __pyx_v_options = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("estimate", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.ModelBase.estimate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_9ModelBase_12estimate(((struct __pyx_obj_5pyfmi_3fmi_ModelBase *)__pyx_v_self), __pyx_v_parameters, __pyx_v_measurements, __pyx_v_input, __pyx_v_algorithm, __pyx_v_options);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":343
 *         return algorithm.get_default_options()
 * 
 *     def estimate(self,             # <<<<<<<<<<<<<<
 *                  parameters,
 *                  measurements,
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_9ModelBase_12estimate(struct __pyx_obj_5pyfmi_3fmi_ModelBase *__pyx_v_self, PyObject *__pyx_v_parameters, PyObject *__pyx_v_measurements, PyObject *__pyx_v_input, PyObject *__pyx_v_algorithm, PyObject *__pyx_v_options) {
  PyObject *__pyx_r = NULL;
  __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("estimate", 0);

  /* "pyfmi\fmi.pyx":404
 *         """
 * 
 *         return self._exec_estimate_algorithm(parameters,             # <<<<<<<<<<<<<<
 *                                              measurements,
 *                                              input,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyfmi\fmi.pyx":409
 *                                              'pyfmi.fmi_algorithm_drivers',
 *                                              algorithm,
 *                                              options)             # <<<<<<<<<<<<<<
 * 
 *     def estimate_options(self, algorithm='SciEstAlg'):
 */
  __pyx_t_2 = PyTuple_New(6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_parameters);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_parameters);
  __Pyx_GIVEREF(__pyx_v_parameters);
  __Pyx_INCREF(__pyx_v_measurements);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_measurements);
  __Pyx_GIVEREF(__pyx_v_measurements);
  __Pyx_INCREF(__pyx_v_input);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_input);
  __Pyx_GIVEREF(__pyx_v_input);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_9));
  PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_kp_s_9));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9));
  __Pyx_INCREF(__pyx_v_algorithm);
  PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_algorithm);
  __Pyx_GIVEREF(__pyx_v_algorithm);
  __Pyx_INCREF(__pyx_v_options);
  PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_v_options);
  __Pyx_GIVEREF(__pyx_v_options);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.ModelBase.estimate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_9ModelBase_15estimate_options(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_9ModelBase_14estimate_options[] = "\n        Get an instance of the estimation options class, filled with default\n        values. If called without argument then the options class for the\n        default estimation algorithm will be returned.\n\n        Parameters::\n\n            algorithm --\n                The algorithm for which the options class should be fetched.\n                Possible values are: 'SciEstAlg'.\n                Default: 'SciEstAlg'\n\n        Returns::\n\n            Options class for the algorithm specified with default values.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_9ModelBase_15estimate_options(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_algorithm = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("estimate_options (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__algorithm,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_n_s__SciEstAlg);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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 (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__algorithm);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "estimate_options") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_algorithm = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("estimate_options", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.ModelBase.estimate_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_9ModelBase_14estimate_options(((struct __pyx_obj_5pyfmi_3fmi_ModelBase *)__pyx_v_self), __pyx_v_algorithm);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":411
 *                                              options)
 * 
 *     def estimate_options(self, algorithm='SciEstAlg'):             # <<<<<<<<<<<<<<
 *         """
 *         Get an instance of the estimation options class, filled with default
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_9ModelBase_14estimate_options(struct __pyx_obj_5pyfmi_3fmi_ModelBase *__pyx_v_self, PyObject *__pyx_v_algorithm) {
  PyObject *__pyx_r = NULL;
  __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("estimate_options", 0);

  /* "pyfmi\fmi.pyx":428
 *             Options class for the algorithm specified with default values.
 *         """
 *         return self._default_options('pyfmi.fmi_algorithm_drivers', algorithm)             # <<<<<<<<<<<<<<
 * 
 *     def get_log_file_name(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___default_options); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __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 = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_9));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_9));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9));
  __Pyx_INCREF(__pyx_v_algorithm);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_algorithm);
  __Pyx_GIVEREF(__pyx_v_algorithm);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.ModelBase.estimate_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_9ModelBase_17get_log_file_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_9ModelBase_17get_log_file_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_log_file_name (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_9ModelBase_16get_log_file_name(((struct __pyx_obj_5pyfmi_3fmi_ModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":430
 *         return self._default_options('pyfmi.fmi_algorithm_drivers', algorithm)
 * 
 *     def get_log_file_name(self):             # <<<<<<<<<<<<<<
 *         return self._fmu_log_name
 * 
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_9ModelBase_16get_log_file_name(struct __pyx_obj_5pyfmi_3fmi_ModelBase *__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("get_log_file_name", 0);

  /* "pyfmi\fmi.pyx":431
 * 
 *     def get_log_file_name(self):
 *         return self._fmu_log_name             # <<<<<<<<<<<<<<
 * 
 *     def get_number_of_lines_log(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromString(__pyx_v_self->_fmu_log_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.ModelBase.get_log_file_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_9ModelBase_19get_number_of_lines_log(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_9ModelBase_18get_number_of_lines_log[] = "\n        Returns the number of lines in the log file.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_9ModelBase_19get_number_of_lines_log(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_number_of_lines_log (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_9ModelBase_18get_number_of_lines_log(((struct __pyx_obj_5pyfmi_3fmi_ModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_5pyfmi_3fmi_9ModelBase_23get_number_of_lines_log_2generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "pyfmi\fmi.pyx":440
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'r') as file:
 *                 num_lines = sum(1 for line in file)             # <<<<<<<<<<<<<<
 *         return num_lines
 * 
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_9ModelBase_23get_number_of_lines_log_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_5pyfmi_3fmi___pyx_scope_struct_1_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_5pyfmi_3fmi___pyx_scope_struct_1_genexpr *)__pyx_ptype_5pyfmi_3fmi___pyx_scope_struct_1_genexpr->tp_new(__pyx_ptype_5pyfmi_3fmi___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_5pyfmi_3fmi___pyx_scope_struct__get_number_of_lines_log *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_5pyfmi_3fmi_9ModelBase_23get_number_of_lines_log_2generator, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __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("pyfmi.fmi.ModelBase.get_number_of_lines_log.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_5pyfmi_3fmi_9ModelBase_23get_number_of_lines_log_2generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_5pyfmi_3fmi___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_5pyfmi_3fmi___pyx_scope_struct_1_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __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 */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_file)) { __Pyx_RaiseClosureNameError("file"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_file) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_file)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_file; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_file); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #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 = 440; __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 = 440; __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;
      #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 = 440; __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 = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_line);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_line);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_cur_scope->__pyx_v_line = __pyx_t_4;
    __pyx_t_4 = 0;
    __Pyx_INCREF(__pyx_int_1);
    __pyx_r = __pyx_int_1;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}

/* "pyfmi\fmi.pyx":433
 *         return self._fmu_log_name
 * 
 *     def get_number_of_lines_log(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the number of lines in the log file.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_9ModelBase_18get_number_of_lines_log(struct __pyx_obj_5pyfmi_3fmi_ModelBase *__pyx_v_self) {
  struct __pyx_obj_5pyfmi_3fmi___pyx_scope_struct__get_number_of_lines_log *__pyx_cur_scope;
  PyObject *__pyx_v_num_lines = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_number_of_lines_log", 0);
  __pyx_cur_scope = (struct __pyx_obj_5pyfmi_3fmi___pyx_scope_struct__get_number_of_lines_log *)__pyx_ptype_5pyfmi_3fmi___pyx_scope_struct__get_number_of_lines_log->tp_new(__pyx_ptype_5pyfmi_3fmi___pyx_scope_struct__get_number_of_lines_log, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);

  /* "pyfmi\fmi.pyx":437
 *         Returns the number of lines in the log file.
 *         """
 *         num_lines = 0             # <<<<<<<<<<<<<<
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'r') as file:
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_num_lines = __pyx_int_0;

  /* "pyfmi\fmi.pyx":438
 *         """
 *         num_lines = 0
 *         if self._fmu_log_name != NULL:             # <<<<<<<<<<<<<<
 *             with open(self._fmu_log_name,'r') as file:
 *                 num_lines = sum(1 for line in file)
 */
  __pyx_t_1 = (__pyx_v_self->_fmu_log_name != NULL);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":439
 *         num_lines = 0
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'r') as file:             # <<<<<<<<<<<<<<
 *                 num_lines = sum(1 for line in file)
 *         return num_lines
 */
    /*with:*/ {
      __pyx_t_2 = PyBytes_FromString(__pyx_v_self->_fmu_log_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__r));
      PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__r));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__r));
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_builtin_open, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s____exit__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s____enter__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /*try:*/ {
        {
          __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
          __Pyx_XGOTREF(__pyx_t_6);
          __Pyx_XGOTREF(__pyx_t_7);
          __Pyx_XGOTREF(__pyx_t_8);
          /*try:*/ {
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_5);
            __pyx_cur_scope->__pyx_v_file = __pyx_t_5;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

            /* "pyfmi\fmi.pyx":440
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'r') as file:
 *                 num_lines = sum(1 for line in file)             # <<<<<<<<<<<<<<
 *         return num_lines
 * 
 */
            __pyx_t_5 = __pyx_pf_5pyfmi_3fmi_9ModelBase_23get_number_of_lines_log_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_5);
            __pyx_t_5 = 0;
            __pyx_t_5 = PyObject_Call(__pyx_builtin_sum, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_v_num_lines);
            __pyx_v_num_lines = __pyx_t_5;
            __pyx_t_5 = 0;
          }
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          goto __pyx_L15_try_end;
          __pyx_L8_error:;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "pyfmi\fmi.pyx":439
 *         num_lines = 0
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'r') as file:             # <<<<<<<<<<<<<<
 *                 num_lines = sum(1 for line in file)
 *         return num_lines
 */
          /*except:*/ {
            __Pyx_AddTraceback("pyfmi.fmi.ModelBase.get_number_of_lines_log", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_2, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_5);
            PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_3);
            __pyx_t_10 = PyObject_Call(__pyx_t_4, __pyx_t_9, NULL);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __pyx_t_11 = (!__pyx_t_1);
            if (__pyx_t_11) {
              __Pyx_GIVEREF(__pyx_t_5);
              __Pyx_GIVEREF(__pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_3);
              __Pyx_ErrRestore(__pyx_t_5, __pyx_t_2, __pyx_t_3);
              __pyx_t_5 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; 
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
              goto __pyx_L19;
            }
            __pyx_L19:;
            __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            goto __pyx_L9_exception_handled;
          }
          __pyx_L10_except_error:;
          __Pyx_XGIVEREF(__pyx_t_6);
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
          goto __pyx_L1_error;
          __pyx_L9_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_6);
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
          __pyx_L15_try_end:;
        }
      }
      /*finally:*/ {
        if (__pyx_t_4) {
          __pyx_t_8 = PyObject_Call(__pyx_t_4, __pyx_k_tuple_10, NULL);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
      }
      goto __pyx_L20;
      __pyx_L4_error:;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L1_error;
      __pyx_L20:;
    }
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":441
 *             with open(self._fmu_log_name,'r') as file:
 *                 num_lines = sum(1 for line in file)
 *         return num_lines             # <<<<<<<<<<<<<<
 * 
 *     def print_log(self, start_lines=-1, end_lines=-1):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_num_lines);
  __pyx_r = __pyx_v_num_lines;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyfmi.fmi.ModelBase.get_number_of_lines_log", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_num_lines);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_9ModelBase_21print_log(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_9ModelBase_20print_log[] = "\n        Prints the log information to the prompt.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_9ModelBase_21print_log(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start_lines = 0;
  PyObject *__pyx_v_end_lines = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("print_log (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start_lines,&__pyx_n_s__end_lines,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)__pyx_int_neg_1);
    values[1] = ((PyObject *)__pyx_int_neg_1);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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 (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start_lines);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end_lines);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "print_log") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        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;
      }
    }
    __pyx_v_start_lines = values[0];
    __pyx_v_end_lines = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("print_log", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.ModelBase.print_log", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_9ModelBase_20print_log(((struct __pyx_obj_5pyfmi_3fmi_ModelBase *)__pyx_v_self), __pyx_v_start_lines, __pyx_v_end_lines);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":443
 *         return num_lines
 * 
 *     def print_log(self, start_lines=-1, end_lines=-1):             # <<<<<<<<<<<<<<
 *         """
 *         Prints the log information to the prompt.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_9ModelBase_20print_log(struct __pyx_obj_5pyfmi_3fmi_ModelBase *__pyx_v_self, PyObject *__pyx_v_start_lines, PyObject *__pyx_v_end_lines) {
  int __pyx_v_N;
  PyObject *__pyx_v_log = NULL;
  int __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("print_log", 0);

  /* "pyfmi\fmi.pyx":448
 *         """
 *         cdef int N
 *         log = self.get_log(start_lines, end_lines)             # <<<<<<<<<<<<<<
 *         N = len(log)
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_log); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __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 = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_start_lines);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_start_lines);
  __Pyx_GIVEREF(__pyx_v_start_lines);
  __Pyx_INCREF(__pyx_v_end_lines);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_end_lines);
  __Pyx_GIVEREF(__pyx_v_end_lines);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_log = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":449
 *         cdef int N
 *         log = self.get_log(start_lines, end_lines)
 *         N = len(log)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(N):
 */
  __pyx_t_4 = PyObject_Length(__pyx_v_log); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_4;

  /* "pyfmi\fmi.pyx":451
 *         N = len(log)
 * 
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             print log[i]
 * 
 */
  __pyx_t_5 = __pyx_v_N;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "pyfmi\fmi.pyx":452
 * 
 *         for i in range(N):
 *             print log[i]             # <<<<<<<<<<<<<<
 * 
 *     def get_log(self, int start_lines=-1, int end_lines=-1):
 */
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_log, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_PrintOne(0, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.ModelBase.print_log", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_log);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_9ModelBase_23get_log(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_9ModelBase_22get_log[] = "\n        Returns the log information as a list. To turn on the logging \n        use load_fmu(..., log_level=1-7) in the loading of the FMU. The \n        log is stored as a list of lists. For example log[0] are the \n        first log message to the log and consists of, in the following \n        order, the instance name, the status, the category and the \n        message.\n\n        Returns::\n\n            log - A list of lists.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_9ModelBase_23get_log(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_start_lines;
  int __pyx_v_end_lines;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_log (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start_lines,&__pyx_n_s__end_lines,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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 (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start_lines);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end_lines);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_log") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        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;
      }
    }
    if (values[0]) {
      __pyx_v_start_lines = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_start_lines == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_start_lines = ((int)-1);
    }
    if (values[1]) {
      __pyx_v_end_lines = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_end_lines == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_end_lines = ((int)-1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_log", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.ModelBase.get_log", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_9ModelBase_22get_log(((struct __pyx_obj_5pyfmi_3fmi_ModelBase *)__pyx_v_self), __pyx_v_start_lines, __pyx_v_end_lines);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":454
 *             print log[i]
 * 
 *     def get_log(self, int start_lines=-1, int end_lines=-1):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the log information as a list. To turn on the logging
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_9ModelBase_22get_log(struct __pyx_obj_5pyfmi_3fmi_ModelBase *__pyx_v_self, int __pyx_v_start_lines, int __pyx_v_end_lines) {
  int __pyx_v_i;
  int __pyx_v_num_lines;
  PyObject *__pyx_v_log = NULL;
  PyObject *__pyx_v_file = NULL;
  PyObject *__pyx_v_line = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_log", 0);

  /* "pyfmi\fmi.pyx":467
 *             log - A list of lists.
 *         """
 *         cdef int i = 0             # <<<<<<<<<<<<<<
 *         cdef int num_lines = 0
 *         log = []
 */
  __pyx_v_i = 0;

  /* "pyfmi\fmi.pyx":468
 *         """
 *         cdef int i = 0
 *         cdef int num_lines = 0             # <<<<<<<<<<<<<<
 *         log = []
 * 
 */
  __pyx_v_num_lines = 0;

  /* "pyfmi\fmi.pyx":469
 *         cdef int i = 0
 *         cdef int num_lines = 0
 *         log = []             # <<<<<<<<<<<<<<
 * 
 *         if end_lines != -1:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_log = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":471
 *         log = []
 * 
 *         if end_lines != -1:             # <<<<<<<<<<<<<<
 *             num_lines = self.get_number_of_lines_log()
 * 
 */
  __pyx_t_2 = (__pyx_v_end_lines != -1);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":472
 * 
 *         if end_lines != -1:
 *             num_lines = self.get_number_of_lines_log()             # <<<<<<<<<<<<<<
 * 
 *         if self._fmu_log_name != NULL:
 */
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_11); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_num_lines = __pyx_t_4;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":474
 *             num_lines = self.get_number_of_lines_log()
 * 
 *         if self._fmu_log_name != NULL:             # <<<<<<<<<<<<<<
 *             with open(self._fmu_log_name,'r') as file:
 *                 while True:
 */
  __pyx_t_2 = (__pyx_v_self->_fmu_log_name != NULL);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":475
 * 
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'r') as file:             # <<<<<<<<<<<<<<
 *                 while True:
 *                     i = i + 1
 */
    /*with:*/ {
      __pyx_t_3 = PyBytes_FromString(__pyx_v_self->_fmu_log_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_3));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__r));
      PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__r));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__r));
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_builtin_open, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s____exit__); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s____enter__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      /*try:*/ {
        {
          __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_7);
          __Pyx_XGOTREF(__pyx_t_8);
          __Pyx_XGOTREF(__pyx_t_9);
          /*try:*/ {
            __Pyx_INCREF(__pyx_t_6);
            __pyx_v_file = __pyx_t_6;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

            /* "pyfmi\fmi.pyx":476
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'r') as file:
 *                 while True:             # <<<<<<<<<<<<<<
 *                     i = i + 1
 *                     line = file.readline()
 */
            while (1) {
              if (!1) break;

              /* "pyfmi\fmi.pyx":477
 *             with open(self._fmu_log_name,'r') as file:
 *                 while True:
 *                     i = i + 1             # <<<<<<<<<<<<<<
 *                     line = file.readline()
 *                     if line == "":
 */
              __pyx_v_i = (__pyx_v_i + 1);

              /* "pyfmi\fmi.pyx":478
 *                 while True:
 *                     i = i + 1
 *                     line = file.readline()             # <<<<<<<<<<<<<<
 *                     if line == "":
 *                         break
 */
              __pyx_t_6 = PyObject_GetAttr(__pyx_v_file, __pyx_n_s__readline); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
              __Pyx_GOTREF(__pyx_t_6);
              __pyx_t_3 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              __Pyx_XDECREF(__pyx_v_line);
              __pyx_v_line = __pyx_t_3;
              __pyx_t_3 = 0;

              /* "pyfmi\fmi.pyx":479
 *                     i = i + 1
 *                     line = file.readline()
 *                     if line == "":             # <<<<<<<<<<<<<<
 *                         break
 *                     if start_lines != -1 and end_lines == -1:
 */
              __pyx_t_3 = PyObject_RichCompare(__pyx_v_line, ((PyObject *)__pyx_kp_s_12), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
              __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              if (__pyx_t_2) {

                /* "pyfmi\fmi.pyx":480
 *                     line = file.readline()
 *                     if line == "":
 *                         break             # <<<<<<<<<<<<<<
 *                     if start_lines != -1 and end_lines == -1:
 *                         if i > start_lines:
 */
                goto __pyx_L19_break;
                goto __pyx_L20;
              }
              __pyx_L20:;

              /* "pyfmi\fmi.pyx":481
 *                     if line == "":
 *                         break
 *                     if start_lines != -1 and end_lines == -1:             # <<<<<<<<<<<<<<
 *                         if i > start_lines:
 *                             break
 */
              __pyx_t_2 = (__pyx_v_start_lines != -1);
              if (__pyx_t_2) {
                __pyx_t_10 = (__pyx_v_end_lines == -1);
                __pyx_t_11 = __pyx_t_10;
              } else {
                __pyx_t_11 = __pyx_t_2;
              }
              if (__pyx_t_11) {

                /* "pyfmi\fmi.pyx":482
 *                         break
 *                     if start_lines != -1 and end_lines == -1:
 *                         if i > start_lines:             # <<<<<<<<<<<<<<
 *                             break
 *                     elif start_lines == -1 and end_lines != -1:
 */
                __pyx_t_11 = (__pyx_v_i > __pyx_v_start_lines);
                if (__pyx_t_11) {

                  /* "pyfmi\fmi.pyx":483
 *                     if start_lines != -1 and end_lines == -1:
 *                         if i > start_lines:
 *                             break             # <<<<<<<<<<<<<<
 *                     elif start_lines == -1 and end_lines != -1:
 *                         if i < num_lines - end_lines + 1:
 */
                  goto __pyx_L19_break;
                  goto __pyx_L22;
                }
                __pyx_L22:;
                goto __pyx_L21;
              }

              /* "pyfmi\fmi.pyx":484
 *                         if i > start_lines:
 *                             break
 *                     elif start_lines == -1 and end_lines != -1:             # <<<<<<<<<<<<<<
 *                         if i < num_lines - end_lines + 1:
 *                             continue
 */
              __pyx_t_11 = (__pyx_v_start_lines == -1);
              if (__pyx_t_11) {
                __pyx_t_2 = (__pyx_v_end_lines != -1);
                __pyx_t_10 = __pyx_t_2;
              } else {
                __pyx_t_10 = __pyx_t_11;
              }
              if (__pyx_t_10) {

                /* "pyfmi\fmi.pyx":485
 *                             break
 *                     elif start_lines == -1 and end_lines != -1:
 *                         if i < num_lines - end_lines + 1:             # <<<<<<<<<<<<<<
 *                             continue
 *                     elif start_lines != -1 and end_lines != -1:
 */
                __pyx_t_10 = (__pyx_v_i < ((__pyx_v_num_lines - __pyx_v_end_lines) + 1));
                if (__pyx_t_10) {

                  /* "pyfmi\fmi.pyx":486
 *                     elif start_lines == -1 and end_lines != -1:
 *                         if i < num_lines - end_lines + 1:
 *                             continue             # <<<<<<<<<<<<<<
 *                     elif start_lines != -1 and end_lines != -1:
 *                         if i > start_lines and i < num_lines - end_lines + 1:
 */
                  goto __pyx_L18_continue;
                  goto __pyx_L23;
                }
                __pyx_L23:;
                goto __pyx_L21;
              }

              /* "pyfmi\fmi.pyx":487
 *                         if i < num_lines - end_lines + 1:
 *                             continue
 *                     elif start_lines != -1 and end_lines != -1:             # <<<<<<<<<<<<<<
 *                         if i > start_lines and i < num_lines - end_lines + 1:
 *                             continue
 */
              __pyx_t_10 = (__pyx_v_start_lines != -1);
              if (__pyx_t_10) {
                __pyx_t_11 = (__pyx_v_end_lines != -1);
                __pyx_t_2 = __pyx_t_11;
              } else {
                __pyx_t_2 = __pyx_t_10;
              }
              if (__pyx_t_2) {

                /* "pyfmi\fmi.pyx":488
 *                             continue
 *                     elif start_lines != -1 and end_lines != -1:
 *                         if i > start_lines and i < num_lines - end_lines + 1:             # <<<<<<<<<<<<<<
 *                             continue
 *                     log.append(line.strip("\n"))
 */
                __pyx_t_2 = (__pyx_v_i > __pyx_v_start_lines);
                if (__pyx_t_2) {
                  __pyx_t_10 = (__pyx_v_i < ((__pyx_v_num_lines - __pyx_v_end_lines) + 1));
                  __pyx_t_11 = __pyx_t_10;
                } else {
                  __pyx_t_11 = __pyx_t_2;
                }
                if (__pyx_t_11) {

                  /* "pyfmi\fmi.pyx":489
 *                     elif start_lines != -1 and end_lines != -1:
 *                         if i > start_lines and i < num_lines - end_lines + 1:
 *                             continue             # <<<<<<<<<<<<<<
 *                     log.append(line.strip("\n"))
 *         return log
 */
                  goto __pyx_L18_continue;
                  goto __pyx_L24;
                }
                __pyx_L24:;
                goto __pyx_L21;
              }
              __pyx_L21:;

              /* "pyfmi\fmi.pyx":490
 *                         if i > start_lines and i < num_lines - end_lines + 1:
 *                             continue
 *                     log.append(line.strip("\n"))             # <<<<<<<<<<<<<<
 *         return log
 * 
 */
              __pyx_t_3 = PyObject_GetAttr(__pyx_v_line, __pyx_n_s__strip); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
              __Pyx_GOTREF(__pyx_t_3);
              __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_14), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
              __Pyx_GOTREF(__pyx_t_6);
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              __pyx_t_12 = PyList_Append(__pyx_v_log, __pyx_t_6); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              __pyx_L18_continue:;
            }
            __pyx_L19_break:;
          }
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L16_try_end;
          __pyx_L9_error:;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "pyfmi\fmi.pyx":475
 * 
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'r') as file:             # <<<<<<<<<<<<<<
 *                 while True:
 *                     i = i + 1
 */
          /*except:*/ {
            __Pyx_AddTraceback("pyfmi.fmi.ModelBase.get_log", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_3, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;}
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;}
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_INCREF(__pyx_t_6);
            PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_6);
            __Pyx_GIVEREF(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_1);
            PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_1);
            __pyx_t_14 = PyObject_Call(__pyx_t_5, __pyx_t_13, NULL);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;}
            __Pyx_GOTREF(__pyx_t_14);
            __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_14);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;}
            __pyx_t_2 = (!__pyx_t_11);
            if (__pyx_t_2) {
              __Pyx_GIVEREF(__pyx_t_6);
              __Pyx_GIVEREF(__pyx_t_3);
              __Pyx_GIVEREF(__pyx_t_1);
              __Pyx_ErrRestore(__pyx_t_6, __pyx_t_3, __pyx_t_1);
              __pyx_t_6 = 0; __pyx_t_3 = 0; __pyx_t_1 = 0; 
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;}
              goto __pyx_L27;
            }
            __pyx_L27:;
            __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            goto __pyx_L10_exception_handled;
          }
          __pyx_L11_except_error:;
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
          goto __pyx_L1_error;
          __pyx_L10_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
          __pyx_L16_try_end:;
        }
      }
      /*finally:*/ {
        if (__pyx_t_5) {
          __pyx_t_9 = PyObject_Call(__pyx_t_5, __pyx_k_tuple_15, NULL);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
      }
      goto __pyx_L28;
      __pyx_L5_error:;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L1_error;
      __pyx_L28:;
    }
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":491
 *                             continue
 *                     log.append(line.strip("\n"))
 *         return log             # <<<<<<<<<<<<<<
 * 
 *     cdef _logger(self, FMIL.jm_string module, int log_level, FMIL.jm_string message) with gil:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_log));
  __pyx_r = ((PyObject *)__pyx_v_log);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("pyfmi.fmi.ModelBase.get_log", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_log);
  __Pyx_XDECREF(__pyx_v_file);
  __Pyx_XDECREF(__pyx_v_line);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":493
 *         return log
 * 
 *     cdef _logger(self, FMIL.jm_string module, int log_level, FMIL.jm_string message) with gil:             # <<<<<<<<<<<<<<
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'a') as file:
 */

static PyObject *__pyx_f_5pyfmi_3fmi_9ModelBase__logger(struct __pyx_obj_5pyfmi_3fmi_ModelBase *__pyx_v_self, jm_string __pyx_v_module, int __pyx_v_log_level, jm_string __pyx_v_message) {
  PyObject *__pyx_v_file = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("_logger", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_self);

  /* "pyfmi\fmi.pyx":494
 * 
 *     cdef _logger(self, FMIL.jm_string module, int log_level, FMIL.jm_string message) with gil:
 *         if self._fmu_log_name != NULL:             # <<<<<<<<<<<<<<
 *             with open(self._fmu_log_name,'a') as file:
 *                 file.write("FMIL: module = %s, log level = %d: %s\n"%(module, log_level, message))
 */
  __pyx_t_1 = (__pyx_v_self->_fmu_log_name != NULL);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":495
 *     cdef _logger(self, FMIL.jm_string module, int log_level, FMIL.jm_string message) with gil:
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'a') as file:             # <<<<<<<<<<<<<<
 *                 file.write("FMIL: module = %s, log level = %d: %s\n"%(module, log_level, message))
 *         else:
 */
    /*with:*/ {
      __pyx_t_2 = PyBytes_FromString(__pyx_v_self->_fmu_log_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__a));
      PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__a));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__a));
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_builtin_open, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s____exit__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s____enter__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /*try:*/ {
        {
          __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
          __Pyx_XGOTREF(__pyx_t_6);
          __Pyx_XGOTREF(__pyx_t_7);
          __Pyx_XGOTREF(__pyx_t_8);
          /*try:*/ {
            __Pyx_INCREF(__pyx_t_5);
            __pyx_v_file = __pyx_t_5;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

            /* "pyfmi\fmi.pyx":496
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'a') as file:
 *                 file.write("FMIL: module = %s, log level = %d: %s\n"%(module, log_level, message))             # <<<<<<<<<<<<<<
 *         else:
 *             self._log.append([module,log_level,message])
 */
            __pyx_t_5 = PyObject_GetAttr(__pyx_v_file, __pyx_n_s__write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_2 = PyBytes_FromString(__pyx_v_module); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(((PyObject *)__pyx_t_2));
            __pyx_t_3 = PyInt_FromLong(__pyx_v_log_level); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_9 = PyBytes_FromString(__pyx_v_message); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(((PyObject *)__pyx_t_9));
            __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_10);
            PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_2));
            __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
            PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_10, 2, ((PyObject *)__pyx_t_9));
            __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
            __pyx_t_2 = 0;
            __pyx_t_3 = 0;
            __pyx_t_9 = 0;
            __pyx_t_9 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_2), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(((PyObject *)__pyx_t_9));
            __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
            __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_10);
            PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_9));
            __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
            __pyx_t_9 = 0;
            __pyx_t_9 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          goto __pyx_L15_try_end;
          __pyx_L8_error:;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

          /* "pyfmi\fmi.pyx":495
 *     cdef _logger(self, FMIL.jm_string module, int log_level, FMIL.jm_string message) with gil:
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'a') as file:             # <<<<<<<<<<<<<<
 *                 file.write("FMIL: module = %s, log level = %d: %s\n"%(module, log_level, message))
 *         else:
 */
          /*except:*/ {
            __Pyx_AddTraceback("pyfmi.fmi.ModelBase._logger", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_9);
            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_10);
            PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_10);
            __Pyx_GIVEREF(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_5);
            PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_5);
            __pyx_t_11 = PyObject_Call(__pyx_t_4, __pyx_t_3, NULL);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __pyx_t_12 = (!__pyx_t_1);
            if (__pyx_t_12) {
              __Pyx_GIVEREF(__pyx_t_9);
              __Pyx_GIVEREF(__pyx_t_10);
              __Pyx_GIVEREF(__pyx_t_5);
              __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_5);
              __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_5 = 0; 
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
              goto __pyx_L19;
            }
            __pyx_L19:;
            __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            goto __pyx_L9_exception_handled;
          }
          __pyx_L10_except_error:;
          __Pyx_XGIVEREF(__pyx_t_6);
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
          goto __pyx_L1_error;
          __pyx_L9_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_6);
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
          __pyx_L15_try_end:;
        }
      }
      /*finally:*/ {
        if (__pyx_t_4) {
          __pyx_t_8 = PyObject_Call(__pyx_t_4, __pyx_k_tuple_16, NULL);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
      }
      goto __pyx_L20;
      __pyx_L4_error:;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L1_error;
      __pyx_L20:;
    }
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":498
 *                 file.write("FMIL: module = %s, log level = %d: %s\n"%(module, log_level, message))
 *         else:
 *             self._log.append([module,log_level,message])             # <<<<<<<<<<<<<<
 * 
 *     def append_log_message(self, module, log_level, message):
 */
    if (unlikely(((PyObject *)__pyx_v_self->_log) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = PyBytes_FromString(__pyx_v_module); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __pyx_t_10 = PyInt_FromLong(__pyx_v_log_level); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_9 = PyBytes_FromString(__pyx_v_message); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_9));
    __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_5));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
    PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_t_9));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
    __pyx_t_5 = 0;
    __pyx_t_10 = 0;
    __pyx_t_9 = 0;
    __pyx_t_13 = PyList_Append(__pyx_v_self->_log, ((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pyfmi.fmi.ModelBase._logger", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_file);
  __Pyx_XDECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_9ModelBase_25append_log_message(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_9ModelBase_25append_log_message(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_module = 0;
  PyObject *__pyx_v_log_level = 0;
  PyObject *__pyx_v_message = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("append_log_message (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__module,&__pyx_n_s__log_level,&__pyx_n_s__message,0};
    PyObject* values[3] = {0,0,0};
    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__module)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__log_level)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("append_log_message", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__message)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("append_log_message", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "append_log_message") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __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_module = values[0];
    __pyx_v_log_level = values[1];
    __pyx_v_message = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("append_log_message", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.ModelBase.append_log_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_9ModelBase_24append_log_message(((struct __pyx_obj_5pyfmi_3fmi_ModelBase *)__pyx_v_self), __pyx_v_module, __pyx_v_log_level, __pyx_v_message);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":500
 *             self._log.append([module,log_level,message])
 * 
 *     def append_log_message(self, module, log_level, message):             # <<<<<<<<<<<<<<
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'a') as file:
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_9ModelBase_24append_log_message(struct __pyx_obj_5pyfmi_3fmi_ModelBase *__pyx_v_self, PyObject *__pyx_v_module, PyObject *__pyx_v_log_level, PyObject *__pyx_v_message) {
  PyObject *__pyx_v_file = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("append_log_message", 0);

  /* "pyfmi\fmi.pyx":501
 * 
 *     def append_log_message(self, module, log_level, message):
 *         if self._fmu_log_name != NULL:             # <<<<<<<<<<<<<<
 *             with open(self._fmu_log_name,'a') as file:
 *                 file.write("FMIL: module = %s, log level = %d: %s\n"%(module, log_level, message))
 */
  __pyx_t_1 = (__pyx_v_self->_fmu_log_name != NULL);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":502
 *     def append_log_message(self, module, log_level, message):
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'a') as file:             # <<<<<<<<<<<<<<
 *                 file.write("FMIL: module = %s, log level = %d: %s\n"%(module, log_level, message))
 *         else:
 */
    /*with:*/ {
      __pyx_t_2 = PyBytes_FromString(__pyx_v_self->_fmu_log_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(((PyObject *)__pyx_n_s__a));
      PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__a));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__a));
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_builtin_open, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s____exit__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s____enter__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /*try:*/ {
        {
          __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
          __Pyx_XGOTREF(__pyx_t_6);
          __Pyx_XGOTREF(__pyx_t_7);
          __Pyx_XGOTREF(__pyx_t_8);
          /*try:*/ {
            __Pyx_INCREF(__pyx_t_5);
            __pyx_v_file = __pyx_t_5;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

            /* "pyfmi\fmi.pyx":503
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'a') as file:
 *                 file.write("FMIL: module = %s, log level = %d: %s\n"%(module, log_level, message))             # <<<<<<<<<<<<<<
 *         else:
 *             self._log.append([module,log_level,message])
 */
            __pyx_t_5 = PyObject_GetAttr(__pyx_v_file, __pyx_n_s__write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_INCREF(__pyx_v_module);
            PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_module);
            __Pyx_GIVEREF(__pyx_v_module);
            __Pyx_INCREF(__pyx_v_log_level);
            PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_log_level);
            __Pyx_GIVEREF(__pyx_v_log_level);
            __Pyx_INCREF(__pyx_v_message);
            PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_message);
            __Pyx_GIVEREF(__pyx_v_message);
            __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_2), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(((PyObject *)__pyx_t_3));
            __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
            __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3));
            __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
            __pyx_t_3 = 0;
            __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          }
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          goto __pyx_L15_try_end;
          __pyx_L8_error:;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "pyfmi\fmi.pyx":502
 *     def append_log_message(self, module, log_level, message):
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'a') as file:             # <<<<<<<<<<<<<<
 *                 file.write("FMIL: module = %s, log level = %d: %s\n"%(module, log_level, message))
 *         else:
 */
          /*except:*/ {
            __Pyx_AddTraceback("pyfmi.fmi.ModelBase.append_log_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_5);
            PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_5);
            __pyx_t_10 = PyObject_Call(__pyx_t_4, __pyx_t_9, NULL);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
            __pyx_t_11 = (!__pyx_t_1);
            if (__pyx_t_11) {
              __Pyx_GIVEREF(__pyx_t_3);
              __Pyx_GIVEREF(__pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_5);
              __Pyx_ErrRestore(__pyx_t_3, __pyx_t_2, __pyx_t_5);
              __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_5 = 0; 
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
              goto __pyx_L19;
            }
            __pyx_L19:;
            __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            goto __pyx_L9_exception_handled;
          }
          __pyx_L10_except_error:;
          __Pyx_XGIVEREF(__pyx_t_6);
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
          goto __pyx_L1_error;
          __pyx_L9_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_6);
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
          __pyx_L15_try_end:;
        }
      }
      /*finally:*/ {
        if (__pyx_t_4) {
          __pyx_t_8 = PyObject_Call(__pyx_t_4, __pyx_k_tuple_17, NULL);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
      }
      goto __pyx_L20;
      __pyx_L4_error:;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L1_error;
      __pyx_L20:;
    }
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":505
 *                 file.write("FMIL: module = %s, log level = %d: %s\n"%(module, log_level, message))
 *         else:
 *             self._log.append([module,log_level,message])             # <<<<<<<<<<<<<<
 * 
 *     def set_log_level(self, FMIL.jm_log_level_enu_t level):
 */
    if (unlikely(((PyObject *)__pyx_v_self->_log) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = PyList_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_module);
    PyList_SET_ITEM(__pyx_t_5, 0, __pyx_v_module);
    __Pyx_GIVEREF(__pyx_v_module);
    __Pyx_INCREF(__pyx_v_log_level);
    PyList_SET_ITEM(__pyx_t_5, 1, __pyx_v_log_level);
    __Pyx_GIVEREF(__pyx_v_log_level);
    __Pyx_INCREF(__pyx_v_message);
    PyList_SET_ITEM(__pyx_t_5, 2, __pyx_v_message);
    __Pyx_GIVEREF(__pyx_v_message);
    __pyx_t_12 = PyList_Append(__pyx_v_self->_log, ((PyObject *)__pyx_t_5)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyfmi.fmi.ModelBase.append_log_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_file);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_9ModelBase_27set_log_level(PyObject *__pyx_v_self, PyObject *__pyx_arg_level); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_9ModelBase_26set_log_level[] = "\n        Specifies the log level for PyFMI. Note that this is\n        different from the FMU logging which is specified via\n        set_debug_logging.\n\n        Parameters::\n\n            level --\n                The log level. Available values:\n                    NOTHING = 0\n                    FATAL = 1\n                    ERROR = 2\n                    WARNING = 3\n                    INFO = 4\n                    VERBOSE = 5\n                    DEBUG = 6\n                    ALL = 7\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_9ModelBase_27set_log_level(PyObject *__pyx_v_self, PyObject *__pyx_arg_level) {
  jm_log_level_enu_t __pyx_v_level;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_log_level (wrapper)", 0);
  assert(__pyx_arg_level); {
    __pyx_v_level = ((jm_log_level_enu_t)PyInt_AsLong(__pyx_arg_level)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.ModelBase.set_log_level", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_9ModelBase_26set_log_level(((struct __pyx_obj_5pyfmi_3fmi_ModelBase *)__pyx_v_self), ((jm_log_level_enu_t)__pyx_v_level));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":507
 *             self._log.append([module,log_level,message])
 * 
 *     def set_log_level(self, FMIL.jm_log_level_enu_t level):             # <<<<<<<<<<<<<<
 *         """
 *         Specifies the log level for PyFMI. Note that this is
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_9ModelBase_26set_log_level(struct __pyx_obj_5pyfmi_3fmi_ModelBase *__pyx_v_self, jm_log_level_enu_t __pyx_v_level) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_log_level", 0);

  /* "pyfmi\fmi.pyx":526
 *                     ALL = 7
 *         """
 *         if level < FMIL.jm_log_level_nothing or level > FMIL.jm_log_level_all:             # <<<<<<<<<<<<<<
 *             raise FMUException("Invalid log level for FMI Library (0-7).")
 *         self.callbacks.log_level = level
 */
  __pyx_t_1 = (__pyx_v_level < jm_log_level_nothing);
  if (!__pyx_t_1) {
    __pyx_t_2 = (__pyx_v_level > jm_log_level_all);
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":527
 *         """
 *         if level < FMIL.jm_log_level_nothing or level > FMIL.jm_log_level_all:
 *             raise FMUException("Invalid log level for FMI Library (0-7).")             # <<<<<<<<<<<<<<
 *         self.callbacks.log_level = level
 * 
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_19), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":528
 *         if level < FMIL.jm_log_level_nothing or level > FMIL.jm_log_level_all:
 *             raise FMUException("Invalid log level for FMI Library (0-7).")
 *         self.callbacks.log_level = level             # <<<<<<<<<<<<<<
 * 
 *     def _convert_filter(self, expression):
 */
  __pyx_v_self->callbacks.log_level = __pyx_v_level;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyfmi.fmi.ModelBase.set_log_level", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_9ModelBase_29_convert_filter(PyObject *__pyx_v_self, PyObject *__pyx_v_expression); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_9ModelBase_28_convert_filter[] = "\n        Convert a filter based on unix filename pattern matching to a\n        list of regular expressions.\n\n        Parameters::\n\n            expression--\n                String or list to convert.\n\n        Returns::\n\n            The converted filter.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_9ModelBase_29_convert_filter(PyObject *__pyx_v_self, PyObject *__pyx_v_expression) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_convert_filter (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_9ModelBase_28_convert_filter(((struct __pyx_obj_5pyfmi_3fmi_ModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_expression));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":530
 *         self.callbacks.log_level = level
 * 
 *     def _convert_filter(self, expression):             # <<<<<<<<<<<<<<
 *         """
 *         Convert a filter based on unix filename pattern matching to a
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_9ModelBase_28_convert_filter(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_ModelBase *__pyx_v_self, PyObject *__pyx_v_expression) {
  PyObject *__pyx_v_regexp = NULL;
  PyObject *__pyx_v_regex = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_convert_filter", 0);

  /* "pyfmi\fmi.pyx":544
 *             The converted filter.
 *         """
 *         regexp = []             # <<<<<<<<<<<<<<
 *         if isinstance(expression,str):
 *             regex = fnmatch.translate(expression)
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_regexp = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":545
 *         """
 *         regexp = []
 *         if isinstance(expression,str):             # <<<<<<<<<<<<<<
 *             regex = fnmatch.translate(expression)
 *             regexp = [re.compile(regex)]
 */
  __pyx_t_2 = PyString_Check(__pyx_v_expression); 
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":546
 *         regexp = []
 *         if isinstance(expression,str):
 *             regex = fnmatch.translate(expression)             # <<<<<<<<<<<<<<
 *             regexp = [re.compile(regex)]
 *         elif isinstance(expression,list):
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__fnmatch); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__translate); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_expression);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_expression);
    __Pyx_GIVEREF(__pyx_v_expression);
    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_v_regex = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "pyfmi\fmi.pyx":547
 *         if isinstance(expression,str):
 *             regex = fnmatch.translate(expression)
 *             regexp = [re.compile(regex)]             # <<<<<<<<<<<<<<
 *         elif isinstance(expression,list):
 *             regex = ""
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__re); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__compile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_regex);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_regex);
    __Pyx_GIVEREF(__pyx_v_regex);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_v_regexp));
    __pyx_v_regexp = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L3;
  }

  /* "pyfmi\fmi.pyx":548
 *             regex = fnmatch.translate(expression)
 *             regexp = [re.compile(regex)]
 *         elif isinstance(expression,list):             # <<<<<<<<<<<<<<
 *             regex = ""
 *             for i in expression:
 */
  __pyx_t_2 = PyList_Check(__pyx_v_expression); 
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":549
 *             regexp = [re.compile(regex)]
 *         elif isinstance(expression,list):
 *             regex = ""             # <<<<<<<<<<<<<<
 *             for i in expression:
 *                 regex = regex + fnmatch.translate(i) + "|"
 */
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_12));
    __pyx_v_regex = ((PyObject *)__pyx_kp_s_12);

    /* "pyfmi\fmi.pyx":550
 *         elif isinstance(expression,list):
 *             regex = ""
 *             for i in expression:             # <<<<<<<<<<<<<<
 *                 regex = regex + fnmatch.translate(i) + "|"
 *             regexp = [re.compile(regex[:-1])]
 */
    if (PyList_CheckExact(__pyx_v_expression) || PyTuple_CheckExact(__pyx_v_expression)) {
      __pyx_t_4 = __pyx_v_expression; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_expression); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_3 = __pyx_t_6(__pyx_t_4);
        if (unlikely(!__pyx_t_3)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF(__pyx_v_i);
      __pyx_v_i = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "pyfmi\fmi.pyx":551
 *             regex = ""
 *             for i in expression:
 *                 regex = regex + fnmatch.translate(i) + "|"             # <<<<<<<<<<<<<<
 *             regexp = [re.compile(regex[:-1])]
 *         else:
 */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__fnmatch); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__translate); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_i);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_i);
      __Pyx_GIVEREF(__pyx_v_i);
      __pyx_t_7 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_t_3 = PyNumber_Add(__pyx_v_regex, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyNumber_Add(__pyx_t_3, ((PyObject *)__pyx_kp_s_20)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_v_regex);
      __pyx_v_regex = __pyx_t_7;
      __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyfmi\fmi.pyx":552
 *             for i in expression:
 *                 regex = regex + fnmatch.translate(i) + "|"
 *             regexp = [re.compile(regex[:-1])]             # <<<<<<<<<<<<<<
 *         else:
 *             raise FMUException("Unknown input.")
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__re); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__compile); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PySequence_GetSlice(__pyx_v_regex, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_v_regexp));
    __pyx_v_regexp = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":554
 *             regexp = [re.compile(regex[:-1])]
 *         else:
 *             raise FMUException("Unknown input.")             # <<<<<<<<<<<<<<
 *         return regexp
 * 
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_22), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":555
 *         else:
 *             raise FMUException("Unknown input.")
 *         return regexp             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_regexp));
  __pyx_r = ((PyObject *)__pyx_v_regexp);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyfmi.fmi.ModelBase._convert_filter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_regexp);
  __Pyx_XDECREF(__pyx_v_regex);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_14ScalarVariable_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_14ScalarVariable_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_value_reference = 0;
  PyObject *__pyx_v_type = 0;
  PyObject *__pyx_v_description = 0;
  PyObject *__pyx_v_variability = 0;
  PyObject *__pyx_v_causality = 0;
  PyObject *__pyx_v_alias = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__name,&__pyx_n_s__value_reference,&__pyx_n_s__type,&__pyx_n_s__description,&__pyx_n_s__variability,&__pyx_n_s__causality,&__pyx_n_s__alias,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    values[3] = ((PyObject *)__pyx_kp_s_12);
    values[4] = __pyx_k_23;
    values[5] = __pyx_k_24;
    values[6] = __pyx_k_25;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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__name)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value_reference)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 7, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__type)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 7, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__description);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__variability);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__causality);
          if (value) { values[5] = value; kw_args--; }
        }
        case  6:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__alias);
          if (value) { values[6] = value; kw_args--; }
        }
      }
      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 = 572; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_name = values[0];
    __pyx_v_value_reference = values[1];
    __pyx_v_type = values[2];
    __pyx_v_description = values[3];
    __pyx_v_variability = values[4];
    __pyx_v_causality = values[5];
    __pyx_v_alias = values[6];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.ScalarVariable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_14ScalarVariable___init__(((struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *)__pyx_v_self), __pyx_v_name, __pyx_v_value_reference, __pyx_v_type, __pyx_v_description, __pyx_v_variability, __pyx_v_causality, __pyx_v_alias);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":572
 *     Class defining data structure based on the XML element ScalarVariable.
 *     """
 *     def __init__(self, name, value_reference, type, description="",             # <<<<<<<<<<<<<<
 *                        variability=FMIL.fmi1_variability_enu_continuous,
 *                        causality=FMIL.fmi1_causality_enu_internal,
 */

static int __pyx_pf_5pyfmi_3fmi_14ScalarVariable___init__(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value_reference, PyObject *__pyx_v_type, PyObject *__pyx_v_description, PyObject *__pyx_v_variability, PyObject *__pyx_v_causality, PyObject *__pyx_v_alias) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  fmi1_value_reference_t __pyx_t_1;
  enum fmi1_base_type_enu_t __pyx_t_2;
  enum fmi1_variability_enu_t __pyx_t_3;
  enum fmi1_causality_enu_t __pyx_t_4;
  enum fmi1_variable_alias_kind_enu_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyfmi\fmi.pyx":577
 *                        alias=FMIL.fmi1_variable_is_not_alias):
 * 
 *         self._name            = name             # <<<<<<<<<<<<<<
 *         self._value_reference = value_reference
 *         self._type            = type
 */
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __Pyx_GOTREF(__pyx_v_self->_name);
  __Pyx_DECREF(__pyx_v_self->_name);
  __pyx_v_self->_name = __pyx_v_name;

  /* "pyfmi\fmi.pyx":578
 * 
 *         self._name            = name
 *         self._value_reference = value_reference             # <<<<<<<<<<<<<<
 *         self._type            = type
 *         self._description     = description
 */
  __pyx_t_1 = __Pyx_PyInt_from_py_fmi1_value_reference_t(__pyx_v_value_reference); if (unlikely((__pyx_t_1 == (fmi1_value_reference_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_value_reference = __pyx_t_1;

  /* "pyfmi\fmi.pyx":579
 *         self._name            = name
 *         self._value_reference = value_reference
 *         self._type            = type             # <<<<<<<<<<<<<<
 *         self._description     = description
 *         self._variability     = variability
 */
  __pyx_t_2 = ((enum fmi1_base_type_enu_t)PyInt_AsLong(__pyx_v_type)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_type = __pyx_t_2;

  /* "pyfmi\fmi.pyx":580
 *         self._value_reference = value_reference
 *         self._type            = type
 *         self._description     = description             # <<<<<<<<<<<<<<
 *         self._variability     = variability
 *         self._causality       = causality
 */
  __Pyx_INCREF(__pyx_v_description);
  __Pyx_GIVEREF(__pyx_v_description);
  __Pyx_GOTREF(__pyx_v_self->_description);
  __Pyx_DECREF(__pyx_v_self->_description);
  __pyx_v_self->_description = __pyx_v_description;

  /* "pyfmi\fmi.pyx":581
 *         self._type            = type
 *         self._description     = description
 *         self._variability     = variability             # <<<<<<<<<<<<<<
 *         self._causality       = causality
 *         self._alias           = alias
 */
  __pyx_t_3 = ((enum fmi1_variability_enu_t)PyInt_AsLong(__pyx_v_variability)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_variability = __pyx_t_3;

  /* "pyfmi\fmi.pyx":582
 *         self._description     = description
 *         self._variability     = variability
 *         self._causality       = causality             # <<<<<<<<<<<<<<
 *         self._alias           = alias
 * 
 */
  __pyx_t_4 = ((enum fmi1_causality_enu_t)PyInt_AsLong(__pyx_v_causality)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_causality = __pyx_t_4;

  /* "pyfmi\fmi.pyx":583
 *         self._variability     = variability
 *         self._causality       = causality
 *         self._alias           = alias             # <<<<<<<<<<<<<<
 * 
 *     def _get_name(self):
 */
  __pyx_t_5 = ((enum fmi1_variable_alias_kind_enu_t)PyInt_AsLong(__pyx_v_alias)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_alias = __pyx_t_5;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyfmi.fmi.ScalarVariable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_14ScalarVariable_3_get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_14ScalarVariable_2_get_name[] = "\n        Get the value of the name attribute.\n\n        Returns::\n\n            The name attribute value as string.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_14ScalarVariable_3_get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_name (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_14ScalarVariable_2_get_name(((struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":585
 *         self._alias           = alias
 * 
 *     def _get_name(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the value of the name attribute.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_14ScalarVariable_2_get_name(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_name", 0);

  /* "pyfmi\fmi.pyx":593
 *             The name attribute value as string.
 *         """
 *         return self._name             # <<<<<<<<<<<<<<
 *     name = property(_get_name)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_name);
  __pyx_r = __pyx_v_self->_name;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_14ScalarVariable_5_get_value_reference(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_14ScalarVariable_4_get_value_reference[] = "\n        Get the value of the value reference attribute.\n\n        Returns::\n\n            The value reference as unsigned int.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_14ScalarVariable_5_get_value_reference(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_value_reference (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_14ScalarVariable_4_get_value_reference(((struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":596
 *     name = property(_get_name)
 * 
 *     def _get_value_reference(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the value of the value reference attribute.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_14ScalarVariable_4_get_value_reference(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *__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("_get_value_reference", 0);

  /* "pyfmi\fmi.pyx":604
 *             The value reference as unsigned int.
 *         """
 *         return self._value_reference             # <<<<<<<<<<<<<<
 *     value_reference = property(_get_value_reference)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_fmi1_value_reference_t(__pyx_v_self->_value_reference); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.ScalarVariable._get_value_reference", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_14ScalarVariable_7_get_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_14ScalarVariable_6_get_type[] = "\n        Get the value of the data type attribute.\n\n        Returns::\n\n            The data type attribute value as enumeration: FMI_REAL,\n            FMI_INTEGER, FMI_BOOLEAN, FMI_ENUMERATION or FMI_STRING.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_14ScalarVariable_7_get_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_type (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_14ScalarVariable_6_get_type(((struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":607
 *     value_reference = property(_get_value_reference)
 * 
 *     def _get_type(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the value of the data type attribute.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_14ScalarVariable_6_get_type(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *__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("_get_type", 0);

  /* "pyfmi\fmi.pyx":616
 *             FMI_INTEGER, FMI_BOOLEAN, FMI_ENUMERATION or FMI_STRING.
 *         """
 *         return self._type             # <<<<<<<<<<<<<<
 *     type = property(_get_type)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(__pyx_v_self->_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.ScalarVariable._get_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_14ScalarVariable_9_get_description(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_14ScalarVariable_8_get_description[] = "\n        Get the value of the description attribute.\n\n        Returns::\n\n            The description attribute value as string (empty string if\n            not set).\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_14ScalarVariable_9_get_description(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_description (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_14ScalarVariable_8_get_description(((struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":619
 *     type = property(_get_type)
 * 
 *     def _get_description(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the value of the description attribute.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_14ScalarVariable_8_get_description(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_description", 0);

  /* "pyfmi\fmi.pyx":628
 *             not set).
 *         """
 *         return self._description             # <<<<<<<<<<<<<<
 *     description = property(_get_description)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_description);
  __pyx_r = __pyx_v_self->_description;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_14ScalarVariable_11_get_variability(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_14ScalarVariable_10_get_variability[] = "\n        Get the value of the variability attribute.\n\n        Returns::\n\n            The variability attribute value as enumeration:\n            FMI_CONTINUOUS, FMI_CONSTANT, FMI_PARAMETER or FMI_DISCRETE.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_14ScalarVariable_11_get_variability(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_variability (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_14ScalarVariable_10_get_variability(((struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":631
 *     description = property(_get_description)
 * 
 *     def _get_variability(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the value of the variability attribute.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_14ScalarVariable_10_get_variability(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *__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("_get_variability", 0);

  /* "pyfmi\fmi.pyx":640
 *             FMI_CONTINUOUS, FMI_CONSTANT, FMI_PARAMETER or FMI_DISCRETE.
 *         """
 *         return self._variability             # <<<<<<<<<<<<<<
 *     variability = property(_get_variability)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(__pyx_v_self->_variability); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.ScalarVariable._get_variability", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_14ScalarVariable_13_get_causality(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_14ScalarVariable_12_get_causality[] = "\n        Get the value of the causality attribute.\n\n        Returns::\n\n            The causality attribute value as enumeration: FMI_INTERNAL,\n            FMI_INPUT, FMI_OUTPUT or FMI_NONE.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_14ScalarVariable_13_get_causality(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_causality (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_14ScalarVariable_12_get_causality(((struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":643
 *     variability = property(_get_variability)
 * 
 *     def _get_causality(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the value of the causality attribute.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_14ScalarVariable_12_get_causality(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *__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("_get_causality", 0);

  /* "pyfmi\fmi.pyx":652
 *             FMI_INPUT, FMI_OUTPUT or FMI_NONE.
 *         """
 *         return self._causality             # <<<<<<<<<<<<<<
 *     causality = property(_get_causality)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(__pyx_v_self->_causality); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.ScalarVariable._get_causality", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_14ScalarVariable_15_get_alias(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_14ScalarVariable_14_get_alias[] = "\n        Get the value of the alias attribute.\n\n        Returns::\n\n            The alias attribute value as enumeration: FMI_NO_ALIAS,\n            FMI_ALIAS or FMI_NEGATED_ALIAS.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_14ScalarVariable_15_get_alias(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_alias (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_14ScalarVariable_14_get_alias(((struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":655
 *     causality = property(_get_causality)
 * 
 *     def _get_alias(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the value of the alias attribute.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_14ScalarVariable_14_get_alias(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *__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("_get_alias", 0);

  /* "pyfmi\fmi.pyx":664
 *             FMI_ALIAS or FMI_NEGATED_ALIAS.
 *         """
 *         return self._alias             # <<<<<<<<<<<<<<
 *     alias = property(_get_alias)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(__pyx_v_self->_alias); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.ScalarVariable._get_alias", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_15ScalarVariable2_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_15ScalarVariable2_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_value_reference = 0;
  PyObject *__pyx_v_type = 0;
  PyObject *__pyx_v_description = 0;
  PyObject *__pyx_v_variability = 0;
  PyObject *__pyx_v_causality = 0;
  PyObject *__pyx_v_alias = 0;
  PyObject *__pyx_v_initial = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__name,&__pyx_n_s__value_reference,&__pyx_n_s__type,&__pyx_n_s__description,&__pyx_n_s__variability,&__pyx_n_s__causality,&__pyx_n_s__alias,&__pyx_n_s__initial,0};
    PyObject* values[8] = {0,0,0,0,0,0,0,0};
    values[3] = ((PyObject *)__pyx_kp_s_12);
    values[4] = __pyx_k_26;
    values[5] = __pyx_k_27;
    values[6] = __pyx_k_28;
    values[7] = __pyx_k_29;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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__name)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value_reference)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 8, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__type)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 8, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__description);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__variability);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__causality);
          if (value) { values[5] = value; kw_args--; }
        }
        case  6:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__alias);
          if (value) { values[6] = value; kw_args--; }
        }
        case  7:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__initial);
          if (value) { values[7] = value; kw_args--; }
        }
      }
      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 = 671; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_name = values[0];
    __pyx_v_value_reference = values[1];
    __pyx_v_type = values[2];
    __pyx_v_description = values[3];
    __pyx_v_variability = values[4];
    __pyx_v_causality = values[5];
    __pyx_v_alias = values[6];
    __pyx_v_initial = values[7];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 8, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.ScalarVariable2.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_15ScalarVariable2___init__(((struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *)__pyx_v_self), __pyx_v_name, __pyx_v_value_reference, __pyx_v_type, __pyx_v_description, __pyx_v_variability, __pyx_v_causality, __pyx_v_alias, __pyx_v_initial);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":671
 *     Class defining data structure based on the XML element ScalarVariable.
 *     """
 *     def __init__(self, name, value_reference, type, description = "",             # <<<<<<<<<<<<<<
 *                        variability = FMIL.fmi2_variability_enu_unknown,
 *                        causality   = FMIL.fmi2_causality_enu_unknown,
 */

static int __pyx_pf_5pyfmi_3fmi_15ScalarVariable2___init__(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value_reference, PyObject *__pyx_v_type, PyObject *__pyx_v_description, PyObject *__pyx_v_variability, PyObject *__pyx_v_causality, PyObject *__pyx_v_alias, PyObject *__pyx_v_initial) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  fmi2_value_reference_t __pyx_t_1;
  fmi2_base_type_enu_t __pyx_t_2;
  fmi2_variability_enu_t __pyx_t_3;
  fmi2_causality_enu_t __pyx_t_4;
  fmi2_variable_alias_kind_enu_t __pyx_t_5;
  fmi2_initial_enu_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyfmi\fmi.pyx":677
 *                        initial     = FMIL.fmi2_initial_enu_unknown):
 * 
 *         self._name            = name             # <<<<<<<<<<<<<<
 *         self._value_reference = value_reference
 *         self._type            = type
 */
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __Pyx_GOTREF(__pyx_v_self->_name);
  __Pyx_DECREF(__pyx_v_self->_name);
  __pyx_v_self->_name = __pyx_v_name;

  /* "pyfmi\fmi.pyx":678
 * 
 *         self._name            = name
 *         self._value_reference = value_reference             # <<<<<<<<<<<<<<
 *         self._type            = type
 *         self._description     = description
 */
  __pyx_t_1 = __Pyx_PyInt_AsSize_t(__pyx_v_value_reference); if (unlikely((__pyx_t_1 == (fmi2_value_reference_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_value_reference = __pyx_t_1;

  /* "pyfmi\fmi.pyx":679
 *         self._name            = name
 *         self._value_reference = value_reference
 *         self._type            = type             # <<<<<<<<<<<<<<
 *         self._description     = description
 *         self._variability     = variability
 */
  __pyx_t_2 = ((fmi2_base_type_enu_t)PyInt_AsLong(__pyx_v_type)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_type = __pyx_t_2;

  /* "pyfmi\fmi.pyx":680
 *         self._value_reference = value_reference
 *         self._type            = type
 *         self._description     = description             # <<<<<<<<<<<<<<
 *         self._variability     = variability
 *         self._causality       = causality
 */
  __Pyx_INCREF(__pyx_v_description);
  __Pyx_GIVEREF(__pyx_v_description);
  __Pyx_GOTREF(__pyx_v_self->_description);
  __Pyx_DECREF(__pyx_v_self->_description);
  __pyx_v_self->_description = __pyx_v_description;

  /* "pyfmi\fmi.pyx":681
 *         self._type            = type
 *         self._description     = description
 *         self._variability     = variability             # <<<<<<<<<<<<<<
 *         self._causality       = causality
 *         self._alias           = alias
 */
  __pyx_t_3 = ((fmi2_variability_enu_t)PyInt_AsLong(__pyx_v_variability)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_variability = __pyx_t_3;

  /* "pyfmi\fmi.pyx":682
 *         self._description     = description
 *         self._variability     = variability
 *         self._causality       = causality             # <<<<<<<<<<<<<<
 *         self._alias           = alias
 *         self._initial         = initial
 */
  __pyx_t_4 = ((fmi2_causality_enu_t)PyInt_AsLong(__pyx_v_causality)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_causality = __pyx_t_4;

  /* "pyfmi\fmi.pyx":683
 *         self._variability     = variability
 *         self._causality       = causality
 *         self._alias           = alias             # <<<<<<<<<<<<<<
 *         self._initial         = initial
 * 
 */
  __pyx_t_5 = ((fmi2_variable_alias_kind_enu_t)PyInt_AsLong(__pyx_v_alias)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_alias = __pyx_t_5;

  /* "pyfmi\fmi.pyx":684
 *         self._causality       = causality
 *         self._alias           = alias
 *         self._initial         = initial             # <<<<<<<<<<<<<<
 * 
 *     def _get_name(self):
 */
  __pyx_t_6 = ((fmi2_initial_enu_t)PyInt_AsLong(__pyx_v_initial)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_initial = __pyx_t_6;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyfmi.fmi.ScalarVariable2.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_15ScalarVariable2_3_get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_15ScalarVariable2_2_get_name[] = "\n        Get the value of the name attribute.\n\n        Returns::\n\n            The name attribute value as string.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_15ScalarVariable2_3_get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_name (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_15ScalarVariable2_2_get_name(((struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":686
 *         self._initial         = initial
 * 
 *     def _get_name(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the value of the name attribute.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_15ScalarVariable2_2_get_name(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_name", 0);

  /* "pyfmi\fmi.pyx":694
 *             The name attribute value as string.
 *         """
 *         return self._name             # <<<<<<<<<<<<<<
 *     name = property(_get_name)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_name);
  __pyx_r = __pyx_v_self->_name;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_15ScalarVariable2_5_get_value_reference(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_15ScalarVariable2_4_get_value_reference[] = "\n        Get the value of the value reference attribute.\n\n        Returns::\n\n            The value reference as unsigned int.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_15ScalarVariable2_5_get_value_reference(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_value_reference (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_15ScalarVariable2_4_get_value_reference(((struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":697
 *     name = property(_get_name)
 * 
 *     def _get_value_reference(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the value of the value reference attribute.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_15ScalarVariable2_4_get_value_reference(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *__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("_get_value_reference", 0);

  /* "pyfmi\fmi.pyx":705
 *             The value reference as unsigned int.
 *         """
 *         return self._value_reference             # <<<<<<<<<<<<<<
 *     value_reference = property(_get_value_reference)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_self->_value_reference); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.ScalarVariable2._get_value_reference", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_15ScalarVariable2_7_get_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_15ScalarVariable2_6_get_type[] = "\n        Get the value of the data type attribute.\n\n        Returns::\n\n            The data type attribute value as enumeration: FMI_REAL,\n            FMI_INTEGER, FMI_BOOLEAN, FMI_ENUMERATION or FMI_STRING.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_15ScalarVariable2_7_get_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_type (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_15ScalarVariable2_6_get_type(((struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":708
 *     value_reference = property(_get_value_reference)
 * 
 *     def _get_type(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the value of the data type attribute.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_15ScalarVariable2_6_get_type(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *__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("_get_type", 0);

  /* "pyfmi\fmi.pyx":717
 *             FMI_INTEGER, FMI_BOOLEAN, FMI_ENUMERATION or FMI_STRING.
 *         """
 *         return self._type             # <<<<<<<<<<<<<<
 *     type = property(_get_type)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(__pyx_v_self->_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.ScalarVariable2._get_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_15ScalarVariable2_9_get_description(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_15ScalarVariable2_8_get_description[] = "\n        Get the value of the description attribute.\n\n        Returns::\n\n            The description attribute value as string (empty string if\n            not set).\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_15ScalarVariable2_9_get_description(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_description (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_15ScalarVariable2_8_get_description(((struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":720
 *     type = property(_get_type)
 * 
 *     def _get_description(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the value of the description attribute.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_15ScalarVariable2_8_get_description(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_description", 0);

  /* "pyfmi\fmi.pyx":729
 *             not set).
 *         """
 *         return self._description             # <<<<<<<<<<<<<<
 *     description = property(_get_description)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_description);
  __pyx_r = __pyx_v_self->_description;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_15ScalarVariable2_11_get_variability(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_15ScalarVariable2_10_get_variability[] = "\n        Get the value of the variability attribute.\n\n        Returns::\n\n            The variability attribute value as enumeration:\n            FMI_CONTINUOUS, FMI_CONSTANT, FMI_PARAMETER or FMI_DISCRETE.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_15ScalarVariable2_11_get_variability(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_variability (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_15ScalarVariable2_10_get_variability(((struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":732
 *     description = property(_get_description)
 * 
 *     def _get_variability(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the value of the variability attribute.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_15ScalarVariable2_10_get_variability(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *__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("_get_variability", 0);

  /* "pyfmi\fmi.pyx":741
 *             FMI_CONTINUOUS, FMI_CONSTANT, FMI_PARAMETER or FMI_DISCRETE.
 *         """
 *         return self._variability             # <<<<<<<<<<<<<<
 *     variability = property(_get_variability)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(__pyx_v_self->_variability); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.ScalarVariable2._get_variability", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_15ScalarVariable2_13_get_causality(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_15ScalarVariable2_12_get_causality[] = "\n        Get the value of the causality attribute.\n\n        Returns::\n\n            The causality attribute value as enumeration: FMI_INTERNAL,\n            FMI_INPUT, FMI_OUTPUT or FMI_NONE.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_15ScalarVariable2_13_get_causality(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_causality (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_15ScalarVariable2_12_get_causality(((struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":744
 *     variability = property(_get_variability)
 * 
 *     def _get_causality(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the value of the causality attribute.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_15ScalarVariable2_12_get_causality(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *__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("_get_causality", 0);

  /* "pyfmi\fmi.pyx":753
 *             FMI_INPUT, FMI_OUTPUT or FMI_NONE.
 *         """
 *         return self._causality             # <<<<<<<<<<<<<<
 *     causality = property(_get_causality)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(__pyx_v_self->_causality); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.ScalarVariable2._get_causality", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_15ScalarVariable2_15_get_alias(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_15ScalarVariable2_14_get_alias[] = "\n        Get the value of the alias attribute.\n\n        Returns::\n\n            The alias attribute value as enumeration: FMI_NO_ALIAS,\n            FMI_ALIAS or FMI_NEGATED_ALIAS.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_15ScalarVariable2_15_get_alias(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_alias (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_15ScalarVariable2_14_get_alias(((struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":756
 *     causality = property(_get_causality)
 * 
 *     def _get_alias(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the value of the alias attribute.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_15ScalarVariable2_14_get_alias(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *__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("_get_alias", 0);

  /* "pyfmi\fmi.pyx":765
 *             FMI_ALIAS or FMI_NEGATED_ALIAS.
 *         """
 *         return self._alias             # <<<<<<<<<<<<<<
 *     alias = property(_get_alias)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(__pyx_v_self->_alias); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.ScalarVariable2._get_alias", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_15ScalarVariable2_17_get_initial(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_15ScalarVariable2_16_get_initial[] = "\n        Get the value of the initial attribute.\n\n        Returns::\n\n            The initial attribute value as enumeration: FMI2_INITIAL_EXACT, \n                              FMI2_INITIAL_APPROX, FMI2_INITIAL_CALCULATED, \n                              FMI2_INITIAL_UNKNOWN    \n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_15ScalarVariable2_17_get_initial(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_initial (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_15ScalarVariable2_16_get_initial(((struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":768
 *     alias = property(_get_alias)
 * 
 *     def _get_initial(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the value of the initial attribute.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_15ScalarVariable2_16_get_initial(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *__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("_get_initial", 0);

  /* "pyfmi\fmi.pyx":778
 *                               FMI2_INITIAL_UNKNOWN
 *         """
 *         return self._initial             # <<<<<<<<<<<<<<
 *     initial = property(_get_initial)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(__pyx_v_self->_initial); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.ScalarVariable2._get_initial", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_9FMUState2_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_9FMUState2_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_9FMUState2___init__(((struct __pyx_obj_5pyfmi_3fmi_FMUState2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":785
 *     Class containing a pointer to a FMU-state.
 *     """
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.fmu_state = NULL
 * 
 */

static int __pyx_pf_5pyfmi_3fmi_9FMUState2___init__(struct __pyx_obj_5pyfmi_3fmi_FMUState2 *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyfmi\fmi.pyx":786
 *     """
 *     def __init__(self):
 *         self.fmu_state = NULL             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->fmu_state = NULL;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase___init__[] = "\n        Constructor.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_5pyfmi_3fmi_12FMUModelBase___init__;
#endif
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fmu = 0;
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_enable_logging = 0;
  PyObject *__pyx_v_log_file_name = 0;
  PyObject *__pyx_v_log_level = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fmu,&__pyx_n_s__path,&__pyx_n_s__enable_logging,&__pyx_n_s__log_file_name,&__pyx_n_s__log_level,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_kp_s_30);

    /* "pyfmi\fmi.pyx":794
 *     An FMI Model loaded from a DLL.
 *     """
 *     def __init__(self, fmu, path='.', enable_logging=None, log_file_name="", log_level=FMI_DEFAULT_LOG_LEVEL):             # <<<<<<<<<<<<<<
 *         """
 *         Constructor.
 */
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)__pyx_kp_s_12);
    values[4] = __pyx_k_31;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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__fmu)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__enable_logging);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__log_file_name);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__log_level);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      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 = 794; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_fmu = values[0];
    __pyx_v_path = values[1];
    __pyx_v_enable_logging = values[2];
    __pyx_v_log_file_name = values[3];
    __pyx_v_log_level = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase___init__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_v_fmu, __pyx_v_path, __pyx_v_enable_logging, __pyx_v_log_file_name, __pyx_v_log_level);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase___init__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_fmu, PyObject *__pyx_v_path, PyObject *__pyx_v_enable_logging, PyObject *__pyx_v_log_file_name, PyObject *__pyx_v_log_level) {
  int __pyx_v_status;
  int __pyx_v_version;
  PyObject *__pyx_v_fmu_full_path = NULL;
  PyObject *__pyx_v_fmu_temp_dir = NULL;
  PyObject *__pyx_v_last_error = NULL;
  PyObject *__pyx_v_fmu_kind = NULL;
  PyObject *__pyx_v_fmu_log_name = NULL;
  PyObject *__pyx_v_file = NULL;
  PyObject *__pyx_v_i = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  jm_log_level_enu_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  char *__pyx_t_9;
  char *__pyx_t_10;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  Py_ssize_t __pyx_t_16;
  PyObject *(*__pyx_t_17)(PyObject *);
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);
  __Pyx_INCREF(__pyx_v_enable_logging);

  /* "pyfmi\fmi.pyx":802
 * 
 *         #Contains the log information
 *         self._log = []             # <<<<<<<<<<<<<<
 * 
 *         #Used for deallocation
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_self->__pyx_base._log);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base._log));
  __pyx_v_self->__pyx_base._log = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":805
 * 
 *         #Used for deallocation
 *         self._allocated_context = 0             # <<<<<<<<<<<<<<
 *         self._allocated_dll     = 0
 *         self._allocated_xml     = 0
 */
  __pyx_v_self->_allocated_context = 0;

  /* "pyfmi\fmi.pyx":806
 *         #Used for deallocation
 *         self._allocated_context = 0
 *         self._allocated_dll     = 0             # <<<<<<<<<<<<<<
 *         self._allocated_xml     = 0
 *         self._allocated_fmu     = 0
 */
  __pyx_v_self->_allocated_dll = 0;

  /* "pyfmi\fmi.pyx":807
 *         self._allocated_context = 0
 *         self._allocated_dll     = 0
 *         self._allocated_xml     = 0             # <<<<<<<<<<<<<<
 *         self._allocated_fmu     = 0
 *         self._instantiated_fmu  = 0
 */
  __pyx_v_self->_allocated_xml = 0;

  /* "pyfmi\fmi.pyx":808
 *         self._allocated_dll     = 0
 *         self._allocated_xml     = 0
 *         self._allocated_fmu     = 0             # <<<<<<<<<<<<<<
 *         self._instantiated_fmu  = 0
 *         self._allocated_list = False
 */
  __pyx_v_self->_allocated_fmu = 0;

  /* "pyfmi\fmi.pyx":809
 *         self._allocated_xml     = 0
 *         self._allocated_fmu     = 0
 *         self._instantiated_fmu  = 0             # <<<<<<<<<<<<<<
 *         self._allocated_list = False
 *         self._fmu_temp_dir = NULL
 */
  __pyx_v_self->_instantiated_fmu = 0;

  /* "pyfmi\fmi.pyx":810
 *         self._allocated_fmu     = 0
 *         self._instantiated_fmu  = 0
 *         self._allocated_list = False             # <<<<<<<<<<<<<<
 *         self._fmu_temp_dir = NULL
 *         self._fmu_log_name = NULL
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_allocated_list);
  __Pyx_DECREF(__pyx_v_self->_allocated_list);
  __pyx_v_self->_allocated_list = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":811
 *         self._instantiated_fmu  = 0
 *         self._allocated_list = False
 *         self._fmu_temp_dir = NULL             # <<<<<<<<<<<<<<
 *         self._fmu_log_name = NULL
 * 
 */
  __pyx_v_self->_fmu_temp_dir = NULL;

  /* "pyfmi\fmi.pyx":812
 *         self._allocated_list = False
 *         self._fmu_temp_dir = NULL
 *         self._fmu_log_name = NULL             # <<<<<<<<<<<<<<
 * 
 *         #Specify the general callback functions
 */
  __pyx_v_self->__pyx_base._fmu_log_name = NULL;

  /* "pyfmi\fmi.pyx":815
 * 
 *         #Specify the general callback functions
 *         self.callbacks.malloc  = FMIL.malloc             # <<<<<<<<<<<<<<
 *         self.callbacks.calloc  = FMIL.calloc
 *         self.callbacks.realloc = FMIL.realloc
 */
  __pyx_v_self->__pyx_base.callbacks.malloc = malloc;

  /* "pyfmi\fmi.pyx":816
 *         #Specify the general callback functions
 *         self.callbacks.malloc  = FMIL.malloc
 *         self.callbacks.calloc  = FMIL.calloc             # <<<<<<<<<<<<<<
 *         self.callbacks.realloc = FMIL.realloc
 *         self.callbacks.free    = FMIL.free
 */
  __pyx_v_self->__pyx_base.callbacks.calloc = calloc;

  /* "pyfmi\fmi.pyx":817
 *         self.callbacks.malloc  = FMIL.malloc
 *         self.callbacks.calloc  = FMIL.calloc
 *         self.callbacks.realloc = FMIL.realloc             # <<<<<<<<<<<<<<
 *         self.callbacks.free    = FMIL.free
 *         self.callbacks.logger  = importlogger
 */
  __pyx_v_self->__pyx_base.callbacks.realloc = realloc;

  /* "pyfmi\fmi.pyx":818
 *         self.callbacks.calloc  = FMIL.calloc
 *         self.callbacks.realloc = FMIL.realloc
 *         self.callbacks.free    = FMIL.free             # <<<<<<<<<<<<<<
 *         self.callbacks.logger  = importlogger
 *         self.callbacks.context = <void*>self #Class loggger
 */
  __pyx_v_self->__pyx_base.callbacks.free = free;

  /* "pyfmi\fmi.pyx":819
 *         self.callbacks.realloc = FMIL.realloc
 *         self.callbacks.free    = FMIL.free
 *         self.callbacks.logger  = importlogger             # <<<<<<<<<<<<<<
 *         self.callbacks.context = <void*>self #Class loggger
 * 
 */
  __pyx_v_self->__pyx_base.callbacks.logger = __pyx_f_5pyfmi_3fmi_importlogger;

  /* "pyfmi\fmi.pyx":820
 *         self.callbacks.free    = FMIL.free
 *         self.callbacks.logger  = importlogger
 *         self.callbacks.context = <void*>self #Class loggger             # <<<<<<<<<<<<<<
 * 
 *         if enable_logging==None:
 */
  __pyx_v_self->__pyx_base.callbacks.context = ((void *)__pyx_v_self);

  /* "pyfmi\fmi.pyx":822
 *         self.callbacks.context = <void*>self #Class loggger
 * 
 *         if enable_logging==None:             # <<<<<<<<<<<<<<
 *             if log_level >= FMIL.jm_log_level_nothing and log_level <= FMIL.jm_log_level_all:
 *                 if log_level == FMIL.jm_log_level_nothing:
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_enable_logging, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":823
 * 
 *         if enable_logging==None:
 *             if log_level >= FMIL.jm_log_level_nothing and log_level <= FMIL.jm_log_level_all:             # <<<<<<<<<<<<<<
 *                 if log_level == FMIL.jm_log_level_nothing:
 *                     enable_logging = False
 */
    __pyx_t_1 = PyInt_FromLong(jm_log_level_nothing); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_log_level, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_2) {
      __pyx_t_3 = PyInt_FromLong(jm_log_level_all); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyObject_RichCompare(__pyx_v_log_level, __pyx_t_3, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __pyx_t_4;
    } else {
      __pyx_t_5 = __pyx_t_2;
    }
    if (__pyx_t_5) {

      /* "pyfmi\fmi.pyx":824
 *         if enable_logging==None:
 *             if log_level >= FMIL.jm_log_level_nothing and log_level <= FMIL.jm_log_level_all:
 *                 if log_level == FMIL.jm_log_level_nothing:             # <<<<<<<<<<<<<<
 *                     enable_logging = False
 *                 else:
 */
      __pyx_t_1 = PyInt_FromLong(jm_log_level_nothing); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_log_level, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_5) {

        /* "pyfmi\fmi.pyx":825
 *             if log_level >= FMIL.jm_log_level_nothing and log_level <= FMIL.jm_log_level_all:
 *                 if log_level == FMIL.jm_log_level_nothing:
 *                     enable_logging = False             # <<<<<<<<<<<<<<
 *                 else:
 *                     enable_logging = True
 */
        __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_v_enable_logging);
        __pyx_v_enable_logging = __pyx_t_3;
        __pyx_t_3 = 0;
        goto __pyx_L5;
      }
      /*else*/ {

        /* "pyfmi\fmi.pyx":827
 *                     enable_logging = False
 *                 else:
 *                     enable_logging = True             # <<<<<<<<<<<<<<
 *                 self.callbacks.log_level = log_level
 *             else:
 */
        __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_v_enable_logging);
        __pyx_v_enable_logging = __pyx_t_3;
        __pyx_t_3 = 0;
      }
      __pyx_L5:;

      /* "pyfmi\fmi.pyx":828
 *                 else:
 *                     enable_logging = True
 *                 self.callbacks.log_level = log_level             # <<<<<<<<<<<<<<
 *             else:
 *                 raise FMUException("The log level must be between %d and %d"%(FMIL.jm_log_level_nothing, FMIL.jm_log_level_all))
 */
      __pyx_t_6 = ((jm_log_level_enu_t)PyInt_AsLong(__pyx_v_log_level)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_self->__pyx_base.callbacks.log_level = __pyx_t_6;
      goto __pyx_L4;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":830
 *                 self.callbacks.log_level = log_level
 *             else:
 *                 raise FMUException("The log level must be between %d and %d"%(FMIL.jm_log_level_nothing, FMIL.jm_log_level_all))             # <<<<<<<<<<<<<<
 *         else:
 *             logging.warning("The attribute 'enable_logging' is deprecated. Please use 'log_level' instead. Setting 'log_level' to INFO...")
 */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyInt_FromLong(jm_log_level_nothing); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = PyInt_FromLong(jm_log_level_all); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      __pyx_t_1 = 0;
      __pyx_t_7 = 0;
      __pyx_t_7 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_32), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_7));
      __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_7));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
      __pyx_t_7 = 0;
      __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
      __Pyx_Raise(__pyx_t_7, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":832
 *                 raise FMUException("The log level must be between %d and %d"%(FMIL.jm_log_level_nothing, FMIL.jm_log_level_all))
 *         else:
 *             logging.warning("The attribute 'enable_logging' is deprecated. Please use 'log_level' instead. Setting 'log_level' to INFO...")             # <<<<<<<<<<<<<<
 *             self.callbacks.log_level = FMIL.jm_log_level_info if enable_logging else FMIL.jm_log_level_error
 * 
 */
    __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__logging); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__warning); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_k_tuple_34), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "pyfmi\fmi.pyx":833
 *         else:
 *             logging.warning("The attribute 'enable_logging' is deprecated. Please use 'log_level' instead. Setting 'log_level' to INFO...")
 *             self.callbacks.log_level = FMIL.jm_log_level_info if enable_logging else FMIL.jm_log_level_error             # <<<<<<<<<<<<<<
 * 
 *         fmu_full_path = os.path.abspath(os.path.join(path,fmu))
 */
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_enable_logging); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_5) {
      __pyx_t_6 = jm_log_level_info;
    } else {
      __pyx_t_6 = jm_log_level_error;
    }
    __pyx_v_self->__pyx_base.callbacks.log_level = __pyx_t_6;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":835
 *             self.callbacks.log_level = FMIL.jm_log_level_info if enable_logging else FMIL.jm_log_level_error
 * 
 *         fmu_full_path = os.path.abspath(os.path.join(path,fmu))             # <<<<<<<<<<<<<<
 *         fmu_temp_dir  = encode(create_temp_dir())
 *         self._fmu_temp_dir = <char*>FMIL.malloc((FMIL.strlen(fmu_temp_dir)+1)*sizeof(char))
 */
  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__path); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__abspath); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__path); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__join); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_path);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  __Pyx_INCREF(__pyx_v_fmu);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_fmu);
  __Pyx_GIVEREF(__pyx_v_fmu);
  __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_v_fmu_full_path = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":836
 * 
 *         fmu_full_path = os.path.abspath(os.path.join(path,fmu))
 *         fmu_temp_dir  = encode(create_temp_dir())             # <<<<<<<<<<<<<<
 *         self._fmu_temp_dir = <char*>FMIL.malloc((FMIL.strlen(fmu_temp_dir)+1)*sizeof(char))
 *         FMIL.strcpy(self._fmu_temp_dir, fmu_temp_dir)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__create_temp_dir); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  __pyx_t_7 = 0;
  __pyx_t_7 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_v_fmu_temp_dir = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "pyfmi\fmi.pyx":837
 *         fmu_full_path = os.path.abspath(os.path.join(path,fmu))
 *         fmu_temp_dir  = encode(create_temp_dir())
 *         self._fmu_temp_dir = <char*>FMIL.malloc((FMIL.strlen(fmu_temp_dir)+1)*sizeof(char))             # <<<<<<<<<<<<<<
 *         FMIL.strcpy(self._fmu_temp_dir, fmu_temp_dir)
 * 
 */
  __pyx_t_9 = PyBytes_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_fmu_temp_dir = ((char *)malloc(((strlen(__pyx_t_9) + 1) * (sizeof(char)))));

  /* "pyfmi\fmi.pyx":838
 *         fmu_temp_dir  = encode(create_temp_dir())
 *         self._fmu_temp_dir = <char*>FMIL.malloc((FMIL.strlen(fmu_temp_dir)+1)*sizeof(char))
 *         FMIL.strcpy(self._fmu_temp_dir, fmu_temp_dir)             # <<<<<<<<<<<<<<
 * 
 *         # Check that the file referenced by fmu has the correct file-ending
 */
  __pyx_t_9 = PyBytes_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  strcpy(__pyx_v_self->_fmu_temp_dir, __pyx_t_9);

  /* "pyfmi\fmi.pyx":841
 * 
 *         # Check that the file referenced by fmu has the correct file-ending
 *         if not fmu_full_path.endswith(".fmu"):             # <<<<<<<<<<<<<<
 *             raise FMUException("FMUModel must be instantiated with an FMU (.fmu) file.")
 * 
 */
  __pyx_t_7 = PyObject_GetAttr(__pyx_v_fmu_full_path, __pyx_n_s__endswith); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_k_tuple_36), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = (!__pyx_t_5);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":842
 *         # Check that the file referenced by fmu has the correct file-ending
 *         if not fmu_full_path.endswith(".fmu"):
 *             raise FMUException("FMUModel must be instantiated with an FMU (.fmu) file.")             # <<<<<<<<<<<<<<
 * 
 *         #Specify FMI related callbacks
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_38), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pyfmi\fmi.pyx":845
 * 
 *         #Specify FMI related callbacks
 *         self.callBackFunctions.logger = FMIL.fmi1_log_forwarding;             # <<<<<<<<<<<<<<
 *         self.callBackFunctions.allocateMemory = FMIL.calloc;
 *         self.callBackFunctions.freeMemory = FMIL.free;
 */
  __pyx_v_self->callBackFunctions.logger = fmi1_log_forwarding;

  /* "pyfmi\fmi.pyx":846
 *         #Specify FMI related callbacks
 *         self.callBackFunctions.logger = FMIL.fmi1_log_forwarding;
 *         self.callBackFunctions.allocateMemory = FMIL.calloc;             # <<<<<<<<<<<<<<
 *         self.callBackFunctions.freeMemory = FMIL.free;
 *         self.callBackFunctions.stepFinished = NULL;
 */
  __pyx_v_self->callBackFunctions.allocateMemory = calloc;

  /* "pyfmi\fmi.pyx":847
 *         self.callBackFunctions.logger = FMIL.fmi1_log_forwarding;
 *         self.callBackFunctions.allocateMemory = FMIL.calloc;
 *         self.callBackFunctions.freeMemory = FMIL.free;             # <<<<<<<<<<<<<<
 *         self.callBackFunctions.stepFinished = NULL;
 * 
 */
  __pyx_v_self->callBackFunctions.freeMemory = free;

  /* "pyfmi\fmi.pyx":848
 *         self.callBackFunctions.allocateMemory = FMIL.calloc;
 *         self.callBackFunctions.freeMemory = FMIL.free;
 *         self.callBackFunctions.stepFinished = NULL;             # <<<<<<<<<<<<<<
 * 
 *         self.context = FMIL.fmi_import_allocate_context(&self.callbacks)
 */
  __pyx_v_self->callBackFunctions.stepFinished = NULL;

  /* "pyfmi\fmi.pyx":850
 *         self.callBackFunctions.stepFinished = NULL;
 * 
 *         self.context = FMIL.fmi_import_allocate_context(&self.callbacks)             # <<<<<<<<<<<<<<
 *         self._allocated_context = 1
 * 
 */
  __pyx_v_self->context = fmi_import_allocate_context((&__pyx_v_self->__pyx_base.callbacks));

  /* "pyfmi\fmi.pyx":851
 * 
 *         self.context = FMIL.fmi_import_allocate_context(&self.callbacks)
 *         self._allocated_context = 1             # <<<<<<<<<<<<<<
 * 
 *         #Get the FMI version of the provided model
 */
  __pyx_v_self->_allocated_context = 1;

  /* "pyfmi\fmi.pyx":854
 * 
 *         #Get the FMI version of the provided model
 *         fmu_full_path = encode(fmu_full_path)             # <<<<<<<<<<<<<<
 *         version = FMIL.fmi_import_get_fmi_version(self.context, fmu_full_path, fmu_temp_dir)
 *         self._version = version #Store version
 */
  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__encode); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_fmu_full_path);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_fmu_full_path);
  __Pyx_GIVEREF(__pyx_v_fmu_full_path);
  __pyx_t_1 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_v_fmu_full_path);
  __pyx_v_fmu_full_path = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":855
 *         #Get the FMI version of the provided model
 *         fmu_full_path = encode(fmu_full_path)
 *         version = FMIL.fmi_import_get_fmi_version(self.context, fmu_full_path, fmu_temp_dir)             # <<<<<<<<<<<<<<
 *         self._version = version #Store version
 * 
 */
  __pyx_t_9 = PyBytes_AsString(__pyx_v_fmu_full_path); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_10 = PyBytes_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_version = fmi_import_get_fmi_version(__pyx_v_self->context, __pyx_t_9, __pyx_t_10);

  /* "pyfmi\fmi.pyx":856
 *         fmu_full_path = encode(fmu_full_path)
 *         version = FMIL.fmi_import_get_fmi_version(self.context, fmu_full_path, fmu_temp_dir)
 *         self._version = version #Store version             # <<<<<<<<<<<<<<
 * 
 *         if version == FMIL.fmi_version_unknown_enu:
 */
  __pyx_v_self->_version = __pyx_v_version;

  /* "pyfmi\fmi.pyx":858
 *         self._version = version #Store version
 * 
 *         if version == FMIL.fmi_version_unknown_enu:             # <<<<<<<<<<<<<<
 *             last_error = decode(FMIL.jm_get_last_error(&self.callbacks))
 *             if self.callbacks.log_level >= FMIL.jm_log_level_error:
 */
  __pyx_t_2 = (__pyx_v_version == fmi_version_unknown_enu);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":859
 * 
 *         if version == FMIL.fmi_version_unknown_enu:
 *             last_error = decode(FMIL.jm_get_last_error(&self.callbacks))             # <<<<<<<<<<<<<<
 *             if self.callbacks.log_level >= FMIL.jm_log_level_error:
 *                 raise FMUException("The FMU version could not be determined. "+last_error)
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyBytes_FromString(jm_get_last_error((&__pyx_v_self->__pyx_base.callbacks))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_t_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __pyx_v_last_error = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "pyfmi\fmi.pyx":860
 *         if version == FMIL.fmi_version_unknown_enu:
 *             last_error = decode(FMIL.jm_get_last_error(&self.callbacks))
 *             if self.callbacks.log_level >= FMIL.jm_log_level_error:             # <<<<<<<<<<<<<<
 *                 raise FMUException("The FMU version could not be determined. "+last_error)
 *             else:
 */
    __pyx_t_2 = (__pyx_v_self->__pyx_base.callbacks.log_level >= jm_log_level_error);
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":861
 *             last_error = decode(FMIL.jm_get_last_error(&self.callbacks))
 *             if self.callbacks.log_level >= FMIL.jm_log_level_error:
 *                 raise FMUException("The FMU version could not be determined. "+last_error)             # <<<<<<<<<<<<<<
 *             else:
 *                 raise FMUException("The FMU version could not be determined. Enable logging for possibly more information.")
 */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = PyNumber_Add(((PyObject *)__pyx_kp_s_39), __pyx_v_last_error); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_Raise(__pyx_t_7, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L8;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":863
 *                 raise FMUException("The FMU version could not be determined. "+last_error)
 *             else:
 *                 raise FMUException("The FMU version could not be determined. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 *         if version != 1:
 *             raise FMUException("This class only supports FMI 1.0 (Model Exchange and Co-Simulation).")
 */
      __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_1 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_k_tuple_41), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L8:;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "pyfmi\fmi.pyx":864
 *             else:
 *                 raise FMUException("The FMU version could not be determined. Enable logging for possibly more information.")
 *         if version != 1:             # <<<<<<<<<<<<<<
 *             raise FMUException("This class only supports FMI 1.0 (Model Exchange and Co-Simulation).")
 * 
 */
  __pyx_t_2 = (__pyx_v_version != 1);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":865
 *                 raise FMUException("The FMU version could not be determined. Enable logging for possibly more information.")
 *         if version != 1:
 *             raise FMUException("This class only supports FMI 1.0 (Model Exchange and Co-Simulation).")             # <<<<<<<<<<<<<<
 * 
 *         #Parse the XML
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_43), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "pyfmi\fmi.pyx":868
 * 
 *         #Parse the XML
 *         self._fmu = FMIL.fmi1_import_parse_xml(self.context, fmu_temp_dir)             # <<<<<<<<<<<<<<
 *         if self._fmu == NULL:
 *             last_error = decode(FMIL.jm_get_last_error(&self.callbacks))
 */
  __pyx_t_10 = PyBytes_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_fmu = fmi1_import_parse_xml(__pyx_v_self->context, __pyx_t_10);

  /* "pyfmi\fmi.pyx":869
 *         #Parse the XML
 *         self._fmu = FMIL.fmi1_import_parse_xml(self.context, fmu_temp_dir)
 *         if self._fmu == NULL:             # <<<<<<<<<<<<<<
 *             last_error = decode(FMIL.jm_get_last_error(&self.callbacks))
 *             if self.callbacks.log_level >= FMIL.jm_log_level_error:
 */
  __pyx_t_2 = (__pyx_v_self->_fmu == NULL);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":870
 *         self._fmu = FMIL.fmi1_import_parse_xml(self.context, fmu_temp_dir)
 *         if self._fmu == NULL:
 *             last_error = decode(FMIL.jm_get_last_error(&self.callbacks))             # <<<<<<<<<<<<<<
 *             if self.callbacks.log_level >= FMIL.jm_log_level_error:
 *                 raise FMUException("The XML file could not be parsed. "+last_error)
 */
    __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_1 = PyBytes_FromString(jm_get_last_error((&__pyx_v_self->__pyx_base.callbacks))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_v_last_error = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pyfmi\fmi.pyx":871
 *         if self._fmu == NULL:
 *             last_error = decode(FMIL.jm_get_last_error(&self.callbacks))
 *             if self.callbacks.log_level >= FMIL.jm_log_level_error:             # <<<<<<<<<<<<<<
 *                 raise FMUException("The XML file could not be parsed. "+last_error)
 *             else:
 */
    __pyx_t_2 = (__pyx_v_self->__pyx_base.callbacks.log_level >= jm_log_level_error);
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":872
 *             last_error = decode(FMIL.jm_get_last_error(&self.callbacks))
 *             if self.callbacks.log_level >= FMIL.jm_log_level_error:
 *                 raise FMUException("The XML file could not be parsed. "+last_error)             # <<<<<<<<<<<<<<
 *             else:
 *                 raise FMUException("The XML file could not be parsed. Enable logging for possibly more information.")
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_kp_s_44), __pyx_v_last_error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L11;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":874
 *                 raise FMUException("The XML file could not be parsed. "+last_error)
 *             else:
 *                 raise FMUException("The XML file could not be parsed. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 *         self._allocated_xml = 1
 * 
 */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_46), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_7, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L11:;
    goto __pyx_L10;
  }
  __pyx_L10:;

  /* "pyfmi\fmi.pyx":875
 *             else:
 *                 raise FMUException("The XML file could not be parsed. Enable logging for possibly more information.")
 *         self._allocated_xml = 1             # <<<<<<<<<<<<<<
 * 
 *         #Check the FMU kind
 */
  __pyx_v_self->_allocated_xml = 1;

  /* "pyfmi\fmi.pyx":878
 * 
 *         #Check the FMU kind
 *         fmu_kind = FMIL.fmi1_import_get_fmu_kind(self._fmu)             # <<<<<<<<<<<<<<
 *         if fmu_kind != FMI_ME and fmu_kind != FMI_CS_STANDALONE:
 *             raise FMUException("This class only supports FMI 1.0 (Model Exchange and Co-Simulation).")
 */
  __pyx_t_7 = PyInt_FromLong(fmi1_import_get_fmu_kind(__pyx_v_self->_fmu)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_v_fmu_kind = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "pyfmi\fmi.pyx":879
 *         #Check the FMU kind
 *         fmu_kind = FMIL.fmi1_import_get_fmu_kind(self._fmu)
 *         if fmu_kind != FMI_ME and fmu_kind != FMI_CS_STANDALONE:             # <<<<<<<<<<<<<<
 *             raise FMUException("This class only supports FMI 1.0 (Model Exchange and Co-Simulation).")
 *         self._fmu_kind = fmu_kind
 */
  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_ME); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_fmu_kind, __pyx_t_7, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_CS_STANDALONE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = PyObject_RichCompare(__pyx_v_fmu_kind, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_4 = __pyx_t_5;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":880
 *         fmu_kind = FMIL.fmi1_import_get_fmu_kind(self._fmu)
 *         if fmu_kind != FMI_ME and fmu_kind != FMI_CS_STANDALONE:
 *             raise FMUException("This class only supports FMI 1.0 (Model Exchange and Co-Simulation).")             # <<<<<<<<<<<<<<
 *         self._fmu_kind = fmu_kind
 * 
 */
    __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_k_tuple_47), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L12;
  }
  __pyx_L12:;

  /* "pyfmi\fmi.pyx":881
 *         if fmu_kind != FMI_ME and fmu_kind != FMI_CS_STANDALONE:
 *             raise FMUException("This class only supports FMI 1.0 (Model Exchange and Co-Simulation).")
 *         self._fmu_kind = fmu_kind             # <<<<<<<<<<<<<<
 * 
 *         #Connect the DLL
 */
  __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_v_fmu_kind); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_fmu_kind = __pyx_t_11;

  /* "pyfmi\fmi.pyx":885
 *         #Connect the DLL
 *         global FMI_REGISTER_GLOBALLY
 *         status = FMIL.fmi1_import_create_dllfmu(self._fmu, self.callBackFunctions, FMI_REGISTER_GLOBALLY);             # <<<<<<<<<<<<<<
 *         if status == FMIL.jm_status_error:
 *             last_error = decode(FMIL.fmi1_import_get_last_error(self._fmu))
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s_48); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_status = fmi1_import_create_dllfmu(__pyx_v_self->_fmu, __pyx_v_self->callBackFunctions, __pyx_t_11);

  /* "pyfmi\fmi.pyx":886
 *         global FMI_REGISTER_GLOBALLY
 *         status = FMIL.fmi1_import_create_dllfmu(self._fmu, self.callBackFunctions, FMI_REGISTER_GLOBALLY);
 *         if status == FMIL.jm_status_error:             # <<<<<<<<<<<<<<
 *             last_error = decode(FMIL.fmi1_import_get_last_error(self._fmu))
 *             if self.callbacks.log_level >= FMIL.jm_log_level_error:
 */
  __pyx_t_4 = (__pyx_v_status == jm_status_error);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":887
 *         status = FMIL.fmi1_import_create_dllfmu(self._fmu, self.callBackFunctions, FMI_REGISTER_GLOBALLY);
 *         if status == FMIL.jm_status_error:
 *             last_error = decode(FMIL.fmi1_import_get_last_error(self._fmu))             # <<<<<<<<<<<<<<
 *             if self.callbacks.log_level >= FMIL.jm_log_level_error:
 *                 raise FMUException(last_error)
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = PyBytes_FromString(fmi1_import_get_last_error(__pyx_v_self->_fmu)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_7));
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_7));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
    __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_v_last_error = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "pyfmi\fmi.pyx":888
 *         if status == FMIL.jm_status_error:
 *             last_error = decode(FMIL.fmi1_import_get_last_error(self._fmu))
 *             if self.callbacks.log_level >= FMIL.jm_log_level_error:             # <<<<<<<<<<<<<<
 *                 raise FMUException(last_error)
 *             else:
 */
    __pyx_t_4 = (__pyx_v_self->__pyx_base.callbacks.log_level >= jm_log_level_error);
    if (__pyx_t_4) {

      /* "pyfmi\fmi.pyx":889
 *             last_error = decode(FMIL.fmi1_import_get_last_error(self._fmu))
 *             if self.callbacks.log_level >= FMIL.jm_log_level_error:
 *                 raise FMUException(last_error)             # <<<<<<<<<<<<<<
 *             else:
 *                 raise FMUException("Error loading the binary. Enable logging for possibly more information.")
 */
      __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_last_error);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_last_error);
      __Pyx_GIVEREF(__pyx_v_last_error);
      __pyx_t_3 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L14;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":891
 *                 raise FMUException(last_error)
 *             else:
 *                 raise FMUException("Error loading the binary. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 *         self._allocated_dll = 1
 *         FMI_REGISTER_GLOBALLY += 1 #Update the global register of FMUs
 */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_50), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L14:;
    goto __pyx_L13;
  }
  __pyx_L13:;

  /* "pyfmi\fmi.pyx":892
 *             else:
 *                 raise FMUException("Error loading the binary. Enable logging for possibly more information.")
 *         self._allocated_dll = 1             # <<<<<<<<<<<<<<
 *         FMI_REGISTER_GLOBALLY += 1 #Update the global register of FMUs
 * 
 */
  __pyx_v_self->_allocated_dll = 1;

  /* "pyfmi\fmi.pyx":893
 *                 raise FMUException("Error loading the binary. Enable logging for possibly more information.")
 *         self._allocated_dll = 1
 *         FMI_REGISTER_GLOBALLY += 1 #Update the global register of FMUs             # <<<<<<<<<<<<<<
 * 
 *         #Default values
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_48); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_48, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":896
 * 
 *         #Default values
 *         self.__t = None             # <<<<<<<<<<<<<<
 * 
 *         #Internal values
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->__t);
  __Pyx_DECREF(__pyx_v_self->__t);
  __pyx_v_self->__t = Py_None;

  /* "pyfmi\fmi.pyx":899
 * 
 *         #Internal values
 *         self._file_open = False             # <<<<<<<<<<<<<<
 *         self._npoints = 0
 *         self._enable_logging = enable_logging
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->_file_open);
  __Pyx_DECREF(__pyx_v_self->_file_open);
  __pyx_v_self->_file_open = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":900
 *         #Internal values
 *         self._file_open = False
 *         self._npoints = 0             # <<<<<<<<<<<<<<
 *         self._enable_logging = enable_logging
 *         self._pyEventInfo = PyEventInfo()
 */
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __Pyx_GOTREF(__pyx_v_self->_npoints);
  __Pyx_DECREF(__pyx_v_self->_npoints);
  __pyx_v_self->_npoints = __pyx_int_0;

  /* "pyfmi\fmi.pyx":901
 *         self._file_open = False
 *         self._npoints = 0
 *         self._enable_logging = enable_logging             # <<<<<<<<<<<<<<
 *         self._pyEventInfo = PyEventInfo()
 * 
 */
  __Pyx_INCREF(__pyx_v_enable_logging);
  __Pyx_GIVEREF(__pyx_v_enable_logging);
  __Pyx_GOTREF(__pyx_v_self->_enable_logging);
  __Pyx_DECREF(__pyx_v_self->_enable_logging);
  __pyx_v_self->_enable_logging = __pyx_v_enable_logging;

  /* "pyfmi\fmi.pyx":902
 *         self._npoints = 0
 *         self._enable_logging = enable_logging
 *         self._pyEventInfo = PyEventInfo()             # <<<<<<<<<<<<<<
 * 
 *         #Load information from model
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__PyEventInfo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_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 = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_pyEventInfo);
  __Pyx_DECREF(__pyx_v_self->_pyEventInfo);
  __pyx_v_self->_pyEventInfo = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":905
 * 
 *         #Load information from model
 *         self._modelid = decode(FMIL.fmi1_import_get_model_identifier(self._fmu))             # <<<<<<<<<<<<<<
 *         self._modelname = decode(FMIL.fmi1_import_get_model_name(self._fmu))
 *         self._nEventIndicators = FMIL.fmi1_import_get_number_of_event_indicators(self._fmu)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyBytes_FromString(fmi1_import_get_model_identifier(__pyx_v_self->_fmu)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_t_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->_modelid);
  __Pyx_DECREF(__pyx_v_self->_modelid);
  __pyx_v_self->_modelid = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":906
 *         #Load information from model
 *         self._modelid = decode(FMIL.fmi1_import_get_model_identifier(self._fmu))
 *         self._modelname = decode(FMIL.fmi1_import_get_model_name(self._fmu))             # <<<<<<<<<<<<<<
 *         self._nEventIndicators = FMIL.fmi1_import_get_number_of_event_indicators(self._fmu)
 *         self._nContinuousStates = FMIL.fmi1_import_get_number_of_continuous_states(self._fmu)
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = PyBytes_FromString(fmi1_import_get_model_name(__pyx_v_self->_fmu)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_7));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
  __pyx_t_7 = 0;
  __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_7);
  __Pyx_GOTREF(__pyx_v_self->_modelname);
  __Pyx_DECREF(__pyx_v_self->_modelname);
  __pyx_v_self->_modelname = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "pyfmi\fmi.pyx":907
 *         self._modelid = decode(FMIL.fmi1_import_get_model_identifier(self._fmu))
 *         self._modelname = decode(FMIL.fmi1_import_get_model_name(self._fmu))
 *         self._nEventIndicators = FMIL.fmi1_import_get_number_of_event_indicators(self._fmu)             # <<<<<<<<<<<<<<
 *         self._nContinuousStates = FMIL.fmi1_import_get_number_of_continuous_states(self._fmu)
 *         fmu_log_name = encode((self._modelid + "_log.txt") if log_file_name=="" else log_file_name)
 */
  __pyx_v_self->_nEventIndicators = fmi1_import_get_number_of_event_indicators(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":908
 *         self._modelname = decode(FMIL.fmi1_import_get_model_name(self._fmu))
 *         self._nEventIndicators = FMIL.fmi1_import_get_number_of_event_indicators(self._fmu)
 *         self._nContinuousStates = FMIL.fmi1_import_get_number_of_continuous_states(self._fmu)             # <<<<<<<<<<<<<<
 *         fmu_log_name = encode((self._modelid + "_log.txt") if log_file_name=="" else log_file_name)
 *         self._fmu_log_name = <char*>FMIL.malloc((FMIL.strlen(fmu_log_name)+1)*sizeof(char))
 */
  __pyx_v_self->_nContinuousStates = fmi1_import_get_number_of_continuous_states(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":909
 *         self._nEventIndicators = FMIL.fmi1_import_get_number_of_event_indicators(self._fmu)
 *         self._nContinuousStates = FMIL.fmi1_import_get_number_of_continuous_states(self._fmu)
 *         fmu_log_name = encode((self._modelid + "_log.txt") if log_file_name=="" else log_file_name)             # <<<<<<<<<<<<<<
 *         self._fmu_log_name = <char*>FMIL.malloc((FMIL.strlen(fmu_log_name)+1)*sizeof(char))
 *         FMIL.strcpy(self._fmu_log_name, fmu_log_name)
 */
  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__encode); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_log_file_name, ((PyObject *)__pyx_kp_s_12), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {
    __pyx_t_3 = PyNumber_Add(__pyx_v_self->_modelid, ((PyObject *)__pyx_kp_s_51)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(__pyx_v_log_file_name);
    __pyx_t_1 = __pyx_v_log_file_name;
  }
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_v_fmu_log_name = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":910
 *         self._nContinuousStates = FMIL.fmi1_import_get_number_of_continuous_states(self._fmu)
 *         fmu_log_name = encode((self._modelid + "_log.txt") if log_file_name=="" else log_file_name)
 *         self._fmu_log_name = <char*>FMIL.malloc((FMIL.strlen(fmu_log_name)+1)*sizeof(char))             # <<<<<<<<<<<<<<
 *         FMIL.strcpy(self._fmu_log_name, fmu_log_name)
 * 
 */
  __pyx_t_10 = PyBytes_AsString(__pyx_v_fmu_log_name); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->__pyx_base._fmu_log_name = ((char *)malloc(((strlen(__pyx_t_10) + 1) * (sizeof(char)))));

  /* "pyfmi\fmi.pyx":911
 *         fmu_log_name = encode((self._modelid + "_log.txt") if log_file_name=="" else log_file_name)
 *         self._fmu_log_name = <char*>FMIL.malloc((FMIL.strlen(fmu_log_name)+1)*sizeof(char))
 *         FMIL.strcpy(self._fmu_log_name, fmu_log_name)             # <<<<<<<<<<<<<<
 * 
 *         #Create the log file
 */
  __pyx_t_10 = PyBytes_AsString(__pyx_v_fmu_log_name); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  strcpy(__pyx_v_self->__pyx_base._fmu_log_name, __pyx_t_10);

  /* "pyfmi\fmi.pyx":914
 * 
 *         #Create the log file
 *         with open(self._fmu_log_name,'w') as file:             # <<<<<<<<<<<<<<
 *             for i in range(len(self._log)):
 *                 file.write("FMIL: module = %s, log level = %d: %s\n"%(self._log[i][0], self._log[i][1], self._log[i][2]))
 */
  /*with:*/ {
    __pyx_t_1 = PyBytes_FromString(__pyx_v_self->__pyx_base._fmu_log_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
    __Pyx_INCREF(((PyObject *)__pyx_n_s__w));
    PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__w));
    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__w));
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_builtin_open, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_12 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____exit__); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____enter__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L15_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L15_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /*try:*/ {
      {
        __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
        __Pyx_XGOTREF(__pyx_t_13);
        __Pyx_XGOTREF(__pyx_t_14);
        __Pyx_XGOTREF(__pyx_t_15);
        /*try:*/ {
          __Pyx_INCREF(__pyx_t_7);
          __pyx_v_file = __pyx_t_7;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "pyfmi\fmi.pyx":915
 *         #Create the log file
 *         with open(self._fmu_log_name,'w') as file:
 *             for i in range(len(self._log)):             # <<<<<<<<<<<<<<
 *                 file.write("FMIL: module = %s, log level = %d: %s\n"%(self._log[i][0], self._log[i][1], self._log[i][2]))
 *             self._log = []
 */
          __pyx_t_7 = ((PyObject *)__pyx_v_self->__pyx_base._log);
          __Pyx_INCREF(__pyx_t_7);
          if (unlikely(__pyx_t_7 == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
          }
          __pyx_t_16 = PyList_GET_SIZE(__pyx_t_7); if (unlikely(__pyx_t_16 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_16); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
          __Pyx_GOTREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_7);
          __pyx_t_7 = 0;
          __pyx_t_7 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
          if (PyList_CheckExact(__pyx_t_7) || PyTuple_CheckExact(__pyx_t_7)) {
            __pyx_t_1 = __pyx_t_7; __Pyx_INCREF(__pyx_t_1); __pyx_t_16 = 0;
            __pyx_t_17 = NULL;
          } else {
            __pyx_t_16 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_17 = Py_TYPE(__pyx_t_1)->tp_iternext;
          }
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          for (;;) {
            if (!__pyx_t_17 && PyList_CheckExact(__pyx_t_1)) {
              if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_1)) break;
              #if CYTHON_COMPILING_IN_CPYTHON
              __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_16); __Pyx_INCREF(__pyx_t_7); __pyx_t_16++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
              #else
              __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
              #endif
            } else if (!__pyx_t_17 && PyTuple_CheckExact(__pyx_t_1)) {
              if (__pyx_t_16 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
              #if CYTHON_COMPILING_IN_CPYTHON
              __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_16); __Pyx_INCREF(__pyx_t_7); __pyx_t_16++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
              #else
              __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
              #endif
            } else {
              __pyx_t_7 = __pyx_t_17(__pyx_t_1);
              if (unlikely(!__pyx_t_7)) {
                if (PyErr_Occurred()) {
                  if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
                  else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
                }
                break;
              }
              __Pyx_GOTREF(__pyx_t_7);
            }
            __Pyx_XDECREF(__pyx_v_i);
            __pyx_v_i = __pyx_t_7;
            __pyx_t_7 = 0;

            /* "pyfmi\fmi.pyx":916
 *         with open(self._fmu_log_name,'w') as file:
 *             for i in range(len(self._log)):
 *                 file.write("FMIL: module = %s, log level = %d: %s\n"%(self._log[i][0], self._log[i][1], self._log[i][2]))             # <<<<<<<<<<<<<<
 *             self._log = []
 * 
 */
            __pyx_t_7 = PyObject_GetAttr(__pyx_v_file, __pyx_n_s__write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            __Pyx_GOTREF(__pyx_t_7);
            if (unlikely(((PyObject *)__pyx_v_self->__pyx_base._log) == Py_None)) {
              PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            }
            __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self->__pyx_base._log), __pyx_v_i); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(((PyObject *)__pyx_v_self->__pyx_base._log) == Py_None)) {
              PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            }
            __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self->__pyx_base._log), __pyx_v_i); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_18 = __Pyx_GetItemInt(__pyx_t_3, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            __Pyx_GOTREF(__pyx_t_18);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(((PyObject *)__pyx_v_self->__pyx_base._log) == Py_None)) {
              PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            }
            __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self->__pyx_base._log), __pyx_v_i); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_19 = __Pyx_GetItemInt(__pyx_t_3, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_19) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            __Pyx_GOTREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8);
            __Pyx_GIVEREF(__pyx_t_8);
            PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_18);
            __Pyx_GIVEREF(__pyx_t_18);
            PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_19);
            __Pyx_GIVEREF(__pyx_t_19);
            __pyx_t_8 = 0;
            __pyx_t_18 = 0;
            __pyx_t_19 = 0;
            __pyx_t_19 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_2), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            __Pyx_GOTREF(((PyObject *)__pyx_t_19));
            __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
            __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            __Pyx_GOTREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_19));
            __Pyx_GIVEREF(((PyObject *)__pyx_t_19));
            __pyx_t_19 = 0;
            __pyx_t_19 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
          }
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "pyfmi\fmi.pyx":917
 *             for i in range(len(self._log)):
 *                 file.write("FMIL: module = %s, log level = %d: %s\n"%(self._log[i][0], self._log[i][1], self._log[i][2]))
 *             self._log = []             # <<<<<<<<<<<<<<
 * 
 *     cpdef _internal_set_fmu_null(self):
 */
          __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
          __Pyx_GOTREF(__pyx_v_self->__pyx_base._log);
          __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base._log));
          __pyx_v_self->__pyx_base._log = ((PyObject*)__pyx_t_1);
          __pyx_t_1 = 0;
        }
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        goto __pyx_L26_try_end;
        __pyx_L19_error:;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "pyfmi\fmi.pyx":914
 * 
 *         #Create the log file
 *         with open(self._fmu_log_name,'w') as file:             # <<<<<<<<<<<<<<
 *             for i in range(len(self._log)):
 *                 file.write("FMIL: module = %s, log level = %d: %s\n"%(self._log[i][0], self._log[i][1], self._log[i][2]))
 */
        /*except:*/ {
          __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_19, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_19);
          PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_19);
          __Pyx_GIVEREF(__pyx_t_19);
          __Pyx_INCREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_3);
          __pyx_t_20 = PyObject_Call(__pyx_t_12, __pyx_t_7, NULL);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;}
          __Pyx_GOTREF(__pyx_t_20);
          __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_20);
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
          if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;}
          __pyx_t_2 = (!__pyx_t_4);
          if (__pyx_t_2) {
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_19);
            __Pyx_GIVEREF(__pyx_t_3);
            __Pyx_ErrRestore(__pyx_t_1, __pyx_t_19, __pyx_t_3);
            __pyx_t_1 = 0; __pyx_t_19 = 0; __pyx_t_3 = 0; 
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;}
            goto __pyx_L32;
          }
          __pyx_L32:;
          __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          goto __pyx_L20_exception_handled;
        }
        __pyx_L21_except_error:;
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_XGIVEREF(__pyx_t_14);
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15);
        goto __pyx_L1_error;
        __pyx_L20_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_XGIVEREF(__pyx_t_14);
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15);
        __pyx_L26_try_end:;
      }
    }
    /*finally:*/ {
      if (__pyx_t_12) {
        __pyx_t_15 = PyObject_Call(__pyx_t_12, __pyx_k_tuple_52, NULL);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
    }
    goto __pyx_L33;
    __pyx_L15_error:;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    goto __pyx_L1_error;
    __pyx_L33:;
  }

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fmu_full_path);
  __Pyx_XDECREF(__pyx_v_fmu_temp_dir);
  __Pyx_XDECREF(__pyx_v_last_error);
  __Pyx_XDECREF(__pyx_v_fmu_kind);
  __Pyx_XDECREF(__pyx_v_fmu_log_name);
  __Pyx_XDECREF(__pyx_v_file);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_enable_logging);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":919
 *             self._log = []
 * 
 *     cpdef _internal_set_fmu_null(self):             # <<<<<<<<<<<<<<
 *         """
 *         This methods is ONLY for testing purposes. It sets the internal
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_3_internal_set_fmu_null(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_12FMUModelBase__internal_set_fmu_null(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_internal_set_fmu_null", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_53); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_3_internal_set_fmu_null)) {
      __Pyx_XDECREF(__pyx_r);
      __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 = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":924
 *         fmu state to NULL
 *         """
 *         self._fmu = NULL             # <<<<<<<<<<<<<<
 * 
 *     def _get_version(self):
 */
  __pyx_v_self->_fmu = NULL;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase._internal_set_fmu_null", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_3_internal_set_fmu_null(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_2_internal_set_fmu_null[] = "\n        This methods is ONLY for testing purposes. It sets the internal\n        fmu state to NULL\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_3_internal_set_fmu_null(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_internal_set_fmu_null (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_2_internal_set_fmu_null(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":919
 *             self._log = []
 * 
 *     cpdef _internal_set_fmu_null(self):             # <<<<<<<<<<<<<<
 *         """
 *         This methods is ONLY for testing purposes. It sets the internal
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_2_internal_set_fmu_null(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__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("_internal_set_fmu_null", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self->__pyx_base.__pyx_vtab)->_internal_set_fmu_null(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase._internal_set_fmu_null", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_5_get_version(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_4_get_version[] = "\n        Returns the FMI version of the Model which it was generated according.\n\n        Returns::\n\n            version --\n                The version.\n\n        Example::\n\n            model.version\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_5_get_version(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_version (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_4_get_version(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":926
 *         self._fmu = NULL
 * 
 *     def _get_version(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the FMI version of the Model which it was generated according.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_4_get_version(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  char *__pyx_v_version;
  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("_get_version", 0);

  /* "pyfmi\fmi.pyx":939
 *             model.version
 *         """
 *         version = FMIL.fmi1_import_get_version(self._fmu)             # <<<<<<<<<<<<<<
 *         return version
 * 
 */
  __pyx_v_version = fmi1_import_get_version(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":940
 *         """
 *         version = FMIL.fmi1_import_get_version(self._fmu)
 *         return version             # <<<<<<<<<<<<<<
 * 
 *     version = property(fget=_get_version)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromString(__pyx_v_version); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase._get_version", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_7get_ode_sizes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_6get_ode_sizes[] = "\n        Returns the number of continuous states and the number of event\n        indicators.\n\n        Returns::\n\n            nbr_cont --\n                The number of continuous states.\n\n            nbr_ind --\n                The number of event indicators.\n\n        Example::\n\n            [nCont, nEvent] = model.get_ode_sizes()\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_7get_ode_sizes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_ode_sizes (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_6get_ode_sizes(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":944
 *     version = property(fget=_get_version)
 * 
 *     def get_ode_sizes(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the number of continuous states and the number of event
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_6get_ode_sizes(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __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("get_ode_sizes", 0);

  /* "pyfmi\fmi.pyx":961
 *             [nCont, nEvent] = model.get_ode_sizes()
 *         """
 *         return self._nContinuousStates, self._nEventIndicators             # <<<<<<<<<<<<<<
 * 
 *     def get_real(self, valueref):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_self->_nContinuousStates); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyLong_FromUnsignedLong(__pyx_v_self->_nEventIndicators); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_ode_sizes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_9get_real(PyObject *__pyx_v_self, PyObject *__pyx_v_valueref); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_8get_real[] = "\n        Returns the real-values from the valuereference(s).\n\n        Parameters::\n\n            valueref --\n                A list of valuereferences.\n\n        Returns::\n\n            values --\n                The values retrieved from the FMU.\n\n        Example::\n\n            val = model.get_real([232])\n\n        Calls the low-level FMI function: fmiGetReal\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_9get_real(PyObject *__pyx_v_self, PyObject *__pyx_v_valueref) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_real (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_8get_real(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_valueref));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":963
 *         return self._nContinuousStates, self._nEventIndicators
 * 
 *     def get_real(self, valueref):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the real-values from the valuereference(s).
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_8get_real(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_valueref) {
  int __pyx_v_status;
  size_t __pyx_v_nref;
  PyArrayObject *__pyx_v_val_ref = 0;
  PyArrayObject *__pyx_v_val = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_val;
  __Pyx_Buffer __pyx_pybuffer_val;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_val_ref;
  __Pyx_Buffer __pyx_pybuffer_val_ref;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyArrayObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_real", 0);
  __pyx_pybuffer_val_ref.pybuffer.buf = NULL;
  __pyx_pybuffer_val_ref.refcount = 0;
  __pyx_pybuffernd_val_ref.data = NULL;
  __pyx_pybuffernd_val_ref.rcbuffer = &__pyx_pybuffer_val_ref;
  __pyx_pybuffer_val.pybuffer.buf = NULL;
  __pyx_pybuffer_val.refcount = 0;
  __pyx_pybuffernd_val.data = NULL;
  __pyx_pybuffernd_val.rcbuffer = &__pyx_pybuffer_val;

  /* "pyfmi\fmi.pyx":985
 *         cdef int status
 *         cdef FMIL.size_t nref
 *         cdef N.ndarray[FMIL.fmi1_value_reference_t, ndim=1,mode='c'] val_ref = N.array(valueref, dtype=N.uint32,ndmin=1).ravel()             # <<<<<<<<<<<<<<
 *         nref = len(val_ref)
 *         cdef N.ndarray[FMIL.fmi1_real_t, ndim=1,mode='c'] val = N.array([0.0]*nref,dtype=N.float, ndmin=1)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_valueref);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_valueref);
  __Pyx_GIVEREF(__pyx_v_valueref);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__uint32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_val_ref.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_fmi1_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_val_ref = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_val_ref.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_val_ref.diminfo[0].strides = __pyx_pybuffernd_val_ref.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_val_ref.diminfo[0].shape = __pyx_pybuffernd_val_ref.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_val_ref = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":986
 *         cdef FMIL.size_t nref
 *         cdef N.ndarray[FMIL.fmi1_value_reference_t, ndim=1,mode='c'] val_ref = N.array(valueref, dtype=N.uint32,ndmin=1).ravel()
 *         nref = len(val_ref)             # <<<<<<<<<<<<<<
 *         cdef N.ndarray[FMIL.fmi1_real_t, ndim=1,mode='c'] val = N.array([0.0]*nref,dtype=N.float, ndmin=1)
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_val_ref)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nref = __pyx_t_7;

  /* "pyfmi\fmi.pyx":987
 *         cdef N.ndarray[FMIL.fmi1_value_reference_t, ndim=1,mode='c'] val_ref = N.array(valueref, dtype=N.uint32,ndmin=1).ravel()
 *         nref = len(val_ref)
 *         cdef N.ndarray[FMIL.fmi1_real_t, ndim=1,mode='c'] val = N.array([0.0]*nref,dtype=N.float, ndmin=1)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyList_New(1 * ((__pyx_v_nref<0) ? 0:__pyx_v_nref)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  { Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < __pyx_v_nref; __pyx_temp++) {
      __Pyx_INCREF(__pyx_t_5);
      PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
    }
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__float); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_val.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn_fmi1_real_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_val = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_val.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_val.diminfo[0].strides = __pyx_pybuffernd_val.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_val.diminfo[0].shape = __pyx_pybuffernd_val.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_8 = 0;
  __pyx_v_val = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":990
 * 
 * 
 *         status = FMIL.fmi1_import_get_real(self._fmu, <FMIL.fmi1_value_reference_t*>val_ref.data, nref, <FMIL.fmi1_real_t*>val.data)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi1_import_get_real(__pyx_v_self->_fmu, ((fmi1_value_reference_t *)__pyx_v_val_ref->data), __pyx_v_nref, ((fmi1_real_t *)__pyx_v_val->data));

  /* "pyfmi\fmi.pyx":992
 *         status = FMIL.fmi1_import_get_real(self._fmu, <FMIL.fmi1_value_reference_t*>val_ref.data, nref, <FMIL.fmi1_real_t*>val.data)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to get the Real values.')
 * 
 */
  __pyx_t_9 = (__pyx_v_status != 0);
  if (__pyx_t_9) {

    /* "pyfmi\fmi.pyx":993
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Real values.')             # <<<<<<<<<<<<<<
 * 
 *         return val
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_55), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":995
 *             raise FMUException('Failed to get the Real values.')
 * 
 *         return val             # <<<<<<<<<<<<<<
 * 
 *     def set_real(self, valueref, values):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_val));
  __pyx_r = ((PyObject *)__pyx_v_val);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_val.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_val_ref.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_real", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_val.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_val_ref.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_val_ref);
  __Pyx_XDECREF((PyObject *)__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_11set_real(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_10set_real[] = "\n        Sets the real-values in the FMU as defined by the valuereference(s).\n\n        Parameters::\n\n            valueref --\n                A list of valuereferences.\n\n            values --\n                Values to be set.\n\n        Example::\n\n            model.set_real([234,235],[2.34,10.4])\n\n        Calls the low-level FMI function: fmiSetReal\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_11set_real(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_valueref = 0;
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_real (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__valueref,&__pyx_n_s__values,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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__valueref)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_real", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_real") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_valueref = values[0];
    __pyx_v_values = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_real", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.set_real", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_10set_real(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_v_valueref, __pyx_v_values);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":997
 *         return val
 * 
 *     def set_real(self, valueref, values):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the real-values in the FMU as defined by the valuereference(s).
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_10set_real(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_valueref, PyObject *__pyx_v_values) {
  int __pyx_v_status;
  size_t __pyx_v_nref;
  PyArrayObject *__pyx_v_val_ref = 0;
  PyArrayObject *__pyx_v_val = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_val;
  __Pyx_Buffer __pyx_pybuffer_val;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_val_ref;
  __Pyx_Buffer __pyx_pybuffer_val_ref;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_real", 0);
  __pyx_pybuffer_val_ref.pybuffer.buf = NULL;
  __pyx_pybuffer_val_ref.refcount = 0;
  __pyx_pybuffernd_val_ref.data = NULL;
  __pyx_pybuffernd_val_ref.rcbuffer = &__pyx_pybuffer_val_ref;
  __pyx_pybuffer_val.pybuffer.buf = NULL;
  __pyx_pybuffer_val.refcount = 0;
  __pyx_pybuffernd_val.data = NULL;
  __pyx_pybuffernd_val.rcbuffer = &__pyx_pybuffer_val;

  /* "pyfmi\fmi.pyx":1017
 *         cdef int status
 *         cdef FMIL.size_t nref
 *         cdef N.ndarray[FMIL.fmi1_value_reference_t, ndim=1,mode='c'] val_ref = N.array(valueref, dtype=N.uint32,ndmin=1).ravel()             # <<<<<<<<<<<<<<
 *         cdef N.ndarray[FMIL.fmi1_real_t, ndim=1,mode='c'] val = N.array(values, dtype=N.float, ndmin=1).ravel()
 *         nref = val_ref.size
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_valueref);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_valueref);
  __Pyx_GIVEREF(__pyx_v_valueref);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__uint32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_val_ref.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_fmi1_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_val_ref = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_val_ref.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_val_ref.diminfo[0].strides = __pyx_pybuffernd_val_ref.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_val_ref.diminfo[0].shape = __pyx_pybuffernd_val_ref.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_val_ref = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":1018
 *         cdef FMIL.size_t nref
 *         cdef N.ndarray[FMIL.fmi1_value_reference_t, ndim=1,mode='c'] val_ref = N.array(valueref, dtype=N.uint32,ndmin=1).ravel()
 *         cdef N.ndarray[FMIL.fmi1_real_t, ndim=1,mode='c'] val = N.array(values, dtype=N.float, ndmin=1).ravel()             # <<<<<<<<<<<<<<
 *         nref = val_ref.size
 * 
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__float); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__ravel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_val.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn_fmi1_real_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_val = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_val.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_val.diminfo[0].strides = __pyx_pybuffernd_val.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_val.diminfo[0].shape = __pyx_pybuffernd_val.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_7 = 0;
  __pyx_v_val = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":1019
 *         cdef N.ndarray[FMIL.fmi1_value_reference_t, ndim=1,mode='c'] val_ref = N.array(valueref, dtype=N.uint32,ndmin=1).ravel()
 *         cdef N.ndarray[FMIL.fmi1_real_t, ndim=1,mode='c'] val = N.array(values, dtype=N.float, ndmin=1).ravel()
 *         nref = val_ref.size             # <<<<<<<<<<<<<<
 * 
 *         if val_ref.size != val.size:
 */
  __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_val_ref), __pyx_n_s__size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = __Pyx_PyInt_from_py_size_t(__pyx_t_4); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_nref = __pyx_t_8;

  /* "pyfmi\fmi.pyx":1021
 *         nref = val_ref.size
 * 
 *         if val_ref.size != val.size:             # <<<<<<<<<<<<<<
 *             raise FMUException(
 *                 'The length of valueref and values are inconsistent.')
 */
  __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_val_ref), __pyx_n_s__size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_val), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_9) {

    /* "pyfmi\fmi.pyx":1022
 * 
 *         if val_ref.size != val.size:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'The length of valueref and values are inconsistent.')
 * 
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_57), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1025
 *                 'The length of valueref and values are inconsistent.')
 * 
 *         status = FMIL.fmi1_import_set_real(self._fmu, <FMIL.fmi1_value_reference_t*>val_ref.data, nref, <FMIL.fmi1_real_t*>val.data)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi1_import_set_real(__pyx_v_self->_fmu, ((fmi1_value_reference_t *)__pyx_v_val_ref->data), __pyx_v_nref, ((fmi1_real_t *)__pyx_v_val->data));

  /* "pyfmi\fmi.pyx":1027
 *         status = FMIL.fmi1_import_set_real(self._fmu, <FMIL.fmi1_value_reference_t*>val_ref.data, nref, <FMIL.fmi1_real_t*>val.data)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to set the Real values.')
 * 
 */
  __pyx_t_9 = (__pyx_v_status != 0);
  if (__pyx_t_9) {

    /* "pyfmi\fmi.pyx":1028
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Real values.')             # <<<<<<<<<<<<<<
 * 
 *     def get_integer(self, valueref):
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_59), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_val.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_val_ref.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.set_real", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_val.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_val_ref.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_val_ref);
  __Pyx_XDECREF((PyObject *)__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_13get_integer(PyObject *__pyx_v_self, PyObject *__pyx_v_valueref); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_12get_integer[] = "\n        Returns the integer-values from the valuereference(s).\n\n        Parameters::\n\n            valueref --\n                A list of valuereferences.\n\n        Return::\n\n            values --\n                The values retrieved from the FMU.\n\n        Example::\n\n            val = model.get_integer([232])\n\n        Calls the low-level FMI function: fmiGetInteger\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_13get_integer(PyObject *__pyx_v_self, PyObject *__pyx_v_valueref) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_integer (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_12get_integer(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_valueref));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1030
 *             raise FMUException('Failed to set the Real values.')
 * 
 *     def get_integer(self, valueref):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the integer-values from the valuereference(s).
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_12get_integer(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_valueref) {
  int __pyx_v_status;
  size_t __pyx_v_nref;
  PyArrayObject *__pyx_v_val_ref = 0;
  PyArrayObject *__pyx_v_val = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_val;
  __Pyx_Buffer __pyx_pybuffer_val;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_val_ref;
  __Pyx_Buffer __pyx_pybuffer_val_ref;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  PyArrayObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_integer", 0);
  __pyx_pybuffer_val_ref.pybuffer.buf = NULL;
  __pyx_pybuffer_val_ref.refcount = 0;
  __pyx_pybuffernd_val_ref.data = NULL;
  __pyx_pybuffernd_val_ref.rcbuffer = &__pyx_pybuffer_val_ref;
  __pyx_pybuffer_val.pybuffer.buf = NULL;
  __pyx_pybuffer_val.refcount = 0;
  __pyx_pybuffernd_val.data = NULL;
  __pyx_pybuffernd_val.rcbuffer = &__pyx_pybuffer_val;

  /* "pyfmi\fmi.pyx":1052
 *         cdef int status
 *         cdef FMIL.size_t nref
 *         cdef N.ndarray[FMIL.fmi1_value_reference_t, ndim=1,mode='c'] val_ref = N.array(valueref, dtype=N.uint32,ndmin=1).ravel()             # <<<<<<<<<<<<<<
 * 
 *         nref = val_ref.size
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_valueref);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_valueref);
  __Pyx_GIVEREF(__pyx_v_valueref);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__uint32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_val_ref.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_fmi1_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_val_ref = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_val_ref.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_val_ref.diminfo[0].strides = __pyx_pybuffernd_val_ref.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_val_ref.diminfo[0].shape = __pyx_pybuffernd_val_ref.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_val_ref = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":1054
 *         cdef N.ndarray[FMIL.fmi1_value_reference_t, ndim=1,mode='c'] val_ref = N.array(valueref, dtype=N.uint32,ndmin=1).ravel()
 * 
 *         nref = val_ref.size             # <<<<<<<<<<<<<<
 *         cdef N.ndarray[FMIL.fmi1_integer_t, ndim=1,mode='c'] val = N.array([0]*nref, dtype=int,ndmin=1)
 * 
 */
  __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_val_ref), __pyx_n_s__size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_PyInt_from_py_size_t(__pyx_t_5); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_nref = __pyx_t_7;

  /* "pyfmi\fmi.pyx":1055
 * 
 *         nref = val_ref.size
 *         cdef N.ndarray[FMIL.fmi1_integer_t, ndim=1,mode='c'] val = N.array([0]*nref, dtype=int,ndmin=1)             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi1_import_get_integer(self._fmu, <FMIL.fmi1_value_reference_t*>val_ref.data, nref, <FMIL.fmi1_integer_t*>val.data)
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyList_New(1 * ((__pyx_v_nref<0) ? 0:__pyx_v_nref)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  { Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < __pyx_v_nref; __pyx_temp++) {
      __Pyx_INCREF(__pyx_int_0);
      PyList_SET_ITEM(__pyx_t_5, __pyx_temp, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
    }
  }
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
  __pyx_t_5 = 0;
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__int); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_val.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn_fmi1_integer_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_val = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_val.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_val.diminfo[0].strides = __pyx_pybuffernd_val.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_val.diminfo[0].shape = __pyx_pybuffernd_val.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_8 = 0;
  __pyx_v_val = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":1057
 *         cdef N.ndarray[FMIL.fmi1_integer_t, ndim=1,mode='c'] val = N.array([0]*nref, dtype=int,ndmin=1)
 * 
 *         status = FMIL.fmi1_import_get_integer(self._fmu, <FMIL.fmi1_value_reference_t*>val_ref.data, nref, <FMIL.fmi1_integer_t*>val.data)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi1_import_get_integer(__pyx_v_self->_fmu, ((fmi1_value_reference_t *)__pyx_v_val_ref->data), __pyx_v_nref, ((fmi1_integer_t *)__pyx_v_val->data));

  /* "pyfmi\fmi.pyx":1059
 *         status = FMIL.fmi1_import_get_integer(self._fmu, <FMIL.fmi1_value_reference_t*>val_ref.data, nref, <FMIL.fmi1_integer_t*>val.data)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to get the Integer values.')
 * 
 */
  __pyx_t_9 = (__pyx_v_status != 0);
  if (__pyx_t_9) {

    /* "pyfmi\fmi.pyx":1060
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Integer values.')             # <<<<<<<<<<<<<<
 * 
 *         return val
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_61), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1062
 *             raise FMUException('Failed to get the Integer values.')
 * 
 *         return val             # <<<<<<<<<<<<<<
 * 
 *     def set_integer(self, valueref, values):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_val));
  __pyx_r = ((PyObject *)__pyx_v_val);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_val.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_val_ref.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_integer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_val.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_val_ref.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_val_ref);
  __Pyx_XDECREF((PyObject *)__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_15set_integer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_14set_integer[] = "\n        Sets the integer-values in the FMU as defined by the valuereference(s).\n\n        Parameters::\n\n            valueref --\n                A list of valuereferences.\n\n            values --\n                Values to be set.\n\n        Example::\n\n            model.set_integer([234,235],[12,-3])\n\n        Calls the low-level FMI function: fmiSetInteger\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_15set_integer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_valueref = 0;
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_integer (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__valueref,&__pyx_n_s__values,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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__valueref)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_integer", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_integer") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_valueref = values[0];
    __pyx_v_values = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_integer", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.set_integer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_14set_integer(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_v_valueref, __pyx_v_values);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1064
 *         return val
 * 
 *     def set_integer(self, valueref, values):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the integer-values in the FMU as defined by the valuereference(s).
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_14set_integer(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_valueref, PyObject *__pyx_v_values) {
  int __pyx_v_status;
  size_t __pyx_v_nref;
  PyArrayObject *__pyx_v_val_ref = 0;
  PyArrayObject *__pyx_v_val = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_val;
  __Pyx_Buffer __pyx_pybuffer_val;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_val_ref;
  __Pyx_Buffer __pyx_pybuffer_val_ref;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_integer", 0);
  __pyx_pybuffer_val_ref.pybuffer.buf = NULL;
  __pyx_pybuffer_val_ref.refcount = 0;
  __pyx_pybuffernd_val_ref.data = NULL;
  __pyx_pybuffernd_val_ref.rcbuffer = &__pyx_pybuffer_val_ref;
  __pyx_pybuffer_val.pybuffer.buf = NULL;
  __pyx_pybuffer_val.refcount = 0;
  __pyx_pybuffernd_val.data = NULL;
  __pyx_pybuffernd_val.rcbuffer = &__pyx_pybuffer_val;

  /* "pyfmi\fmi.pyx":1084
 *         cdef int status
 *         cdef FMIL.size_t nref
 *         cdef N.ndarray[FMIL.fmi1_value_reference_t, ndim=1,mode='c'] val_ref = N.array(valueref, dtype=N.uint32,ndmin=1).ravel()             # <<<<<<<<<<<<<<
 *         cdef N.ndarray[FMIL.fmi1_integer_t, ndim=1,mode='c'] val = N.array(values, dtype=int,ndmin=1).ravel()
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_valueref);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_valueref);
  __Pyx_GIVEREF(__pyx_v_valueref);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__uint32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_val_ref.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_fmi1_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_val_ref = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_val_ref.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_val_ref.diminfo[0].strides = __pyx_pybuffernd_val_ref.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_val_ref.diminfo[0].shape = __pyx_pybuffernd_val_ref.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_val_ref = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":1085
 *         cdef FMIL.size_t nref
 *         cdef N.ndarray[FMIL.fmi1_value_reference_t, ndim=1,mode='c'] val_ref = N.array(valueref, dtype=N.uint32,ndmin=1).ravel()
 *         cdef N.ndarray[FMIL.fmi1_integer_t, ndim=1,mode='c'] val = N.array(values, dtype=int,ndmin=1).ravel()             # <<<<<<<<<<<<<<
 * 
 *         nref = val_ref.size
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__int); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ravel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __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 = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_val.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn_fmi1_integer_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_val = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_val.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_val.diminfo[0].strides = __pyx_pybuffernd_val.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_val.diminfo[0].shape = __pyx_pybuffernd_val.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_7 = 0;
  __pyx_v_val = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":1087
 *         cdef N.ndarray[FMIL.fmi1_integer_t, ndim=1,mode='c'] val = N.array(values, dtype=int,ndmin=1).ravel()
 * 
 *         nref = val_ref.size             # <<<<<<<<<<<<<<
 * 
 *         if val_ref.size != val.size:
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_val_ref), __pyx_n_s__size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_PyInt_from_py_size_t(__pyx_t_2); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_nref = __pyx_t_8;

  /* "pyfmi\fmi.pyx":1089
 *         nref = val_ref.size
 * 
 *         if val_ref.size != val.size:             # <<<<<<<<<<<<<<
 *             raise FMUException(
 *                 'The length of valueref and values are inconsistent.')
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_val_ref), __pyx_n_s__size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_val), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_9) {

    /* "pyfmi\fmi.pyx":1090
 * 
 *         if val_ref.size != val.size:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'The length of valueref and values are inconsistent.')
 * 
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_62), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1093
 *                 'The length of valueref and values are inconsistent.')
 * 
 *         status = FMIL.fmi1_import_set_integer(self._fmu, <FMIL.fmi1_value_reference_t*>val_ref.data, nref, <FMIL.fmi1_integer_t*>val.data)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi1_import_set_integer(__pyx_v_self->_fmu, ((fmi1_value_reference_t *)__pyx_v_val_ref->data), __pyx_v_nref, ((fmi1_integer_t *)__pyx_v_val->data));

  /* "pyfmi\fmi.pyx":1095
 *         status = FMIL.fmi1_import_set_integer(self._fmu, <FMIL.fmi1_value_reference_t*>val_ref.data, nref, <FMIL.fmi1_integer_t*>val.data)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to set the Integer values.')
 * 
 */
  __pyx_t_9 = (__pyx_v_status != 0);
  if (__pyx_t_9) {

    /* "pyfmi\fmi.pyx":1096
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Integer values.')             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_64), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_val.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_val_ref.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.set_integer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_val.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_val_ref.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_val_ref);
  __Pyx_XDECREF((PyObject *)__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_17get_boolean(PyObject *__pyx_v_self, PyObject *__pyx_v_valueref); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_16get_boolean[] = "\n        Returns the boolean-values from the valuereference(s).\n\n        Parameters::\n\n            valueref --\n                A list of valuereferences.\n\n        Returns::\n\n            values --\n                The values retrieved from the FMU.\n\n        Example::\n\n            val = model.get_boolean([232])\n\n        Calls the low-level FMI function: fmiGetBoolean\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_17get_boolean(PyObject *__pyx_v_self, PyObject *__pyx_v_valueref) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_boolean (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_16get_boolean(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_valueref));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1099
 * 
 * 
 *     def get_boolean(self, valueref):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the boolean-values from the valuereference(s).
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_16get_boolean(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_valueref) {
  int __pyx_v_status;
  size_t __pyx_v_nref;
  PyArrayObject *__pyx_v_val_ref = 0;
  void *__pyx_v_val;
  PyObject *__pyx_v_return_values = NULL;
  size_t __pyx_v_i;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_val_ref;
  __Pyx_Buffer __pyx_pybuffer_val_ref;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  size_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_boolean", 0);
  __pyx_pybuffer_val_ref.pybuffer.buf = NULL;
  __pyx_pybuffer_val_ref.refcount = 0;
  __pyx_pybuffernd_val_ref.data = NULL;
  __pyx_pybuffernd_val_ref.rcbuffer = &__pyx_pybuffer_val_ref;

  /* "pyfmi\fmi.pyx":1121
 *         cdef int status
 *         cdef FMIL.size_t nref
 *         cdef N.ndarray[FMIL.fmi1_value_reference_t, ndim=1,mode='c'] val_ref = N.array(valueref, dtype=N.uint32,ndmin=1).ravel()             # <<<<<<<<<<<<<<
 * 
 *         nref = val_ref.size
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_valueref);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_valueref);
  __Pyx_GIVEREF(__pyx_v_valueref);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__uint32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_val_ref.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_fmi1_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_val_ref = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_val_ref.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_val_ref.diminfo[0].strides = __pyx_pybuffernd_val_ref.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_val_ref.diminfo[0].shape = __pyx_pybuffernd_val_ref.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_val_ref = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":1123
 *         cdef N.ndarray[FMIL.fmi1_value_reference_t, ndim=1,mode='c'] val_ref = N.array(valueref, dtype=N.uint32,ndmin=1).ravel()
 * 
 *         nref = val_ref.size             # <<<<<<<<<<<<<<
 *         #cdef N.ndarray[FMIL.fmi1_boolean_t, ndim=1,mode='c'] val = N.array(['0']*nref, dtype=N.char.character,ndmin=1)
 *         cdef void *val = FMIL.malloc(sizeof(FMIL.fmi1_boolean_t)*nref)
 */
  __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_val_ref), __pyx_n_s__size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_PyInt_from_py_size_t(__pyx_t_5); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_nref = __pyx_t_7;

  /* "pyfmi\fmi.pyx":1125
 *         nref = val_ref.size
 *         #cdef N.ndarray[FMIL.fmi1_boolean_t, ndim=1,mode='c'] val = N.array(['0']*nref, dtype=N.char.character,ndmin=1)
 *         cdef void *val = FMIL.malloc(sizeof(FMIL.fmi1_boolean_t)*nref)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_val = malloc(((sizeof(fmi1_boolean_t)) * __pyx_v_nref));

  /* "pyfmi\fmi.pyx":1129
 * 
 *         #status = FMIL.fmi1_import_get_boolean(self._fmu, <FMIL.fmi1_value_reference_t*>val_ref.data, nref, <FMIL.fmi1_boolean_t*>val.data)
 *         status = FMIL.fmi1_import_get_boolean(self._fmu, <FMIL.fmi1_value_reference_t*>val_ref.data, nref, <FMIL.fmi1_boolean_t*>val)             # <<<<<<<<<<<<<<
 * 
 *         return_values = []
 */
  __pyx_v_status = fmi1_import_get_boolean(__pyx_v_self->_fmu, ((fmi1_value_reference_t *)__pyx_v_val_ref->data), __pyx_v_nref, ((fmi1_boolean_t *)__pyx_v_val));

  /* "pyfmi\fmi.pyx":1131
 *         status = FMIL.fmi1_import_get_boolean(self._fmu, <FMIL.fmi1_value_reference_t*>val_ref.data, nref, <FMIL.fmi1_boolean_t*>val)
 * 
 *         return_values = []             # <<<<<<<<<<<<<<
 *         for i in range(nref):
 *             return_values.append((<FMIL.fmi1_boolean_t*>val)[i]==1)
 */
  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_return_values = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":1132
 * 
 *         return_values = []
 *         for i in range(nref):             # <<<<<<<<<<<<<<
 *             return_values.append((<FMIL.fmi1_boolean_t*>val)[i]==1)
 *             #print (<FMIL.fmi1_boolean_t*>val)[i], (<FMIL.fmi1_boolean_t*>val)[i]==1
 */
  __pyx_t_7 = __pyx_v_nref;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;

    /* "pyfmi\fmi.pyx":1133
 *         return_values = []
 *         for i in range(nref):
 *             return_values.append((<FMIL.fmi1_boolean_t*>val)[i]==1)             # <<<<<<<<<<<<<<
 *             #print (<FMIL.fmi1_boolean_t*>val)[i], (<FMIL.fmi1_boolean_t*>val)[i]==1
 * 
 */
    __pyx_t_5 = __Pyx_PyBool_FromLong(((((fmi1_boolean_t *)__pyx_v_val)[__pyx_v_i]) == 1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = PyList_Append(__pyx_v_return_values, __pyx_t_5); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }

  /* "pyfmi\fmi.pyx":1139
 * 
 *         #Dealloc
 *         FMIL.free(val)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  free(__pyx_v_val);

  /* "pyfmi\fmi.pyx":1141
 *         FMIL.free(val)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to get the Boolean values.')
 * 
 */
  __pyx_t_10 = (__pyx_v_status != 0);
  if (__pyx_t_10) {

    /* "pyfmi\fmi.pyx":1142
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Boolean values.')             # <<<<<<<<<<<<<<
 * 
 *         return N.array(return_values)
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_66), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":1144
 *             raise FMUException('Failed to get the Boolean values.')
 * 
 *         return N.array(return_values)             # <<<<<<<<<<<<<<
 *         #return val==FMI_TRUE
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_return_values));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_return_values));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_return_values));
  __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_val_ref.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_boolean", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_val_ref.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_val_ref);
  __Pyx_XDECREF(__pyx_v_return_values);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_19set_boolean(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_18set_boolean[] = "\n        Sets the boolean-values in the FMU as defined by the valuereference(s).\n\n        Parameters::\n\n            valueref --\n                A list of valuereferences.\n\n            values --\n                Values to be set.\n\n        Example::\n\n            model.set_boolean([234,235],[True,False])\n\n        Calls the low-level FMI function: fmiSetBoolean\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_19set_boolean(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_valueref = 0;
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_boolean (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__valueref,&__pyx_n_s__values,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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__valueref)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_boolean", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_boolean") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_valueref = values[0];
    __pyx_v_values = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_boolean", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.set_boolean", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_18set_boolean(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_v_valueref, __pyx_v_values);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1147
 *         #return val==FMI_TRUE
 * 
 *     def set_boolean(self, valueref, values):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the boolean-values in the FMU as defined by the valuereference(s).
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_18set_boolean(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_valueref, PyObject *__pyx_v_values) {
  int __pyx_v_status;
  size_t __pyx_v_nref;
  PyArrayObject *__pyx_v_val_ref = 0;
  void *__pyx_v_val;
  size_t __pyx_v_i;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_val_ref;
  __Pyx_Buffer __pyx_pybuffer_val_ref;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  size_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_boolean", 0);
  __Pyx_INCREF(__pyx_v_values);
  __pyx_pybuffer_val_ref.pybuffer.buf = NULL;
  __pyx_pybuffer_val_ref.refcount = 0;
  __pyx_pybuffernd_val_ref.data = NULL;
  __pyx_pybuffernd_val_ref.rcbuffer = &__pyx_pybuffer_val_ref;

  /* "pyfmi\fmi.pyx":1168
 *         cdef FMIL.size_t nref
 * 
 *         cdef N.ndarray[FMIL.fmi1_value_reference_t, ndim=1,mode='c'] val_ref = N.array(valueref, dtype=N.uint32,ndmin=1).ravel()             # <<<<<<<<<<<<<<
 *         nref = val_ref.size
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_valueref);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_valueref);
  __Pyx_GIVEREF(__pyx_v_valueref);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__uint32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_val_ref.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_fmi1_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_val_ref = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_val_ref.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_val_ref.diminfo[0].strides = __pyx_pybuffernd_val_ref.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_val_ref.diminfo[0].shape = __pyx_pybuffernd_val_ref.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_val_ref = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":1169
 * 
 *         cdef N.ndarray[FMIL.fmi1_value_reference_t, ndim=1,mode='c'] val_ref = N.array(valueref, dtype=N.uint32,ndmin=1).ravel()
 *         nref = val_ref.size             # <<<<<<<<<<<<<<
 * 
 *         #cdef N.ndarray[FMIL.fmi1_boolean_t, ndim=1,mode='c'] val = N.array(['0']*nref, dtype=N.char.character,ndmin=1).flatten()
 */
  __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_val_ref), __pyx_n_s__size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_PyInt_from_py_size_t(__pyx_t_5); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_nref = __pyx_t_7;

  /* "pyfmi\fmi.pyx":1172
 * 
 *         #cdef N.ndarray[FMIL.fmi1_boolean_t, ndim=1,mode='c'] val = N.array(['0']*nref, dtype=N.char.character,ndmin=1).flatten()
 *         cdef void *val = FMIL.malloc(sizeof(FMIL.fmi1_boolean_t)*nref)             # <<<<<<<<<<<<<<
 * 
 *         values = N.array(values,ndmin=1).ravel()
 */
  __pyx_v_val = malloc(((sizeof(fmi1_boolean_t)) * __pyx_v_nref));

  /* "pyfmi\fmi.pyx":1174
 *         cdef void *val = FMIL.malloc(sizeof(FMIL.fmi1_boolean_t)*nref)
 * 
 *         values = N.array(values,ndmin=1).ravel()             # <<<<<<<<<<<<<<
 *         for i in range(nref):
 *             if values[i]:
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ravel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __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 = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_v_values);
  __pyx_v_values = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":1175
 * 
 *         values = N.array(values,ndmin=1).ravel()
 *         for i in range(nref):             # <<<<<<<<<<<<<<
 *             if values[i]:
 *                 #val[i]=1
 */
  __pyx_t_7 = __pyx_v_nref;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;

    /* "pyfmi\fmi.pyx":1176
 *         values = N.array(values,ndmin=1).ravel()
 *         for i in range(nref):
 *             if values[i]:             # <<<<<<<<<<<<<<
 *                 #val[i]=1
 *                 (<FMIL.fmi1_boolean_t*>val)[i] = 1
 */
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_values, __pyx_v_i, sizeof(size_t)+1, __Pyx_PyInt_to_py_size_t); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_9) {

      /* "pyfmi\fmi.pyx":1178
 *             if values[i]:
 *                 #val[i]=1
 *                 (<FMIL.fmi1_boolean_t*>val)[i] = 1             # <<<<<<<<<<<<<<
 *             else:
 *                 #val[i]=0
 */
      (((fmi1_boolean_t *)__pyx_v_val)[__pyx_v_i]) = 1;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":1181
 *             else:
 *                 #val[i]=0
 *                 (<FMIL.fmi1_boolean_t*>val)[i] = 0             # <<<<<<<<<<<<<<
 * 
 *         if val_ref.size != values.size:
 */
      (((fmi1_boolean_t *)__pyx_v_val)[__pyx_v_i]) = 0;
    }
    __pyx_L5:;
  }

  /* "pyfmi\fmi.pyx":1183
 *                 (<FMIL.fmi1_boolean_t*>val)[i] = 0
 * 
 *         if val_ref.size != values.size:             # <<<<<<<<<<<<<<
 *             raise FMUException(
 *                 'The length of valueref and values are inconsistent.')
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_val_ref), __pyx_n_s__size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_values, __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_9) {

    /* "pyfmi\fmi.pyx":1184
 * 
 *         if val_ref.size != values.size:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'The length of valueref and values are inconsistent.')
 * 
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_67), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pyfmi\fmi.pyx":1188
 * 
 *         #status = FMIL.fmi1_import_set_boolean(self._fmu, <FMIL.fmi1_value_reference_t*>val_ref.data, nref, <FMIL.fmi1_boolean_t*>val.data)
 *         status = FMIL.fmi1_import_set_boolean(self._fmu, <FMIL.fmi1_value_reference_t*>val_ref.data, nref, <FMIL.fmi1_boolean_t*>val)             # <<<<<<<<<<<<<<
 * 
 *         FMIL.free(val)
 */
  __pyx_v_status = fmi1_import_set_boolean(__pyx_v_self->_fmu, ((fmi1_value_reference_t *)__pyx_v_val_ref->data), __pyx_v_nref, ((fmi1_boolean_t *)__pyx_v_val));

  /* "pyfmi\fmi.pyx":1190
 *         status = FMIL.fmi1_import_set_boolean(self._fmu, <FMIL.fmi1_value_reference_t*>val_ref.data, nref, <FMIL.fmi1_boolean_t*>val)
 * 
 *         FMIL.free(val)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  free(__pyx_v_val);

  /* "pyfmi\fmi.pyx":1192
 *         FMIL.free(val)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to set the Boolean values.')
 * 
 */
  __pyx_t_9 = (__pyx_v_status != 0);
  if (__pyx_t_9) {

    /* "pyfmi\fmi.pyx":1193
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Boolean values.')             # <<<<<<<<<<<<<<
 * 
 *     def get_string(self, valueref):
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_69), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_val_ref.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.set_boolean", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_val_ref.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_val_ref);
  __Pyx_XDECREF(__pyx_v_values);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_21get_string(PyObject *__pyx_v_self, PyObject *__pyx_v_valueref); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_20get_string[] = "\n        Returns the string-values from the valuereference(s).\n\n        Parameters::\n\n            valueref --\n                A list of valuereferences.\n\n        Returns::\n\n            values --\n                The values retrieved from the FMU.\n\n        Example::\n\n            val = model.get_string([232])\n\n        Calls the low-level FMI function: fmiGetString\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_21get_string(PyObject *__pyx_v_self, PyObject *__pyx_v_valueref) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_string (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_20get_string(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_valueref));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1195
 *             raise FMUException('Failed to set the Boolean values.')
 * 
 *     def get_string(self, valueref):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the string-values from the valuereference(s).
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_20get_string(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_valueref) {
  int __pyx_v_status;
  PyArrayObject *__pyx_v_input_valueref = 0;
  fmi1_string_t *__pyx_v_output_value;
  PyObject *__pyx_v_out = NULL;
  PyObject *__pyx_v_i = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_input_valueref;
  __Pyx_Buffer __pyx_pybuffer_input_valueref;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  Py_ssize_t __pyx_t_11;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_string", 0);
  __pyx_pybuffer_input_valueref.pybuffer.buf = NULL;
  __pyx_pybuffer_input_valueref.refcount = 0;
  __pyx_pybuffernd_input_valueref.data = NULL;
  __pyx_pybuffernd_input_valueref.rcbuffer = &__pyx_pybuffer_input_valueref;

  /* "pyfmi\fmi.pyx":1216
 *         """
 *         cdef int         status
 *         cdef N.ndarray[FMIL.fmi1_value_reference_t, ndim=1, mode='c'] input_valueref = N.array(valueref, dtype=N.uint32, ndmin=1).ravel()             # <<<<<<<<<<<<<<
 *         cdef FMIL.fmi1_string_t* output_value = <FMIL.fmi1_string_t*>FMIL.malloc(sizeof(FMIL.fmi1_string_t)*input_valueref.size)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_valueref);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_valueref);
  __Pyx_GIVEREF(__pyx_v_valueref);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__uint32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input_valueref.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_fmi1_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_input_valueref = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_input_valueref.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_input_valueref.diminfo[0].strides = __pyx_pybuffernd_input_valueref.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input_valueref.diminfo[0].shape = __pyx_pybuffernd_input_valueref.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_input_valueref = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":1217
 *         cdef int         status
 *         cdef N.ndarray[FMIL.fmi1_value_reference_t, ndim=1, mode='c'] input_valueref = N.array(valueref, dtype=N.uint32, ndmin=1).ravel()
 *         cdef FMIL.fmi1_string_t* output_value = <FMIL.fmi1_string_t*>FMIL.malloc(sizeof(FMIL.fmi1_string_t)*input_valueref.size)             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi1_import_get_string(self._fmu, <FMIL.fmi1_value_reference_t*> input_valueref.data, input_valueref.size, output_value)
 */
  __pyx_t_5 = __Pyx_PyInt_FromSize_t((sizeof(fmi1_string_t))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_input_valueref), __pyx_n_s__size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyNumber_Multiply(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = __Pyx_PyInt_AsSize_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_output_value = ((fmi1_string_t *)malloc(__pyx_t_7));

  /* "pyfmi\fmi.pyx":1219
 *         cdef FMIL.fmi1_string_t* output_value = <FMIL.fmi1_string_t*>FMIL.malloc(sizeof(FMIL.fmi1_string_t)*input_valueref.size)
 * 
 *         status = FMIL.fmi1_import_get_string(self._fmu, <FMIL.fmi1_value_reference_t*> input_valueref.data, input_valueref.size, output_value)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_input_valueref), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyInt_AsSize_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_status = fmi1_import_get_string(__pyx_v_self->_fmu, ((fmi1_value_reference_t *)__pyx_v_input_valueref->data), __pyx_t_7, __pyx_v_output_value);

  /* "pyfmi\fmi.pyx":1221
 *         status = FMIL.fmi1_import_get_string(self._fmu, <FMIL.fmi1_value_reference_t*> input_valueref.data, input_valueref.size, output_value)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to get the String values.')
 * 
 */
  __pyx_t_8 = (__pyx_v_status != 0);
  if (__pyx_t_8) {

    /* "pyfmi\fmi.pyx":1222
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the String values.')             # <<<<<<<<<<<<<<
 * 
 *         out = []
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_71), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1224
 *             raise FMUException('Failed to get the String values.')
 * 
 *         out = []             # <<<<<<<<<<<<<<
 *         for i in range(input_valueref.size):
 *             out.append(decode(output_value[i]))
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_out = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":1225
 * 
 *         out = []
 *         for i in range(input_valueref.size):             # <<<<<<<<<<<<<<
 *             out.append(decode(output_value[i]))
 * 
 */
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_input_valueref), __pyx_n_s__size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0;
    __pyx_t_10 = NULL;
  } else {
    __pyx_t_9 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_10 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (!__pyx_t_10 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_10 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_3 = __pyx_t_10(__pyx_t_1);
      if (unlikely(!__pyx_t_3)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF(__pyx_v_i);
    __pyx_v_i = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "pyfmi\fmi.pyx":1226
 *         out = []
 *         for i in range(input_valueref.size):
 *             out.append(decode(output_value[i]))             # <<<<<<<<<<<<<<
 * 
 *         FMIL.free(output_value)
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = PyBytes_FromString((__pyx_v_output_value[__pyx_t_11])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_5));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_12 = PyList_Append(__pyx_v_out, __pyx_t_5); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":1228
 *             out.append(decode(output_value[i]))
 * 
 *         FMIL.free(output_value)             # <<<<<<<<<<<<<<
 * 
 *         return out
 */
  free(__pyx_v_output_value);

  /* "pyfmi\fmi.pyx":1230
 *         FMIL.free(output_value)
 * 
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     def set_string(self, valueref, values):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = ((PyObject *)__pyx_v_out);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_valueref.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_valueref.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_input_valueref);
  __Pyx_XDECREF(__pyx_v_out);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_23set_string(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_22set_string[] = "\n        Sets the string-values in the FMU as defined by the valuereference(s).\n\n        Parameters::\n\n            valueref --\n                A list of valuereferences.\n\n            values --\n                Values to be set.\n\n        Example::\n\n            model.set_string([234,235],['text','text'])\n\n        Calls the low-level FMI function: fmiSetString\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_23set_string(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_valueref = 0;
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_string (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__valueref,&__pyx_n_s__values,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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__valueref)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_string", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_string") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_valueref = values[0];
    __pyx_v_values = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_string", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.set_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_22set_string(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_v_valueref, __pyx_v_values);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1232
 *         return out
 * 
 *     def set_string(self, valueref, values):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the string-values in the FMU as defined by the valuereference(s).
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_22set_string(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_valueref, PyObject *__pyx_v_values) {
  int __pyx_v_status;
  PyArrayObject *__pyx_v_val_ref = 0;
  fmi1_string_t *__pyx_v_val;
  PyObject *__pyx_v_i = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_val_ref;
  __Pyx_Buffer __pyx_pybuffer_val_ref;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  fmi1_string_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_string", 0);
  __pyx_pybuffer_val_ref.pybuffer.buf = NULL;
  __pyx_pybuffer_val_ref.refcount = 0;
  __pyx_pybuffernd_val_ref.data = NULL;
  __pyx_pybuffernd_val_ref.rcbuffer = &__pyx_pybuffer_val_ref;

  /* "pyfmi\fmi.pyx":1251
 *         """
 *         cdef int status
 *         cdef N.ndarray[FMIL.fmi1_value_reference_t, ndim=1,mode='c'] val_ref = N.array(valueref, dtype=N.uint32,ndmin=1).ravel()             # <<<<<<<<<<<<<<
 *         cdef FMIL.fmi1_string_t* val = <FMIL.fmi1_string_t*>FMIL.malloc(sizeof(FMIL.fmi1_string_t)*val_ref.size)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_valueref);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_valueref);
  __Pyx_GIVEREF(__pyx_v_valueref);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__uint32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_val_ref.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_fmi1_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_val_ref = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_val_ref.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_val_ref.diminfo[0].strides = __pyx_pybuffernd_val_ref.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_val_ref.diminfo[0].shape = __pyx_pybuffernd_val_ref.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_val_ref = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":1252
 *         cdef int status
 *         cdef N.ndarray[FMIL.fmi1_value_reference_t, ndim=1,mode='c'] val_ref = N.array(valueref, dtype=N.uint32,ndmin=1).ravel()
 *         cdef FMIL.fmi1_string_t* val = <FMIL.fmi1_string_t*>FMIL.malloc(sizeof(FMIL.fmi1_string_t)*val_ref.size)             # <<<<<<<<<<<<<<
 * 
 *         if not isinstance(values, list):
 */
  __pyx_t_5 = __Pyx_PyInt_FromSize_t((sizeof(fmi1_string_t))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_val_ref), __pyx_n_s__size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyNumber_Multiply(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = __Pyx_PyInt_AsSize_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_val = ((fmi1_string_t *)malloc(__pyx_t_7));

  /* "pyfmi\fmi.pyx":1254
 *         cdef FMIL.fmi1_string_t* val = <FMIL.fmi1_string_t*>FMIL.malloc(sizeof(FMIL.fmi1_string_t)*val_ref.size)
 * 
 *         if not isinstance(values, list):             # <<<<<<<<<<<<<<
 *             raise FMUException(
 *                 'The values needs to be a list of values.')
 */
  __pyx_t_8 = PyList_Check(__pyx_v_values); 
  __pyx_t_9 = (!__pyx_t_8);
  if (__pyx_t_9) {

    /* "pyfmi\fmi.pyx":1255
 * 
 *         if not isinstance(values, list):
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'The values needs to be a list of values.')
 *         if len(values) != val_ref.size:
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_73), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1257
 *             raise FMUException(
 *                 'The values needs to be a list of values.')
 *         if len(values) != val_ref.size:             # <<<<<<<<<<<<<<
 *             raise FMUException(
 *                 'The length of valueref and values are inconsistent.')
 */
  __pyx_t_10 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_val_ref), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_9) {

    /* "pyfmi\fmi.pyx":1258
 *                 'The values needs to be a list of values.')
 *         if len(values) != val_ref.size:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'The length of valueref and values are inconsistent.')
 * 
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_74), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":1261
 *                 'The length of valueref and values are inconsistent.')
 * 
 *         for i in range(val_ref.size):             # <<<<<<<<<<<<<<
 *             val[i] = values[i]
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_val_ref), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5); __pyx_t_10 = 0;
    __pyx_t_11 = NULL;
  } else {
    __pyx_t_10 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_11 = Py_TYPE(__pyx_t_5)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_5)) {
      if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_5)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_5)) {
      if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_11(__pyx_t_5);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF(__pyx_v_i);
    __pyx_v_i = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pyfmi\fmi.pyx":1262
 * 
 *         for i in range(val_ref.size):
 *             val[i] = values[i]             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi1_import_set_string(self._fmu, <FMIL.fmi1_value_reference_t*>val_ref.data, val_ref.size, val)
 */
    __pyx_t_1 = PyObject_GetItem(__pyx_v_values, __pyx_v_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_12 = PyBytes_AsString(__pyx_t_1); if (unlikely((__pyx_t_12 == (fmi1_string_t)NULL) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    (__pyx_v_val[__pyx_t_13]) = __pyx_t_12;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":1264
 *             val[i] = values[i]
 * 
 *         status = FMIL.fmi1_import_set_string(self._fmu, <FMIL.fmi1_value_reference_t*>val_ref.data, val_ref.size, val)             # <<<<<<<<<<<<<<
 * 
 *         FMIL.free(val)
 */
  __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_val_ref), __pyx_n_s__size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_PyInt_AsSize_t(__pyx_t_5); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_status = fmi1_import_set_string(__pyx_v_self->_fmu, ((fmi1_value_reference_t *)__pyx_v_val_ref->data), __pyx_t_7, __pyx_v_val);

  /* "pyfmi\fmi.pyx":1266
 *         status = FMIL.fmi1_import_set_string(self._fmu, <FMIL.fmi1_value_reference_t*>val_ref.data, val_ref.size, val)
 * 
 *         FMIL.free(val)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  free(__pyx_v_val);

  /* "pyfmi\fmi.pyx":1268
 *         FMIL.free(val)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to set the String values.')
 * 
 */
  __pyx_t_9 = (__pyx_v_status != 0);
  if (__pyx_t_9) {

    /* "pyfmi\fmi.pyx":1269
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the String values.')             # <<<<<<<<<<<<<<
 * 
 *     def set_debug_logging(self,flag):
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_76), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_val_ref.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.set_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_val_ref.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_val_ref);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_25set_debug_logging(PyObject *__pyx_v_self, PyObject *__pyx_v_flag); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_24set_debug_logging[] = "\n        Specifies if the logging from the FMU should be turned on or \n        off. Note that this only determines the output from the FMU to\n        PyFMI which are additionally filtered using the method \n        'set_log_level'. To specify actual given logging output, \n        please use also use that method.\n\n        Parameters::\n\n            flag --\n                Boolean value.\n\n        Calls the low-level FMI function: fmiSetDebuggLogging\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_25set_debug_logging(PyObject *__pyx_v_self, PyObject *__pyx_v_flag) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_debug_logging (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_24set_debug_logging(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_flag));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1271
 *             raise FMUException('Failed to set the String values.')
 * 
 *     def set_debug_logging(self,flag):             # <<<<<<<<<<<<<<
 *         """
 *         Specifies if the logging from the FMU should be turned on or
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_24set_debug_logging(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_flag) {
  fmi1_boolean_t __pyx_v_log;
  int __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  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("set_debug_logging", 0);

  /* "pyfmi\fmi.pyx":1291
 *         #self.callbacks.log_level = FMIL.jm_log_level_warning if flag else FMIL.jm_log_level_nothing
 * 
 *         if flag:             # <<<<<<<<<<<<<<
 *             log = 1
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":1292
 * 
 *         if flag:
 *             log = 1             # <<<<<<<<<<<<<<
 *         else:
 *             log = 0
 */
    __pyx_v_log = 1;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":1294
 *             log = 1
 *         else:
 *             log = 0             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi1_import_set_debug_logging(self._fmu, log)
 */
    __pyx_v_log = 0;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1296
 *             log = 0
 * 
 *         status = FMIL.fmi1_import_set_debug_logging(self._fmu, log)             # <<<<<<<<<<<<<<
 *         self._enable_logging = bool(log)
 * 
 */
  __pyx_v_status = fmi1_import_set_debug_logging(__pyx_v_self->_fmu, __pyx_v_log);

  /* "pyfmi\fmi.pyx":1297
 * 
 *         status = FMIL.fmi1_import_set_debug_logging(self._fmu, log)
 *         self._enable_logging = bool(log)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_t_2 = __Pyx_PyInt_to_py_fmi1_boolean_t(__pyx_v_log); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_1))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->_enable_logging);
  __Pyx_DECREF(__pyx_v_self->_enable_logging);
  __pyx_v_self->_enable_logging = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":1299
 *         self._enable_logging = bool(log)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to set the debugging option.')
 * 
 */
  __pyx_t_1 = (__pyx_v_status != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":1300
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the debugging option.')             # <<<<<<<<<<<<<<
 * 
 *     def set_fmil_log_level(self, FMIL.jm_log_level_enu_t level):
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_78), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.set_debug_logging", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_27set_fmil_log_level(PyObject *__pyx_v_self, PyObject *__pyx_arg_level); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_27set_fmil_log_level(PyObject *__pyx_v_self, PyObject *__pyx_arg_level) {
  jm_log_level_enu_t __pyx_v_level;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_fmil_log_level (wrapper)", 0);
  assert(__pyx_arg_level); {
    __pyx_v_level = ((jm_log_level_enu_t)PyInt_AsLong(__pyx_arg_level)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1302; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.set_fmil_log_level", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_26set_fmil_log_level(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((jm_log_level_enu_t)__pyx_v_level));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1302
 *             raise FMUException('Failed to set the debugging option.')
 * 
 *     def set_fmil_log_level(self, FMIL.jm_log_level_enu_t level):             # <<<<<<<<<<<<<<
 *         logging.warning("The method 'set_fmil_log_level' is deprecated, use 'set_log_level' instead.")
 *         self.set_log_level(level)
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_26set_fmil_log_level(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, jm_log_level_enu_t __pyx_v_level) {
  PyObject *__pyx_r = NULL;
  __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("set_fmil_log_level", 0);

  /* "pyfmi\fmi.pyx":1303
 * 
 *     def set_fmil_log_level(self, FMIL.jm_log_level_enu_t level):
 *         logging.warning("The method 'set_fmil_log_level' is deprecated, use 'set_log_level' instead.")             # <<<<<<<<<<<<<<
 *         self.set_log_level(level)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logging); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__warning); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_80), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":1304
 *     def set_fmil_log_level(self, FMIL.jm_log_level_enu_t level):
 *         logging.warning("The method 'set_fmil_log_level' is deprecated, use 'set_log_level' instead.")
 *         self.set_log_level(level)             # <<<<<<<<<<<<<<
 * 
 *     def _set(self, variable_name, value):
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__set_log_level); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromLong(__pyx_v_level); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.set_fmil_log_level", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_29_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_28_set[] = "\n        Helper method to set, see docstring on set.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_29_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_variable_name = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__variable_name,&__pyx_n_s__value,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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__variable_name)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_set", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_set") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_variable_name = values[0];
    __pyx_v_value = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_set", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase._set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_28_set(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_v_variable_name, __pyx_v_value);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1306
 *         self.set_log_level(level)
 * 
 *     def _set(self, variable_name, value):             # <<<<<<<<<<<<<<
 *         """
 *         Helper method to set, see docstring on set.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_28_set(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name, PyObject *__pyx_v_value) {
  fmi1_value_reference_t __pyx_v_ref;
  enum fmi1_base_type_enu_t __pyx_v_type;
  fmi1_import_variable_t *__pyx_v_variable;
  enum fmi1_variable_alias_kind_enu_t __pyx_v_alias_kind;
  char *__pyx_v_variablename;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set", 0);
  __Pyx_INCREF(__pyx_v_variable_name);
  __Pyx_INCREF(__pyx_v_value);

  /* "pyfmi\fmi.pyx":1315
 *         cdef FMIL.fmi1_variable_alias_kind_enu_t alias_kind
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __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 = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_variable_name);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_variable_name);
  __Pyx_GIVEREF(__pyx_v_variable_name);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_v_variable_name);
  __pyx_v_variable_name = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":1316
 * 
 *         variable_name = encode(variable_name)
 *         cdef char* variablename = variable_name             # <<<<<<<<<<<<<<
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 */
  __pyx_t_4 = PyBytes_AsString(__pyx_v_variable_name); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_4;

  /* "pyfmi\fmi.pyx":1318
 *         cdef char* variablename = variable_name
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)             # <<<<<<<<<<<<<<
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variable_name)
 */
  __pyx_v_variable = fmi1_import_get_variable_by_name(__pyx_v_self->_fmu, __pyx_v_variablename);

  /* "pyfmi\fmi.pyx":1319
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The variable %s could not be found."%variable_name)
 * 
 */
  __pyx_t_5 = (__pyx_v_variable == NULL);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":1320
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variable_name)             # <<<<<<<<<<<<<<
 * 
 *         ref =  FMIL.fmi1_import_get_variable_vr(variable)
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_81), __pyx_v_variable_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __pyx_t_2 = 0;
    __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 = 1320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1322
 *             raise FMUException("The variable %s could not be found."%variable_name)
 * 
 *         ref =  FMIL.fmi1_import_get_variable_vr(variable)             # <<<<<<<<<<<<<<
 *         type = FMIL.fmi1_import_get_variable_base_type(variable)
 *         alias_kind = FMIL.fmi1_import_get_variable_alias_kind(variable)
 */
  __pyx_v_ref = fmi1_import_get_variable_vr(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":1323
 * 
 *         ref =  FMIL.fmi1_import_get_variable_vr(variable)
 *         type = FMIL.fmi1_import_get_variable_base_type(variable)             # <<<<<<<<<<<<<<
 *         alias_kind = FMIL.fmi1_import_get_variable_alias_kind(variable)
 * 
 */
  __pyx_v_type = fmi1_import_get_variable_base_type(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":1324
 *         ref =  FMIL.fmi1_import_get_variable_vr(variable)
 *         type = FMIL.fmi1_import_get_variable_base_type(variable)
 *         alias_kind = FMIL.fmi1_import_get_variable_alias_kind(variable)             # <<<<<<<<<<<<<<
 * 
 *         if type == FMIL.fmi1_base_type_real:  #REAL
 */
  __pyx_v_alias_kind = fmi1_import_get_variable_alias_kind(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":1326
 *         alias_kind = FMIL.fmi1_import_get_variable_alias_kind(variable)
 * 
 *         if type == FMIL.fmi1_base_type_real:  #REAL             # <<<<<<<<<<<<<<
 *             if alias_kind == FMI_NEGATED_ALIAS:
 *                 value = -value
 */
  __pyx_t_5 = (__pyx_v_type == fmi1_base_type_real);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":1327
 * 
 *         if type == FMIL.fmi1_base_type_real:  #REAL
 *             if alias_kind == FMI_NEGATED_ALIAS:             # <<<<<<<<<<<<<<
 *                 value = -value
 *             self.set_real([ref], [value])
 */
    __pyx_t_2 = PyInt_FromLong(__pyx_v_alias_kind); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_NEGATED_ALIAS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {

      /* "pyfmi\fmi.pyx":1328
 *         if type == FMIL.fmi1_base_type_real:  #REAL
 *             if alias_kind == FMI_NEGATED_ALIAS:
 *                 value = -value             # <<<<<<<<<<<<<<
 *             self.set_real([ref], [value])
 *         elif type == FMIL.fmi1_base_type_int or type == FMIL.fmi1_base_type_enum: #INTEGER
 */
      __pyx_t_3 = PyNumber_Negative(__pyx_v_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_v_value);
      __pyx_v_value = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "pyfmi\fmi.pyx":1329
 *             if alias_kind == FMI_NEGATED_ALIAS:
 *                 value = -value
 *             self.set_real([ref], [value])             # <<<<<<<<<<<<<<
 *         elif type == FMIL.fmi1_base_type_int or type == FMIL.fmi1_base_type_enum: #INTEGER
 *             if alias_kind == FMI_NEGATED_ALIAS:
 */
    __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__set_real); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyInt_to_py_fmi1_value_reference_t(__pyx_v_ref); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_value);
    PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_value);
    __Pyx_GIVEREF(__pyx_v_value);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_t_1));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
    __pyx_t_2 = 0;
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L4;
  }

  /* "pyfmi\fmi.pyx":1330
 *                 value = -value
 *             self.set_real([ref], [value])
 *         elif type == FMIL.fmi1_base_type_int or type == FMIL.fmi1_base_type_enum: #INTEGER             # <<<<<<<<<<<<<<
 *             if alias_kind == FMI_NEGATED_ALIAS:
 *                 value = -value
 */
  __pyx_t_5 = (__pyx_v_type == fmi1_base_type_int);
  if (!__pyx_t_5) {
    __pyx_t_7 = (__pyx_v_type == fmi1_base_type_enum);
    __pyx_t_8 = __pyx_t_7;
  } else {
    __pyx_t_8 = __pyx_t_5;
  }
  if (__pyx_t_8) {

    /* "pyfmi\fmi.pyx":1331
 *             self.set_real([ref], [value])
 *         elif type == FMIL.fmi1_base_type_int or type == FMIL.fmi1_base_type_enum: #INTEGER
 *             if alias_kind == FMI_NEGATED_ALIAS:             # <<<<<<<<<<<<<<
 *                 value = -value
 *             self.set_integer([ref], [value])
 */
    __pyx_t_1 = PyInt_FromLong(__pyx_v_alias_kind); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_NEGATED_ALIAS); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_8) {

      /* "pyfmi\fmi.pyx":1332
 *         elif type == FMIL.fmi1_base_type_int or type == FMIL.fmi1_base_type_enum: #INTEGER
 *             if alias_kind == FMI_NEGATED_ALIAS:
 *                 value = -value             # <<<<<<<<<<<<<<
 *             self.set_integer([ref], [value])
 *         elif type == FMIL.fmi1_base_type_str: #STRING
 */
      __pyx_t_3 = PyNumber_Negative(__pyx_v_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_v_value);
      __pyx_v_value = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "pyfmi\fmi.pyx":1333
 *             if alias_kind == FMI_NEGATED_ALIAS:
 *                 value = -value
 *             self.set_integer([ref], [value])             # <<<<<<<<<<<<<<
 *         elif type == FMIL.fmi1_base_type_str: #STRING
 *             self.set_string([ref], [value])
 */
    __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__set_integer); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyInt_to_py_fmi1_value_reference_t(__pyx_v_ref); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_value);
    PyList_SET_ITEM(__pyx_t_6, 0, __pyx_v_value);
    __Pyx_GIVEREF(__pyx_v_value);
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
    PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_t_6));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
    __pyx_t_1 = 0;
    __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L4;
  }

  /* "pyfmi\fmi.pyx":1334
 *                 value = -value
 *             self.set_integer([ref], [value])
 *         elif type == FMIL.fmi1_base_type_str: #STRING             # <<<<<<<<<<<<<<
 *             self.set_string([ref], [value])
 *         elif type == FMIL.fmi1_base_type_bool: #BOOLEAN
 */
  __pyx_t_8 = (__pyx_v_type == fmi1_base_type_str);
  if (__pyx_t_8) {

    /* "pyfmi\fmi.pyx":1335
 *             self.set_integer([ref], [value])
 *         elif type == FMIL.fmi1_base_type_str: #STRING
 *             self.set_string([ref], [value])             # <<<<<<<<<<<<<<
 *         elif type == FMIL.fmi1_base_type_bool: #BOOLEAN
 *             if alias_kind == FMI_NEGATED_ALIAS:
 */
    __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__set_string); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_PyInt_to_py_fmi1_value_reference_t(__pyx_v_ref); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_value);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_value);
    __Pyx_GIVEREF(__pyx_v_value);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
    PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __pyx_t_3 = 0;
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L4;
  }

  /* "pyfmi\fmi.pyx":1336
 *         elif type == FMIL.fmi1_base_type_str: #STRING
 *             self.set_string([ref], [value])
 *         elif type == FMIL.fmi1_base_type_bool: #BOOLEAN             # <<<<<<<<<<<<<<
 *             if alias_kind == FMI_NEGATED_ALIAS:
 *                 value = not value
 */
  __pyx_t_8 = (__pyx_v_type == fmi1_base_type_bool);
  if (__pyx_t_8) {

    /* "pyfmi\fmi.pyx":1337
 *             self.set_string([ref], [value])
 *         elif type == FMIL.fmi1_base_type_bool: #BOOLEAN
 *             if alias_kind == FMI_NEGATED_ALIAS:             # <<<<<<<<<<<<<<
 *                 value = not value
 *             self.set_boolean([ref], [value])
 */
    __pyx_t_2 = PyInt_FromLong(__pyx_v_alias_kind); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_NEGATED_ALIAS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_8) {

      /* "pyfmi\fmi.pyx":1338
 *         elif type == FMIL.fmi1_base_type_bool: #BOOLEAN
 *             if alias_kind == FMI_NEGATED_ALIAS:
 *                 value = not value             # <<<<<<<<<<<<<<
 *             self.set_boolean([ref], [value])
 *         else:
 */
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = __Pyx_PyBool_FromLong((!__pyx_t_8)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_v_value);
      __pyx_v_value = __pyx_t_6;
      __pyx_t_6 = 0;
      goto __pyx_L7;
    }
    __pyx_L7:;

    /* "pyfmi\fmi.pyx":1339
 *             if alias_kind == FMI_NEGATED_ALIAS:
 *                 value = not value
 *             self.set_boolean([ref], [value])             # <<<<<<<<<<<<<<
 *         else:
 *             raise FMUException('Type not supported.')
 */
    __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__set_boolean); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = __Pyx_PyInt_to_py_fmi1_value_reference_t(__pyx_v_ref); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_value);
    PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_value);
    __Pyx_GIVEREF(__pyx_v_value);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_t_1));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
    __pyx_t_2 = 0;
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":1341
 *             self.set_boolean([ref], [value])
 *         else:
 *             raise FMUException('Type not supported.')             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_83), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L4:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase._set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_31_get(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_30_get[] = "\n        Helper method to get, see docstring on get.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_31_get(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_30_get(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1344
 * 
 * 
 *     def _get(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Helper method to get, see docstring on get.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_30_get(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  fmi1_value_reference_t __pyx_v_ref;
  enum fmi1_base_type_enu_t __pyx_v_type;
  fmi1_import_variable_t *__pyx_v_variable;
  enum fmi1_variable_alias_kind_enu_t __pyx_v_alias_kind;
  char *__pyx_v_variablename;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get", 0);
  __Pyx_INCREF(__pyx_v_variable_name);

  /* "pyfmi\fmi.pyx":1353
 *         cdef FMIL.fmi1_variable_alias_kind_enu_t alias_kind
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __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 = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_variable_name);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_variable_name);
  __Pyx_GIVEREF(__pyx_v_variable_name);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_v_variable_name);
  __pyx_v_variable_name = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":1354
 * 
 *         variable_name = encode(variable_name)
 *         cdef char* variablename = variable_name             # <<<<<<<<<<<<<<
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 */
  __pyx_t_4 = PyBytes_AsString(__pyx_v_variable_name); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_4;

  /* "pyfmi\fmi.pyx":1356
 *         cdef char* variablename = variable_name
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)             # <<<<<<<<<<<<<<
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variable_name)
 */
  __pyx_v_variable = fmi1_import_get_variable_by_name(__pyx_v_self->_fmu, __pyx_v_variablename);

  /* "pyfmi\fmi.pyx":1357
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The variable %s could not be found."%variable_name)
 * 
 */
  __pyx_t_5 = (__pyx_v_variable == NULL);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":1358
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variable_name)             # <<<<<<<<<<<<<<
 * 
 *         ref =  FMIL.fmi1_import_get_variable_vr(variable)
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_81), __pyx_v_variable_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __pyx_t_2 = 0;
    __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 = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1360
 *             raise FMUException("The variable %s could not be found."%variable_name)
 * 
 *         ref =  FMIL.fmi1_import_get_variable_vr(variable)             # <<<<<<<<<<<<<<
 *         type = FMIL.fmi1_import_get_variable_base_type(variable)
 *         alias_kind = FMIL.fmi1_import_get_variable_alias_kind(variable)
 */
  __pyx_v_ref = fmi1_import_get_variable_vr(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":1361
 * 
 *         ref =  FMIL.fmi1_import_get_variable_vr(variable)
 *         type = FMIL.fmi1_import_get_variable_base_type(variable)             # <<<<<<<<<<<<<<
 *         alias_kind = FMIL.fmi1_import_get_variable_alias_kind(variable)
 * 
 */
  __pyx_v_type = fmi1_import_get_variable_base_type(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":1362
 *         ref =  FMIL.fmi1_import_get_variable_vr(variable)
 *         type = FMIL.fmi1_import_get_variable_base_type(variable)
 *         alias_kind = FMIL.fmi1_import_get_variable_alias_kind(variable)             # <<<<<<<<<<<<<<
 * 
 *         if type == FMIL.fmi1_base_type_real:  #REAL
 */
  __pyx_v_alias_kind = fmi1_import_get_variable_alias_kind(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":1364
 *         alias_kind = FMIL.fmi1_import_get_variable_alias_kind(variable)
 * 
 *         if type == FMIL.fmi1_base_type_real:  #REAL             # <<<<<<<<<<<<<<
 *             value = self.get_real([ref])
 *             return -1*value if alias_kind == FMI_NEGATED_ALIAS else value
 */
  __pyx_t_5 = (__pyx_v_type == fmi1_base_type_real);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":1365
 * 
 *         if type == FMIL.fmi1_base_type_real:  #REAL
 *             value = self.get_real([ref])             # <<<<<<<<<<<<<<
 *             return -1*value if alias_kind == FMI_NEGATED_ALIAS else value
 *         elif type == FMIL.fmi1_base_type_int or type == FMIL.fmi1_base_type_enum: #INTEGER
 */
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_real); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyInt_to_py_fmi1_value_reference_t(__pyx_v_ref); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __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;
    __pyx_v_value = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "pyfmi\fmi.pyx":1366
 *         if type == FMIL.fmi1_base_type_real:  #REAL
 *             value = self.get_real([ref])
 *             return -1*value if alias_kind == FMI_NEGATED_ALIAS else value             # <<<<<<<<<<<<<<
 *         elif type == FMIL.fmi1_base_type_int or type == FMIL.fmi1_base_type_enum: #INTEGER
 *             value = self.get_integer([ref])
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyInt_FromLong(__pyx_v_alias_kind); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_NEGATED_ALIAS); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_5) {
      __pyx_t_6 = PyNumber_Multiply(__pyx_int_neg_1, __pyx_v_value); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_3 = __pyx_t_6;
      __pyx_t_6 = 0;
    } else {
      __Pyx_INCREF(__pyx_v_value);
      __pyx_t_3 = __pyx_v_value;
    }
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }

  /* "pyfmi\fmi.pyx":1367
 *             value = self.get_real([ref])
 *             return -1*value if alias_kind == FMI_NEGATED_ALIAS else value
 *         elif type == FMIL.fmi1_base_type_int or type == FMIL.fmi1_base_type_enum: #INTEGER             # <<<<<<<<<<<<<<
 *             value = self.get_integer([ref])
 *             return -1*value if alias_kind == FMI_NEGATED_ALIAS else value
 */
  __pyx_t_5 = (__pyx_v_type == fmi1_base_type_int);
  if (!__pyx_t_5) {
    __pyx_t_7 = (__pyx_v_type == fmi1_base_type_enum);
    __pyx_t_8 = __pyx_t_7;
  } else {
    __pyx_t_8 = __pyx_t_5;
  }
  if (__pyx_t_8) {

    /* "pyfmi\fmi.pyx":1368
 *             return -1*value if alias_kind == FMI_NEGATED_ALIAS else value
 *         elif type == FMIL.fmi1_base_type_int or type == FMIL.fmi1_base_type_enum: #INTEGER
 *             value = self.get_integer([ref])             # <<<<<<<<<<<<<<
 *             return -1*value if alias_kind == FMI_NEGATED_ALIAS else value
 *         elif type == FMIL.fmi1_base_type_str: #STRING
 */
    __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_integer); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyInt_to_py_fmi1_value_reference_t(__pyx_v_ref); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __pyx_v_value = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyfmi\fmi.pyx":1369
 *         elif type == FMIL.fmi1_base_type_int or type == FMIL.fmi1_base_type_enum: #INTEGER
 *             value = self.get_integer([ref])
 *             return -1*value if alias_kind == FMI_NEGATED_ALIAS else value             # <<<<<<<<<<<<<<
 *         elif type == FMIL.fmi1_base_type_str: #STRING
 *             return self.get_string([ref])
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = PyInt_FromLong(__pyx_v_alias_kind); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_NEGATED_ALIAS); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_8) {
      __pyx_t_1 = PyNumber_Multiply(__pyx_int_neg_1, __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __pyx_t_1;
      __pyx_t_1 = 0;
    } else {
      __Pyx_INCREF(__pyx_v_value);
      __pyx_t_2 = __pyx_v_value;
    }
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }

  /* "pyfmi\fmi.pyx":1370
 *             value = self.get_integer([ref])
 *             return -1*value if alias_kind == FMI_NEGATED_ALIAS else value
 *         elif type == FMIL.fmi1_base_type_str: #STRING             # <<<<<<<<<<<<<<
 *             return self.get_string([ref])
 *         elif type == FMIL.fmi1_base_type_bool: #BOOLEAN
 */
  __pyx_t_8 = (__pyx_v_type == fmi1_base_type_str);
  if (__pyx_t_8) {

    /* "pyfmi\fmi.pyx":1371
 *             return -1*value if alias_kind == FMI_NEGATED_ALIAS else value
 *         elif type == FMIL.fmi1_base_type_str: #STRING
 *             return self.get_string([ref])             # <<<<<<<<<<<<<<
 *         elif type == FMIL.fmi1_base_type_bool: #BOOLEAN
 *             value = self.get_boolean([ref])
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_string); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyInt_to_py_fmi1_value_reference_t(__pyx_v_ref); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; __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;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }

  /* "pyfmi\fmi.pyx":1372
 *         elif type == FMIL.fmi1_base_type_str: #STRING
 *             return self.get_string([ref])
 *         elif type == FMIL.fmi1_base_type_bool: #BOOLEAN             # <<<<<<<<<<<<<<
 *             value = self.get_boolean([ref])
 *             return not value if alias_kind == FMI_NEGATED_ALIAS else value
 */
  __pyx_t_8 = (__pyx_v_type == fmi1_base_type_bool);
  if (__pyx_t_8) {

    /* "pyfmi\fmi.pyx":1373
 *             return self.get_string([ref])
 *         elif type == FMIL.fmi1_base_type_bool: #BOOLEAN
 *             value = self.get_boolean([ref])             # <<<<<<<<<<<<<<
 *             return not value if alias_kind == FMI_NEGATED_ALIAS else value
 *         else:
 */
    __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_boolean); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyInt_to_py_fmi1_value_reference_t(__pyx_v_ref); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __pyx_t_2 = 0;
    __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 = 1373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_v_value = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyfmi\fmi.pyx":1374
 *         elif type == FMIL.fmi1_base_type_bool: #BOOLEAN
 *             value = self.get_boolean([ref])
 *             return not value if alias_kind == FMI_NEGATED_ALIAS else value             # <<<<<<<<<<<<<<
 *         else:
 *             raise FMUException('Type not supported.')
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyInt_FromLong(__pyx_v_alias_kind); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_NEGATED_ALIAS); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_8) {
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = __Pyx_PyBool_FromLong((!__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_2 = __pyx_t_6;
      __pyx_t_6 = 0;
    } else {
      __Pyx_INCREF(__pyx_v_value);
      __pyx_t_2 = __pyx_v_value;
    }
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":1376
 *             return not value if alias_kind == FMI_NEGATED_ALIAS else value
 *         else:
 *             raise FMUException('Type not supported.')             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_description(self, variable_name):
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_84), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L4:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase._get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1378
 *             raise FMUException('Type not supported.')
 * 
 *     cpdef get_variable_description(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Get the description of a given variable.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_33get_variable_description(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_description(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch) {
  fmi1_import_variable_t *__pyx_v_variable;
  char *__pyx_v_desc;
  char *__pyx_v_variablename;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_description", 0);
  __Pyx_INCREF(__pyx_v_variable_name);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_85); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_33get_variable_description)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_variable_name);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_variable_name);
      __Pyx_GIVEREF(__pyx_v_variable_name);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":1394
 *         cdef char* desc
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_variable_name);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_variable_name);
  __Pyx_GIVEREF(__pyx_v_variable_name);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_v_variable_name);
  __pyx_v_variable_name = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":1395
 * 
 *         variable_name = encode(variable_name)
 *         cdef char* variablename = variable_name             # <<<<<<<<<<<<<<
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 */
  __pyx_t_4 = PyBytes_AsString(__pyx_v_variable_name); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_4;

  /* "pyfmi\fmi.pyx":1397
 *         cdef char* variablename = variable_name
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)             # <<<<<<<<<<<<<<
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)
 */
  __pyx_v_variable = fmi1_import_get_variable_by_name(__pyx_v_self->_fmu, __pyx_v_variablename);

  /* "pyfmi\fmi.pyx":1398
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 */
  __pyx_t_5 = (__pyx_v_variable == NULL);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":1399
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 * 
 *         desc = FMIL.fmi1_import_get_variable_description(variable)
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_81), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
    __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 = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1401
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 *         desc = FMIL.fmi1_import_get_variable_description(variable)             # <<<<<<<<<<<<<<
 * 
 *         return desc if desc != NULL else ""
 */
  __pyx_v_desc = fmi1_import_get_variable_description(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":1403
 *         desc = FMIL.fmi1_import_get_variable_description(variable)
 * 
 *         return desc if desc != NULL else ""             # <<<<<<<<<<<<<<
 * 
 *     cpdef FMIL.fmi1_base_type_enu_t get_variable_data_type(self, variable_name) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  if ((__pyx_v_desc != NULL)) {
    __pyx_t_3 = PyBytes_FromString(__pyx_v_desc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = ((PyObject *)__pyx_t_3);
    __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_12));
    __pyx_t_1 = ((PyObject *)__pyx_kp_s_12);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_description", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_33get_variable_description(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_32get_variable_description[] = "\n        Get the description of a given variable.\n\n        Parameter::\n\n            variable_name --\n                The name of the variable\n\n        Returns::\n\n            The description of the variable.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_33get_variable_description(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_description (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_32get_variable_description(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1378
 *             raise FMUException('Type not supported.')
 * 
 *     cpdef get_variable_description(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Get the description of a given variable.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_32get_variable_description(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  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("get_variable_description", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_variable_description(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_description", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1405
 *         return desc if desc != NULL else ""
 * 
 *     cpdef FMIL.fmi1_base_type_enu_t get_variable_data_type(self, variable_name) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Get data type of variable.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_35get_variable_data_type(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static enum fmi1_base_type_enu_t __pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_data_type(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch) {
  fmi1_import_variable_t *__pyx_v_variable;
  enum fmi1_base_type_enu_t __pyx_v_type;
  char *__pyx_v_variablename;
  enum fmi1_base_type_enu_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  enum fmi1_base_type_enu_t __pyx_t_4;
  char *__pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_data_type", 0);
  __Pyx_INCREF(__pyx_v_variable_name);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_86); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_35get_variable_data_type)) {
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_variable_name);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_variable_name);
      __Pyx_GIVEREF(__pyx_v_variable_name);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_t_4 = ((enum fmi1_base_type_enu_t)PyInt_AsLong(__pyx_t_3)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":1421
 *         cdef FMIL.fmi1_base_type_enu_t type
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_variable_name);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_variable_name);
  __Pyx_GIVEREF(__pyx_v_variable_name);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_v_variable_name);
  __pyx_v_variable_name = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":1422
 * 
 *         variable_name = encode(variable_name)
 *         cdef char* variablename = variable_name             # <<<<<<<<<<<<<<
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 */
  __pyx_t_5 = PyBytes_AsString(__pyx_v_variable_name); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_5;

  /* "pyfmi\fmi.pyx":1424
 *         cdef char* variablename = variable_name
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)             # <<<<<<<<<<<<<<
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)
 */
  __pyx_v_variable = fmi1_import_get_variable_by_name(__pyx_v_self->_fmu, __pyx_v_variablename);

  /* "pyfmi\fmi.pyx":1425
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 */
  __pyx_t_6 = (__pyx_v_variable == NULL);
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":1426
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 * 
 *         type = FMIL.fmi1_import_get_variable_base_type(variable)
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_81), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
    __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 = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1428
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 *         type = FMIL.fmi1_import_get_variable_base_type(variable)             # <<<<<<<<<<<<<<
 * 
 *         return type
 */
  __pyx_v_type = fmi1_import_get_variable_base_type(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":1430
 *         type = FMIL.fmi1_import_get_variable_base_type(variable)
 * 
 *         return type             # <<<<<<<<<<<<<<
 * 
 *     cpdef FMIL.fmi1_value_reference_t get_variable_valueref(self, variable_name) except *:
 */
  __pyx_r = __pyx_v_type;
  goto __pyx_L0;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_data_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_35get_variable_data_type(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_34get_variable_data_type[] = "\n        Get data type of variable.\n\n        Parameter::\n\n            variable_name --\n                The name of the variable.\n\n        Returns::\n\n            The type of the variable.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_35get_variable_data_type(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_data_type (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_34get_variable_data_type(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1405
 *         return desc if desc != NULL else ""
 * 
 *     cpdef FMIL.fmi1_base_type_enu_t get_variable_data_type(self, variable_name) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Get data type of variable.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_34get_variable_data_type(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  enum fmi1_base_type_enu_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_data_type", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_variable_data_type(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_data_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1432
 *         return type
 * 
 *     cpdef FMIL.fmi1_value_reference_t get_variable_valueref(self, variable_name) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Extract the ValueReference given a variable name.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_37get_variable_valueref(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static fmi1_value_reference_t __pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_valueref(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch) {
  fmi1_import_variable_t *__pyx_v_variable;
  fmi1_value_reference_t __pyx_v_vr;
  char *__pyx_v_variablename;
  fmi1_value_reference_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  fmi1_value_reference_t __pyx_t_4;
  char *__pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_valueref", 0);
  __Pyx_INCREF(__pyx_v_variable_name);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_87); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_37get_variable_valueref)) {
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_variable_name);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_variable_name);
      __Pyx_GIVEREF(__pyx_v_variable_name);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_t_4 = __Pyx_PyInt_from_py_fmi1_value_reference_t(__pyx_t_3); if (unlikely((__pyx_t_4 == (fmi1_value_reference_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":1448
 *         cdef FMIL.fmi1_value_reference_t vr
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_variable_name);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_variable_name);
  __Pyx_GIVEREF(__pyx_v_variable_name);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_v_variable_name);
  __pyx_v_variable_name = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":1449
 * 
 *         variable_name = encode(variable_name)
 *         cdef char* variablename = variable_name             # <<<<<<<<<<<<<<
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 */
  __pyx_t_5 = PyBytes_AsString(__pyx_v_variable_name); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_5;

  /* "pyfmi\fmi.pyx":1451
 *         cdef char* variablename = variable_name
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)             # <<<<<<<<<<<<<<
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)
 */
  __pyx_v_variable = fmi1_import_get_variable_by_name(__pyx_v_self->_fmu, __pyx_v_variablename);

  /* "pyfmi\fmi.pyx":1452
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The variable %s could not be found."%variablename)
 *         vr =  FMIL.fmi1_import_get_variable_vr(variable)
 */
  __pyx_t_6 = (__pyx_v_variable == NULL);
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":1453
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 *         vr =  FMIL.fmi1_import_get_variable_vr(variable)
 * 
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_81), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
    __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 = 1453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1454
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)
 *         vr =  FMIL.fmi1_import_get_variable_vr(variable)             # <<<<<<<<<<<<<<
 * 
 *         return vr
 */
  __pyx_v_vr = fmi1_import_get_variable_vr(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":1456
 *         vr =  FMIL.fmi1_import_get_variable_vr(variable)
 * 
 *         return vr             # <<<<<<<<<<<<<<
 * 
 *     def get_variable_nominal(self, variable_name=None, valueref=None):
 */
  __pyx_r = __pyx_v_vr;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_valueref", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_37get_variable_valueref(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_36get_variable_valueref[] = "\n        Extract the ValueReference given a variable name.\n\n        Parameters::\n\n            variable_name --\n                The name of the variable.\n\n        Returns::\n\n            The ValueReference for the variable passed as argument.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_37get_variable_valueref(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_valueref (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_36get_variable_valueref(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1432
 *         return type
 * 
 *     cpdef FMIL.fmi1_value_reference_t get_variable_valueref(self, variable_name) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Extract the ValueReference given a variable name.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_36get_variable_valueref(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  fmi1_value_reference_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_valueref", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_variable_valueref(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyInt_to_py_fmi1_value_reference_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_valueref", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_39get_variable_nominal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_38get_variable_nominal[] = "\n        Returns the nominal value from a real variable determined by\n        either its value reference or its variable name.\n\n        Parameters::\n\n            valueref --\n                The value reference of the variable.\n            variablename --\n                The name of the variable.\n\n        Returns::\n\n            The nominal value of the given variable.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_39get_variable_nominal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_variable_name = 0;
  PyObject *__pyx_v_valueref = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_nominal (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__variable_name,&__pyx_n_s__valueref,0};
    PyObject* values[2] = {0,0};

    /* "pyfmi\fmi.pyx":1458
 *         return vr
 * 
 *     def get_variable_nominal(self, variable_name=None, valueref=None):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the nominal value from a real variable determined by
 */
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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 (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__variable_name);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__valueref);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_variable_nominal") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1458; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        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;
      }
    }
    __pyx_v_variable_name = values[0];
    __pyx_v_valueref = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_variable_nominal", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1458; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_nominal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_38get_variable_nominal(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_v_variable_name, __pyx_v_valueref);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_38get_variable_nominal(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name, PyObject *__pyx_v_valueref) {
  fmi1_import_variable_t *__pyx_v_variable;
  fmi1_import_real_variable_t *__pyx_v_real_variable;
  char *__pyx_v_variablename;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  fmi1_value_reference_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  char *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_nominal", 0);
  __Pyx_INCREF(__pyx_v_variable_name);

  /* "pyfmi\fmi.pyx":1478
 *         cdef char* variablename
 * 
 *         if valueref != None:             # <<<<<<<<<<<<<<
 *             variable = FMIL.fmi1_import_get_variable_by_vr(self._fmu, FMIL.fmi1_base_type_real, <FMIL.fmi1_value_reference_t>valueref)
 *             if variable == NULL:
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_valueref, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":1479
 * 
 *         if valueref != None:
 *             variable = FMIL.fmi1_import_get_variable_by_vr(self._fmu, FMIL.fmi1_base_type_real, <FMIL.fmi1_value_reference_t>valueref)             # <<<<<<<<<<<<<<
 *             if variable == NULL:
 *                 raise FMUException("The variable with value reference: %s, could not be found."%str(valueref))
 */
    __pyx_t_3 = __Pyx_PyInt_from_py_fmi1_value_reference_t(__pyx_v_valueref); if (unlikely((__pyx_t_3 == (fmi1_value_reference_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_variable = fmi1_import_get_variable_by_vr(__pyx_v_self->_fmu, fmi1_base_type_real, ((fmi1_value_reference_t)__pyx_t_3));

    /* "pyfmi\fmi.pyx":1480
 *         if valueref != None:
 *             variable = FMIL.fmi1_import_get_variable_by_vr(self._fmu, FMIL.fmi1_base_type_real, <FMIL.fmi1_value_reference_t>valueref)
 *             if variable == NULL:             # <<<<<<<<<<<<<<
 *                 raise FMUException("The variable with value reference: %s, could not be found."%str(valueref))
 *         elif variable_name != None:
 */
    __pyx_t_2 = (__pyx_v_variable == NULL);
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":1481
 *             variable = FMIL.fmi1_import_get_variable_by_vr(self._fmu, FMIL.fmi1_base_type_real, <FMIL.fmi1_value_reference_t>valueref)
 *             if variable == NULL:
 *                 raise FMUException("The variable with value reference: %s, could not be found."%str(valueref))             # <<<<<<<<<<<<<<
 *         elif variable_name != None:
 *             variable_name = encode(variable_name)
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_valueref);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_valueref);
      __Pyx_GIVEREF(__pyx_v_valueref);
      __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_88), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
      __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L4;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }

  /* "pyfmi\fmi.pyx":1482
 *             if variable == NULL:
 *                 raise FMUException("The variable with value reference: %s, could not be found."%str(valueref))
 *         elif variable_name != None:             # <<<<<<<<<<<<<<
 *             variable_name = encode(variable_name)
 *             variablename  = variable_name
 */
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_variable_name, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":1483
 *                 raise FMUException("The variable with value reference: %s, could not be found."%str(valueref))
 *         elif variable_name != None:
 *             variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *             variablename  = variable_name
 * 
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_variable_name);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_variable_name);
    __Pyx_GIVEREF(__pyx_v_variable_name);
    __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_v_variable_name);
    __pyx_v_variable_name = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pyfmi\fmi.pyx":1484
 *         elif variable_name != None:
 *             variable_name = encode(variable_name)
 *             variablename  = variable_name             # <<<<<<<<<<<<<<
 * 
 *             variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 */
    __pyx_t_6 = PyBytes_AsString(__pyx_v_variable_name); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_variablename = __pyx_t_6;

    /* "pyfmi\fmi.pyx":1486
 *             variablename  = variable_name
 * 
 *             variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)             # <<<<<<<<<<<<<<
 *             if variable == NULL:
 *                 raise FMUException("The variable %s could not be found."%variablename)
 */
    __pyx_v_variable = fmi1_import_get_variable_by_name(__pyx_v_self->_fmu, __pyx_v_variablename);

    /* "pyfmi\fmi.pyx":1487
 * 
 *             variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *             if variable == NULL:             # <<<<<<<<<<<<<<
 *                 raise FMUException("The variable %s could not be found."%variablename)
 *         else:
 */
    __pyx_t_2 = (__pyx_v_variable == NULL);
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":1488
 *             variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *             if variable == NULL:
 *                 raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 *         else:
 *             raise FMUException('Either provide value reference or variable name.')
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_81), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
      __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L5;
    }
    __pyx_L5:;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":1490
 *                 raise FMUException("The variable %s could not be found."%variablename)
 *         else:
 *             raise FMUException('Either provide value reference or variable name.')             # <<<<<<<<<<<<<<
 * 
 *         real_variable = FMIL.fmi1_import_get_variable_as_real(variable)
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_90), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1492
 *             raise FMUException('Either provide value reference or variable name.')
 * 
 *         real_variable = FMIL.fmi1_import_get_variable_as_real(variable)             # <<<<<<<<<<<<<<
 *         if real_variable == NULL:
 *             raise FMUException("The variable is not a real variable.")
 */
  __pyx_v_real_variable = fmi1_import_get_variable_as_real(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":1493
 * 
 *         real_variable = FMIL.fmi1_import_get_variable_as_real(variable)
 *         if real_variable == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The variable is not a real variable.")
 * 
 */
  __pyx_t_2 = (__pyx_v_real_variable == NULL);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":1494
 *         real_variable = FMIL.fmi1_import_get_variable_as_real(variable)
 *         if real_variable == NULL:
 *             raise FMUException("The variable is not a real variable.")             # <<<<<<<<<<<<<<
 * 
 *         return  FMIL.fmi1_import_get_real_variable_nominal(real_variable)
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_92), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pyfmi\fmi.pyx":1496
 *             raise FMUException("The variable is not a real variable.")
 * 
 *         return  FMIL.fmi1_import_get_real_variable_nominal(real_variable)             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_fixed(self, variable_name):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyFloat_FromDouble(fmi1_import_get_real_variable_nominal(__pyx_v_real_variable)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_nominal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1498
 *         return  FMIL.fmi1_import_get_real_variable_nominal(real_variable)
 * 
 *     cpdef get_variable_fixed(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Returns if the start value is fixed (True - The value is used as
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_41get_variable_fixed(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_fixed(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch) {
  fmi1_import_variable_t *__pyx_v_variable;
  char *__pyx_v_variablename;
  int __pyx_v_status;
  int __pyx_v_fixed;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_fixed", 0);
  __Pyx_INCREF(__pyx_v_variable_name);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_variable_fixed); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_41get_variable_fixed)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_variable_name);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_variable_name);
      __Pyx_GIVEREF(__pyx_v_variable_name);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":1515
 *         cdef FMIL.fmi1_import_variable_t *variable
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_variable_name);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_variable_name);
  __Pyx_GIVEREF(__pyx_v_variable_name);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_v_variable_name);
  __pyx_v_variable_name = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":1516
 * 
 *         variable_name = encode(variable_name)
 *         cdef char* variablename = variable_name             # <<<<<<<<<<<<<<
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 */
  __pyx_t_4 = PyBytes_AsString(__pyx_v_variable_name); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_4;

  /* "pyfmi\fmi.pyx":1518
 *         cdef char* variablename = variable_name
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)             # <<<<<<<<<<<<<<
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)
 */
  __pyx_v_variable = fmi1_import_get_variable_by_name(__pyx_v_self->_fmu, __pyx_v_variablename);

  /* "pyfmi\fmi.pyx":1519
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 */
  __pyx_t_5 = (__pyx_v_variable == NULL);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":1520
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi1_import_get_variable_has_start(variable)
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_81), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
    __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 = 1520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1522
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 *         status = FMIL.fmi1_import_get_variable_has_start(variable)             # <<<<<<<<<<<<<<
 * 
 *         if status == 0:
 */
  __pyx_v_status = fmi1_import_get_variable_has_start(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":1524
 *         status = FMIL.fmi1_import_get_variable_has_start(variable)
 * 
 *         if status == 0:             # <<<<<<<<<<<<<<
 *             raise FMUException("The variable %s does not have a start value."%variablename)
 * 
 */
  __pyx_t_5 = (__pyx_v_status == 0);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":1525
 * 
 *         if status == 0:
 *             raise FMUException("The variable %s does not have a start value."%variablename)             # <<<<<<<<<<<<<<
 * 
 *         fixed = FMIL.fmi1_import_get_variable_is_fixed(variable)
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_93), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":1527
 *             raise FMUException("The variable %s does not have a start value."%variablename)
 * 
 *         fixed = FMIL.fmi1_import_get_variable_is_fixed(variable)             # <<<<<<<<<<<<<<
 * 
 *         return fixed==1
 */
  __pyx_v_fixed = fmi1_import_get_variable_is_fixed(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":1529
 *         fixed = FMIL.fmi1_import_get_variable_is_fixed(variable)
 * 
 *         return fixed==1             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyBool_FromLong((__pyx_v_fixed == 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_fixed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_41get_variable_fixed(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_40get_variable_fixed[] = "\n        Returns if the start value is fixed (True - The value is used as\n        an initial value) or not (False - The value is used as a guess\n        value).\n\n        Parameters::\n\n            variable_name --\n                The name of the variable\n\n        Returns::\n\n            If the start value is fixed or not.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_41get_variable_fixed(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_fixed (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_40get_variable_fixed(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1498
 *         return  FMIL.fmi1_import_get_real_variable_nominal(real_variable)
 * 
 *     cpdef get_variable_fixed(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Returns if the start value is fixed (True - The value is used as
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_40get_variable_fixed(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  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("get_variable_fixed", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_variable_fixed(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_fixed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1532
 * 
 * 
 *     cpdef get_variable_start(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the start value for the variable or else raises
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_43get_variable_start(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_start(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch) {
  fmi1_import_variable_t *__pyx_v_variable;
  fmi1_import_integer_variable_t *__pyx_v_int_variable;
  fmi1_import_real_variable_t *__pyx_v_real_variable;
  fmi1_import_bool_variable_t *__pyx_v_bool_variable;
  fmi1_import_enum_variable_t *__pyx_v_enum_variable;
  fmi1_import_string_variable_t *__pyx_v_str_variable;
  enum fmi1_base_type_enu_t __pyx_v_type;
  int __pyx_v_status;
  fmi1_boolean_t __pyx_v_FMITRUE;
  char *__pyx_v_variablename;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_start", 0);
  __Pyx_INCREF(__pyx_v_variable_name);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_variable_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_43get_variable_start)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_variable_name);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_variable_name);
      __Pyx_GIVEREF(__pyx_v_variable_name);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":1554
 *         cdef FMIL.fmi1_base_type_enu_t type
 *         cdef int status
 *         cdef FMIL.fmi1_boolean_t FMITRUE = 1             # <<<<<<<<<<<<<<
 * 
 *         variable_name = encode(variable_name)
 */
  __pyx_v_FMITRUE = 1;

  /* "pyfmi\fmi.pyx":1556
 *         cdef FMIL.fmi1_boolean_t FMITRUE = 1
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_variable_name);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_variable_name);
  __Pyx_GIVEREF(__pyx_v_variable_name);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_v_variable_name);
  __pyx_v_variable_name = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":1557
 * 
 *         variable_name = encode(variable_name)
 *         cdef char* variablename = variable_name             # <<<<<<<<<<<<<<
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 */
  __pyx_t_4 = PyBytes_AsString(__pyx_v_variable_name); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_4;

  /* "pyfmi\fmi.pyx":1559
 *         cdef char* variablename = variable_name
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)             # <<<<<<<<<<<<<<
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)
 */
  __pyx_v_variable = fmi1_import_get_variable_by_name(__pyx_v_self->_fmu, __pyx_v_variablename);

  /* "pyfmi\fmi.pyx":1560
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 */
  __pyx_t_5 = (__pyx_v_variable == NULL);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":1561
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi1_import_get_variable_has_start(variable)
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_81), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
    __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 = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1563
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 *         status = FMIL.fmi1_import_get_variable_has_start(variable)             # <<<<<<<<<<<<<<
 * 
 *         if status == 0:
 */
  __pyx_v_status = fmi1_import_get_variable_has_start(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":1565
 *         status = FMIL.fmi1_import_get_variable_has_start(variable)
 * 
 *         if status == 0:             # <<<<<<<<<<<<<<
 *             raise FMUException("The variable %s does not have a start value."%variablename)
 * 
 */
  __pyx_t_5 = (__pyx_v_status == 0);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":1566
 * 
 *         if status == 0:
 *             raise FMUException("The variable %s does not have a start value."%variablename)             # <<<<<<<<<<<<<<
 * 
 *         type = FMIL.fmi1_import_get_variable_base_type(variable)
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_93), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":1568
 *             raise FMUException("The variable %s does not have a start value."%variablename)
 * 
 *         type = FMIL.fmi1_import_get_variable_base_type(variable)             # <<<<<<<<<<<<<<
 * 
 *         if type == FMIL.fmi1_base_type_real:
 */
  __pyx_v_type = fmi1_import_get_variable_base_type(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":1570
 *         type = FMIL.fmi1_import_get_variable_base_type(variable)
 * 
 *         if type == FMIL.fmi1_base_type_real:             # <<<<<<<<<<<<<<
 *             real_variable = FMIL.fmi1_import_get_variable_as_real(variable)
 *             return FMIL.fmi1_import_get_real_variable_start(real_variable)
 */
  __pyx_t_5 = (__pyx_v_type == fmi1_base_type_real);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":1571
 * 
 *         if type == FMIL.fmi1_base_type_real:
 *             real_variable = FMIL.fmi1_import_get_variable_as_real(variable)             # <<<<<<<<<<<<<<
 *             return FMIL.fmi1_import_get_real_variable_start(real_variable)
 * 
 */
    __pyx_v_real_variable = fmi1_import_get_variable_as_real(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":1572
 *         if type == FMIL.fmi1_base_type_real:
 *             real_variable = FMIL.fmi1_import_get_variable_as_real(variable)
 *             return FMIL.fmi1_import_get_real_variable_start(real_variable)             # <<<<<<<<<<<<<<
 * 
 *         elif type == FMIL.fmi1_base_type_int:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble(fmi1_import_get_real_variable_start(__pyx_v_real_variable)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }

  /* "pyfmi\fmi.pyx":1574
 *             return FMIL.fmi1_import_get_real_variable_start(real_variable)
 * 
 *         elif type == FMIL.fmi1_base_type_int:             # <<<<<<<<<<<<<<
 *             int_variable = FMIL.fmi1_import_get_variable_as_integer(variable)
 *             return FMIL.fmi1_import_get_integer_variable_start(int_variable)
 */
  __pyx_t_5 = (__pyx_v_type == fmi1_base_type_int);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":1575
 * 
 *         elif type == FMIL.fmi1_base_type_int:
 *             int_variable = FMIL.fmi1_import_get_variable_as_integer(variable)             # <<<<<<<<<<<<<<
 *             return FMIL.fmi1_import_get_integer_variable_start(int_variable)
 * 
 */
    __pyx_v_int_variable = fmi1_import_get_variable_as_integer(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":1576
 *         elif type == FMIL.fmi1_base_type_int:
 *             int_variable = FMIL.fmi1_import_get_variable_as_integer(variable)
 *             return FMIL.fmi1_import_get_integer_variable_start(int_variable)             # <<<<<<<<<<<<<<
 * 
 *         elif type == FMIL.fmi1_base_type_bool:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyInt_FromLong(fmi1_import_get_integer_variable_start(__pyx_v_int_variable)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }

  /* "pyfmi\fmi.pyx":1578
 *             return FMIL.fmi1_import_get_integer_variable_start(int_variable)
 * 
 *         elif type == FMIL.fmi1_base_type_bool:             # <<<<<<<<<<<<<<
 *             bool_variable = FMIL.fmi1_import_get_variable_as_boolean(variable)
 *             return FMIL.fmi1_import_get_boolean_variable_start(bool_variable) == FMITRUE
 */
  __pyx_t_5 = (__pyx_v_type == fmi1_base_type_bool);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":1579
 * 
 *         elif type == FMIL.fmi1_base_type_bool:
 *             bool_variable = FMIL.fmi1_import_get_variable_as_boolean(variable)             # <<<<<<<<<<<<<<
 *             return FMIL.fmi1_import_get_boolean_variable_start(bool_variable) == FMITRUE
 * 
 */
    __pyx_v_bool_variable = fmi1_import_get_variable_as_boolean(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":1580
 *         elif type == FMIL.fmi1_base_type_bool:
 *             bool_variable = FMIL.fmi1_import_get_variable_as_boolean(variable)
 *             return FMIL.fmi1_import_get_boolean_variable_start(bool_variable) == FMITRUE             # <<<<<<<<<<<<<<
 * 
 *         elif type == FMIL.fmi1_base_type_enum:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyBool_FromLong((fmi1_import_get_boolean_variable_start(__pyx_v_bool_variable) == __pyx_v_FMITRUE)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }

  /* "pyfmi\fmi.pyx":1582
 *             return FMIL.fmi1_import_get_boolean_variable_start(bool_variable) == FMITRUE
 * 
 *         elif type == FMIL.fmi1_base_type_enum:             # <<<<<<<<<<<<<<
 *             enum_variable = FMIL.fmi1_import_get_variable_as_enum(variable)
 *             return FMIL.fmi1_import_get_enum_variable_start(enum_variable)
 */
  __pyx_t_5 = (__pyx_v_type == fmi1_base_type_enum);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":1583
 * 
 *         elif type == FMIL.fmi1_base_type_enum:
 *             enum_variable = FMIL.fmi1_import_get_variable_as_enum(variable)             # <<<<<<<<<<<<<<
 *             return FMIL.fmi1_import_get_enum_variable_start(enum_variable)
 * 
 */
    __pyx_v_enum_variable = fmi1_import_get_variable_as_enum(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":1584
 *         elif type == FMIL.fmi1_base_type_enum:
 *             enum_variable = FMIL.fmi1_import_get_variable_as_enum(variable)
 *             return FMIL.fmi1_import_get_enum_variable_start(enum_variable)             # <<<<<<<<<<<<<<
 * 
 *         elif type == FMIL.fmi1_base_type_str:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyInt_FromLong(fmi1_import_get_enum_variable_start(__pyx_v_enum_variable)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }

  /* "pyfmi\fmi.pyx":1586
 *             return FMIL.fmi1_import_get_enum_variable_start(enum_variable)
 * 
 *         elif type == FMIL.fmi1_base_type_str:             # <<<<<<<<<<<<<<
 *             str_variable = FMIL.fmi1_import_get_variable_as_string(variable)
 *             return FMIL.fmi1_import_get_string_variable_start(str_variable)
 */
  __pyx_t_5 = (__pyx_v_type == fmi1_base_type_str);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":1587
 * 
 *         elif type == FMIL.fmi1_base_type_str:
 *             str_variable = FMIL.fmi1_import_get_variable_as_string(variable)             # <<<<<<<<<<<<<<
 *             return FMIL.fmi1_import_get_string_variable_start(str_variable)
 * 
 */
    __pyx_v_str_variable = fmi1_import_get_variable_as_string(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":1588
 *         elif type == FMIL.fmi1_base_type_str:
 *             str_variable = FMIL.fmi1_import_get_variable_as_string(variable)
 *             return FMIL.fmi1_import_get_string_variable_start(str_variable)             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyBytes_FromString(fmi1_import_get_string_variable_start(__pyx_v_str_variable)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_r = ((PyObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":1591
 * 
 *         else:
 *             raise FMUException("Unknown variable type.")             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_max(self, variable_name):
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_95), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_43get_variable_start(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_42get_variable_start[] = "\n        Returns the start value for the variable or else raises\n        FMUException.\n\n        Parameters::\n\n            variable_name --\n                The name of the variable\n\n        Returns::\n\n            The start value.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_43get_variable_start(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_start (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_42get_variable_start(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1532
 * 
 * 
 *     cpdef get_variable_start(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the start value for the variable or else raises
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_42get_variable_start(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  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("get_variable_start", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_variable_start(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1593
 *             raise FMUException("Unknown variable type.")
 * 
 *     cpdef get_variable_max(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the maximum value for the given variable.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_45get_variable_max(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_max(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch) {
  fmi1_import_variable_t *__pyx_v_variable;
  fmi1_import_integer_variable_t *__pyx_v_int_variable;
  fmi1_import_real_variable_t *__pyx_v_real_variable;
  fmi1_import_enum_variable_t *__pyx_v_enum_variable;
  enum fmi1_base_type_enu_t __pyx_v_type;
  char *__pyx_v_variablename;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_max", 0);
  __Pyx_INCREF(__pyx_v_variable_name);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_variable_max); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_45get_variable_max)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_variable_name);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_variable_name);
      __Pyx_GIVEREF(__pyx_v_variable_name);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":1612
 *         cdef FMIL.fmi1_base_type_enu_t type
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_variable_name);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_variable_name);
  __Pyx_GIVEREF(__pyx_v_variable_name);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_v_variable_name);
  __pyx_v_variable_name = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":1613
 * 
 *         variable_name = encode(variable_name)
 *         cdef char* variablename = variable_name             # <<<<<<<<<<<<<<
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 */
  __pyx_t_4 = PyBytes_AsString(__pyx_v_variable_name); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_4;

  /* "pyfmi\fmi.pyx":1615
 *         cdef char* variablename = variable_name
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)             # <<<<<<<<<<<<<<
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)
 */
  __pyx_v_variable = fmi1_import_get_variable_by_name(__pyx_v_self->_fmu, __pyx_v_variablename);

  /* "pyfmi\fmi.pyx":1616
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 */
  __pyx_t_5 = (__pyx_v_variable == NULL);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":1617
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 * 
 *         type = FMIL.fmi1_import_get_variable_base_type(variable)
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_81), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
    __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 = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1619
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 *         type = FMIL.fmi1_import_get_variable_base_type(variable)             # <<<<<<<<<<<<<<
 * 
 *         if type == FMIL.fmi1_base_type_real:
 */
  __pyx_v_type = fmi1_import_get_variable_base_type(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":1621
 *         type = FMIL.fmi1_import_get_variable_base_type(variable)
 * 
 *         if type == FMIL.fmi1_base_type_real:             # <<<<<<<<<<<<<<
 *             real_variable = FMIL.fmi1_import_get_variable_as_real(variable)
 *             return FMIL.fmi1_import_get_real_variable_max(real_variable)
 */
  __pyx_t_5 = (__pyx_v_type == fmi1_base_type_real);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":1622
 * 
 *         if type == FMIL.fmi1_base_type_real:
 *             real_variable = FMIL.fmi1_import_get_variable_as_real(variable)             # <<<<<<<<<<<<<<
 *             return FMIL.fmi1_import_get_real_variable_max(real_variable)
 * 
 */
    __pyx_v_real_variable = fmi1_import_get_variable_as_real(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":1623
 *         if type == FMIL.fmi1_base_type_real:
 *             real_variable = FMIL.fmi1_import_get_variable_as_real(variable)
 *             return FMIL.fmi1_import_get_real_variable_max(real_variable)             # <<<<<<<<<<<<<<
 * 
 *         elif type == FMIL.fmi1_base_type_int:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyFloat_FromDouble(fmi1_import_get_real_variable_max(__pyx_v_real_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }

  /* "pyfmi\fmi.pyx":1625
 *             return FMIL.fmi1_import_get_real_variable_max(real_variable)
 * 
 *         elif type == FMIL.fmi1_base_type_int:             # <<<<<<<<<<<<<<
 *             int_variable = FMIL.fmi1_import_get_variable_as_integer(variable)
 *             return FMIL.fmi1_import_get_integer_variable_max(int_variable)
 */
  __pyx_t_5 = (__pyx_v_type == fmi1_base_type_int);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":1626
 * 
 *         elif type == FMIL.fmi1_base_type_int:
 *             int_variable = FMIL.fmi1_import_get_variable_as_integer(variable)             # <<<<<<<<<<<<<<
 *             return FMIL.fmi1_import_get_integer_variable_max(int_variable)
 * 
 */
    __pyx_v_int_variable = fmi1_import_get_variable_as_integer(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":1627
 *         elif type == FMIL.fmi1_base_type_int:
 *             int_variable = FMIL.fmi1_import_get_variable_as_integer(variable)
 *             return FMIL.fmi1_import_get_integer_variable_max(int_variable)             # <<<<<<<<<<<<<<
 * 
 *         elif type == FMIL.fmi1_base_type_enum:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyInt_FromLong(fmi1_import_get_integer_variable_max(__pyx_v_int_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }

  /* "pyfmi\fmi.pyx":1629
 *             return FMIL.fmi1_import_get_integer_variable_max(int_variable)
 * 
 *         elif type == FMIL.fmi1_base_type_enum:             # <<<<<<<<<<<<<<
 *             enum_variable = FMIL.fmi1_import_get_variable_as_enum(variable)
 *             return FMIL.fmi1_import_get_enum_variable_max(enum_variable)
 */
  __pyx_t_5 = (__pyx_v_type == fmi1_base_type_enum);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":1630
 * 
 *         elif type == FMIL.fmi1_base_type_enum:
 *             enum_variable = FMIL.fmi1_import_get_variable_as_enum(variable)             # <<<<<<<<<<<<<<
 *             return FMIL.fmi1_import_get_enum_variable_max(enum_variable)
 * 
 */
    __pyx_v_enum_variable = fmi1_import_get_variable_as_enum(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":1631
 *         elif type == FMIL.fmi1_base_type_enum:
 *             enum_variable = FMIL.fmi1_import_get_variable_as_enum(variable)
 *             return FMIL.fmi1_import_get_enum_variable_max(enum_variable)             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyInt_FromLong(fmi1_import_get_enum_variable_max(__pyx_v_enum_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":1634
 * 
 *         else:
 *             raise FMUException("The variable type does not have a maximum value.")             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_min(self, variable_name):
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_97), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L4:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_45get_variable_max(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_44get_variable_max[] = "\n        Returns the maximum value for the given variable.\n\n        Parameters::\n\n            variable_name --\n                The name of the variable.\n\n        Returns::\n\n            The maximum value for the variable.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_45get_variable_max(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_max (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_44get_variable_max(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1593
 *             raise FMUException("Unknown variable type.")
 * 
 *     cpdef get_variable_max(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the maximum value for the given variable.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_44get_variable_max(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  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("get_variable_max", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_variable_max(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1636
 *             raise FMUException("The variable type does not have a maximum value.")
 * 
 *     cpdef get_variable_min(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the minimum value for the given variable.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_47get_variable_min(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_min(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch) {
  fmi1_import_variable_t *__pyx_v_variable;
  fmi1_import_integer_variable_t *__pyx_v_int_variable;
  fmi1_import_real_variable_t *__pyx_v_real_variable;
  fmi1_import_enum_variable_t *__pyx_v_enum_variable;
  enum fmi1_base_type_enu_t __pyx_v_type;
  char *__pyx_v_variablename;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_min", 0);
  __Pyx_INCREF(__pyx_v_variable_name);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_variable_min); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_47get_variable_min)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_variable_name);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_variable_name);
      __Pyx_GIVEREF(__pyx_v_variable_name);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":1655
 *         cdef FMIL.fmi1_base_type_enu_t type
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_variable_name);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_variable_name);
  __Pyx_GIVEREF(__pyx_v_variable_name);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_v_variable_name);
  __pyx_v_variable_name = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":1656
 * 
 *         variable_name = encode(variable_name)
 *         cdef char* variablename = variable_name             # <<<<<<<<<<<<<<
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 */
  __pyx_t_4 = PyBytes_AsString(__pyx_v_variable_name); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_4;

  /* "pyfmi\fmi.pyx":1658
 *         cdef char* variablename = variable_name
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)             # <<<<<<<<<<<<<<
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)
 */
  __pyx_v_variable = fmi1_import_get_variable_by_name(__pyx_v_self->_fmu, __pyx_v_variablename);

  /* "pyfmi\fmi.pyx":1659
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 */
  __pyx_t_5 = (__pyx_v_variable == NULL);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":1660
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 * 
 *         type = FMIL.fmi1_import_get_variable_base_type(variable)
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_81), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
    __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 = 1660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1662
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 *         type = FMIL.fmi1_import_get_variable_base_type(variable)             # <<<<<<<<<<<<<<
 * 
 *         if type == FMIL.fmi1_base_type_real:
 */
  __pyx_v_type = fmi1_import_get_variable_base_type(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":1664
 *         type = FMIL.fmi1_import_get_variable_base_type(variable)
 * 
 *         if type == FMIL.fmi1_base_type_real:             # <<<<<<<<<<<<<<
 *             real_variable = FMIL.fmi1_import_get_variable_as_real(variable)
 *             return FMIL.fmi1_import_get_real_variable_min(real_variable)
 */
  __pyx_t_5 = (__pyx_v_type == fmi1_base_type_real);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":1665
 * 
 *         if type == FMIL.fmi1_base_type_real:
 *             real_variable = FMIL.fmi1_import_get_variable_as_real(variable)             # <<<<<<<<<<<<<<
 *             return FMIL.fmi1_import_get_real_variable_min(real_variable)
 * 
 */
    __pyx_v_real_variable = fmi1_import_get_variable_as_real(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":1666
 *         if type == FMIL.fmi1_base_type_real:
 *             real_variable = FMIL.fmi1_import_get_variable_as_real(variable)
 *             return FMIL.fmi1_import_get_real_variable_min(real_variable)             # <<<<<<<<<<<<<<
 * 
 *         elif type == FMIL.fmi1_base_type_int:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyFloat_FromDouble(fmi1_import_get_real_variable_min(__pyx_v_real_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }

  /* "pyfmi\fmi.pyx":1668
 *             return FMIL.fmi1_import_get_real_variable_min(real_variable)
 * 
 *         elif type == FMIL.fmi1_base_type_int:             # <<<<<<<<<<<<<<
 *             int_variable = FMIL.fmi1_import_get_variable_as_integer(variable)
 *             return FMIL.fmi1_import_get_integer_variable_min(int_variable)
 */
  __pyx_t_5 = (__pyx_v_type == fmi1_base_type_int);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":1669
 * 
 *         elif type == FMIL.fmi1_base_type_int:
 *             int_variable = FMIL.fmi1_import_get_variable_as_integer(variable)             # <<<<<<<<<<<<<<
 *             return FMIL.fmi1_import_get_integer_variable_min(int_variable)
 * 
 */
    __pyx_v_int_variable = fmi1_import_get_variable_as_integer(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":1670
 *         elif type == FMIL.fmi1_base_type_int:
 *             int_variable = FMIL.fmi1_import_get_variable_as_integer(variable)
 *             return FMIL.fmi1_import_get_integer_variable_min(int_variable)             # <<<<<<<<<<<<<<
 * 
 *         elif type == FMIL.fmi1_base_type_enum:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyInt_FromLong(fmi1_import_get_integer_variable_min(__pyx_v_int_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }

  /* "pyfmi\fmi.pyx":1672
 *             return FMIL.fmi1_import_get_integer_variable_min(int_variable)
 * 
 *         elif type == FMIL.fmi1_base_type_enum:             # <<<<<<<<<<<<<<
 *             enum_variable = FMIL.fmi1_import_get_variable_as_enum(variable)
 *             return FMIL.fmi1_import_get_enum_variable_min(enum_variable)
 */
  __pyx_t_5 = (__pyx_v_type == fmi1_base_type_enum);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":1673
 * 
 *         elif type == FMIL.fmi1_base_type_enum:
 *             enum_variable = FMIL.fmi1_import_get_variable_as_enum(variable)             # <<<<<<<<<<<<<<
 *             return FMIL.fmi1_import_get_enum_variable_min(enum_variable)
 * 
 */
    __pyx_v_enum_variable = fmi1_import_get_variable_as_enum(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":1674
 *         elif type == FMIL.fmi1_base_type_enum:
 *             enum_variable = FMIL.fmi1_import_get_variable_as_enum(variable)
 *             return FMIL.fmi1_import_get_enum_variable_min(enum_variable)             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyInt_FromLong(fmi1_import_get_enum_variable_min(__pyx_v_enum_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":1677
 * 
 *         else:
 *             raise FMUException("The variable type does not have a minimum value.")             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_99), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L4:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_min", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_47get_variable_min(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_46get_variable_min[] = "\n        Returns the minimum value for the given variable.\n\n        Parameters::\n\n            variable_name --\n                The name of the variable.\n\n        Returns::\n\n            The minimum value for the variable.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_47get_variable_min(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_min (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_46get_variable_min(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1636
 *             raise FMUException("The variable type does not have a maximum value.")
 * 
 *     cpdef get_variable_min(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the minimum value for the given variable.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_46get_variable_min(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  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("get_variable_min", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_variable_min(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_min", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_49get_model_variables(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_48get_model_variables[] = "\n        Extract the names of the variables in a model.\n\n        Parameters::\n\n            type --\n                The type of the variables (Real==0, Int==1, Bool=2,\n                String==3, Enumeration==4). Default None (i.e all).\n            include_alias --\n                If alias should be included or not. Default True\n            causality --\n                The causality of the variables (Input==0, Output==1,\n                Internal==2, None==3). Default None (i.e all).\n            variability --\n                The variability of the variables (Constant==0,\n                Parameter==1, Discrete==2, Continuous==3). Default None\n                (i.e. all)\n            only_start --\n                If only variables that has a start value should be\n                returned. Default False\n            only_fixed --\n                If only variables that has a start value that is fixed\n                should be returned. Default False\n            filter --\n                Filter the variables using a unix filename pattern\n                matching (filter=\"*der*\"). Can also be a list of filters\n                See http://docs.python.org/2/library/fnmatch.html.\n                Default None\n\n        Returns::\n\n            Dict with variable name as key and a ScalarVariable class as\n            value.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_49get_model_variables(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_type = 0;
  PyObject *__pyx_v_include_alias = 0;
  PyObject *__pyx_v_causality = 0;
  PyObject *__pyx_v_variability = 0;
  PyObject *__pyx_v_only_start = 0;
  PyObject *__pyx_v_only_fixed = 0;
  PyObject *__pyx_v_filter = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_model_variables (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__type,&__pyx_n_s__include_alias,&__pyx_n_s__causality,&__pyx_n_s__variability,&__pyx_n_s__only_start,&__pyx_n_s__only_fixed,&__pyx_n_s__filter,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};

    /* "pyfmi\fmi.pyx":1680
 * 
 * 
 *     def get_model_variables(self,type=None, include_alias=True,             # <<<<<<<<<<<<<<
 *                             causality=None,   variability=None,
 *                             only_start=False,  only_fixed=False,
 */
    values[0] = ((PyObject *)Py_None);
    values[1] = __pyx_k_100;

    /* "pyfmi\fmi.pyx":1681
 * 
 *     def get_model_variables(self,type=None, include_alias=True,
 *                             causality=None,   variability=None,             # <<<<<<<<<<<<<<
 *                             only_start=False,  only_fixed=False,
 *                             filter=None):
 */
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_None);
    values[4] = __pyx_k_101;
    values[5] = __pyx_k_102;

    /* "pyfmi\fmi.pyx":1683
 *                             causality=None,   variability=None,
 *                             only_start=False,  only_fixed=False,
 *                             filter=None):             # <<<<<<<<<<<<<<
 *         """
 *         Extract the names of the variables in a model.
 */
    values[6] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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 (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__type);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__include_alias);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__causality);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__variability);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__only_start);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__only_fixed);
          if (value) { values[5] = value; kw_args--; }
        }
        case  6:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__filter);
          if (value) { values[6] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_model_variables") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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;
      }
    }
    __pyx_v_type = values[0];
    __pyx_v_include_alias = values[1];
    __pyx_v_causality = values[2];
    __pyx_v_variability = values[3];
    __pyx_v_only_start = values[4];
    __pyx_v_only_fixed = values[5];
    __pyx_v_filter = values[6];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_model_variables", 0, 0, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_model_variables", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_48get_model_variables(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_v_type, __pyx_v_include_alias, __pyx_v_causality, __pyx_v_variability, __pyx_v_only_start, __pyx_v_only_fixed, __pyx_v_filter);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1680
 * 
 * 
 *     def get_model_variables(self,type=None, include_alias=True,             # <<<<<<<<<<<<<<
 *                             causality=None,   variability=None,
 *                             only_start=False,  only_fixed=False,
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_48get_model_variables(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_type, PyObject *__pyx_v_include_alias, PyObject *__pyx_v_causality, PyObject *__pyx_v_variability, PyObject *__pyx_v_only_start, PyObject *__pyx_v_only_fixed, PyObject *__pyx_v_filter) {
  fmi1_import_variable_t *__pyx_v_variable;
  struct fmi1_import_variable_list_t *__pyx_v_variable_list;
  size_t __pyx_v_variable_list_size;
  fmi1_value_reference_t __pyx_v_value_ref;
  enum fmi1_base_type_enu_t __pyx_v_data_type;
  enum fmi1_base_type_enu_t __pyx_v_target_type;
  enum fmi1_variability_enu_t __pyx_v_data_variability;
  enum fmi1_variability_enu_t __pyx_v_target_variability;
  enum fmi1_causality_enu_t __pyx_v_data_causality;
  enum fmi1_causality_enu_t __pyx_v_target_causality;
  enum fmi1_variable_alias_kind_enu_t __pyx_v_alias_kind;
  char *__pyx_v_desc;
  PyObject *__pyx_v_variable_dict = 0;
  PyObject *__pyx_v_filter_list = 0;
  int __pyx_v_selected_type;
  int __pyx_v_selected_variability;
  int __pyx_v_selected_causality;
  int __pyx_v_has_start;
  int __pyx_v_is_fixed;
  int __pyx_v_selected_filter;
  int __pyx_v_length_filter;
  size_t __pyx_v_i;
  PyObject *__pyx_v_name = NULL;
  int __pyx_v_j;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  long __pyx_t_2;
  int __pyx_t_3;
  enum fmi1_base_type_enu_t __pyx_t_4;
  enum fmi1_causality_enu_t __pyx_t_5;
  enum fmi1_variability_enu_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  size_t __pyx_t_10;
  size_t __pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  int __pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_model_variables", 0);

  /* "pyfmi\fmi.pyx":1727
 *         cdef FMIL.fmi1_variable_alias_kind_enu_t alias_kind
 *         cdef char* desc
 *         cdef dict variable_dict = {}             # <<<<<<<<<<<<<<
 *         cdef list filter_list = []
 *         cdef int  selected_type = 0 #If a type has been selected
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_variable_dict = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":1728
 *         cdef char* desc
 *         cdef dict variable_dict = {}
 *         cdef list filter_list = []             # <<<<<<<<<<<<<<
 *         cdef int  selected_type = 0 #If a type has been selected
 *         cdef int  selected_variability = 0 #If a variability has been selected
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_filter_list = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":1729
 *         cdef dict variable_dict = {}
 *         cdef list filter_list = []
 *         cdef int  selected_type = 0 #If a type has been selected             # <<<<<<<<<<<<<<
 *         cdef int  selected_variability = 0 #If a variability has been selected
 *         cdef int  selected_causality = 0 #If a causality has been selected
 */
  __pyx_v_selected_type = 0;

  /* "pyfmi\fmi.pyx":1730
 *         cdef list filter_list = []
 *         cdef int  selected_type = 0 #If a type has been selected
 *         cdef int  selected_variability = 0 #If a variability has been selected             # <<<<<<<<<<<<<<
 *         cdef int  selected_causality = 0 #If a causality has been selected
 *         cdef int  has_start, is_fixed
 */
  __pyx_v_selected_variability = 0;

  /* "pyfmi\fmi.pyx":1731
 *         cdef int  selected_type = 0 #If a type has been selected
 *         cdef int  selected_variability = 0 #If a variability has been selected
 *         cdef int  selected_causality = 0 #If a causality has been selected             # <<<<<<<<<<<<<<
 *         cdef int  has_start, is_fixed
 *         cdef int  selected_filter = 1 if filter else 0
 */
  __pyx_v_selected_causality = 0;

  /* "pyfmi\fmi.pyx":1733
 *         cdef int  selected_causality = 0 #If a causality has been selected
 *         cdef int  has_start, is_fixed
 *         cdef int  selected_filter = 1 if filter else 0             # <<<<<<<<<<<<<<
 *         cdef int  length_filter = 0
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_filter); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_3) {
    __pyx_t_2 = 1;
  } else {
    __pyx_t_2 = 0;
  }
  __pyx_v_selected_filter = __pyx_t_2;

  /* "pyfmi\fmi.pyx":1734
 *         cdef int  has_start, is_fixed
 *         cdef int  selected_filter = 1 if filter else 0
 *         cdef int  length_filter = 0             # <<<<<<<<<<<<<<
 * 
 *         variable_list = FMIL.fmi1_import_get_variable_list(self._fmu)
 */
  __pyx_v_length_filter = 0;

  /* "pyfmi\fmi.pyx":1736
 *         cdef int  length_filter = 0
 * 
 *         variable_list = FMIL.fmi1_import_get_variable_list(self._fmu)             # <<<<<<<<<<<<<<
 *         variable_list_size = FMIL.fmi1_import_get_variable_list_size(variable_list)
 * 
 */
  __pyx_v_variable_list = fmi1_import_get_variable_list(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":1737
 * 
 *         variable_list = FMIL.fmi1_import_get_variable_list(self._fmu)
 *         variable_list_size = FMIL.fmi1_import_get_variable_list_size(variable_list)             # <<<<<<<<<<<<<<
 * 
 *         if type!=None: #A type have has been selected
 */
  __pyx_v_variable_list_size = fmi1_import_get_variable_list_size(__pyx_v_variable_list);

  /* "pyfmi\fmi.pyx":1739
 *         variable_list_size = FMIL.fmi1_import_get_variable_list_size(variable_list)
 * 
 *         if type!=None: #A type have has been selected             # <<<<<<<<<<<<<<
 *             target_type = type
 *             selected_type = 1
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_type, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":1740
 * 
 *         if type!=None: #A type have has been selected
 *             target_type = type             # <<<<<<<<<<<<<<
 *             selected_type = 1
 *         if causality!=None: #A causality has been selected
 */
    __pyx_t_4 = ((enum fmi1_base_type_enu_t)PyInt_AsLong(__pyx_v_type)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_target_type = __pyx_t_4;

    /* "pyfmi\fmi.pyx":1741
 *         if type!=None: #A type have has been selected
 *             target_type = type
 *             selected_type = 1             # <<<<<<<<<<<<<<
 *         if causality!=None: #A causality has been selected
 *             target_causality = causality
 */
    __pyx_v_selected_type = 1;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1742
 *             target_type = type
 *             selected_type = 1
 *         if causality!=None: #A causality has been selected             # <<<<<<<<<<<<<<
 *             target_causality = causality
 *             selected_causality = 1
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_causality, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":1743
 *             selected_type = 1
 *         if causality!=None: #A causality has been selected
 *             target_causality = causality             # <<<<<<<<<<<<<<
 *             selected_causality = 1
 *         if variability!=None: #A variability has been selected
 */
    __pyx_t_5 = ((enum fmi1_causality_enu_t)PyInt_AsLong(__pyx_v_causality)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_target_causality = __pyx_t_5;

    /* "pyfmi\fmi.pyx":1744
 *         if causality!=None: #A causality has been selected
 *             target_causality = causality
 *             selected_causality = 1             # <<<<<<<<<<<<<<
 *         if variability!=None: #A variability has been selected
 *             target_variability = variability
 */
    __pyx_v_selected_causality = 1;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":1745
 *             target_causality = causality
 *             selected_causality = 1
 *         if variability!=None: #A variability has been selected             # <<<<<<<<<<<<<<
 *             target_variability = variability
 *             selected_variability = 1
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_variability, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":1746
 *             selected_causality = 1
 *         if variability!=None: #A variability has been selected
 *             target_variability = variability             # <<<<<<<<<<<<<<
 *             selected_variability = 1
 *         if selected_filter:
 */
    __pyx_t_6 = ((enum fmi1_variability_enu_t)PyInt_AsLong(__pyx_v_variability)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_target_variability = __pyx_t_6;

    /* "pyfmi\fmi.pyx":1747
 *         if variability!=None: #A variability has been selected
 *             target_variability = variability
 *             selected_variability = 1             # <<<<<<<<<<<<<<
 *         if selected_filter:
 *             filter_list = self._convert_filter(filter)
 */
    __pyx_v_selected_variability = 1;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":1748
 *             target_variability = variability
 *             selected_variability = 1
 *         if selected_filter:             # <<<<<<<<<<<<<<
 *             filter_list = self._convert_filter(filter)
 *             length_filter = len(filter_list)
 */
  if (__pyx_v_selected_filter) {

    /* "pyfmi\fmi.pyx":1749
 *             selected_variability = 1
 *         if selected_filter:
 *             filter_list = self._convert_filter(filter)             # <<<<<<<<<<<<<<
 *             length_filter = len(filter_list)
 * 
 */
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___convert_filter); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_v_filter);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_filter);
    __Pyx_GIVEREF(__pyx_v_filter);
    __pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    if (!(likely(PyList_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_t_8)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_v_filter_list));
    __pyx_v_filter_list = ((PyObject*)__pyx_t_8);
    __pyx_t_8 = 0;

    /* "pyfmi\fmi.pyx":1750
 *         if selected_filter:
 *             filter_list = self._convert_filter(filter)
 *             length_filter = len(filter_list)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(variable_list_size):
 */
    if (unlikely(((PyObject *)__pyx_v_filter_list) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_9 = PyList_GET_SIZE(((PyObject *)__pyx_v_filter_list)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_length_filter = __pyx_t_9;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pyfmi\fmi.pyx":1752
 *             length_filter = len(filter_list)
 * 
 *         for i in range(variable_list_size):             # <<<<<<<<<<<<<<
 * 
 *             variable = FMIL.fmi1_import_get_variable(variable_list, i)
 */
  __pyx_t_10 = __pyx_v_variable_list_size;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "pyfmi\fmi.pyx":1754
 *         for i in range(variable_list_size):
 * 
 *             variable = FMIL.fmi1_import_get_variable(variable_list, i)             # <<<<<<<<<<<<<<
 * 
 *             alias_kind = FMIL.fmi1_import_get_variable_alias_kind(variable)
 */
    __pyx_v_variable = fmi1_import_get_variable(__pyx_v_variable_list, __pyx_v_i);

    /* "pyfmi\fmi.pyx":1756
 *             variable = FMIL.fmi1_import_get_variable(variable_list, i)
 * 
 *             alias_kind = FMIL.fmi1_import_get_variable_alias_kind(variable)             # <<<<<<<<<<<<<<
 *             name       = decode(FMIL.fmi1_import_get_variable_name(variable))
 *             value_ref  = FMIL.fmi1_import_get_variable_vr(variable)
 */
    __pyx_v_alias_kind = fmi1_import_get_variable_alias_kind(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":1757
 * 
 *             alias_kind = FMIL.fmi1_import_get_variable_alias_kind(variable)
 *             name       = decode(FMIL.fmi1_import_get_variable_name(variable))             # <<<<<<<<<<<<<<
 *             value_ref  = FMIL.fmi1_import_get_variable_vr(variable)
 *             data_type  = FMIL.fmi1_import_get_variable_base_type(variable)
 */
    __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = PyBytes_FromString(fmi1_import_get_variable_name(__pyx_v_variable)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_7));
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_7));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
    __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_v_name);
    __pyx_v_name = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "pyfmi\fmi.pyx":1758
 *             alias_kind = FMIL.fmi1_import_get_variable_alias_kind(variable)
 *             name       = decode(FMIL.fmi1_import_get_variable_name(variable))
 *             value_ref  = FMIL.fmi1_import_get_variable_vr(variable)             # <<<<<<<<<<<<<<
 *             data_type  = FMIL.fmi1_import_get_variable_base_type(variable)
 *             has_start  = FMIL.fmi1_import_get_variable_has_start(variable)
 */
    __pyx_v_value_ref = fmi1_import_get_variable_vr(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":1759
 *             name       = decode(FMIL.fmi1_import_get_variable_name(variable))
 *             value_ref  = FMIL.fmi1_import_get_variable_vr(variable)
 *             data_type  = FMIL.fmi1_import_get_variable_base_type(variable)             # <<<<<<<<<<<<<<
 *             has_start  = FMIL.fmi1_import_get_variable_has_start(variable)
 *             data_variability = FMIL.fmi1_import_get_variability(variable)
 */
    __pyx_v_data_type = fmi1_import_get_variable_base_type(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":1760
 *             value_ref  = FMIL.fmi1_import_get_variable_vr(variable)
 *             data_type  = FMIL.fmi1_import_get_variable_base_type(variable)
 *             has_start  = FMIL.fmi1_import_get_variable_has_start(variable)             # <<<<<<<<<<<<<<
 *             data_variability = FMIL.fmi1_import_get_variability(variable)
 *             data_causality   = FMIL.fmi1_import_get_causality(variable)
 */
    __pyx_v_has_start = fmi1_import_get_variable_has_start(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":1761
 *             data_type  = FMIL.fmi1_import_get_variable_base_type(variable)
 *             has_start  = FMIL.fmi1_import_get_variable_has_start(variable)
 *             data_variability = FMIL.fmi1_import_get_variability(variable)             # <<<<<<<<<<<<<<
 *             data_causality   = FMIL.fmi1_import_get_causality(variable)
 *             desc       = FMIL.fmi1_import_get_variable_description(variable)
 */
    __pyx_v_data_variability = fmi1_import_get_variability(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":1762
 *             has_start  = FMIL.fmi1_import_get_variable_has_start(variable)
 *             data_variability = FMIL.fmi1_import_get_variability(variable)
 *             data_causality   = FMIL.fmi1_import_get_causality(variable)             # <<<<<<<<<<<<<<
 *             desc       = FMIL.fmi1_import_get_variable_description(variable)
 * 
 */
    __pyx_v_data_causality = fmi1_import_get_causality(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":1763
 *             data_variability = FMIL.fmi1_import_get_variability(variable)
 *             data_causality   = FMIL.fmi1_import_get_causality(variable)
 *             desc       = FMIL.fmi1_import_get_variable_description(variable)             # <<<<<<<<<<<<<<
 * 
 *             #If only variables with start are wanted, check if the variable has start
 */
    __pyx_v_desc = fmi1_import_get_variable_description(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":1766
 * 
 *             #If only variables with start are wanted, check if the variable has start
 *             if only_start and has_start != 1:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_only_start); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_3) {
      __pyx_t_12 = (__pyx_v_has_start != 1);
      __pyx_t_13 = __pyx_t_12;
    } else {
      __pyx_t_13 = __pyx_t_3;
    }
    if (__pyx_t_13) {

      /* "pyfmi\fmi.pyx":1767
 *             #If only variables with start are wanted, check if the variable has start
 *             if only_start and has_start != 1:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             if only_fixed:
 */
      goto __pyx_L7_continue;
      goto __pyx_L9;
    }
    __pyx_L9:;

    /* "pyfmi\fmi.pyx":1769
 *                 continue
 * 
 *             if only_fixed:             # <<<<<<<<<<<<<<
 *                 if has_start!=1:
 *                     continue
 */
    __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_only_fixed); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_13) {

      /* "pyfmi\fmi.pyx":1770
 * 
 *             if only_fixed:
 *                 if has_start!=1:             # <<<<<<<<<<<<<<
 *                     continue
 *                 else:
 */
      __pyx_t_13 = (__pyx_v_has_start != 1);
      if (__pyx_t_13) {

        /* "pyfmi\fmi.pyx":1771
 *             if only_fixed:
 *                 if has_start!=1:
 *                     continue             # <<<<<<<<<<<<<<
 *                 else:
 *                     is_fixed = FMIL.fmi1_import_get_variable_is_fixed(variable)
 */
        goto __pyx_L7_continue;
        goto __pyx_L11;
      }
      /*else*/ {

        /* "pyfmi\fmi.pyx":1773
 *                     continue
 *                 else:
 *                     is_fixed = FMIL.fmi1_import_get_variable_is_fixed(variable)             # <<<<<<<<<<<<<<
 *                     if is_fixed !=1:
 *                         continue
 */
        __pyx_v_is_fixed = fmi1_import_get_variable_is_fixed(__pyx_v_variable);

        /* "pyfmi\fmi.pyx":1774
 *                 else:
 *                     is_fixed = FMIL.fmi1_import_get_variable_is_fixed(variable)
 *                     if is_fixed !=1:             # <<<<<<<<<<<<<<
 *                         continue
 * 
 */
        __pyx_t_13 = (__pyx_v_is_fixed != 1);
        if (__pyx_t_13) {

          /* "pyfmi\fmi.pyx":1775
 *                     is_fixed = FMIL.fmi1_import_get_variable_is_fixed(variable)
 *                     if is_fixed !=1:
 *                         continue             # <<<<<<<<<<<<<<
 * 
 *             if selected_type == 1 and data_type != target_type:
 */
          goto __pyx_L7_continue;
          goto __pyx_L12;
        }
        __pyx_L12:;
      }
      __pyx_L11:;
      goto __pyx_L10;
    }
    __pyx_L10:;

    /* "pyfmi\fmi.pyx":1777
 *                         continue
 * 
 *             if selected_type == 1 and data_type != target_type:             # <<<<<<<<<<<<<<
 *                 continue
 *             if selected_causality == 1 and data_causality != target_causality:
 */
    __pyx_t_13 = (__pyx_v_selected_type == 1);
    if (__pyx_t_13) {
      __pyx_t_3 = (__pyx_v_data_type != __pyx_v_target_type);
      __pyx_t_12 = __pyx_t_3;
    } else {
      __pyx_t_12 = __pyx_t_13;
    }
    if (__pyx_t_12) {

      /* "pyfmi\fmi.pyx":1778
 * 
 *             if selected_type == 1 and data_type != target_type:
 *                 continue             # <<<<<<<<<<<<<<
 *             if selected_causality == 1 and data_causality != target_causality:
 *                 continue
 */
      goto __pyx_L7_continue;
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "pyfmi\fmi.pyx":1779
 *             if selected_type == 1 and data_type != target_type:
 *                 continue
 *             if selected_causality == 1 and data_causality != target_causality:             # <<<<<<<<<<<<<<
 *                 continue
 *             if selected_variability == 1 and data_variability != target_variability:
 */
    __pyx_t_12 = (__pyx_v_selected_causality == 1);
    if (__pyx_t_12) {
      __pyx_t_13 = (__pyx_v_data_causality != __pyx_v_target_causality);
      __pyx_t_3 = __pyx_t_13;
    } else {
      __pyx_t_3 = __pyx_t_12;
    }
    if (__pyx_t_3) {

      /* "pyfmi\fmi.pyx":1780
 *                 continue
 *             if selected_causality == 1 and data_causality != target_causality:
 *                 continue             # <<<<<<<<<<<<<<
 *             if selected_variability == 1 and data_variability != target_variability:
 *                 continue
 */
      goto __pyx_L7_continue;
      goto __pyx_L14;
    }
    __pyx_L14:;

    /* "pyfmi\fmi.pyx":1781
 *             if selected_causality == 1 and data_causality != target_causality:
 *                 continue
 *             if selected_variability == 1 and data_variability != target_variability:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    __pyx_t_3 = (__pyx_v_selected_variability == 1);
    if (__pyx_t_3) {
      __pyx_t_12 = (__pyx_v_data_variability != __pyx_v_target_variability);
      __pyx_t_13 = __pyx_t_12;
    } else {
      __pyx_t_13 = __pyx_t_3;
    }
    if (__pyx_t_13) {

      /* "pyfmi\fmi.pyx":1782
 *                 continue
 *             if selected_variability == 1 and data_variability != target_variability:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             if selected_filter:
 */
      goto __pyx_L7_continue;
      goto __pyx_L15;
    }
    __pyx_L15:;

    /* "pyfmi\fmi.pyx":1784
 *                 continue
 * 
 *             if selected_filter:             # <<<<<<<<<<<<<<
 *                 for j in range(length_filter):
 *                     #if re.match(filter_list[j], name):
 */
    if (__pyx_v_selected_filter) {

      /* "pyfmi\fmi.pyx":1785
 * 
 *             if selected_filter:
 *                 for j in range(length_filter):             # <<<<<<<<<<<<<<
 *                     #if re.match(filter_list[j], name):
 *                     if filter_list[j].match(name):
 */
      __pyx_t_14 = __pyx_v_length_filter;
      for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
        __pyx_v_j = __pyx_t_15;

        /* "pyfmi\fmi.pyx":1787
 *                 for j in range(length_filter):
 *                     #if re.match(filter_list[j], name):
 *                     if filter_list[j].match(name):             # <<<<<<<<<<<<<<
 *                         break
 *                 else:
 */
        if (unlikely(((PyObject *)__pyx_v_filter_list) == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_7 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_filter_list), __pyx_v_j, sizeof(int), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_1 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__match); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_v_name);
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_name);
        __Pyx_GIVEREF(__pyx_v_name);
        __pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
        __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (__pyx_t_13) {

          /* "pyfmi\fmi.pyx":1788
 *                     #if re.match(filter_list[j], name):
 *                     if filter_list[j].match(name):
 *                         break             # <<<<<<<<<<<<<<
 *                 else:
 *                     continue
 */
          goto __pyx_L18_break;
          goto __pyx_L19;
        }
        __pyx_L19:;
      }
      /*else*/ {

        /* "pyfmi\fmi.pyx":1790
 *                         break
 *                 else:
 *                     continue             # <<<<<<<<<<<<<<
 * 
 *             if include_alias:
 */
        goto __pyx_L7_continue;
      }
      __pyx_L18_break:;
      goto __pyx_L16;
    }
    __pyx_L16:;

    /* "pyfmi\fmi.pyx":1792
 *                     continue
 * 
 *             if include_alias:             # <<<<<<<<<<<<<<
 *                 variable_dict[name] = ScalarVariable(name,
 *                                        value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",
 */
    __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_include_alias); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_13) {

      /* "pyfmi\fmi.pyx":1794
 *             if include_alias:
 *                 variable_dict[name] = ScalarVariable(name,
 *                                        value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",             # <<<<<<<<<<<<<<
 *                                        data_variability, data_causality,
 *                                        alias_kind)
 */
      __pyx_t_8 = __Pyx_PyInt_to_py_fmi1_value_reference_t(__pyx_v_value_ref); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      if ((__pyx_v_desc != NULL)) {
        __pyx_t_16 = ((PyObject *)__Pyx_decode_c_string(__pyx_v_desc, 0, strlen(__pyx_v_desc), NULL, NULL, PyUnicode_DecodeUTF8)); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_16));
        __pyx_t_1 = ((PyObject *)__pyx_t_16);
        __pyx_t_16 = 0;
      } else {
        __Pyx_INCREF(((PyObject *)__pyx_kp_s_12));
        __pyx_t_1 = ((PyObject *)__pyx_kp_s_12);
      }

      /* "pyfmi\fmi.pyx":1795
 *                 variable_dict[name] = ScalarVariable(name,
 *                                        value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",
 *                                        data_variability, data_causality,             # <<<<<<<<<<<<<<
 *                                        alias_kind)
 * 
 */
      __pyx_t_16 = PyInt_FromLong(__pyx_v_data_variability); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_17 = PyInt_FromLong(__pyx_v_data_causality); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_17);

      /* "pyfmi\fmi.pyx":1796
 *                                        value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",
 *                                        data_variability, data_causality,
 *                                        alias_kind)             # <<<<<<<<<<<<<<
 * 
 *             elif alias_kind ==FMIL.fmi1_variable_is_not_alias:
 */
      __pyx_t_18 = PyInt_FromLong(__pyx_v_alias_kind); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_18);
      __pyx_t_19 = PyTuple_New(7); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_INCREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_19, 2, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_19, 3, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_19, 4, __pyx_t_16);
      __Pyx_GIVEREF(__pyx_t_16);
      PyTuple_SET_ITEM(__pyx_t_19, 5, __pyx_t_17);
      __Pyx_GIVEREF(__pyx_t_17);
      PyTuple_SET_ITEM(__pyx_t_19, 6, __pyx_t_18);
      __Pyx_GIVEREF(__pyx_t_18);
      __pyx_t_8 = 0;
      __pyx_t_7 = 0;
      __pyx_t_1 = 0;
      __pyx_t_16 = 0;
      __pyx_t_17 = 0;
      __pyx_t_18 = 0;
      __pyx_t_18 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_ScalarVariable)), ((PyObject *)__pyx_t_19), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_18);
      __Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;

      /* "pyfmi\fmi.pyx":1793
 * 
 *             if include_alias:
 *                 variable_dict[name] = ScalarVariable(name,             # <<<<<<<<<<<<<<
 *                                        value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",
 *                                        data_variability, data_causality,
 */
      if (PyDict_SetItem(((PyObject *)__pyx_v_variable_dict), __pyx_v_name, __pyx_t_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
      goto __pyx_L20;
    }

    /* "pyfmi\fmi.pyx":1798
 *                                        alias_kind)
 * 
 *             elif alias_kind ==FMIL.fmi1_variable_is_not_alias:             # <<<<<<<<<<<<<<
 *                 variable_dict[name] = ScalarVariable(name,
 *                                        value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",
 */
    __pyx_t_13 = (__pyx_v_alias_kind == fmi1_variable_is_not_alias);
    if (__pyx_t_13) {

      /* "pyfmi\fmi.pyx":1800
 *             elif alias_kind ==FMIL.fmi1_variable_is_not_alias:
 *                 variable_dict[name] = ScalarVariable(name,
 *                                        value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",             # <<<<<<<<<<<<<<
 *                                        data_variability, data_causality,
 *                                        alias_kind)
 */
      __pyx_t_18 = __Pyx_PyInt_to_py_fmi1_value_reference_t(__pyx_v_value_ref); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_18);
      __pyx_t_19 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      if ((__pyx_v_desc != NULL)) {
        __pyx_t_16 = ((PyObject *)__Pyx_decode_c_string(__pyx_v_desc, 0, strlen(__pyx_v_desc), NULL, NULL, PyUnicode_DecodeUTF8)); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_16));
        __pyx_t_17 = ((PyObject *)__pyx_t_16);
        __pyx_t_16 = 0;
      } else {
        __Pyx_INCREF(((PyObject *)__pyx_kp_s_12));
        __pyx_t_17 = ((PyObject *)__pyx_kp_s_12);
      }

      /* "pyfmi\fmi.pyx":1801
 *                 variable_dict[name] = ScalarVariable(name,
 *                                        value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",
 *                                        data_variability, data_causality,             # <<<<<<<<<<<<<<
 *                                        alias_kind)
 * 
 */
      __pyx_t_16 = PyInt_FromLong(__pyx_v_data_variability); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_1 = PyInt_FromLong(__pyx_v_data_causality); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);

      /* "pyfmi\fmi.pyx":1802
 *                                        value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",
 *                                        data_variability, data_causality,
 *                                        alias_kind)             # <<<<<<<<<<<<<<
 * 
 *         #Free the variable list
 */
      __pyx_t_7 = PyInt_FromLong(__pyx_v_alias_kind); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = PyTuple_New(7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_18);
      __Pyx_GIVEREF(__pyx_t_18);
      PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_19);
      __Pyx_GIVEREF(__pyx_t_19);
      PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_17);
      __Pyx_GIVEREF(__pyx_t_17);
      PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_t_16);
      __Pyx_GIVEREF(__pyx_t_16);
      PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_8, 6, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      __pyx_t_18 = 0;
      __pyx_t_19 = 0;
      __pyx_t_17 = 0;
      __pyx_t_16 = 0;
      __pyx_t_1 = 0;
      __pyx_t_7 = 0;
      __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_ScalarVariable)), ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;

      /* "pyfmi\fmi.pyx":1799
 * 
 *             elif alias_kind ==FMIL.fmi1_variable_is_not_alias:
 *                 variable_dict[name] = ScalarVariable(name,             # <<<<<<<<<<<<<<
 *                                        value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",
 *                                        data_variability, data_causality,
 */
      if (PyDict_SetItem(((PyObject *)__pyx_v_variable_dict), __pyx_v_name, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L20;
    }
    __pyx_L20:;
    __pyx_L7_continue:;
  }

  /* "pyfmi\fmi.pyx":1805
 * 
 *         #Free the variable list
 *         FMIL.fmi1_import_free_variable_list(variable_list)             # <<<<<<<<<<<<<<
 * 
 *         return variable_dict
 */
  fmi1_import_free_variable_list(__pyx_v_variable_list);

  /* "pyfmi\fmi.pyx":1807
 *         FMIL.fmi1_import_free_variable_list(variable_list)
 * 
 *         return variable_dict             # <<<<<<<<<<<<<<
 * 
 *     def get_model_time_varying_value_references(self, filter=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_variable_dict));
  __pyx_r = ((PyObject *)__pyx_v_variable_dict);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_model_variables", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_dict);
  __Pyx_XDECREF(__pyx_v_filter_list);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_51get_model_time_varying_value_references(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_50get_model_time_varying_value_references[] = "\n        Extract the value references of the variables in a model\n        that are time-varying. This method is typically used to\n        retrieve the variables for which the result can be stored.\n\n        Parameters::\n\n            filter --\n                Filter the variables using a unix filename pattern\n                matching (filter=\"*der*\"). Can also be a list of filters\n                See http://docs.python.org/2/library/fnmatch.html.\n                Default None\n\n        Returns::\n\n            Three lists with the real, integer and boolean value-references\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_51get_model_time_varying_value_references(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_filter = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_model_time_varying_value_references (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__filter,0};
    PyObject* values[1] = {0};

    /* "pyfmi\fmi.pyx":1809
 *         return variable_dict
 * 
 *     def get_model_time_varying_value_references(self, filter=None):             # <<<<<<<<<<<<<<
 *         """
 *         Extract the value references of the variables in a model
 */
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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 (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__filter);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_model_time_varying_value_references") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_filter = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_model_time_varying_value_references", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_model_time_varying_value_references", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_50get_model_time_varying_value_references(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_v_filter);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_50get_model_time_varying_value_references(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_filter) {
  fmi1_import_variable_t *__pyx_v_variable;
  fmi1_import_variable_t *__pyx_v_base_variable;
  struct fmi1_import_variable_list_t *__pyx_v_variable_list;
  size_t __pyx_v_variable_list_size;
  fmi1_value_reference_t __pyx_v_value_ref;
  enum fmi1_base_type_enu_t __pyx_v_data_type;
  enum fmi1_variability_enu_t __pyx_v_data_variability;
  enum fmi1_variable_alias_kind_enu_t __pyx_v_alias_kind;
  CYTHON_UNUSED PyObject *__pyx_v_variable_dict = 0;
  PyObject *__pyx_v_filter_list = 0;
  PyObject *__pyx_v_real_var_ref = 0;
  PyObject *__pyx_v_int_var_ref = 0;
  PyObject *__pyx_v_bool_var_ref = 0;
  CYTHON_UNUSED int __pyx_v_selected_variability;
  int __pyx_v_selected_filter;
  int __pyx_v_length_filter;
  size_t __pyx_v_i;
  PyObject *__pyx_v_name = NULL;
  int __pyx_v_j;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  long __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  size_t __pyx_t_7;
  size_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_model_time_varying_value_references", 0);

  /* "pyfmi\fmi.pyx":1835
 *         cdef FMIL.fmi1_variability_enu_t data_variability
 *         cdef FMIL.fmi1_variable_alias_kind_enu_t alias_kind
 *         cdef dict variable_dict = {}             # <<<<<<<<<<<<<<
 *         cdef list filter_list = []
 *         cdef dict real_var_ref = {}
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_variable_dict = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":1836
 *         cdef FMIL.fmi1_variable_alias_kind_enu_t alias_kind
 *         cdef dict variable_dict = {}
 *         cdef list filter_list = []             # <<<<<<<<<<<<<<
 *         cdef dict real_var_ref = {}
 *         cdef dict int_var_ref = {}
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_filter_list = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":1837
 *         cdef dict variable_dict = {}
 *         cdef list filter_list = []
 *         cdef dict real_var_ref = {}             # <<<<<<<<<<<<<<
 *         cdef dict int_var_ref = {}
 *         cdef dict bool_var_ref = {}
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_real_var_ref = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":1838
 *         cdef list filter_list = []
 *         cdef dict real_var_ref = {}
 *         cdef dict int_var_ref = {}             # <<<<<<<<<<<<<<
 *         cdef dict bool_var_ref = {}
 *         cdef int  selected_variability = 0 #If a variability has been selected
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_int_var_ref = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":1839
 *         cdef dict real_var_ref = {}
 *         cdef dict int_var_ref = {}
 *         cdef dict bool_var_ref = {}             # <<<<<<<<<<<<<<
 *         cdef int  selected_variability = 0 #If a variability has been selected
 *         cdef int  selected_filter = 1 if filter else 0
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_bool_var_ref = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":1840
 *         cdef dict int_var_ref = {}
 *         cdef dict bool_var_ref = {}
 *         cdef int  selected_variability = 0 #If a variability has been selected             # <<<<<<<<<<<<<<
 *         cdef int  selected_filter = 1 if filter else 0
 *         cdef int  length_filter = 0
 */
  __pyx_v_selected_variability = 0;

  /* "pyfmi\fmi.pyx":1841
 *         cdef dict bool_var_ref = {}
 *         cdef int  selected_variability = 0 #If a variability has been selected
 *         cdef int  selected_filter = 1 if filter else 0             # <<<<<<<<<<<<<<
 *         cdef int  length_filter = 0
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_filter); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_3) {
    __pyx_t_2 = 1;
  } else {
    __pyx_t_2 = 0;
  }
  __pyx_v_selected_filter = __pyx_t_2;

  /* "pyfmi\fmi.pyx":1842
 *         cdef int  selected_variability = 0 #If a variability has been selected
 *         cdef int  selected_filter = 1 if filter else 0
 *         cdef int  length_filter = 0             # <<<<<<<<<<<<<<
 * 
 *         variable_list = FMIL.fmi1_import_get_variable_list(self._fmu)
 */
  __pyx_v_length_filter = 0;

  /* "pyfmi\fmi.pyx":1844
 *         cdef int  length_filter = 0
 * 
 *         variable_list = FMIL.fmi1_import_get_variable_list(self._fmu)             # <<<<<<<<<<<<<<
 *         variable_list_size = FMIL.fmi1_import_get_variable_list_size(variable_list)
 * 
 */
  __pyx_v_variable_list = fmi1_import_get_variable_list(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":1845
 * 
 *         variable_list = FMIL.fmi1_import_get_variable_list(self._fmu)
 *         variable_list_size = FMIL.fmi1_import_get_variable_list_size(variable_list)             # <<<<<<<<<<<<<<
 * 
 *         if selected_filter:
 */
  __pyx_v_variable_list_size = fmi1_import_get_variable_list_size(__pyx_v_variable_list);

  /* "pyfmi\fmi.pyx":1847
 *         variable_list_size = FMIL.fmi1_import_get_variable_list_size(variable_list)
 * 
 *         if selected_filter:             # <<<<<<<<<<<<<<
 *             filter_list = self._convert_filter(filter)
 *             length_filter = len(filter_list)
 */
  if (__pyx_v_selected_filter) {

    /* "pyfmi\fmi.pyx":1848
 * 
 *         if selected_filter:
 *             filter_list = self._convert_filter(filter)             # <<<<<<<<<<<<<<
 *             length_filter = len(filter_list)
 * 
 */
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___convert_filter); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_filter);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_filter);
    __Pyx_GIVEREF(__pyx_v_filter);
    __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    if (!(likely(PyList_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_t_5)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_v_filter_list));
    __pyx_v_filter_list = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "pyfmi\fmi.pyx":1849
 *         if selected_filter:
 *             filter_list = self._convert_filter(filter)
 *             length_filter = len(filter_list)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(variable_list_size):
 */
    if (unlikely(((PyObject *)__pyx_v_filter_list) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = PyList_GET_SIZE(((PyObject *)__pyx_v_filter_list)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_length_filter = __pyx_t_6;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1851
 *             length_filter = len(filter_list)
 * 
 *         for i in range(variable_list_size):             # <<<<<<<<<<<<<<
 * 
 *             variable = FMIL.fmi1_import_get_variable(variable_list, i)
 */
  __pyx_t_7 = __pyx_v_variable_list_size;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;

    /* "pyfmi\fmi.pyx":1853
 *         for i in range(variable_list_size):
 * 
 *             variable = FMIL.fmi1_import_get_variable(variable_list, i)             # <<<<<<<<<<<<<<
 * 
 *             alias_kind = FMIL.fmi1_import_get_variable_alias_kind(variable)
 */
    __pyx_v_variable = fmi1_import_get_variable(__pyx_v_variable_list, __pyx_v_i);

    /* "pyfmi\fmi.pyx":1855
 *             variable = FMIL.fmi1_import_get_variable(variable_list, i)
 * 
 *             alias_kind = FMIL.fmi1_import_get_variable_alias_kind(variable)             # <<<<<<<<<<<<<<
 *             name       = decode(FMIL.fmi1_import_get_variable_name(variable))
 *             data_variability = FMIL.fmi1_import_get_variability(variable)
 */
    __pyx_v_alias_kind = fmi1_import_get_variable_alias_kind(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":1856
 * 
 *             alias_kind = FMIL.fmi1_import_get_variable_alias_kind(variable)
 *             name       = decode(FMIL.fmi1_import_get_variable_name(variable))             # <<<<<<<<<<<<<<
 *             data_variability = FMIL.fmi1_import_get_variability(variable)
 *             data_type  = FMIL.fmi1_import_get_variable_base_type(variable)
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyBytes_FromString(fmi1_import_get_variable_name(__pyx_v_variable)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_4));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_v_name);
    __pyx_v_name = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "pyfmi\fmi.pyx":1857
 *             alias_kind = FMIL.fmi1_import_get_variable_alias_kind(variable)
 *             name       = decode(FMIL.fmi1_import_get_variable_name(variable))
 *             data_variability = FMIL.fmi1_import_get_variability(variable)             # <<<<<<<<<<<<<<
 *             data_type  = FMIL.fmi1_import_get_variable_base_type(variable)
 * 
 */
    __pyx_v_data_variability = fmi1_import_get_variability(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":1858
 *             name       = decode(FMIL.fmi1_import_get_variable_name(variable))
 *             data_variability = FMIL.fmi1_import_get_variability(variable)
 *             data_type  = FMIL.fmi1_import_get_variable_base_type(variable)             # <<<<<<<<<<<<<<
 * 
 *             if data_type != FMI_REAL and data_type != FMI_INTEGER and data_type != FMI_BOOLEAN and data_type != FMI_ENUMERATION:
 */
    __pyx_v_data_type = fmi1_import_get_variable_base_type(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":1860
 *             data_type  = FMIL.fmi1_import_get_variable_base_type(variable)
 * 
 *             if data_type != FMI_REAL and data_type != FMI_INTEGER and data_type != FMI_BOOLEAN and data_type != FMI_ENUMERATION:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    __pyx_t_4 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_REAL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_3) {
      __pyx_t_5 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_INTEGER); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_9) {
        __pyx_t_4 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_BOOLEAN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (__pyx_t_10) {
          __pyx_t_5 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_ENUMERATION); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_12 = __pyx_t_11;
        } else {
          __pyx_t_12 = __pyx_t_10;
        }
        __pyx_t_10 = __pyx_t_12;
      } else {
        __pyx_t_10 = __pyx_t_9;
      }
      __pyx_t_9 = __pyx_t_10;
    } else {
      __pyx_t_9 = __pyx_t_3;
    }
    if (__pyx_t_9) {

      /* "pyfmi\fmi.pyx":1861
 * 
 *             if data_type != FMI_REAL and data_type != FMI_INTEGER and data_type != FMI_BOOLEAN and data_type != FMI_ENUMERATION:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             if data_variability != FMI_CONTINUOUS and data_variability != FMI_DISCRETE:
 */
      goto __pyx_L4_continue;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "pyfmi\fmi.pyx":1863
 *                 continue
 * 
 *             if data_variability != FMI_CONTINUOUS and data_variability != FMI_DISCRETE:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    __pyx_t_4 = PyInt_FromLong(__pyx_v_data_variability); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_CONTINUOUS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_9) {
      __pyx_t_5 = PyInt_FromLong(__pyx_v_data_variability); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_DISCRETE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_10 = __pyx_t_3;
    } else {
      __pyx_t_10 = __pyx_t_9;
    }
    if (__pyx_t_10) {

      /* "pyfmi\fmi.pyx":1864
 * 
 *             if data_variability != FMI_CONTINUOUS and data_variability != FMI_DISCRETE:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             if selected_filter:
 */
      goto __pyx_L4_continue;
      goto __pyx_L7;
    }
    __pyx_L7:;

    /* "pyfmi\fmi.pyx":1866
 *                 continue
 * 
 *             if selected_filter:             # <<<<<<<<<<<<<<
 *                 for j in range(length_filter):
 *                     #if re.match(filter_list[j], name):
 */
    if (__pyx_v_selected_filter) {

      /* "pyfmi\fmi.pyx":1867
 * 
 *             if selected_filter:
 *                 for j in range(length_filter):             # <<<<<<<<<<<<<<
 *                     #if re.match(filter_list[j], name):
 *                     if filter_list[j].match(name):
 */
      __pyx_t_13 = __pyx_v_length_filter;
      for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
        __pyx_v_j = __pyx_t_14;

        /* "pyfmi\fmi.pyx":1869
 *                 for j in range(length_filter):
 *                     #if re.match(filter_list[j], name):
 *                     if filter_list[j].match(name):             # <<<<<<<<<<<<<<
 *                         break
 *                 else:
 */
        if (unlikely(((PyObject *)__pyx_v_filter_list) == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_4 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_filter_list), __pyx_v_j, sizeof(int), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__match); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_v_name);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_name);
        __Pyx_GIVEREF(__pyx_v_name);
        __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (__pyx_t_10) {

          /* "pyfmi\fmi.pyx":1870
 *                     #if re.match(filter_list[j], name):
 *                     if filter_list[j].match(name):
 *                         break             # <<<<<<<<<<<<<<
 *                 else:
 *                     continue
 */
          goto __pyx_L10_break;
          goto __pyx_L11;
        }
        __pyx_L11:;
      }
      /*else*/ {

        /* "pyfmi\fmi.pyx":1872
 *                         break
 *                 else:
 *                     continue             # <<<<<<<<<<<<<<
 *             else:
 *                 if alias_kind != FMIL.fmi1_variable_is_not_alias:
 */
        goto __pyx_L4_continue;
      }
      __pyx_L10_break:;
      goto __pyx_L8;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":1874
 *                     continue
 *             else:
 *                 if alias_kind != FMIL.fmi1_variable_is_not_alias:             # <<<<<<<<<<<<<<
 *                     continue
 * 
 */
      __pyx_t_10 = (__pyx_v_alias_kind != fmi1_variable_is_not_alias);
      if (__pyx_t_10) {

        /* "pyfmi\fmi.pyx":1875
 *             else:
 *                 if alias_kind != FMIL.fmi1_variable_is_not_alias:
 *                     continue             # <<<<<<<<<<<<<<
 * 
 *             if alias_kind == FMIL.fmi1_variable_is_not_alias:
 */
        goto __pyx_L4_continue;
        goto __pyx_L12;
      }
      __pyx_L12:;
    }
    __pyx_L8:;

    /* "pyfmi\fmi.pyx":1877
 *                     continue
 * 
 *             if alias_kind == FMIL.fmi1_variable_is_not_alias:             # <<<<<<<<<<<<<<
 *                 value_ref = FMIL.fmi1_import_get_variable_vr(variable)
 *             else:
 */
    __pyx_t_10 = (__pyx_v_alias_kind == fmi1_variable_is_not_alias);
    if (__pyx_t_10) {

      /* "pyfmi\fmi.pyx":1878
 * 
 *             if alias_kind == FMIL.fmi1_variable_is_not_alias:
 *                 value_ref = FMIL.fmi1_import_get_variable_vr(variable)             # <<<<<<<<<<<<<<
 *             else:
 *                 base_variable = FMIL.fmi1_import_get_variable_alias_base(self._fmu, variable)
 */
      __pyx_v_value_ref = fmi1_import_get_variable_vr(__pyx_v_variable);
      goto __pyx_L13;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":1880
 *                 value_ref = FMIL.fmi1_import_get_variable_vr(variable)
 *             else:
 *                 base_variable = FMIL.fmi1_import_get_variable_alias_base(self._fmu, variable)             # <<<<<<<<<<<<<<
 *                 value_ref  = FMIL.fmi1_import_get_variable_vr(base_variable)
 * 
 */
      __pyx_v_base_variable = fmi1_import_get_variable_alias_base(__pyx_v_self->_fmu, __pyx_v_variable);

      /* "pyfmi\fmi.pyx":1881
 *             else:
 *                 base_variable = FMIL.fmi1_import_get_variable_alias_base(self._fmu, variable)
 *                 value_ref  = FMIL.fmi1_import_get_variable_vr(base_variable)             # <<<<<<<<<<<<<<
 * 
 *             if data_type == FMI_REAL:
 */
      __pyx_v_value_ref = fmi1_import_get_variable_vr(__pyx_v_base_variable);
    }
    __pyx_L13:;

    /* "pyfmi\fmi.pyx":1883
 *                 value_ref  = FMIL.fmi1_import_get_variable_vr(base_variable)
 * 
 *             if data_type == FMI_REAL:             # <<<<<<<<<<<<<<
 *                 real_var_ref[value_ref] = 1
 *             if data_type == FMI_INTEGER or data_type == FMI_ENUMERATION:
 */
    __pyx_t_5 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_REAL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_10) {

      /* "pyfmi\fmi.pyx":1884
 * 
 *             if data_type == FMI_REAL:
 *                 real_var_ref[value_ref] = 1             # <<<<<<<<<<<<<<
 *             if data_type == FMI_INTEGER or data_type == FMI_ENUMERATION:
 *                 int_var_ref[value_ref] = 1
 */
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_real_var_ref), __pyx_v_value_ref, __pyx_int_1, sizeof(fmi1_value_reference_t)+1, __Pyx_PyInt_to_py_fmi1_value_reference_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L14;
    }
    __pyx_L14:;

    /* "pyfmi\fmi.pyx":1885
 *             if data_type == FMI_REAL:
 *                 real_var_ref[value_ref] = 1
 *             if data_type == FMI_INTEGER or data_type == FMI_ENUMERATION:             # <<<<<<<<<<<<<<
 *                 int_var_ref[value_ref] = 1
 *             if data_type == FMI_BOOLEAN:
 */
    __pyx_t_1 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_INTEGER); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (!__pyx_t_10) {
      __pyx_t_5 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_ENUMERATION); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_3 = __pyx_t_9;
    } else {
      __pyx_t_3 = __pyx_t_10;
    }
    if (__pyx_t_3) {

      /* "pyfmi\fmi.pyx":1886
 *                 real_var_ref[value_ref] = 1
 *             if data_type == FMI_INTEGER or data_type == FMI_ENUMERATION:
 *                 int_var_ref[value_ref] = 1             # <<<<<<<<<<<<<<
 *             if data_type == FMI_BOOLEAN:
 *                 bool_var_ref[value_ref] = 1
 */
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_int_var_ref), __pyx_v_value_ref, __pyx_int_1, sizeof(fmi1_value_reference_t)+1, __Pyx_PyInt_to_py_fmi1_value_reference_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L15;
    }
    __pyx_L15:;

    /* "pyfmi\fmi.pyx":1887
 *             if data_type == FMI_INTEGER or data_type == FMI_ENUMERATION:
 *                 int_var_ref[value_ref] = 1
 *             if data_type == FMI_BOOLEAN:             # <<<<<<<<<<<<<<
 *                 bool_var_ref[value_ref] = 1
 * 
 */
    __pyx_t_1 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_BOOLEAN); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_3) {

      /* "pyfmi\fmi.pyx":1888
 *                 int_var_ref[value_ref] = 1
 *             if data_type == FMI_BOOLEAN:
 *                 bool_var_ref[value_ref] = 1             # <<<<<<<<<<<<<<
 * 
 *         #Free the variable list
 */
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_bool_var_ref), __pyx_v_value_ref, __pyx_int_1, sizeof(fmi1_value_reference_t)+1, __Pyx_PyInt_to_py_fmi1_value_reference_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L16;
    }
    __pyx_L16:;
    __pyx_L4_continue:;
  }

  /* "pyfmi\fmi.pyx":1891
 * 
 *         #Free the variable list
 *         FMIL.fmi1_import_free_variable_list(variable_list)             # <<<<<<<<<<<<<<
 * 
 *         return list(real_var_ref.keys()) if python3_flag else real_var_ref.keys(), list(int_var_ref.keys()) if python3_flag else int_var_ref.keys(), list(bool_var_ref.keys()) if python3_flag else bool_var_ref.keys()
 */
  fmi1_import_free_variable_list(__pyx_v_variable_list);

  /* "pyfmi\fmi.pyx":1893
 *         FMIL.fmi1_import_free_variable_list(variable_list)
 * 
 *         return list(real_var_ref.keys()) if python3_flag else real_var_ref.keys(), list(int_var_ref.keys()) if python3_flag else int_var_ref.keys(), list(bool_var_ref.keys()) if python3_flag else bool_var_ref.keys()             # <<<<<<<<<<<<<<
 * 
 *     def get_variable_alias_base(self, variable_name):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__python3_flag); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_3) {
    __pyx_t_4 = PyDict_Keys(__pyx_v_real_var_ref); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_5 = __pyx_t_4;
    __pyx_t_4 = 0;
  } else {
    __pyx_t_4 = PyDict_Keys(__pyx_v_real_var_ref); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __pyx_t_4;
    __pyx_t_4 = 0;
  }
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__python3_flag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {
    __pyx_t_1 = PyDict_Keys(__pyx_v_int_var_ref); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
    PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
    __pyx_t_4 = __pyx_t_1;
    __pyx_t_1 = 0;
  } else {
    __pyx_t_1 = PyDict_Keys(__pyx_v_int_var_ref); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __pyx_t_1;
    __pyx_t_1 = 0;
  }
  __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s__python3_flag); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  if (__pyx_t_3) {
    __pyx_t_15 = PyDict_Keys(__pyx_v_bool_var_ref); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_16);
    PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15);
    __Pyx_GIVEREF(__pyx_t_15);
    __pyx_t_15 = 0;
    __pyx_t_15 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0;
    __pyx_t_1 = __pyx_t_15;
    __pyx_t_15 = 0;
  } else {
    __pyx_t_15 = PyDict_Keys(__pyx_v_bool_var_ref); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_1 = __pyx_t_15;
    __pyx_t_15 = 0;
  }
  __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_5 = 0;
  __pyx_t_4 = 0;
  __pyx_t_1 = 0;
  __pyx_r = ((PyObject *)__pyx_t_15);
  __pyx_t_15 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_model_time_varying_value_references", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_dict);
  __Pyx_XDECREF(__pyx_v_filter_list);
  __Pyx_XDECREF(__pyx_v_real_var_ref);
  __Pyx_XDECREF(__pyx_v_int_var_ref);
  __Pyx_XDECREF(__pyx_v_bool_var_ref);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_53get_variable_alias_base(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_52get_variable_alias_base[] = "\n        Returns the base variable for the provided variable name.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_53get_variable_alias_base(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_alias_base (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_52get_variable_alias_base(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1895
 *         return list(real_var_ref.keys()) if python3_flag else real_var_ref.keys(), list(int_var_ref.keys()) if python3_flag else int_var_ref.keys(), list(bool_var_ref.keys()) if python3_flag else bool_var_ref.keys()
 * 
 *     def get_variable_alias_base(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the base variable for the provided variable name.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_52get_variable_alias_base(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  fmi1_import_variable_t *__pyx_v_variable;
  fmi1_import_variable_t *__pyx_v_base_variable;
  char *__pyx_v_variablename;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_alias_base", 0);
  __Pyx_INCREF(__pyx_v_variable_name);

  /* "pyfmi\fmi.pyx":1903
 *         cdef FMIL.fmi1_value_reference_t vr
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __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 = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_variable_name);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_variable_name);
  __Pyx_GIVEREF(__pyx_v_variable_name);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_v_variable_name);
  __pyx_v_variable_name = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":1904
 * 
 *         variable_name = encode(variable_name)
 *         cdef char* variablename = variable_name             # <<<<<<<<<<<<<<
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 */
  __pyx_t_4 = PyBytes_AsString(__pyx_v_variable_name); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_4;

  /* "pyfmi\fmi.pyx":1906
 *         cdef char* variablename = variable_name
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)             # <<<<<<<<<<<<<<
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)
 */
  __pyx_v_variable = fmi1_import_get_variable_by_name(__pyx_v_self->_fmu, __pyx_v_variablename);

  /* "pyfmi\fmi.pyx":1907
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 */
  __pyx_t_5 = (__pyx_v_variable == NULL);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":1908
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 * 
 *         base_variable = FMIL.fmi1_import_get_variable_alias_base(self._fmu, variable)
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_81), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1910
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 *         base_variable = FMIL.fmi1_import_get_variable_alias_base(self._fmu, variable)             # <<<<<<<<<<<<<<
 *         if base_variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)
 */
  __pyx_v_base_variable = fmi1_import_get_variable_alias_base(__pyx_v_self->_fmu, __pyx_v_variable);

  /* "pyfmi\fmi.pyx":1911
 * 
 *         base_variable = FMIL.fmi1_import_get_variable_alias_base(self._fmu, variable)
 *         if base_variable == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 */
  __pyx_t_5 = (__pyx_v_base_variable == NULL);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":1912
 *         base_variable = FMIL.fmi1_import_get_variable_alias_base(self._fmu, variable)
 *         if base_variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 * 
 *         name = decode(FMIL.fmi1_import_get_variable_name(base_variable))
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_81), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":1914
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 *         name = decode(FMIL.fmi1_import_get_variable_name(base_variable))             # <<<<<<<<<<<<<<
 * 
 *         return name
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyBytes_FromString(fmi1_import_get_variable_name(__pyx_v_base_variable)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
  __pyx_t_2 = 0;
  __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 = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_v_name = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":1916
 *         name = decode(FMIL.fmi1_import_get_variable_name(base_variable))
 * 
 *         return name             # <<<<<<<<<<<<<<
 * 
 *     def get_variable_alias(self, variable_name):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_name);
  __pyx_r = __pyx_v_name;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_alias_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_55get_variable_alias(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_54get_variable_alias[] = "\n        Return a dict of all alias variables belonging to the provided variable\n        where the key are the names and the value indicating whether the variable\n        should be negated or not.\n\n        Returns::\n\n            A dict consisting of the alias variables along with no alias variable.\n            The values indicates wheter or not the variable should be negated or not.\n\n        Raises::\n\n            FMUException if the variable is not in the model.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_55get_variable_alias(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_alias (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_54get_variable_alias(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1918
 *         return name
 * 
 *     def get_variable_alias(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Return a dict of all alias variables belonging to the provided variable
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_54get_variable_alias(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  fmi1_import_variable_t *__pyx_v_variable;
  struct fmi1_import_variable_list_t *__pyx_v_alias_list;
  size_t __pyx_v_alias_list_size;
  enum fmi1_variable_alias_kind_enu_t __pyx_v_alias_kind;
  PyObject *__pyx_v_ret_values = 0;
  char *__pyx_v_variablename;
  size_t __pyx_v_i;
  PyObject *__pyx_v_alias_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  int __pyx_t_5;
  size_t __pyx_t_6;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_alias", 0);
  __Pyx_INCREF(__pyx_v_variable_name);

  /* "pyfmi\fmi.pyx":1937
 *         cdef FMIL.size_t alias_list_size
 *         cdef FMIL.fmi1_variable_alias_kind_enu_t alias_kind
 *         cdef dict ret_values = {}             # <<<<<<<<<<<<<<
 * 
 *         variable_name = encode(variable_name)
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_ret_values = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":1939
 *         cdef dict ret_values = {}
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1939; __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 = 1939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_variable_name);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_variable_name);
  __Pyx_GIVEREF(__pyx_v_variable_name);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_v_variable_name);
  __pyx_v_variable_name = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":1940
 * 
 *         variable_name = encode(variable_name)
 *         cdef char* variablename = variable_name             # <<<<<<<<<<<<<<
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 */
  __pyx_t_4 = PyBytes_AsString(__pyx_v_variable_name); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_4;

  /* "pyfmi\fmi.pyx":1942
 *         cdef char* variablename = variable_name
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)             # <<<<<<<<<<<<<<
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)
 */
  __pyx_v_variable = fmi1_import_get_variable_by_name(__pyx_v_self->_fmu, __pyx_v_variablename);

  /* "pyfmi\fmi.pyx":1943
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 */
  __pyx_t_5 = (__pyx_v_variable == NULL);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":1944
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 * 
 *         alias_list = FMIL.fmi1_import_get_variable_aliases(self._fmu, variable)
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_81), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1946
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 *         alias_list = FMIL.fmi1_import_get_variable_aliases(self._fmu, variable)             # <<<<<<<<<<<<<<
 * 
 *         alias_list_size = FMIL.fmi1_import_get_variable_list_size(alias_list)
 */
  __pyx_v_alias_list = fmi1_import_get_variable_aliases(__pyx_v_self->_fmu, __pyx_v_variable);

  /* "pyfmi\fmi.pyx":1948
 *         alias_list = FMIL.fmi1_import_get_variable_aliases(self._fmu, variable)
 * 
 *         alias_list_size = FMIL.fmi1_import_get_variable_list_size(alias_list)             # <<<<<<<<<<<<<<
 * 
 *         #Loop over all the alias variables
 */
  __pyx_v_alias_list_size = fmi1_import_get_variable_list_size(__pyx_v_alias_list);

  /* "pyfmi\fmi.pyx":1951
 * 
 *         #Loop over all the alias variables
 *         for i in range(alias_list_size):             # <<<<<<<<<<<<<<
 * 
 *             variable = FMIL.fmi1_import_get_variable(alias_list, i)
 */
  __pyx_t_6 = __pyx_v_alias_list_size;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "pyfmi\fmi.pyx":1953
 *         for i in range(alias_list_size):
 * 
 *             variable = FMIL.fmi1_import_get_variable(alias_list, i)             # <<<<<<<<<<<<<<
 * 
 *             alias_kind = FMIL.fmi1_import_get_variable_alias_kind(variable)
 */
    __pyx_v_variable = fmi1_import_get_variable(__pyx_v_alias_list, __pyx_v_i);

    /* "pyfmi\fmi.pyx":1955
 *             variable = FMIL.fmi1_import_get_variable(alias_list, i)
 * 
 *             alias_kind = FMIL.fmi1_import_get_variable_alias_kind(variable)             # <<<<<<<<<<<<<<
 *             alias_name = decode(FMIL.fmi1_import_get_variable_name(variable))
 * 
 */
    __pyx_v_alias_kind = fmi1_import_get_variable_alias_kind(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":1956
 * 
 *             alias_kind = FMIL.fmi1_import_get_variable_alias_kind(variable)
 *             alias_name = decode(FMIL.fmi1_import_get_variable_name(variable))             # <<<<<<<<<<<<<<
 * 
 *             ret_values[alias_name] = alias_kind
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyBytes_FromString(fmi1_import_get_variable_name(__pyx_v_variable)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_v_alias_name);
    __pyx_v_alias_name = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyfmi\fmi.pyx":1958
 *             alias_name = decode(FMIL.fmi1_import_get_variable_name(variable))
 * 
 *             ret_values[alias_name] = alias_kind             # <<<<<<<<<<<<<<
 * 
 *         #FREE VARIABLE LIST
 */
    __pyx_t_2 = PyInt_FromLong(__pyx_v_alias_kind); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(((PyObject *)__pyx_v_ret_values), __pyx_v_alias_name, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "pyfmi\fmi.pyx":1961
 * 
 *         #FREE VARIABLE LIST
 *         FMIL.fmi1_import_free_variable_list(alias_list)             # <<<<<<<<<<<<<<
 * 
 *         return ret_values
 */
  fmi1_import_free_variable_list(__pyx_v_alias_list);

  /* "pyfmi\fmi.pyx":1963
 *         FMIL.fmi1_import_free_variable_list(alias_list)
 * 
 *         return ret_values             # <<<<<<<<<<<<<<
 * 
 *     cpdef FMIL.fmi1_variability_enu_t get_variable_variability(self, variable_name) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ret_values));
  __pyx_r = ((PyObject *)__pyx_v_ret_values);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_alias", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret_values);
  __Pyx_XDECREF(__pyx_v_alias_name);
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1965
 *         return ret_values
 * 
 *     cpdef FMIL.fmi1_variability_enu_t get_variable_variability(self, variable_name) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Get variability of variable.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_57get_variable_variability(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static enum fmi1_variability_enu_t __pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_variability(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch) {
  fmi1_import_variable_t *__pyx_v_variable;
  enum fmi1_variability_enu_t __pyx_v_variability;
  char *__pyx_v_variablename;
  enum fmi1_variability_enu_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  enum fmi1_variability_enu_t __pyx_t_4;
  char *__pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_variability", 0);
  __Pyx_INCREF(__pyx_v_variable_name);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_103); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_57get_variable_variability)) {
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_variable_name);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_variable_name);
      __Pyx_GIVEREF(__pyx_v_variable_name);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_t_4 = ((enum fmi1_variability_enu_t)PyInt_AsLong(__pyx_t_3)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":1983
 *         cdef FMIL.fmi1_variability_enu_t variability
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_variable_name);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_variable_name);
  __Pyx_GIVEREF(__pyx_v_variable_name);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_v_variable_name);
  __pyx_v_variable_name = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":1984
 * 
 *         variable_name = encode(variable_name)
 *         cdef char* variablename = variable_name             # <<<<<<<<<<<<<<
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 */
  __pyx_t_5 = PyBytes_AsString(__pyx_v_variable_name); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_5;

  /* "pyfmi\fmi.pyx":1986
 *         cdef char* variablename = variable_name
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)             # <<<<<<<<<<<<<<
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)
 */
  __pyx_v_variable = fmi1_import_get_variable_by_name(__pyx_v_self->_fmu, __pyx_v_variablename);

  /* "pyfmi\fmi.pyx":1987
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The variable %s could not be found."%variablename)
 *         variability = FMIL.fmi1_import_get_variability(variable)
 */
  __pyx_t_6 = (__pyx_v_variable == NULL);
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":1988
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 *         variability = FMIL.fmi1_import_get_variability(variable)
 * 
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_81), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
    __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 = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":1989
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)
 *         variability = FMIL.fmi1_import_get_variability(variable)             # <<<<<<<<<<<<<<
 * 
 *         return variability
 */
  __pyx_v_variability = fmi1_import_get_variability(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":1991
 *         variability = FMIL.fmi1_import_get_variability(variable)
 * 
 *         return variability             # <<<<<<<<<<<<<<
 * 
 *     def get_variable_by_valueref(self, FMIL.fmi1_value_reference_t valueref, type=0):
 */
  __pyx_r = __pyx_v_variability;
  goto __pyx_L0;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_variability", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_57get_variable_variability(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_56get_variable_variability[] = "\n        Get variability of variable.\n\n        Parameters::\n\n            variablename --\n\n                The name of the variable.\n\n        Returns::\n\n            The variability of the variable, CONTINUOUS(3), CONSTANT(0),\n            PARAMETER(1) or DISCRETE(2)\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_57get_variable_variability(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_variability (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_56get_variable_variability(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1965
 *         return ret_values
 * 
 *     cpdef FMIL.fmi1_variability_enu_t get_variable_variability(self, variable_name) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Get variability of variable.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_56get_variable_variability(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  enum fmi1_variability_enu_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_variability", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_variable_variability(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_variability", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_59get_variable_by_valueref(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_58get_variable_by_valueref[] = "\n        Get the name of a variable given a value reference. Note that it\n        returns the no-aliased variable.\n\n        Parameters::\n\n            valueref --\n                The value reference of the variable\n\n            type --\n                The type of the variables (Real==0, Int==1, Bool=2,\n                String==3, Enumeration==4). Default 0 (i.e Real).\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_59get_variable_by_valueref(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  fmi1_value_reference_t __pyx_v_valueref;
  PyObject *__pyx_v_type = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_by_valueref (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__valueref,&__pyx_n_s__type,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_int_0);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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__valueref)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__type);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_variable_by_valueref") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_valueref = __Pyx_PyInt_from_py_fmi1_value_reference_t(values[0]); if (unlikely((__pyx_v_valueref == (fmi1_value_reference_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_type = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_variable_by_valueref", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_by_valueref", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_58get_variable_by_valueref(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_v_valueref, __pyx_v_type);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":1993
 *         return variability
 * 
 *     def get_variable_by_valueref(self, FMIL.fmi1_value_reference_t valueref, type=0):             # <<<<<<<<<<<<<<
 *         """
 *         Get the name of a variable given a value reference. Note that it
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_58get_variable_by_valueref(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, fmi1_value_reference_t __pyx_v_valueref, PyObject *__pyx_v_type) {
  fmi1_import_variable_t *__pyx_v_variable;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  enum fmi1_base_type_enu_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_by_valueref", 0);

  /* "pyfmi\fmi.pyx":2009
 *         cdef FMIL.fmi1_import_variable_t* variable
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_vr(self._fmu, type, valueref)             # <<<<<<<<<<<<<<
 *         if variable==NULL:
 *             raise FMUException("The variable with the valuref %i could not be found."%valueref)
 */
  __pyx_t_1 = ((enum fmi1_base_type_enu_t)PyInt_AsLong(__pyx_v_type)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variable = fmi1_import_get_variable_by_vr(__pyx_v_self->_fmu, __pyx_t_1, __pyx_v_valueref);

  /* "pyfmi\fmi.pyx":2010
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_vr(self._fmu, type, valueref)
 *         if variable==NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The variable with the valuref %i could not be found."%valueref)
 * 
 */
  __pyx_t_2 = (__pyx_v_variable == NULL);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":2011
 *         variable = FMIL.fmi1_import_get_variable_by_vr(self._fmu, type, valueref)
 *         if variable==NULL:
 *             raise FMUException("The variable with the valuref %i could not be found."%valueref)             # <<<<<<<<<<<<<<
 * 
 *         name = decode(FMIL.fmi1_import_get_variable_name(variable))
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyInt_to_py_fmi1_value_reference_t(__pyx_v_valueref); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_104), __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_5));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2013
 *             raise FMUException("The variable with the valuref %i could not be found."%valueref)
 * 
 *         name = decode(FMIL.fmi1_import_get_variable_name(variable))             # <<<<<<<<<<<<<<
 * 
 *         return name
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyBytes_FromString(fmi1_import_get_variable_name(__pyx_v_variable)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_v_name = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":2015
 *         name = decode(FMIL.fmi1_import_get_variable_name(variable))
 * 
 *         return name             # <<<<<<<<<<<<<<
 * 
 *     cpdef FMIL.fmi1_causality_enu_t get_variable_causality(self, variable_name) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_name);
  __pyx_r = __pyx_v_name;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_by_valueref", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2017
 *         return name
 * 
 *     cpdef FMIL.fmi1_causality_enu_t get_variable_causality(self, variable_name) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Get the causality of the variable.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_61get_variable_causality(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static enum fmi1_causality_enu_t __pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_causality(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch) {
  fmi1_import_variable_t *__pyx_v_variable;
  enum fmi1_causality_enu_t __pyx_v_causality;
  char *__pyx_v_variablename;
  enum fmi1_causality_enu_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  enum fmi1_causality_enu_t __pyx_t_4;
  char *__pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_causality", 0);
  __Pyx_INCREF(__pyx_v_variable_name);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_105); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_61get_variable_causality)) {
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_variable_name);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_variable_name);
      __Pyx_GIVEREF(__pyx_v_variable_name);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_t_4 = ((enum fmi1_causality_enu_t)PyInt_AsLong(__pyx_t_3)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":2034
 *         cdef FMIL.fmi1_causality_enu_t causality
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_variable_name);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_variable_name);
  __Pyx_GIVEREF(__pyx_v_variable_name);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_v_variable_name);
  __pyx_v_variable_name = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":2035
 * 
 *         variable_name = encode(variable_name)
 *         cdef char* variablename = variable_name             # <<<<<<<<<<<<<<
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 */
  __pyx_t_5 = PyBytes_AsString(__pyx_v_variable_name); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_5;

  /* "pyfmi\fmi.pyx":2037
 *         cdef char* variablename = variable_name
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)             # <<<<<<<<<<<<<<
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)
 */
  __pyx_v_variable = fmi1_import_get_variable_by_name(__pyx_v_self->_fmu, __pyx_v_variablename);

  /* "pyfmi\fmi.pyx":2038
 * 
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 */
  __pyx_t_6 = (__pyx_v_variable == NULL);
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":2039
 *         variable = FMIL.fmi1_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 * 
 *         causality = FMIL.fmi1_import_get_causality(variable)
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_81), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
    __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 = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2041
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 *         causality = FMIL.fmi1_import_get_causality(variable)             # <<<<<<<<<<<<<<
 * 
 *         return causality
 */
  __pyx_v_causality = fmi1_import_get_causality(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":2043
 *         causality = FMIL.fmi1_import_get_causality(variable)
 * 
 *         return causality             # <<<<<<<<<<<<<<
 * 
 *     def get_name(self):
 */
  __pyx_r = __pyx_v_causality;
  goto __pyx_L0;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_causality", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_61get_variable_causality(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_60get_variable_causality[] = "\n        Get the causality of the variable.\n\n        Parameters::\n\n            variable_name --\n                The name of the variable.\n\n        Returns::\n\n            The variability of the variable, INPUT(0), OUTPUT(1),\n            INTERNAL(2), NONE(3)\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_61get_variable_causality(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_causality (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_60get_variable_causality(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2017
 *         return name
 * 
 *     cpdef FMIL.fmi1_causality_enu_t get_variable_causality(self, variable_name) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Get the causality of the variable.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_60get_variable_causality(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  enum fmi1_causality_enu_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_causality", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_variable_causality(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_variable_causality", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_63get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_62get_name[] = "\n        Return the model name as used in the modeling environment.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_63get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_name (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_62get_name(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2045
 *         return causality
 * 
 *     def get_name(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the model name as used in the modeling environment.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_62get_name(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_name", 0);

  /* "pyfmi\fmi.pyx":2049
 *         Return the model name as used in the modeling environment.
 *         """
 *         return self._modelname             # <<<<<<<<<<<<<<
 * 
 *     def get_identifier(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_modelname);
  __pyx_r = __pyx_v_self->_modelname;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_65get_identifier(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_64get_identifier[] = "\n        Return the model identifier, name of binary model file and prefix in\n        the C-function names of the model.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_65get_identifier(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_identifier (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_64get_identifier(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2051
 *         return self._modelname
 * 
 *     def get_identifier(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the model identifier, name of binary model file and prefix in
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_64get_identifier(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_identifier", 0);

  /* "pyfmi\fmi.pyx":2056
 *         the C-function names of the model.
 *         """
 *         return self._modelid             # <<<<<<<<<<<<<<
 * 
 *     def get_author(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_modelid);
  __pyx_r = __pyx_v_self->_modelid;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_67get_author(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_66get_author[] = "\n        Return the name and organization of the model author.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_67get_author(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_author (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_66get_author(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2058
 *         return self._modelid
 * 
 *     def get_author(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the name and organization of the model author.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_66get_author(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  char *__pyx_v_author;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_author", 0);

  /* "pyfmi\fmi.pyx":2063
 *         """
 *         cdef char* author
 *         author = FMIL.fmi1_import_get_author(self._fmu)             # <<<<<<<<<<<<<<
 *         return author if author != NULL else ""
 * 
 */
  __pyx_v_author = fmi1_import_get_author(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":2064
 *         cdef char* author
 *         author = FMIL.fmi1_import_get_author(self._fmu)
 *         return author if author != NULL else ""             # <<<<<<<<<<<<<<
 * 
 *     def get_default_experiment_start_time(self):
 */
  __Pyx_XDECREF(__pyx_r);
  if ((__pyx_v_author != NULL)) {
    __pyx_t_2 = PyBytes_FromString(__pyx_v_author); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_1 = ((PyObject *)__pyx_t_2);
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_12));
    __pyx_t_1 = ((PyObject *)__pyx_kp_s_12);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_author", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_69get_default_experiment_start_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_68get_default_experiment_start_time[] = "\n        Returns the default experiment start time as defined the XML\n        description.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_69get_default_experiment_start_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_default_experiment_start_time (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_68get_default_experiment_start_time(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2066
 *         return author if author != NULL else ""
 * 
 *     def get_default_experiment_start_time(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the default experiment start time as defined the XML
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_68get_default_experiment_start_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__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("get_default_experiment_start_time", 0);

  /* "pyfmi\fmi.pyx":2071
 *         description.
 *         """
 *         return FMIL.fmi1_import_get_default_experiment_start(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *     def get_default_experiment_stop_time(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(fmi1_import_get_default_experiment_start(__pyx_v_self->_fmu)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_default_experiment_start_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_71get_default_experiment_stop_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_70get_default_experiment_stop_time[] = "\n        Returns the default experiment stop time as defined the XML\n        description.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_71get_default_experiment_stop_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_default_experiment_stop_time (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_70get_default_experiment_stop_time(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2073
 *         return FMIL.fmi1_import_get_default_experiment_start(self._fmu)
 * 
 *     def get_default_experiment_stop_time(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the default experiment stop time as defined the XML
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_70get_default_experiment_stop_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__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("get_default_experiment_stop_time", 0);

  /* "pyfmi\fmi.pyx":2078
 *         description.
 *         """
 *         return FMIL.fmi1_import_get_default_experiment_stop(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *     def get_default_experiment_tolerance(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(fmi1_import_get_default_experiment_stop(__pyx_v_self->_fmu)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_default_experiment_stop_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_73get_default_experiment_tolerance(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_72get_default_experiment_tolerance[] = "\n        Returns the default experiment tolerance as defined in the XML\n        description.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_73get_default_experiment_tolerance(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_default_experiment_tolerance (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_72get_default_experiment_tolerance(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2080
 *         return FMIL.fmi1_import_get_default_experiment_stop(self._fmu)
 * 
 *     def get_default_experiment_tolerance(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the default experiment tolerance as defined in the XML
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_72get_default_experiment_tolerance(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__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("get_default_experiment_tolerance", 0);

  /* "pyfmi\fmi.pyx":2085
 *         description.
 *         """
 *         return FMIL.fmi1_import_get_default_experiment_tolerance(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *     def get_description(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(fmi1_import_get_default_experiment_tolerance(__pyx_v_self->_fmu)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_default_experiment_tolerance", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_75get_description(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_74get_description[] = "\n        Return the model description.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_75get_description(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_description (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_74get_description(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2087
 *         return FMIL.fmi1_import_get_default_experiment_tolerance(self._fmu)
 * 
 *     def get_description(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the model description.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_74get_description(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  char *__pyx_v_desc;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_description", 0);

  /* "pyfmi\fmi.pyx":2092
 *         """
 *         cdef char* desc
 *         desc = FMIL.fmi1_import_get_description(self._fmu)             # <<<<<<<<<<<<<<
 *         return desc if desc != NULL else ""
 * 
 */
  __pyx_v_desc = fmi1_import_get_description(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":2093
 *         cdef char* desc
 *         desc = FMIL.fmi1_import_get_description(self._fmu)
 *         return desc if desc != NULL else ""             # <<<<<<<<<<<<<<
 * 
 *     def get_generation_tool(self):
 */
  __Pyx_XDECREF(__pyx_r);
  if ((__pyx_v_desc != NULL)) {
    __pyx_t_2 = PyBytes_FromString(__pyx_v_desc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_1 = ((PyObject *)__pyx_t_2);
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_12));
    __pyx_t_1 = ((PyObject *)__pyx_kp_s_12);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_description", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_77get_generation_tool(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_76get_generation_tool[] = "\n        Return the model generation tool.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_77get_generation_tool(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_generation_tool (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_76get_generation_tool(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2095
 *         return desc if desc != NULL else ""
 * 
 *     def get_generation_tool(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the model generation tool.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_76get_generation_tool(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  char *__pyx_v_gen;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_generation_tool", 0);

  /* "pyfmi\fmi.pyx":2100
 *         """
 *         cdef char* gen
 *         gen = FMIL.fmi1_import_get_generation_tool(self._fmu)             # <<<<<<<<<<<<<<
 *         return gen if gen != NULL else ""
 * 
 */
  __pyx_v_gen = fmi1_import_get_generation_tool(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":2101
 *         cdef char* gen
 *         gen = FMIL.fmi1_import_get_generation_tool(self._fmu)
 *         return gen if gen != NULL else ""             # <<<<<<<<<<<<<<
 * 
 *     def get_guid(self):
 */
  __Pyx_XDECREF(__pyx_r);
  if ((__pyx_v_gen != NULL)) {
    __pyx_t_2 = PyBytes_FromString(__pyx_v_gen); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_1 = ((PyObject *)__pyx_t_2);
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_12));
    __pyx_t_1 = ((PyObject *)__pyx_kp_s_12);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_generation_tool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_79get_guid(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12FMUModelBase_78get_guid[] = "\n        Return the model GUID.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_79get_guid(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_guid (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_78get_guid(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2103
 *         return gen if gen != NULL else ""
 * 
 *     def get_guid(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the model GUID.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_78get_guid(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  PyObject *__pyx_v_guid = NULL;
  PyObject *__pyx_r = NULL;
  __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("get_guid", 0);

  /* "pyfmi\fmi.pyx":2107
 *         Return the model GUID.
 *         """
 *         guid = decode(FMIL.fmi1_import_get_GUID(self._fmu))             # <<<<<<<<<<<<<<
 *         return guid
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyBytes_FromString(fmi1_import_get_GUID(__pyx_v_self->_fmu)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_v_guid = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":2108
 *         """
 *         guid = decode(FMIL.fmi1_import_get_GUID(self._fmu))
 *         return guid             # <<<<<<<<<<<<<<
 * 
 * cdef class FMUModelCS1(FMUModelBase):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_guid);
  __pyx_r = __pyx_v_guid;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase.get_guid", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_guid);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_3__t_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_3__t_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_3__t___get__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pxd":90
 * 
 *     #Internal values
 *     cdef public object __t             # <<<<<<<<<<<<<<
 *     cdef public object _file_open
 *     cdef public object _npoints
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_3__t___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->__t);
  __pyx_r = __pyx_v_self->__t;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_3__t_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_3__t_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_3__t_2__set__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_3__t_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->__t);
  __Pyx_DECREF(__pyx_v_self->__t);
  __pyx_v_self->__t = __pyx_v_value;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_3__t_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_3__t_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_3__t_4__del__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_3__t_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->__t);
  __Pyx_DECREF(__pyx_v_self->__t);
  __pyx_v_self->__t = Py_None;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_10_file_open_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_10_file_open_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_10_file_open___get__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pxd":91
 *     #Internal values
 *     cdef public object __t
 *     cdef public object _file_open             # <<<<<<<<<<<<<<
 *     cdef public object _npoints
 *     cdef public object _enable_logging
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_10_file_open___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_file_open);
  __pyx_r = __pyx_v_self->_file_open;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_10_file_open_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_10_file_open_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_10_file_open_2__set__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_10_file_open_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->_file_open);
  __Pyx_DECREF(__pyx_v_self->_file_open);
  __pyx_v_self->_file_open = __pyx_v_value;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_10_file_open_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_10_file_open_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_10_file_open_4__del__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_10_file_open_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_file_open);
  __Pyx_DECREF(__pyx_v_self->_file_open);
  __pyx_v_self->_file_open = Py_None;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_8_npoints_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_8_npoints_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_8_npoints___get__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pxd":92
 *     cdef public object __t
 *     cdef public object _file_open
 *     cdef public object _npoints             # <<<<<<<<<<<<<<
 *     cdef public object _enable_logging
 *     cdef public object _pyEventInfo
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_8_npoints___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_npoints);
  __pyx_r = __pyx_v_self->_npoints;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_8_npoints_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_8_npoints_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_8_npoints_2__set__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_8_npoints_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->_npoints);
  __Pyx_DECREF(__pyx_v_self->_npoints);
  __pyx_v_self->_npoints = __pyx_v_value;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_8_npoints_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_8_npoints_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_8_npoints_4__del__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_8_npoints_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_npoints);
  __Pyx_DECREF(__pyx_v_self->_npoints);
  __pyx_v_self->_npoints = Py_None;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_15_enable_logging_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_15_enable_logging_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_15_enable_logging___get__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pxd":93
 *     cdef public object _file_open
 *     cdef public object _npoints
 *     cdef public object _enable_logging             # <<<<<<<<<<<<<<
 *     cdef public object _pyEventInfo
 *     cdef int _version
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_15_enable_logging___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_enable_logging);
  __pyx_r = __pyx_v_self->_enable_logging;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_15_enable_logging_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_15_enable_logging_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_15_enable_logging_2__set__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_15_enable_logging_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->_enable_logging);
  __Pyx_DECREF(__pyx_v_self->_enable_logging);
  __pyx_v_self->_enable_logging = __pyx_v_value;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_15_enable_logging_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_15_enable_logging_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_15_enable_logging_4__del__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_15_enable_logging_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_enable_logging);
  __Pyx_DECREF(__pyx_v_self->_enable_logging);
  __pyx_v_self->_enable_logging = Py_None;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo___get__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pxd":94
 *     cdef public object _npoints
 *     cdef public object _enable_logging
 *     cdef public object _pyEventInfo             # <<<<<<<<<<<<<<
 *     cdef int _version
 *     cdef int _instantiated_fmu
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_pyEventInfo);
  __pyx_r = __pyx_v_self->_pyEventInfo;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo_2__set__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->_pyEventInfo);
  __Pyx_DECREF(__pyx_v_self->_pyEventInfo);
  __pyx_v_self->_pyEventInfo = __pyx_v_value;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo_4__del__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_pyEventInfo);
  __Pyx_DECREF(__pyx_v_self->_pyEventInfo);
  __pyx_v_self->_pyEventInfo = Py_None;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val___get__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pxd":103
 *     cdef unsigned int _nEventIndicators
 *     cdef unsigned int _nContinuousStates
 *     cdef public list _save_real_variables_val             # <<<<<<<<<<<<<<
 *     cdef public list _save_int_variables_val
 *     cdef public list _save_bool_variables_val
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->_save_real_variables_val));
  __pyx_r = ((PyObject *)__pyx_v_self->_save_real_variables_val);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val_2__set__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->_save_real_variables_val);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_save_real_variables_val));
  __pyx_v_self->_save_real_variables_val = ((PyObject*)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase._save_real_variables_val.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val_4__del__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_save_real_variables_val);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_save_real_variables_val));
  __pyx_v_self->_save_real_variables_val = ((PyObject*)Py_None);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val___get__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pxd":104
 *     cdef unsigned int _nContinuousStates
 *     cdef public list _save_real_variables_val
 *     cdef public list _save_int_variables_val             # <<<<<<<<<<<<<<
 *     cdef public list _save_bool_variables_val
 *     cdef int _fmu_kind
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->_save_int_variables_val));
  __pyx_r = ((PyObject *)__pyx_v_self->_save_int_variables_val);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val_2__set__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->_save_int_variables_val);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_save_int_variables_val));
  __pyx_v_self->_save_int_variables_val = ((PyObject*)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase._save_int_variables_val.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val_4__del__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_save_int_variables_val);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_save_int_variables_val));
  __pyx_v_self->_save_int_variables_val = ((PyObject*)Py_None);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val___get__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pxd":105
 *     cdef public list _save_real_variables_val
 *     cdef public list _save_int_variables_val
 *     cdef public list _save_bool_variables_val             # <<<<<<<<<<<<<<
 *     cdef int _fmu_kind
 *     cdef char* _fmu_temp_dir
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->_save_bool_variables_val));
  __pyx_r = ((PyObject *)__pyx_v_self->_save_bool_variables_val);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val_2__set__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->_save_bool_variables_val);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_save_bool_variables_val));
  __pyx_v_self->_save_bool_variables_val = ((PyObject*)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase._save_bool_variables_val.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val_4__del__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_save_bool_variables_val);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_save_bool_variables_val));
  __pyx_v_self->_save_bool_variables_val = ((PyObject*)Py_None);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_11FMUModelCS1_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_11FMUModelCS1_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fmu = 0;
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_enable_logging = 0;
  PyObject *__pyx_v_log_file_name = 0;
  PyObject *__pyx_v_log_level = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fmu,&__pyx_n_s__path,&__pyx_n_s__enable_logging,&__pyx_n_s__log_file_name,&__pyx_n_s__log_level,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_kp_s_30);

    /* "pyfmi\fmi.pyx":2114
 *     #stepFinished not supported
 * 
 *     def __init__(self, fmu, path='.', enable_logging=None, log_file_name="", log_level=FMI_DEFAULT_LOG_LEVEL):             # <<<<<<<<<<<<<<
 *         #Call super
 *         FMUModelBase.__init__(self,fmu,path,enable_logging,log_file_name, log_level)
 */
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)__pyx_kp_s_12);
    values[4] = __pyx_k_106;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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__fmu)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__enable_logging);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__log_file_name);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__log_level);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      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 = 2114; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_fmu = values[0];
    __pyx_v_path = values[1];
    __pyx_v_enable_logging = values[2];
    __pyx_v_log_file_name = values[3];
    __pyx_v_log_level = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS1___init__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self), __pyx_v_fmu, __pyx_v_path, __pyx_v_enable_logging, __pyx_v_log_file_name, __pyx_v_log_level);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_11FMUModelCS1___init__(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_fmu, PyObject *__pyx_v_path, PyObject *__pyx_v_enable_logging, PyObject *__pyx_v_log_file_name, PyObject *__pyx_v_log_level) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyfmi\fmi.pyx":2116
 *     def __init__(self, fmu, path='.', enable_logging=None, log_file_name="", log_level=FMI_DEFAULT_LOG_LEVEL):
 *         #Call super
 *         FMUModelBase.__init__(self,fmu,path,enable_logging,log_file_name, log_level)             # <<<<<<<<<<<<<<
 * 
 *         if self._fmu_kind != FMI_CS_STANDALONE:
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelBase)), __pyx_n_s____init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __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_fmu);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_fmu);
  __Pyx_GIVEREF(__pyx_v_fmu);
  __Pyx_INCREF(__pyx_v_path);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  __Pyx_INCREF(__pyx_v_enable_logging);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_enable_logging);
  __Pyx_GIVEREF(__pyx_v_enable_logging);
  __Pyx_INCREF(__pyx_v_log_file_name);
  PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_log_file_name);
  __Pyx_GIVEREF(__pyx_v_log_file_name);
  __Pyx_INCREF(__pyx_v_log_level);
  PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_v_log_level);
  __Pyx_GIVEREF(__pyx_v_log_level);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":2118
 *         FMUModelBase.__init__(self,fmu,path,enable_logging,log_file_name, log_level)
 * 
 *         if self._fmu_kind != FMI_CS_STANDALONE:             # <<<<<<<<<<<<<<
 *             raise FMUException("This class only supports FMI 1.0 for Co-simulation.")
 * 
 */
  __pyx_t_3 = PyInt_FromLong(__pyx_v_self->__pyx_base._fmu_kind); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_CS_STANDALONE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":2119
 * 
 *         if self._fmu_kind != FMI_CS_STANDALONE:
 *             raise FMUException("This class only supports FMI 1.0 for Co-simulation.")             # <<<<<<<<<<<<<<
 * 
 *         self.instantiate_slave(logging = self._enable_logging)
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_108), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2121
 *             raise FMUException("This class only supports FMI 1.0 for Co-simulation.")
 * 
 *         self.instantiate_slave(logging = self._enable_logging)             # <<<<<<<<<<<<<<
 * 
 *     cpdef _get_time(self):
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__instantiate_slave); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__logging), __pyx_v_self->__pyx_base._enable_logging) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2121; __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 = 2121; __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;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2123
 *         self.instantiate_slave(logging = self._enable_logging)
 * 
 *     cpdef _get_time(self):             # <<<<<<<<<<<<<<
 *         return self.__t
 * 
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_3_get_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_11FMUModelCS1__get_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_time", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___get_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_3_get_time)) {
      __Pyx_XDECREF(__pyx_r);
      __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 = 2123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":2124
 * 
 *     cpdef _get_time(self):
 *         return self.__t             # <<<<<<<<<<<<<<
 * 
 *     cpdef _set_time(self, FMIL.fmi1_real_t t):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.__t);
  __pyx_r = __pyx_v_self->__pyx_base.__t;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1._get_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_3_get_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_3_get_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_time (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_2_get_time(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2123
 *         self.instantiate_slave(logging = self._enable_logging)
 * 
 *     cpdef _get_time(self):             # <<<<<<<<<<<<<<
 *         return self.__t
 * 
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_2_get_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__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("_get_time", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_get_time(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1._get_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2126
 *         return self.__t
 * 
 *     cpdef _set_time(self, FMIL.fmi1_real_t t):             # <<<<<<<<<<<<<<
 *         self.__t = t
 * 
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_5_set_time(PyObject *__pyx_v_self, PyObject *__pyx_arg_t); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_11FMUModelCS1__set_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, fmi1_real_t __pyx_v_t, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __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("_set_time", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___set_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_5_set_time)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":2127
 * 
 *     cpdef _set_time(self, FMIL.fmi1_real_t t):
 *         self.__t = t             # <<<<<<<<<<<<<<
 * 
 *     time = property(_get_time,_set_time, doc =
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.__t);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.__t);
  __pyx_v_self->__pyx_base.__t = __pyx_t_1;
  __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1._set_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_5_set_time(PyObject *__pyx_v_self, PyObject *__pyx_arg_t); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_5_set_time(PyObject *__pyx_v_self, PyObject *__pyx_arg_t) {
  fmi1_real_t __pyx_v_t;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set_time (wrapper)", 0);
  assert(__pyx_arg_t); {
    __pyx_v_t = __pyx_PyFloat_AsDouble(__pyx_arg_t); if (unlikely((__pyx_v_t == (fmi1_real_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1._set_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_4_set_time(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self), ((fmi1_real_t)__pyx_v_t));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2126
 *         return self.__t
 * 
 *     cpdef _set_time(self, FMIL.fmi1_real_t t):             # <<<<<<<<<<<<<<
 *         self.__t = t
 * 
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_4_set_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, fmi1_real_t __pyx_v_t) {
  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("_set_time", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_set_time(__pyx_v_self, __pyx_v_t, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1._set_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static void __pyx_pw_5pyfmi_3fmi_11FMUModelCS1_7__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_5pyfmi_3fmi_11FMUModelCS1_7__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_6__dealloc__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
}

/* "pyfmi\fmi.pyx":2135
 *     """)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Deallocate memory allocated
 */

static void __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_6__dealloc__(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pyfmi\fmi.pyx":2139
 *         Deallocate memory allocated
 *         """
 *         if self._allocated_fmu == 1:             # <<<<<<<<<<<<<<
 *             FMIL.fmi1_import_terminate_slave(self._fmu)
 * 
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base._allocated_fmu == 1);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2140
 *         """
 *         if self._allocated_fmu == 1:
 *             FMIL.fmi1_import_terminate_slave(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if self._instantiated_fmu == 1:
 */
    fmi1_import_terminate_slave(__pyx_v_self->__pyx_base._fmu);
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2142
 *             FMIL.fmi1_import_terminate_slave(self._fmu)
 * 
 *         if self._instantiated_fmu == 1:             # <<<<<<<<<<<<<<
 *             FMIL.fmi1_import_free_slave_instance(self._fmu)
 * 
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base._instantiated_fmu == 1);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2143
 * 
 *         if self._instantiated_fmu == 1:
 *             FMIL.fmi1_import_free_slave_instance(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if self._allocated_dll == 1:
 */
    fmi1_import_free_slave_instance(__pyx_v_self->__pyx_base._fmu);
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":2145
 *             FMIL.fmi1_import_free_slave_instance(self._fmu)
 * 
 *         if self._allocated_dll == 1:             # <<<<<<<<<<<<<<
 *             FMIL.fmi1_import_destroy_dllfmu(self._fmu)
 * 
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base._allocated_dll == 1);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2146
 * 
 *         if self._allocated_dll == 1:
 *             FMIL.fmi1_import_destroy_dllfmu(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if self._allocated_xml == 1:
 */
    fmi1_import_destroy_dllfmu(__pyx_v_self->__pyx_base._fmu);
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":2148
 *             FMIL.fmi1_import_destroy_dllfmu(self._fmu)
 * 
 *         if self._allocated_xml == 1:             # <<<<<<<<<<<<<<
 *             FMIL.fmi1_import_free(self._fmu)
 * 
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base._allocated_xml == 1);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2149
 * 
 *         if self._allocated_xml == 1:
 *             FMIL.fmi1_import_free(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if self._fmu_temp_dir != NULL:
 */
    fmi1_import_free(__pyx_v_self->__pyx_base._fmu);
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pyfmi\fmi.pyx":2151
 *             FMIL.fmi1_import_free(self._fmu)
 * 
 *         if self._fmu_temp_dir != NULL:             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_rmdir(&self.callbacks, self._fmu_temp_dir)
 *             FMIL.free(self._fmu_temp_dir)
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base._fmu_temp_dir != NULL);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2152
 * 
 *         if self._fmu_temp_dir != NULL:
 *             FMIL.fmi_import_rmdir(&self.callbacks, self._fmu_temp_dir)             # <<<<<<<<<<<<<<
 *             FMIL.free(self._fmu_temp_dir)
 *             self._fmu_temp_dir = NULL
 */
    fmi_import_rmdir((&__pyx_v_self->__pyx_base.__pyx_base.callbacks), __pyx_v_self->__pyx_base._fmu_temp_dir);

    /* "pyfmi\fmi.pyx":2153
 *         if self._fmu_temp_dir != NULL:
 *             FMIL.fmi_import_rmdir(&self.callbacks, self._fmu_temp_dir)
 *             FMIL.free(self._fmu_temp_dir)             # <<<<<<<<<<<<<<
 *             self._fmu_temp_dir = NULL
 * 
 */
    free(__pyx_v_self->__pyx_base._fmu_temp_dir);

    /* "pyfmi\fmi.pyx":2154
 *             FMIL.fmi_import_rmdir(&self.callbacks, self._fmu_temp_dir)
 *             FMIL.free(self._fmu_temp_dir)
 *             self._fmu_temp_dir = NULL             # <<<<<<<<<<<<<<
 * 
 *         if self._allocated_context == 1:
 */
    __pyx_v_self->__pyx_base._fmu_temp_dir = NULL;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "pyfmi\fmi.pyx":2156
 *             self._fmu_temp_dir = NULL
 * 
 *         if self._allocated_context == 1:             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_free_context(self.context)
 * 
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base._allocated_context == 1);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2157
 * 
 *         if self._allocated_context == 1:
 *             FMIL.fmi_import_free_context(self.context)             # <<<<<<<<<<<<<<
 * 
 *         if self._fmu_log_name != NULL:
 */
    fmi_import_free_context(__pyx_v_self->__pyx_base.context);
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "pyfmi\fmi.pyx":2159
 *             FMIL.fmi_import_free_context(self.context)
 * 
 *         if self._fmu_log_name != NULL:             # <<<<<<<<<<<<<<
 *             FMIL.free(self._fmu_log_name)
 *             self._fmu_log_name = NULL
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base.__pyx_base._fmu_log_name != NULL);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2160
 * 
 *         if self._fmu_log_name != NULL:
 *             FMIL.free(self._fmu_log_name)             # <<<<<<<<<<<<<<
 *             self._fmu_log_name = NULL
 * 
 */
    free(__pyx_v_self->__pyx_base.__pyx_base._fmu_log_name);

    /* "pyfmi\fmi.pyx":2161
 *         if self._fmu_log_name != NULL:
 *             FMIL.free(self._fmu_log_name)
 *             self._fmu_log_name = NULL             # <<<<<<<<<<<<<<
 * 
 *     def do_step(self, FMIL.fmi1_real_t current_t, FMIL.fmi1_real_t step_size, new_step=True):
 */
    __pyx_v_self->__pyx_base.__pyx_base._fmu_log_name = NULL;
    goto __pyx_L9;
  }
  __pyx_L9:;

  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_9do_step(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_8do_step[] = "\n        Performs an integrator step.\n\n        Parameters::\n\n            current_t --\n                    The current communication point (current time) of\n                    the master.\n            step_size --\n                    The length of the step to be taken.\n            new_step --\n                    True the last step was accepted by the master and\n                    False if not.\n\n        Returns::\n\n            status --\n                    The status of function which can be checked against\n                    FMI_OK, FMI_WARNING. FMI_DISCARD, FMI_ERROR,\n                    FMI_FATAL,FMI_PENDING...\n\n        Calls the underlying low-level function fmiDoStep.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_9do_step(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  fmi1_real_t __pyx_v_current_t;
  fmi1_real_t __pyx_v_step_size;
  PyObject *__pyx_v_new_step = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("do_step (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__current_t,&__pyx_n_s__step_size,&__pyx_n_s__new_step,0};
    PyObject* values[3] = {0,0,0};
    values[2] = __pyx_k_109;
    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__current_t)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__step_size)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("do_step", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__new_step);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "do_step") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_current_t = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_current_t == (fmi1_real_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_step_size = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_step_size == (fmi1_real_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_new_step = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("do_step", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.do_step", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_8do_step(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self), __pyx_v_current_t, __pyx_v_step_size, __pyx_v_new_step);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2163
 *             self._fmu_log_name = NULL
 * 
 *     def do_step(self, FMIL.fmi1_real_t current_t, FMIL.fmi1_real_t step_size, new_step=True):             # <<<<<<<<<<<<<<
 *         """
 *         Performs an integrator step.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_8do_step(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, fmi1_real_t __pyx_v_current_t, fmi1_real_t __pyx_v_step_size, PyObject *__pyx_v_new_step) {
  int __pyx_v_status;
  fmi1_boolean_t __pyx_v_new_s;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("do_step", 0);

  /* "pyfmi\fmi.pyx":2190
 *         cdef FMIL.fmi1_boolean_t new_s
 * 
 *         if new_step:             # <<<<<<<<<<<<<<
 *             new_s = 1
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_new_step); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2191
 * 
 *         if new_step:
 *             new_s = 1             # <<<<<<<<<<<<<<
 *         else:
 *             new_s = 0
 */
    __pyx_v_new_s = 1;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":2193
 *             new_s = 1
 *         else:
 *             new_s = 0             # <<<<<<<<<<<<<<
 * 
 *         self.time = current_t+step_size
 */
    __pyx_v_new_s = 0;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2195
 *             new_s = 0
 * 
 *         self.time = current_t+step_size             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi1_import_do_step(self._fmu, current_t, step_size, new_s)
 */
  __pyx_t_2 = PyFloat_FromDouble((__pyx_v_current_t + __pyx_v_step_size)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__time, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":2197
 *         self.time = current_t+step_size
 * 
 *         status = FMIL.fmi1_import_do_step(self._fmu, current_t, step_size, new_s)             # <<<<<<<<<<<<<<
 * 
 *         return status
 */
  __pyx_v_status = fmi1_import_do_step(__pyx_v_self->__pyx_base._fmu, __pyx_v_current_t, __pyx_v_step_size, __pyx_v_new_s);

  /* "pyfmi\fmi.pyx":2199
 *         status = FMIL.fmi1_import_do_step(self._fmu, current_t, step_size, new_s)
 * 
 *         return status             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyInt_FromLong(__pyx_v_status); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.do_step", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_11cancel_step(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_10cancel_step[] = "\n        Cancel a current integrator step. Can only be called if the\n        status from do_step returns FMI_PENDING.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_11cancel_step(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cancel_step (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_10cancel_step(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2202
 * 
 * 
 *     def cancel_step(self):             # <<<<<<<<<<<<<<
 *         """
 *         Cancel a current integrator step. Can only be called if the
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_10cancel_step(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cancel_step", 0);

  /* "pyfmi\fmi.pyx":2207
 *         status from do_step returns FMI_PENDING.
 *         """
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     def get_output_derivatives(self, variables, FMIL.fmi1_integer_t order):
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.cancel_step", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_13get_output_derivatives(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_12get_output_derivatives[] = "\n        Returns the output derivatives for the specified variables. The\n        order specifies the nth-derivative.\n\n        Parameters::\n\n                variables --\n                        The variables for which the output derivatives\n                        should be returned.\n                order --\n                        The derivative order.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_13get_output_derivatives(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_variables = 0;
  fmi1_integer_t __pyx_v_order;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_output_derivatives (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__variables,&__pyx_n_s__order,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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__variables)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__order)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_output_derivatives", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2209; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_output_derivatives") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2209; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_variables = values[0];
    __pyx_v_order = __Pyx_PyInt_from_py_fmi1_integer_t(values[1]); if (unlikely((__pyx_v_order == (fmi1_integer_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2209; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_output_derivatives", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2209; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.get_output_derivatives", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_12get_output_derivatives(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self), __pyx_v_variables, __pyx_v_order);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2209
 *         raise NotImplementedError
 * 
 *     def get_output_derivatives(self, variables, FMIL.fmi1_integer_t order):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the output derivatives for the specified variables. The
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_12get_output_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_variables, fmi1_integer_t __pyx_v_order) {
  int __pyx_v_status;
  unsigned int __pyx_v_max_output_derivative;
  size_t __pyx_v_nref;
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_value_refs = 0;
  PyArrayObject *__pyx_v_orders = 0;
  fmi1_import_capabilities_t *__pyx_v_fmu_capabilities;
  size_t __pyx_v_i;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_orders;
  __Pyx_Buffer __pyx_pybuffer_orders;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_value_refs;
  __Pyx_Buffer __pyx_pybuffer_value_refs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyArrayObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyArrayObject *__pyx_t_14 = NULL;
  fmi1_value_reference_t __pyx_t_15;
  long __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  size_t __pyx_t_18;
  size_t __pyx_t_19;
  size_t __pyx_t_20;
  size_t __pyx_t_21;
  PyArrayObject *__pyx_t_22 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_output_derivatives", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_value_refs.pybuffer.buf = NULL;
  __pyx_pybuffer_value_refs.refcount = 0;
  __pyx_pybuffernd_value_refs.data = NULL;
  __pyx_pybuffernd_value_refs.rcbuffer = &__pyx_pybuffer_value_refs;
  __pyx_pybuffer_orders.pybuffer.buf = NULL;
  __pyx_pybuffer_orders.refcount = 0;
  __pyx_pybuffernd_orders.data = NULL;
  __pyx_pybuffernd_orders.rcbuffer = &__pyx_pybuffer_orders;

  /* "pyfmi\fmi.pyx":2230
 *         cdef FMIL.fmi1_import_capabilities_t *fmu_capabilities
 * 
 *         fmu_capabilities = FMIL.fmi1_import_get_capabilities(self._fmu)             # <<<<<<<<<<<<<<
 *         max_output_derivative = FMIL.fmi1_import_get_maxOutputDerivativeOrder(fmu_capabilities)
 * 
 */
  __pyx_v_fmu_capabilities = fmi1_import_get_capabilities(__pyx_v_self->__pyx_base._fmu);

  /* "pyfmi\fmi.pyx":2231
 * 
 *         fmu_capabilities = FMIL.fmi1_import_get_capabilities(self._fmu)
 *         max_output_derivative = FMIL.fmi1_import_get_maxOutputDerivativeOrder(fmu_capabilities)             # <<<<<<<<<<<<<<
 * 
 *         if order < 1 or order > max_output_derivative:
 */
  __pyx_v_max_output_derivative = fmi1_import_get_maxOutputDerivativeOrder(__pyx_v_fmu_capabilities);

  /* "pyfmi\fmi.pyx":2233
 *         max_output_derivative = FMIL.fmi1_import_get_maxOutputDerivativeOrder(fmu_capabilities)
 * 
 *         if order < 1 or order > max_output_derivative:             # <<<<<<<<<<<<<<
 *             raise FMUException("The order must be greater than zero and below the maximum output derivative support of the FMU (%d)."%max_output_derivative)
 * 
 */
  __pyx_t_1 = (__pyx_v_order < 1);
  if (!__pyx_t_1) {
    __pyx_t_2 = (__pyx_v_order > __pyx_v_max_output_derivative);
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":2234
 * 
 *         if order < 1 or order > max_output_derivative:
 *             raise FMUException("The order must be greater than zero and below the maximum output derivative support of the FMU (%d)."%max_output_derivative)             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(variables,str):
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyLong_FromUnsignedLong(__pyx_v_max_output_derivative); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_110), __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_6));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
    __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2236
 *             raise FMUException("The order must be greater than zero and below the maximum output derivative support of the FMU (%d)."%max_output_derivative)
 * 
 *         if isinstance(variables,str):             # <<<<<<<<<<<<<<
 *             nref = 1
 *             value_refs = N.array([0], dtype=N.uint32,ndmin=1).ravel()
 */
  __pyx_t_3 = PyString_Check(__pyx_v_variables); 
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":2237
 * 
 *         if isinstance(variables,str):
 *             nref = 1             # <<<<<<<<<<<<<<
 *             value_refs = N.array([0], dtype=N.uint32,ndmin=1).ravel()
 *             orders = N.array(order, dtype=N.int32)
 */
    __pyx_v_nref = 1;

    /* "pyfmi\fmi.pyx":2238
 *         if isinstance(variables,str):
 *             nref = 1
 *             value_refs = N.array([0], dtype=N.uint32,ndmin=1).ravel()             # <<<<<<<<<<<<<<
 *             orders = N.array(order, dtype=N.int32)
 *             value_refs[0] = self.get_variable_valueref(variables)
 */
    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_int_0);
    PyList_SET_ITEM(__pyx_t_6, 0, __pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_6));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
    __pyx_t_6 = 0;
    __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
    __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__uint32); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_8 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__ravel); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = ((PyArrayObject *)__pyx_t_8);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer);
      __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn_fmi1_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_10 < 0)) {
        PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer, (PyObject*)__pyx_v_value_refs, &__Pyx_TypeInfo_nn_fmi1_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
        }
      }
      __pyx_pybuffernd_value_refs.diminfo[0].strides = __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_value_refs.diminfo[0].shape = __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_9 = 0;
    __pyx_v_value_refs = ((PyArrayObject *)__pyx_t_8);
    __pyx_t_8 = 0;

    /* "pyfmi\fmi.pyx":2239
 *             nref = 1
 *             value_refs = N.array([0], dtype=N.uint32,ndmin=1).ravel()
 *             orders = N.array(order, dtype=N.int32)             # <<<<<<<<<<<<<<
 *             value_refs[0] = self.get_variable_valueref(variables)
 *         elif isinstance(variables,list) and isinstance(variables[-1],str):
 */
    __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_6 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyInt_to_py_fmi1_integer_t(__pyx_v_order); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_8));
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int32); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
    if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = ((PyArrayObject *)__pyx_t_7);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_orders.rcbuffer->pybuffer);
      __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_orders.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn_fmi1_integer_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_10 < 0)) {
        PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_orders.rcbuffer->pybuffer, (PyObject*)__pyx_v_orders, &__Pyx_TypeInfo_nn_fmi1_integer_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11);
        }
      }
      __pyx_pybuffernd_orders.diminfo[0].strides = __pyx_pybuffernd_orders.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_orders.diminfo[0].shape = __pyx_pybuffernd_orders.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_14 = 0;
    __pyx_v_orders = ((PyArrayObject *)__pyx_t_7);
    __pyx_t_7 = 0;

    /* "pyfmi\fmi.pyx":2240
 *             value_refs = N.array([0], dtype=N.uint32,ndmin=1).ravel()
 *             orders = N.array(order, dtype=N.int32)
 *             value_refs[0] = self.get_variable_valueref(variables)             # <<<<<<<<<<<<<<
 *         elif isinstance(variables,list) and isinstance(variables[-1],str):
 *             nref = len(variables)
 */
    __pyx_t_15 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.get_variable_valueref(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_v_variables, 0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_16 = 0;
    __pyx_t_10 = -1;
    if (__pyx_t_16 < 0) {
      __pyx_t_16 += __pyx_pybuffernd_value_refs.diminfo[0].shape;
      if (unlikely(__pyx_t_16 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_value_refs.diminfo[0].shape)) __pyx_t_10 = 0;
    if (unlikely(__pyx_t_10 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_10);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrCContig1d(fmi1_value_reference_t *, __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_value_refs.diminfo[0].strides) = __pyx_t_15;
    goto __pyx_L4;
  }

  /* "pyfmi\fmi.pyx":2241
 *             orders = N.array(order, dtype=N.int32)
 *             value_refs[0] = self.get_variable_valueref(variables)
 *         elif isinstance(variables,list) and isinstance(variables[-1],str):             # <<<<<<<<<<<<<<
 *             nref = len(variables)
 *             value_refs = N.array([0]*nref, dtype=N.uint32,ndmin=1).ravel()
 */
  __pyx_t_3 = PyList_Check(__pyx_v_variables); 
  if (__pyx_t_3) {
    __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_variables, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_1 = PyString_Check(__pyx_t_7); 
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_2 = __pyx_t_1;
  } else {
    __pyx_t_2 = __pyx_t_3;
  }
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":2242
 *             value_refs[0] = self.get_variable_valueref(variables)
 *         elif isinstance(variables,list) and isinstance(variables[-1],str):
 *             nref = len(variables)             # <<<<<<<<<<<<<<
 *             value_refs = N.array([0]*nref, dtype=N.uint32,ndmin=1).ravel()
 *             orders = N.array([0]*nref, dtype=N.int32)
 */
    __pyx_t_17 = PyObject_Length(__pyx_v_variables); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_nref = __pyx_t_17;

    /* "pyfmi\fmi.pyx":2243
 *         elif isinstance(variables,list) and isinstance(variables[-1],str):
 *             nref = len(variables)
 *             value_refs = N.array([0]*nref, dtype=N.uint32,ndmin=1).ravel()             # <<<<<<<<<<<<<<
 *             orders = N.array([0]*nref, dtype=N.int32)
 *             for i in range(nref):
 */
    __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__array); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyList_New(1 * ((__pyx_v_nref<0) ? 0:__pyx_v_nref)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    { Py_ssize_t __pyx_temp;
      for (__pyx_temp=0; __pyx_temp < __pyx_v_nref; __pyx_temp++) {
        __Pyx_INCREF(__pyx_int_0);
        PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
      }
    }
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_7));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
    __pyx_t_7 = 0;
    __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_7));
    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__uint32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__ravel); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = ((PyArrayObject *)__pyx_t_5);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer);
      __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn_fmi1_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_10 < 0)) {
        PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer, (PyObject*)__pyx_v_value_refs, &__Pyx_TypeInfo_nn_fmi1_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
        }
      }
      __pyx_pybuffernd_value_refs.diminfo[0].strides = __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_value_refs.diminfo[0].shape = __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_9 = 0;
    __pyx_v_value_refs = ((PyArrayObject *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "pyfmi\fmi.pyx":2244
 *             nref = len(variables)
 *             value_refs = N.array([0]*nref, dtype=N.uint32,ndmin=1).ravel()
 *             orders = N.array([0]*nref, dtype=N.int32)             # <<<<<<<<<<<<<<
 *             for i in range(nref):
 *                 value_refs[i] = self.get_variable_valueref(variables[i])
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__array); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyList_New(1 * ((__pyx_v_nref<0) ? 0:__pyx_v_nref)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    { Py_ssize_t __pyx_temp;
      for (__pyx_temp=0; __pyx_temp < __pyx_v_nref; __pyx_temp++) {
        __Pyx_INCREF(__pyx_int_0);
        PyList_SET_ITEM(__pyx_t_5, __pyx_temp, __pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
      }
    }
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_5));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
    __pyx_t_5 = 0;
    __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_6 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__int32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = ((PyArrayObject *)__pyx_t_6);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_orders.rcbuffer->pybuffer);
      __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_orders.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn_fmi1_integer_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_10 < 0)) {
        PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_orders.rcbuffer->pybuffer, (PyObject*)__pyx_v_orders, &__Pyx_TypeInfo_nn_fmi1_integer_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11);
        }
      }
      __pyx_pybuffernd_orders.diminfo[0].strides = __pyx_pybuffernd_orders.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_orders.diminfo[0].shape = __pyx_pybuffernd_orders.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_14 = 0;
    __pyx_v_orders = ((PyArrayObject *)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "pyfmi\fmi.pyx":2245
 *             value_refs = N.array([0]*nref, dtype=N.uint32,ndmin=1).ravel()
 *             orders = N.array([0]*nref, dtype=N.int32)
 *             for i in range(nref):             # <<<<<<<<<<<<<<
 *                 value_refs[i] = self.get_variable_valueref(variables[i])
 *                 orders[i] = order
 */
    __pyx_t_18 = __pyx_v_nref;
    for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
      __pyx_v_i = __pyx_t_19;

      /* "pyfmi\fmi.pyx":2246
 *             orders = N.array([0]*nref, dtype=N.int32)
 *             for i in range(nref):
 *                 value_refs[i] = self.get_variable_valueref(variables[i])             # <<<<<<<<<<<<<<
 *                 orders[i] = order
 *         else:
 */
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_variables, __pyx_v_i, sizeof(size_t)+1, __Pyx_PyInt_to_py_size_t); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_15 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.get_variable_valueref(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_t_6, 0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_20 = __pyx_v_i;
      __pyx_t_10 = -1;
      if (unlikely(__pyx_t_20 >= (size_t)__pyx_pybuffernd_value_refs.diminfo[0].shape)) __pyx_t_10 = 0;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrCContig1d(fmi1_value_reference_t *, __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_value_refs.diminfo[0].strides) = __pyx_t_15;

      /* "pyfmi\fmi.pyx":2247
 *             for i in range(nref):
 *                 value_refs[i] = self.get_variable_valueref(variables[i])
 *                 orders[i] = order             # <<<<<<<<<<<<<<
 *         else:
 *             raise FMUException("The variables must either be a string or a list of strings")
 */
      __pyx_t_21 = __pyx_v_i;
      __pyx_t_10 = -1;
      if (unlikely(__pyx_t_21 >= (size_t)__pyx_pybuffernd_orders.diminfo[0].shape)) __pyx_t_10 = 0;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrCContig1d(fmi1_integer_t *, __pyx_pybuffernd_orders.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_orders.diminfo[0].strides) = __pyx_v_order;
    }
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":2249
 *                 orders[i] = order
 *         else:
 *             raise FMUException("The variables must either be a string or a list of strings")             # <<<<<<<<<<<<<<
 * 
 *         values = N.array([0.0]*nref,dtype=N.float, ndmin=1)
 */
    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_112), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":2251
 *             raise FMUException("The variables must either be a string or a list of strings")
 * 
 *         values = N.array([0.0]*nref,dtype=N.float, ndmin=1)             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi1_import_get_real_output_derivatives(self._fmu, <FMIL.fmi1_value_reference_t*>value_refs.data, nref, <FMIL.fmi1_integer_t*>orders.data, <FMIL.fmi1_real_t*>values.data)
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyList_New(1 * ((__pyx_v_nref<0) ? 0:__pyx_v_nref)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  { Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < __pyx_v_nref; __pyx_temp++) {
      __Pyx_INCREF(__pyx_t_5);
      PyList_SET_ITEM(__pyx_t_4, __pyx_temp, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
    }
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
  __pyx_t_4 = 0;
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__float); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_22 = ((PyArrayObject *)__pyx_t_8);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
    __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_22, &__Pyx_TypeInfo_nn_fmi1_real_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_10 < 0)) {
      PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn_fmi1_real_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
      }
    }
    __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_22 = 0;
  __pyx_v_values = ((PyArrayObject *)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "pyfmi\fmi.pyx":2253
 *         values = N.array([0.0]*nref,dtype=N.float, ndmin=1)
 * 
 *         status = FMIL.fmi1_import_get_real_output_derivatives(self._fmu, <FMIL.fmi1_value_reference_t*>value_refs.data, nref, <FMIL.fmi1_integer_t*>orders.data, <FMIL.fmi1_real_t*>values.data)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi1_import_get_real_output_derivatives(__pyx_v_self->__pyx_base._fmu, ((fmi1_value_reference_t *)__pyx_v_value_refs->data), __pyx_v_nref, ((fmi1_integer_t *)__pyx_v_orders->data), ((fmi1_real_t *)__pyx_v_values->data));

  /* "pyfmi\fmi.pyx":2255
 *         status = FMIL.fmi1_import_get_real_output_derivatives(self._fmu, <FMIL.fmi1_value_reference_t*>value_refs.data, nref, <FMIL.fmi1_integer_t*>orders.data, <FMIL.fmi1_real_t*>values.data)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to get the Real output derivatives.')
 * 
 */
  __pyx_t_2 = (__pyx_v_status != 0);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":2256
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Real output derivatives.')             # <<<<<<<<<<<<<<
 * 
 *         return values
 */
    __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_k_tuple_114), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "pyfmi\fmi.pyx":2258
 *             raise FMUException('Failed to get the Real output derivatives.')
 * 
 *         return values             # <<<<<<<<<<<<<<
 * 
 *     def _get_types_platform(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_values));
  __pyx_r = ((PyObject *)__pyx_v_values);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_orders.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.get_output_derivatives", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_orders.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_values);
  __Pyx_XDECREF((PyObject *)__pyx_v_value_refs);
  __Pyx_XDECREF((PyObject *)__pyx_v_orders);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_15_get_types_platform(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_14_get_types_platform[] = "\n        Returns the set of valid compatible platforms for the Model, extracted\n        from the XML.\n\n        Returns::\n\n            types_platform --\n                The valid platforms.\n\n        Example::\n\n            model.types_platform\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_15_get_types_platform(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_types_platform (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_14_get_types_platform(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2260
 *         return values
 * 
 *     def _get_types_platform(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the set of valid compatible platforms for the Model, extracted
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_14_get_types_platform(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__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("_get_types_platform", 0);

  /* "pyfmi\fmi.pyx":2274
 *             model.types_platform
 *         """
 *         return FMIL.fmi1_import_get_types_platform(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *     types_platform = property(fget=_get_types_platform)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromString(fmi1_import_get_types_platform(__pyx_v_self->__pyx_base._fmu)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1._get_types_platform", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_17get_real_status(PyObject *__pyx_v_self, PyObject *__pyx_v_status_kind); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_16get_real_status[] = "\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_17get_real_status(PyObject *__pyx_v_self, PyObject *__pyx_v_status_kind) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_real_status (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_16get_real_status(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self), ((PyObject *)__pyx_v_status_kind));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2278
 *     types_platform = property(fget=_get_types_platform)
 * 
 *     def get_real_status(self, status_kind):             # <<<<<<<<<<<<<<
 *         """
 *         """
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_16get_real_status(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_status_kind) {
  fmi1_real_t __pyx_v_value;
  int __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_real_status", 0);

  /* "pyfmi\fmi.pyx":2281
 *         """
 *         """
 *         cdef FMIL.fmi1_real_t value = 0.0             # <<<<<<<<<<<<<<
 *         cdef int status
 * 
 */
  __pyx_v_value = 0.0;

  /* "pyfmi\fmi.pyx":2284
 *         cdef int status
 * 
 *         if status_kind == FMIL.fmi1_last_successful_time:             # <<<<<<<<<<<<<<
 *             status = FMIL.fmi1_import_get_real_status(self._fmu, FMIL.fmi1_last_successful_time, &value)
 * 
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_last_successful_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_status_kind, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":2285
 * 
 *         if status_kind == FMIL.fmi1_last_successful_time:
 *             status = FMIL.fmi1_import_get_real_status(self._fmu, FMIL.fmi1_last_successful_time, &value)             # <<<<<<<<<<<<<<
 * 
 *             if status != 0:
 */
    __pyx_v_status = fmi1_import_get_real_status(__pyx_v_self->__pyx_base._fmu, fmi1_last_successful_time, (&__pyx_v_value));

    /* "pyfmi\fmi.pyx":2287
 *             status = FMIL.fmi1_import_get_real_status(self._fmu, FMIL.fmi1_last_successful_time, &value)
 * 
 *             if status != 0:             # <<<<<<<<<<<<<<
 *                 raise FMUException('Failed to retrieve the last successful time. See the log for possibly more information.')
 * 
 */
    __pyx_t_3 = (__pyx_v_status != 0);
    if (__pyx_t_3) {

      /* "pyfmi\fmi.pyx":2288
 * 
 *             if status != 0:
 *                 raise FMUException('Failed to retrieve the last successful time. See the log for possibly more information.')             # <<<<<<<<<<<<<<
 * 
 *             return value
 */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_116), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "pyfmi\fmi.pyx":2290
 *                 raise FMUException('Failed to retrieve the last successful time. See the log for possibly more information.')
 * 
 *             return value             # <<<<<<<<<<<<<<
 *         else:
 *             raise FMUException('Not supported status kind.')
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":2292
 *             return value
 *         else:
 *             raise FMUException('Not supported status kind.')             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_118), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.get_real_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_19set_input_derivatives(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_18set_input_derivatives[] = "\n        Sets the input derivative order for the specified variables.\n\n        Parameters::\n\n                variables --\n                        The variables for which the input derivative\n                        should be set.\n                values --\n                        The actual values.\n                order --\n                        The derivative orders to set.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_19set_input_derivatives(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_variables = 0;
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_v_orders = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_input_derivatives (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__variables,&__pyx_n_s__values,&__pyx_n_s__orders,0};
    PyObject* values[3] = {0,0,0};
    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__variables)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_input_derivatives", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2295; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__orders)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_input_derivatives", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2295; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_input_derivatives") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2295; __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_variables = values[0];
    __pyx_v_values = values[1];
    __pyx_v_orders = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_input_derivatives", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2295; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.set_input_derivatives", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_18set_input_derivatives(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self), __pyx_v_variables, __pyx_v_values, __pyx_v_orders);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2295
 * 
 * 
 *     def set_input_derivatives(self, variables, values, orders):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the input derivative order for the specified variables.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_18set_input_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_values, PyObject *__pyx_v_orders) {
  int __pyx_v_status;
  int __pyx_v_can_interpolate_inputs;
  size_t __pyx_v_nref;
  fmi1_import_capabilities_t *__pyx_v_fmu_capabilities;
  PyArrayObject *__pyx_v_np_orders = 0;
  PyArrayObject *__pyx_v_value_refs = 0;
  PyArrayObject *__pyx_v_val = 0;
  PyObject *__pyx_v_i = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_np_orders;
  __Pyx_Buffer __pyx_pybuffer_np_orders;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_val;
  __Pyx_Buffer __pyx_pybuffer_val;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_value_refs;
  __Pyx_Buffer __pyx_pybuffer_value_refs;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  PyArrayObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  fmi1_value_reference_t __pyx_t_17;
  long __pyx_t_18;
  int __pyx_t_19;
  int __pyx_t_20;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_input_derivatives", 0);
  __Pyx_INCREF(__pyx_v_orders);
  __pyx_pybuffer_np_orders.pybuffer.buf = NULL;
  __pyx_pybuffer_np_orders.refcount = 0;
  __pyx_pybuffernd_np_orders.data = NULL;
  __pyx_pybuffernd_np_orders.rcbuffer = &__pyx_pybuffer_np_orders;
  __pyx_pybuffer_value_refs.pybuffer.buf = NULL;
  __pyx_pybuffer_value_refs.refcount = 0;
  __pyx_pybuffernd_value_refs.data = NULL;
  __pyx_pybuffernd_value_refs.rcbuffer = &__pyx_pybuffer_value_refs;
  __pyx_pybuffer_val.pybuffer.buf = NULL;
  __pyx_pybuffer_val.refcount = 0;
  __pyx_pybuffernd_val.data = NULL;
  __pyx_pybuffernd_val.rcbuffer = &__pyx_pybuffer_val;

  /* "pyfmi\fmi.pyx":2313
 *         cdef FMIL.size_t nref
 *         cdef FMIL.fmi1_import_capabilities_t *fmu_capabilities
 *         cdef N.ndarray[FMIL.fmi1_integer_t, ndim=1,mode='c'] np_orders = N.array(orders, dtype=N.int32, ndmin=1).ravel()             # <<<<<<<<<<<<<<
 *         cdef N.ndarray[FMIL.fmi1_value_reference_t, ndim=1,mode='c'] value_refs
 *         cdef N.ndarray[FMIL.fmi1_real_t, ndim=1,mode='c'] val = N.array(values, dtype=N.float, ndmin=1).ravel()
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_orders);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_orders);
  __Pyx_GIVEREF(__pyx_v_orders);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_np_orders.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_fmi1_integer_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_np_orders = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_np_orders.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_np_orders.diminfo[0].strides = __pyx_pybuffernd_np_orders.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_np_orders.diminfo[0].shape = __pyx_pybuffernd_np_orders.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_np_orders = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":2315
 *         cdef N.ndarray[FMIL.fmi1_integer_t, ndim=1,mode='c'] np_orders = N.array(orders, dtype=N.int32, ndmin=1).ravel()
 *         cdef N.ndarray[FMIL.fmi1_value_reference_t, ndim=1,mode='c'] value_refs
 *         cdef N.ndarray[FMIL.fmi1_real_t, ndim=1,mode='c'] val = N.array(values, dtype=N.float, ndmin=1).ravel()             # <<<<<<<<<<<<<<
 * 
 *         nref = val.size
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__float); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__ravel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_val.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn_fmi1_real_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_val = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_val.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_val.diminfo[0].strides = __pyx_pybuffernd_val.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_val.diminfo[0].shape = __pyx_pybuffernd_val.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_7 = 0;
  __pyx_v_val = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":2317
 *         cdef N.ndarray[FMIL.fmi1_real_t, ndim=1,mode='c'] val = N.array(values, dtype=N.float, ndmin=1).ravel()
 * 
 *         nref = val.size             # <<<<<<<<<<<<<<
 *         orders = N.array([0]*nref, dtype=N.int32)
 * 
 */
  __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_val), __pyx_n_s__size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = __Pyx_PyInt_from_py_size_t(__pyx_t_4); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_nref = __pyx_t_8;

  /* "pyfmi\fmi.pyx":2318
 * 
 *         nref = val.size
 *         orders = N.array([0]*nref, dtype=N.int32)             # <<<<<<<<<<<<<<
 * 
 *         if nref != np_orders.size:
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyList_New(1 * ((__pyx_v_nref<0) ? 0:__pyx_v_nref)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  { Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < __pyx_v_nref; __pyx_temp++) {
      __Pyx_INCREF(__pyx_int_0);
      PyList_SET_ITEM(__pyx_t_4, __pyx_temp, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
    }
  }
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
  __pyx_t_4 = 0;
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__int32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_v_orders);
  __pyx_v_orders = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":2320
 *         orders = N.array([0]*nref, dtype=N.int32)
 * 
 *         if nref != np_orders.size:             # <<<<<<<<<<<<<<
 *             raise FMUException("The number of variables must be the same as the number of orders.")
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_to_py_size_t(__pyx_v_nref); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_np_orders), __pyx_n_s__size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_9) {

    /* "pyfmi\fmi.pyx":2321
 * 
 *         if nref != np_orders.size:
 *             raise FMUException("The number of variables must be the same as the number of orders.")             # <<<<<<<<<<<<<<
 * 
 *         fmu_capabilities = FMIL.fmi1_import_get_capabilities(self._fmu)
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_120), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2323
 *             raise FMUException("The number of variables must be the same as the number of orders.")
 * 
 *         fmu_capabilities = FMIL.fmi1_import_get_capabilities(self._fmu)             # <<<<<<<<<<<<<<
 *         can_interpolate_inputs = FMIL.fmi1_import_get_canInterpolateInputs(fmu_capabilities)
 *         #NOTE IS THIS THE HIGHEST ORDER OF INTERPOLATION OR SIMPLY IF IT CAN OR NOT?
 */
  __pyx_v_fmu_capabilities = fmi1_import_get_capabilities(__pyx_v_self->__pyx_base._fmu);

  /* "pyfmi\fmi.pyx":2324
 * 
 *         fmu_capabilities = FMIL.fmi1_import_get_capabilities(self._fmu)
 *         can_interpolate_inputs = FMIL.fmi1_import_get_canInterpolateInputs(fmu_capabilities)             # <<<<<<<<<<<<<<
 *         #NOTE IS THIS THE HIGHEST ORDER OF INTERPOLATION OR SIMPLY IF IT CAN OR NOT?
 * 
 */
  __pyx_v_can_interpolate_inputs = fmi1_import_get_canInterpolateInputs(__pyx_v_fmu_capabilities);

  /* "pyfmi\fmi.pyx":2327
 *         #NOTE IS THIS THE HIGHEST ORDER OF INTERPOLATION OR SIMPLY IF IT CAN OR NOT?
 * 
 *         for i in range(np_orders.size):             # <<<<<<<<<<<<<<
 *             if np_orders[i] < 1:
 *                 raise FMUException("The order must be greater than zero.")
 */
  __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_np_orders), __pyx_n_s__size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_10 = 0;
    __pyx_t_11 = NULL;
  } else {
    __pyx_t_10 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_11 = Py_TYPE(__pyx_t_5)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_5)) {
      if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_5)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_5)) {
      if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_4 = __pyx_t_11(__pyx_t_5);
      if (unlikely(!__pyx_t_4)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF(__pyx_v_i);
    __pyx_v_i = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "pyfmi\fmi.pyx":2328
 * 
 *         for i in range(np_orders.size):
 *             if np_orders[i] < 1:             # <<<<<<<<<<<<<<
 *                 raise FMUException("The order must be greater than zero.")
 *         if not can_interpolate_inputs:
 */
    __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_np_orders), __pyx_v_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_int_1, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_9) {

      /* "pyfmi\fmi.pyx":2329
 *         for i in range(np_orders.size):
 *             if np_orders[i] < 1:
 *                 raise FMUException("The order must be greater than zero.")             # <<<<<<<<<<<<<<
 *         if not can_interpolate_inputs:
 *             raise FMUException("The FMU does not support input derivatives.")
 */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_122), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L6;
    }
    __pyx_L6:;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":2330
 *             if np_orders[i] < 1:
 *                 raise FMUException("The order must be greater than zero.")
 *         if not can_interpolate_inputs:             # <<<<<<<<<<<<<<
 *             raise FMUException("The FMU does not support input derivatives.")
 * 
 */
  __pyx_t_9 = (!__pyx_v_can_interpolate_inputs);
  if (__pyx_t_9) {

    /* "pyfmi\fmi.pyx":2331
 *                 raise FMUException("The order must be greater than zero.")
 *         if not can_interpolate_inputs:
 *             raise FMUException("The FMU does not support input derivatives.")             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(variables,str):
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_124), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "pyfmi\fmi.pyx":2333
 *             raise FMUException("The FMU does not support input derivatives.")
 * 
 *         if isinstance(variables,str):             # <<<<<<<<<<<<<<
 *             value_refs = N.array([0], dtype=N.uint32,ndmin=1).ravel()
 *             value_refs[0] = self.get_variable_valueref(variables)
 */
  __pyx_t_9 = PyString_Check(__pyx_v_variables); 
  if (__pyx_t_9) {

    /* "pyfmi\fmi.pyx":2334
 * 
 *         if isinstance(variables,str):
 *             value_refs = N.array([0], dtype=N.uint32,ndmin=1).ravel()             # <<<<<<<<<<<<<<
 *             value_refs[0] = self.get_variable_valueref(variables)
 *         elif isinstance(variables,list) and isinstance(variables[-1],str):
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_int_0);
    PyList_SET_ITEM(__pyx_t_4, 0, __pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_4));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
    __pyx_t_4 = 0;
    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__uint32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__ravel); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_12 = ((PyArrayObject *)__pyx_t_3);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer);
      __pyx_t_13 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn_fmi1_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_13 < 0)) {
        PyErr_Fetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer, (PyObject*)__pyx_v_value_refs, &__Pyx_TypeInfo_nn_fmi1_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_16);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_14, __pyx_t_15, __pyx_t_16);
        }
      }
      __pyx_pybuffernd_value_refs.diminfo[0].strides = __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_value_refs.diminfo[0].shape = __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_12 = 0;
    __pyx_v_value_refs = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyfmi\fmi.pyx":2335
 *         if isinstance(variables,str):
 *             value_refs = N.array([0], dtype=N.uint32,ndmin=1).ravel()
 *             value_refs[0] = self.get_variable_valueref(variables)             # <<<<<<<<<<<<<<
 *         elif isinstance(variables,list) and isinstance(variables[-1],str):
 *             value_refs = N.array([0]*nref, dtype=N.uint32,ndmin=1).ravel()
 */
    __pyx_t_17 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.get_variable_valueref(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_v_variables, 0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_18 = 0;
    __pyx_t_13 = -1;
    if (__pyx_t_18 < 0) {
      __pyx_t_18 += __pyx_pybuffernd_value_refs.diminfo[0].shape;
      if (unlikely(__pyx_t_18 < 0)) __pyx_t_13 = 0;
    } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_value_refs.diminfo[0].shape)) __pyx_t_13 = 0;
    if (unlikely(__pyx_t_13 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_13);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrCContig1d(fmi1_value_reference_t *, __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_value_refs.diminfo[0].strides) = __pyx_t_17;
    goto __pyx_L8;
  }

  /* "pyfmi\fmi.pyx":2336
 *             value_refs = N.array([0], dtype=N.uint32,ndmin=1).ravel()
 *             value_refs[0] = self.get_variable_valueref(variables)
 *         elif isinstance(variables,list) and isinstance(variables[-1],str):             # <<<<<<<<<<<<<<
 *             value_refs = N.array([0]*nref, dtype=N.uint32,ndmin=1).ravel()
 *             for i in range(nref):
 */
  __pyx_t_9 = PyList_Check(__pyx_v_variables); 
  if (__pyx_t_9) {
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_variables, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_19 = PyString_Check(__pyx_t_3); 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_20 = __pyx_t_19;
  } else {
    __pyx_t_20 = __pyx_t_9;
  }
  if (__pyx_t_20) {

    /* "pyfmi\fmi.pyx":2337
 *             value_refs[0] = self.get_variable_valueref(variables)
 *         elif isinstance(variables,list) and isinstance(variables[-1],str):
 *             value_refs = N.array([0]*nref, dtype=N.uint32,ndmin=1).ravel()             # <<<<<<<<<<<<<<
 *             for i in range(nref):
 *                 value_refs[i] = self.get_variable_valueref(variables[i])
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyList_New(1 * ((__pyx_v_nref<0) ? 0:__pyx_v_nref)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    { Py_ssize_t __pyx_temp;
      for (__pyx_temp=0; __pyx_temp < __pyx_v_nref; __pyx_temp++) {
        __Pyx_INCREF(__pyx_int_0);
        PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
      }
    }
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
    __pyx_t_3 = 0;
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__uint32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __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 = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_12 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer);
      __pyx_t_13 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn_fmi1_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_13 < 0)) {
        PyErr_Fetch(&__pyx_t_16, &__pyx_t_15, &__pyx_t_14);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer, (PyObject*)__pyx_v_value_refs, &__Pyx_TypeInfo_nn_fmi1_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_14);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_16, __pyx_t_15, __pyx_t_14);
        }
      }
      __pyx_pybuffernd_value_refs.diminfo[0].strides = __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_value_refs.diminfo[0].shape = __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_12 = 0;
    __pyx_v_value_refs = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyfmi\fmi.pyx":2338
 *         elif isinstance(variables,list) and isinstance(variables[-1],str):
 *             value_refs = N.array([0]*nref, dtype=N.uint32,ndmin=1).ravel()
 *             for i in range(nref):             # <<<<<<<<<<<<<<
 *                 value_refs[i] = self.get_variable_valueref(variables[i])
 *         else:
 */
    __pyx_t_1 = __Pyx_PyInt_to_py_size_t(__pyx_v_nref); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
      __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_10 = 0;
      __pyx_t_11 = NULL;
    } else {
      __pyx_t_10 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_11 = Py_TYPE(__pyx_t_3)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_3)) {
        if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_3)) {
        if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_1 = __pyx_t_11(__pyx_t_3);
        if (unlikely(!__pyx_t_1)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_XDECREF(__pyx_v_i);
      __pyx_v_i = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "pyfmi\fmi.pyx":2339
 *             value_refs = N.array([0]*nref, dtype=N.uint32,ndmin=1).ravel()
 *             for i in range(nref):
 *                 value_refs[i] = self.get_variable_valueref(variables[i])             # <<<<<<<<<<<<<<
 *         else:
 *             raise FMUException("The variables must either be a string or a list of strings")
 */
      __pyx_t_1 = PyObject_GetItem(__pyx_v_variables, __pyx_v_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_17 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.get_variable_valueref(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_v_self), __pyx_t_1, 0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyInt_to_py_fmi1_value_reference_t(__pyx_t_17); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      if (PyObject_SetItem(((PyObject *)__pyx_v_value_refs), __pyx_v_i, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":2341
 *                 value_refs[i] = self.get_variable_valueref(variables[i])
 *         else:
 *             raise FMUException("The variables must either be a string or a list of strings")             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi1_import_set_real_input_derivatives(self._fmu, <FMIL.fmi1_value_reference_t*>value_refs.data, nref, <FMIL.fmi1_integer_t*>np_orders.data, <FMIL.fmi1_real_t*>val.data)
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_125), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L8:;

  /* "pyfmi\fmi.pyx":2343
 *             raise FMUException("The variables must either be a string or a list of strings")
 * 
 *         status = FMIL.fmi1_import_set_real_input_derivatives(self._fmu, <FMIL.fmi1_value_reference_t*>value_refs.data, nref, <FMIL.fmi1_integer_t*>np_orders.data, <FMIL.fmi1_real_t*>val.data)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi1_import_set_real_input_derivatives(__pyx_v_self->__pyx_base._fmu, ((fmi1_value_reference_t *)__pyx_v_value_refs->data), __pyx_v_nref, ((fmi1_integer_t *)__pyx_v_np_orders->data), ((fmi1_real_t *)__pyx_v_val->data));

  /* "pyfmi\fmi.pyx":2345
 *         status = FMIL.fmi1_import_set_real_input_derivatives(self._fmu, <FMIL.fmi1_value_reference_t*>value_refs.data, nref, <FMIL.fmi1_integer_t*>np_orders.data, <FMIL.fmi1_real_t*>val.data)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to set the Real input derivatives.')
 * 
 */
  __pyx_t_20 = (__pyx_v_status != 0);
  if (__pyx_t_20) {

    /* "pyfmi\fmi.pyx":2346
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Real input derivatives.')             # <<<<<<<<<<<<<<
 * 
 *     def simulate(self,
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_127), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L11;
  }
  __pyx_L11:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_np_orders.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_val.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.set_input_derivatives", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_np_orders.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_val.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_np_orders);
  __Pyx_XDECREF((PyObject *)__pyx_v_value_refs);
  __Pyx_XDECREF((PyObject *)__pyx_v_val);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_orders);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_21simulate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_20simulate[] = "\n        Compact function for model simulation.\n\n        The simulation method depends on which algorithm is used, this can be\n        set with the function argument 'algorithm'. Options for the algorithm\n        are passed as option classes or as pure dicts. See\n        FMUModel.simulate_options for more details.\n\n        The default algorithm for this function is FMICSAlg.\n\n        Parameters::\n\n            start_time --\n                Start time for the simulation.\n                Default: Start time defined in the default experiment from\n                        the ModelDescription file.\n\n            final_time --\n                Final time for the simulation.\n                Default: Stop time defined in the default experiment from\n                        the ModelDescription file.\n\n            input --\n                Input signal for the simulation. The input should be a 2-tuple\n                consisting of first the names of the input variable(s) and then\n                the data matrix.\n                Default: Empty tuple.\n\n            algorithm --\n                The algorithm which will be used for the simulation is specified\n                by passing the algorithm class as string or class object in this\n                argument. 'algorithm' can be any class which implements the\n                abstract class AlgorithmBase (found in algorithm_drivers.py). In\n                this way it is possible to write own algorithms and use them\n                with this function.\n                Default: 'FMICSAlg'\n\n            options --\n                The options that should be used in the algorithm. For details on\n                the options do:\n\n                    >> myModel = FMUModel(...)\n                    >> opts = myModel.simulate_options()\n                    >> opts?\n\n                Valid values are:\n                    - A dict which gives AssimuloFMIAlgOptions with\n                      default valu""es on all options except the ones\n                      listed in the dict. Empty dict will thus give all\n                      options with default values.\n                    - An options object.\n                Default: Empty dict\n\n        Returns::\n\n            Result object, subclass of common.algorithm_drivers.ResultBase.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_21simulate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start_time = 0;
  PyObject *__pyx_v_final_time = 0;
  PyObject *__pyx_v_input = 0;
  PyObject *__pyx_v_algorithm = 0;
  PyObject *__pyx_v_options = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("simulate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start_time,&__pyx_n_s__final_time,&__pyx_n_s__input,&__pyx_n_s__algorithm,&__pyx_n_s__options,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[0] = ((PyObject *)__pyx_n_s__Default);
    values[1] = ((PyObject *)__pyx_n_s__Default);

    /* "pyfmi\fmi.pyx":2351
 *                  start_time='Default',
 *                  final_time='Default',
 *                  input=(),             # <<<<<<<<<<<<<<
 *                  algorithm='FMICSAlg',
 *                  options={}):
 */
    values[2] = ((PyObject *)__pyx_empty_tuple);
    values[3] = ((PyObject *)__pyx_n_s__FMICSAlg);
    values[4] = __pyx_k_128;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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 (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start_time);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__final_time);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__input);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__algorithm);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__options);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "simulate") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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;
      }
    }
    __pyx_v_start_time = values[0];
    __pyx_v_final_time = values[1];
    __pyx_v_input = values[2];
    __pyx_v_algorithm = values[3];
    __pyx_v_options = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("simulate", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.simulate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_20simulate(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self), __pyx_v_start_time, __pyx_v_final_time, __pyx_v_input, __pyx_v_algorithm, __pyx_v_options);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2348
 *             raise FMUException('Failed to set the Real input derivatives.')
 * 
 *     def simulate(self,             # <<<<<<<<<<<<<<
 *                  start_time='Default',
 *                  final_time='Default',
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_20simulate(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_start_time, PyObject *__pyx_v_final_time, PyObject *__pyx_v_input, PyObject *__pyx_v_algorithm, PyObject *__pyx_v_options) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("simulate", 0);
  __Pyx_INCREF(__pyx_v_start_time);
  __Pyx_INCREF(__pyx_v_final_time);

  /* "pyfmi\fmi.pyx":2411
 *             Result object, subclass of common.algorithm_drivers.ResultBase.
 *         """
 *         if start_time == "Default":             # <<<<<<<<<<<<<<
 *             start_time = self.get_default_experiment_start_time()
 *         if final_time == "Default":
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_start_time, ((PyObject *)__pyx_n_s__Default), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":2412
 *         """
 *         if start_time == "Default":
 *             start_time = self.get_default_experiment_start_time()             # <<<<<<<<<<<<<<
 *         if final_time == "Default":
 *             final_time = self.get_default_experiment_stop_time()
 */
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_129); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_v_start_time);
    __pyx_v_start_time = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2413
 *         if start_time == "Default":
 *             start_time = self.get_default_experiment_start_time()
 *         if final_time == "Default":             # <<<<<<<<<<<<<<
 *             final_time = self.get_default_experiment_stop_time()
 * 
 */
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_final_time, ((PyObject *)__pyx_n_s__Default), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":2414
 *             start_time = self.get_default_experiment_start_time()
 *         if final_time == "Default":
 *             final_time = self.get_default_experiment_stop_time()             # <<<<<<<<<<<<<<
 * 
 *         return self._exec_simulate_algorithm(start_time,
 */
    __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_130); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2414; __pyx_clineno = __LINE__; goto __pyx_L1_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 = 2414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_v_final_time);
    __pyx_v_final_time = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":2416
 *             final_time = self.get_default_experiment_stop_time()
 * 
 *         return self._exec_simulate_algorithm(start_time,             # <<<<<<<<<<<<<<
 *                                              final_time,
 *                                              input,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_131); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyfmi\fmi.pyx":2421
 *                                              'pyfmi.fmi_algorithm_drivers',
 *                                              algorithm,
 *                                              options)             # <<<<<<<<<<<<<<
 * 
 *     def simulate_options(self, algorithm='FMICSAlg'):
 */
  __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_start_time);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_start_time);
  __Pyx_GIVEREF(__pyx_v_start_time);
  __Pyx_INCREF(__pyx_v_final_time);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_final_time);
  __Pyx_GIVEREF(__pyx_v_final_time);
  __Pyx_INCREF(__pyx_v_input);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_input);
  __Pyx_GIVEREF(__pyx_v_input);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_9));
  PyTuple_SET_ITEM(__pyx_t_3, 3, ((PyObject *)__pyx_kp_s_9));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9));
  __Pyx_INCREF(__pyx_v_algorithm);
  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_algorithm);
  __Pyx_GIVEREF(__pyx_v_algorithm);
  __Pyx_INCREF(__pyx_v_options);
  PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_v_options);
  __Pyx_GIVEREF(__pyx_v_options);
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.simulate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_start_time);
  __Pyx_XDECREF(__pyx_v_final_time);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_23simulate_options(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_22simulate_options[] = "\n        Get an instance of the simulate options class, filled with default\n        values. If called without argument then the options class for the\n        default simulation algorithm will be returned.\n\n        Parameters::\n\n            algorithm --\n                The algorithm for which the options class should be fetched.\n                Possible values are: 'FMICSAlg'.\n                Default: 'FMICSAlg'\n\n        Returns::\n\n            Options class for the algorithm specified with default values.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_23simulate_options(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_algorithm = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("simulate_options (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__algorithm,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_n_s__FMICSAlg);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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 (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__algorithm);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "simulate_options") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_algorithm = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("simulate_options", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.simulate_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_22simulate_options(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self), __pyx_v_algorithm);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2423
 *                                              options)
 * 
 *     def simulate_options(self, algorithm='FMICSAlg'):             # <<<<<<<<<<<<<<
 *         """
 *         Get an instance of the simulate options class, filled with default
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_22simulate_options(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_algorithm) {
  PyObject *__pyx_r = NULL;
  __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("simulate_options", 0);

  /* "pyfmi\fmi.pyx":2440
 *             Options class for the algorithm specified with default values.
 *         """
 *         return self._default_options('pyfmi.fmi_algorithm_drivers', algorithm)             # <<<<<<<<<<<<<<
 * 
 *     def initialize(self, tStart=0.0, tStop=1.0, StopTimeDefined=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___default_options); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2440; __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 = 2440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_9));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_9));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9));
  __Pyx_INCREF(__pyx_v_algorithm);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_algorithm);
  __Pyx_GIVEREF(__pyx_v_algorithm);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.simulate_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_25initialize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_24initialize[] = "\n        Initializes the slave.\n\n        Parameters::\n\n            tStart -\n            tSTop --\n            StopTimeDefined --\n\n        Calls the low-level FMU function: fmiInstantiateSlave\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_25initialize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_tStart = 0;
  PyObject *__pyx_v_tStop = 0;
  PyObject *__pyx_v_StopTimeDefined = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("initialize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__tStart,&__pyx_n_s__tStop,&__pyx_n_s__StopTimeDefined,0};
    PyObject* values[3] = {0,0,0};
    values[0] = __pyx_k_132;
    values[1] = __pyx_k_133;
    values[2] = __pyx_k_134;
    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 (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tStart);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tStop);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__StopTimeDefined);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "initialize") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2442; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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;
      }
    }
    __pyx_v_tStart = values[0];
    __pyx_v_tStop = values[1];
    __pyx_v_StopTimeDefined = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("initialize", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2442; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.initialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_24initialize(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self), __pyx_v_tStart, __pyx_v_tStop, __pyx_v_StopTimeDefined);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2442
 *         return self._default_options('pyfmi.fmi_algorithm_drivers', algorithm)
 * 
 *     def initialize(self, tStart=0.0, tStop=1.0, StopTimeDefined=False):             # <<<<<<<<<<<<<<
 *         """
 *         Initializes the slave.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_24initialize(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_tStart, PyObject *__pyx_v_tStop, PyObject *__pyx_v_StopTimeDefined) {
  int __pyx_v_status;
  fmi1_boolean_t __pyx_v_stopDefined;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  long __pyx_t_1;
  int __pyx_t_2;
  fmi1_real_t __pyx_t_3;
  fmi1_real_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("initialize", 0);

  /* "pyfmi\fmi.pyx":2455
 *         """
 *         cdef int status
 *         cdef FMIL.fmi1_boolean_t stopDefined = 1 if StopTimeDefined else 0             # <<<<<<<<<<<<<<
 * 
 *         self.time = tStart
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_StopTimeDefined); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {
    __pyx_t_1 = 1;
  } else {
    __pyx_t_1 = 0;
  }
  __pyx_v_stopDefined = __pyx_t_1;

  /* "pyfmi\fmi.pyx":2457
 *         cdef FMIL.fmi1_boolean_t stopDefined = 1 if StopTimeDefined else 0
 * 
 *         self.time = tStart             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi1_import_initialize_slave(self._fmu, tStart, stopDefined, tStop)
 */
  if (PyObject_SetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__time, __pyx_v_tStart) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":2459
 *         self.time = tStart
 * 
 *         status = FMIL.fmi1_import_initialize_slave(self._fmu, tStart, stopDefined, tStop)             # <<<<<<<<<<<<<<
 * 
 *         if status != FMIL.fmi1_status_ok:
 */
  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_tStart); if (unlikely((__pyx_t_3 == (fmi1_real_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_tStop); if (unlikely((__pyx_t_4 == (fmi1_real_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_status = fmi1_import_initialize_slave(__pyx_v_self->__pyx_base._fmu, __pyx_t_3, __pyx_v_stopDefined, __pyx_t_4);

  /* "pyfmi\fmi.pyx":2461
 *         status = FMIL.fmi1_import_initialize_slave(self._fmu, tStart, stopDefined, tStop)
 * 
 *         if status != FMIL.fmi1_status_ok:             # <<<<<<<<<<<<<<
 *             raise FMUException("The slave failed to initialize. See the log for possibly more information.")
 * 
 */
  __pyx_t_2 = (__pyx_v_status != fmi1_status_ok);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":2462
 * 
 *         if status != FMIL.fmi1_status_ok:
 *             raise FMUException("The slave failed to initialize. See the log for possibly more information.")             # <<<<<<<<<<<<<<
 * 
 *         self._allocated_fmu = 1
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_136), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2464
 *             raise FMUException("The slave failed to initialize. See the log for possibly more information.")
 * 
 *         self._allocated_fmu = 1             # <<<<<<<<<<<<<<
 * 
 *     def reset(self):
 */
  __pyx_v_self->__pyx_base._allocated_fmu = 1;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.initialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_27reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_26reset[] = "\n        This method resets the FMU according to the reset method defined\n        in the FMI1 specification.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_27reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_26reset(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2466
 *         self._allocated_fmu = 1
 * 
 *     def reset(self):             # <<<<<<<<<<<<<<
 *         """
 *         This method resets the FMU according to the reset method defined
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_26reset(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self) {
  int __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  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("reset", 0);

  /* "pyfmi\fmi.pyx":2472
 *         """
 * 
 *         status = FMIL.fmi1_import_reset_slave(self._fmu)             # <<<<<<<<<<<<<<
 *         if status != FMIL.fmi1_status_ok:
 *             raise FMUException("Failed to reset the FMU.")
 */
  __pyx_v_status = fmi1_import_reset_slave(__pyx_v_self->__pyx_base._fmu);

  /* "pyfmi\fmi.pyx":2473
 * 
 *         status = FMIL.fmi1_import_reset_slave(self._fmu)
 *         if status != FMIL.fmi1_status_ok:             # <<<<<<<<<<<<<<
 *             raise FMUException("Failed to reset the FMU.")
 * 
 */
  __pyx_t_1 = (__pyx_v_status != fmi1_status_ok);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2474
 *         status = FMIL.fmi1_import_reset_slave(self._fmu)
 *         if status != FMIL.fmi1_status_ok:
 *             raise FMUException("Failed to reset the FMU.")             # <<<<<<<<<<<<<<
 * 
 *         #The FMU is no longer initialized
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_138), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2477
 * 
 *         #The FMU is no longer initialized
 *         self._allocated_fmu = 0             # <<<<<<<<<<<<<<
 * 
 *         #Default values
 */
  __pyx_v_self->__pyx_base._allocated_fmu = 0;

  /* "pyfmi\fmi.pyx":2480
 * 
 *         #Default values
 *         self.__t = None             # <<<<<<<<<<<<<<
 * 
 *         #Internal values
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.__t);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.__t);
  __pyx_v_self->__pyx_base.__t = Py_None;

  /* "pyfmi\fmi.pyx":2483
 * 
 *         #Internal values
 *         self._file_open = False             # <<<<<<<<<<<<<<
 *         self._npoints = 0
 *         self._log = []
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base._file_open);
  __Pyx_DECREF(__pyx_v_self->__pyx_base._file_open);
  __pyx_v_self->__pyx_base._file_open = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":2484
 *         #Internal values
 *         self._file_open = False
 *         self._npoints = 0             # <<<<<<<<<<<<<<
 *         self._log = []
 * 
 */
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base._npoints);
  __Pyx_DECREF(__pyx_v_self->__pyx_base._npoints);
  __pyx_v_self->__pyx_base._npoints = __pyx_int_0;

  /* "pyfmi\fmi.pyx":2485
 *         self._file_open = False
 *         self._npoints = 0
 *         self._log = []             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.__pyx_base._log);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base._log));
  __pyx_v_self->__pyx_base.__pyx_base._log = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_29instantiate_slave(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_28instantiate_slave[] = "\n        Instantiate the slave.\n\n        Parameters::\n\n            name --\n                The name of the instance.\n                Default: 'Slave'\n\n            logging --\n                Defines if the logging should be turned on or off.\n                Default: False, no logging.\n\n        Calls the low-level FMI function: fmiInstantiateSlave.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_29instantiate_slave(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_logging = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("instantiate_slave (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__name,&__pyx_n_s__logging,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)__pyx_n_s__Slave);
    values[1] = __pyx_k_139;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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 (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__name);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__logging);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "instantiate_slave") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2488; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        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;
      }
    }
    __pyx_v_name = values[0];
    __pyx_v_logging = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("instantiate_slave", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2488; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.instantiate_slave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_28instantiate_slave(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self), __pyx_v_name, __pyx_v_logging);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2488
 * 
 * 
 *     def instantiate_slave(self, name='Slave', logging=False):             # <<<<<<<<<<<<<<
 *         """
 *         Instantiate the slave.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_28instantiate_slave(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_logging) {
  int __pyx_v_status;
  fmi1_boolean_t __pyx_v_log;
  fmi1_real_t __pyx_v_timeout;
  fmi1_boolean_t __pyx_v_visible;
  fmi1_boolean_t __pyx_v_interactive;
  fmi1_string_t __pyx_v_location;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  long __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  fmi1_string_t __pyx_t_6;
  fmi1_string_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("instantiate_slave", 0);
  __Pyx_INCREF(__pyx_v_name);

  /* "pyfmi\fmi.pyx":2505
 *         """
 *         cdef int status
 *         cdef FMIL.fmi1_boolean_t log = 1 if logging else 0             # <<<<<<<<<<<<<<
 *         cdef FMIL.fmi1_real_t timeout = 0.0
 *         cdef FMIL.fmi1_boolean_t visible = 0
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_logging); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {
    __pyx_t_1 = 1;
  } else {
    __pyx_t_1 = 0;
  }
  __pyx_v_log = __pyx_t_1;

  /* "pyfmi\fmi.pyx":2506
 *         cdef int status
 *         cdef FMIL.fmi1_boolean_t log = 1 if logging else 0
 *         cdef FMIL.fmi1_real_t timeout = 0.0             # <<<<<<<<<<<<<<
 *         cdef FMIL.fmi1_boolean_t visible = 0
 *         cdef FMIL.fmi1_boolean_t interactive = 0
 */
  __pyx_v_timeout = 0.0;

  /* "pyfmi\fmi.pyx":2507
 *         cdef FMIL.fmi1_boolean_t log = 1 if logging else 0
 *         cdef FMIL.fmi1_real_t timeout = 0.0
 *         cdef FMIL.fmi1_boolean_t visible = 0             # <<<<<<<<<<<<<<
 *         cdef FMIL.fmi1_boolean_t interactive = 0
 *         cdef FMIL.fmi1_string_t location = NULL
 */
  __pyx_v_visible = 0;

  /* "pyfmi\fmi.pyx":2508
 *         cdef FMIL.fmi1_real_t timeout = 0.0
 *         cdef FMIL.fmi1_boolean_t visible = 0
 *         cdef FMIL.fmi1_boolean_t interactive = 0             # <<<<<<<<<<<<<<
 *         cdef FMIL.fmi1_string_t location = NULL
 * 
 */
  __pyx_v_interactive = 0;

  /* "pyfmi\fmi.pyx":2509
 *         cdef FMIL.fmi1_boolean_t visible = 0
 *         cdef FMIL.fmi1_boolean_t interactive = 0
 *         cdef FMIL.fmi1_string_t location = NULL             # <<<<<<<<<<<<<<
 * 
 *         name = encode(name)
 */
  __pyx_v_location = NULL;

  /* "pyfmi\fmi.pyx":2511
 *         cdef FMIL.fmi1_string_t location = NULL
 * 
 *         name = encode(name)             # <<<<<<<<<<<<<<
 *         status = FMIL.fmi1_import_instantiate_slave(self._fmu, name, location,
 *                                         FMI_MIME_CS_STANDALONE, timeout, visible,
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_name);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_v_name);
  __pyx_v_name = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":2512
 * 
 *         name = encode(name)
 *         status = FMIL.fmi1_import_instantiate_slave(self._fmu, name, location,             # <<<<<<<<<<<<<<
 *                                         FMI_MIME_CS_STANDALONE, timeout, visible,
 *                                         interactive)
 */
  __pyx_t_6 = PyBytes_AsString(__pyx_v_name); if (unlikely((__pyx_t_6 == (fmi1_string_t)NULL) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":2513
 *         name = encode(name)
 *         status = FMIL.fmi1_import_instantiate_slave(self._fmu, name, location,
 *                                         FMI_MIME_CS_STANDALONE, timeout, visible,             # <<<<<<<<<<<<<<
 *                                         interactive)
 * 
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s_140); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = PyBytes_AsString(__pyx_t_5); if (unlikely((__pyx_t_7 == (fmi1_string_t)NULL) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":2514
 *         status = FMIL.fmi1_import_instantiate_slave(self._fmu, name, location,
 *                                         FMI_MIME_CS_STANDALONE, timeout, visible,
 *                                         interactive)             # <<<<<<<<<<<<<<
 * 
 *         if status != FMIL.jm_status_success:
 */
  __pyx_v_status = fmi1_import_instantiate_slave(__pyx_v_self->__pyx_base._fmu, __pyx_t_6, __pyx_v_location, __pyx_t_7, __pyx_v_timeout, __pyx_v_visible, __pyx_v_interactive);

  /* "pyfmi\fmi.pyx":2516
 *                                         interactive)
 * 
 *         if status != FMIL.jm_status_success:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to instantiate the slave. See the log for possibly more information.')
 * 
 */
  __pyx_t_2 = (__pyx_v_status != jm_status_success);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":2517
 * 
 *         if status != FMIL.jm_status_success:
 *             raise FMUException('Failed to instantiate the slave. See the log for possibly more information.')             # <<<<<<<<<<<<<<
 * 
 *         #The FMU is instantiated
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_142), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2520
 * 
 *         #The FMU is instantiated
 *         self._instantiated_fmu = 1             # <<<<<<<<<<<<<<
 * 
 *         #Just to be safe, some problems with Dymola (2012) FMUs not reacting
 */
  __pyx_v_self->__pyx_base._instantiated_fmu = 1;

  /* "pyfmi\fmi.pyx":2524
 *         #Just to be safe, some problems with Dymola (2012) FMUs not reacting
 *         #to logging when set to the instantiate method.
 *         status = FMIL.fmi1_import_set_debug_logging(self._fmu, log)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi1_import_set_debug_logging(__pyx_v_self->__pyx_base._fmu, __pyx_v_log);

  /* "pyfmi\fmi.pyx":2526
 *         status = FMIL.fmi1_import_set_debug_logging(self._fmu, log)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to set the debugging option. See the log for possibly more information.')
 * 
 */
  __pyx_t_2 = (__pyx_v_status != 0);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":2527
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the debugging option. See the log for possibly more information.')             # <<<<<<<<<<<<<<
 * 
 *     def get_capability_flags(self):
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_144), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.instantiate_slave", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_31get_capability_flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_30get_capability_flags[] = "\n        Returns a dictionary with the capability flags of the FMU.\n\n        Capabilities::\n\n            canHandleVariableCommunicationStepSize\n            canHandleEvents\n            canRejectSteps\n            canInterpolateInputs\n            maxOutputDerivativeOrder\n            canRunAsynchronuously\n            canSignalEvents\n            canBeinstantiatedOnlyOncePerProcess\n            canNotUseMemoryManagementFunctions\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_31get_capability_flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_capability_flags (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_30get_capability_flags(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2529
 *             raise FMUException('Failed to set the debugging option. See the log for possibly more information.')
 * 
 *     def get_capability_flags(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a dictionary with the capability flags of the FMU.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_30get_capability_flags(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self) {
  PyObject *__pyx_v_capabilities = 0;
  fmi1_import_capabilities_t *__pyx_v_cap;
  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("get_capability_flags", 0);

  /* "pyfmi\fmi.pyx":2545
 *             canNotUseMemoryManagementFunctions
 *         """
 *         cdef dict capabilities = {}             # <<<<<<<<<<<<<<
 *         cdef FMIL.fmi1_import_capabilities_t *cap
 * 
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_capabilities = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2548
 *         cdef FMIL.fmi1_import_capabilities_t *cap
 * 
 *         cap = FMIL.fmi1_import_get_capabilities(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         capabilities["canHandleVariableCommunicationStepSize"] = FMIL.fmi1_import_get_canHandleVariableCommunicationStepSize(cap)
 */
  __pyx_v_cap = fmi1_import_get_capabilities(__pyx_v_self->__pyx_base._fmu);

  /* "pyfmi\fmi.pyx":2550
 *         cap = FMIL.fmi1_import_get_capabilities(self._fmu)
 * 
 *         capabilities["canHandleVariableCommunicationStepSize"] = FMIL.fmi1_import_get_canHandleVariableCommunicationStepSize(cap)             # <<<<<<<<<<<<<<
 *         capabilities["canHandleEvents"] = FMIL.fmi1_import_get_canHandleEvents(cap)
 *         capabilities["canRejectSteps"] = FMIL.fmi1_import_get_canRejectSteps(cap)
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_import_get_canHandleVariableCommunicationStepSize(__pyx_v_cap)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_145), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2551
 * 
 *         capabilities["canHandleVariableCommunicationStepSize"] = FMIL.fmi1_import_get_canHandleVariableCommunicationStepSize(cap)
 *         capabilities["canHandleEvents"] = FMIL.fmi1_import_get_canHandleEvents(cap)             # <<<<<<<<<<<<<<
 *         capabilities["canRejectSteps"] = FMIL.fmi1_import_get_canRejectSteps(cap)
 *         capabilities["canInterpolateInputs"] = FMIL.fmi1_import_get_canInterpolateInputs(cap)
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_import_get_canHandleEvents(__pyx_v_cap)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s__canHandleEvents), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2552
 *         capabilities["canHandleVariableCommunicationStepSize"] = FMIL.fmi1_import_get_canHandleVariableCommunicationStepSize(cap)
 *         capabilities["canHandleEvents"] = FMIL.fmi1_import_get_canHandleEvents(cap)
 *         capabilities["canRejectSteps"] = FMIL.fmi1_import_get_canRejectSteps(cap)             # <<<<<<<<<<<<<<
 *         capabilities["canInterpolateInputs"] = FMIL.fmi1_import_get_canInterpolateInputs(cap)
 *         capabilities["maxOutputDerivativeOrder"] = FMIL.fmi1_import_get_maxOutputDerivativeOrder(cap)
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_import_get_canRejectSteps(__pyx_v_cap)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s__canRejectSteps), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2553
 *         capabilities["canHandleEvents"] = FMIL.fmi1_import_get_canHandleEvents(cap)
 *         capabilities["canRejectSteps"] = FMIL.fmi1_import_get_canRejectSteps(cap)
 *         capabilities["canInterpolateInputs"] = FMIL.fmi1_import_get_canInterpolateInputs(cap)             # <<<<<<<<<<<<<<
 *         capabilities["maxOutputDerivativeOrder"] = FMIL.fmi1_import_get_maxOutputDerivativeOrder(cap)
 *         capabilities["canRunAsynchronuously"] = FMIL.fmi1_import_get_canRunAsynchronuously(cap)
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_import_get_canInterpolateInputs(__pyx_v_cap)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_146), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2554
 *         capabilities["canRejectSteps"] = FMIL.fmi1_import_get_canRejectSteps(cap)
 *         capabilities["canInterpolateInputs"] = FMIL.fmi1_import_get_canInterpolateInputs(cap)
 *         capabilities["maxOutputDerivativeOrder"] = FMIL.fmi1_import_get_maxOutputDerivativeOrder(cap)             # <<<<<<<<<<<<<<
 *         capabilities["canRunAsynchronuously"] = FMIL.fmi1_import_get_canRunAsynchronuously(cap)
 *         capabilities["canSignalEvents"] = FMIL.fmi1_import_get_canSignalEvents(cap)
 */
  __pyx_t_1 = PyLong_FromUnsignedLong(fmi1_import_get_maxOutputDerivativeOrder(__pyx_v_cap)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_147), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2555
 *         capabilities["canInterpolateInputs"] = FMIL.fmi1_import_get_canInterpolateInputs(cap)
 *         capabilities["maxOutputDerivativeOrder"] = FMIL.fmi1_import_get_maxOutputDerivativeOrder(cap)
 *         capabilities["canRunAsynchronuously"] = FMIL.fmi1_import_get_canRunAsynchronuously(cap)             # <<<<<<<<<<<<<<
 *         capabilities["canSignalEvents"] = FMIL.fmi1_import_get_canSignalEvents(cap)
 *         capabilities["canBeInstantiatedOnlyOncePerProcess"] = FMIL.fmi1_import_get_canBeInstantiatedOnlyOncePerProcess(cap)
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_import_get_canRunAsynchronuously(__pyx_v_cap)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_148), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2556
 *         capabilities["maxOutputDerivativeOrder"] = FMIL.fmi1_import_get_maxOutputDerivativeOrder(cap)
 *         capabilities["canRunAsynchronuously"] = FMIL.fmi1_import_get_canRunAsynchronuously(cap)
 *         capabilities["canSignalEvents"] = FMIL.fmi1_import_get_canSignalEvents(cap)             # <<<<<<<<<<<<<<
 *         capabilities["canBeInstantiatedOnlyOncePerProcess"] = FMIL.fmi1_import_get_canBeInstantiatedOnlyOncePerProcess(cap)
 *         capabilities["canNotUseMemoryManagementFunctions"] = FMIL.fmi1_import_get_canNotUseMemoryManagementFunctions(cap)
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_import_get_canSignalEvents(__pyx_v_cap)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s__canSignalEvents), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2557
 *         capabilities["canRunAsynchronuously"] = FMIL.fmi1_import_get_canRunAsynchronuously(cap)
 *         capabilities["canSignalEvents"] = FMIL.fmi1_import_get_canSignalEvents(cap)
 *         capabilities["canBeInstantiatedOnlyOncePerProcess"] = FMIL.fmi1_import_get_canBeInstantiatedOnlyOncePerProcess(cap)             # <<<<<<<<<<<<<<
 *         capabilities["canNotUseMemoryManagementFunctions"] = FMIL.fmi1_import_get_canNotUseMemoryManagementFunctions(cap)
 * 
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_import_get_canBeInstantiatedOnlyOncePerProcess(__pyx_v_cap)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_149), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2558
 *         capabilities["canSignalEvents"] = FMIL.fmi1_import_get_canSignalEvents(cap)
 *         capabilities["canBeInstantiatedOnlyOncePerProcess"] = FMIL.fmi1_import_get_canBeInstantiatedOnlyOncePerProcess(cap)
 *         capabilities["canNotUseMemoryManagementFunctions"] = FMIL.fmi1_import_get_canNotUseMemoryManagementFunctions(cap)             # <<<<<<<<<<<<<<
 * 
 *         return capabilities
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_import_get_canNotUseMemoryManagementFunctions(__pyx_v_cap)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_150), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2560
 *         capabilities["canNotUseMemoryManagementFunctions"] = FMIL.fmi1_import_get_canNotUseMemoryManagementFunctions(cap)
 * 
 *         return capabilities             # <<<<<<<<<<<<<<
 * 
 *     def terminate(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_capabilities));
  __pyx_r = ((PyObject *)__pyx_v_capabilities);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS1.get_capability_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_capabilities);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_33terminate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_32terminate[] = "\n        Calls the FMI function fmiTerminateSlave() on the FMU.\n        After this call, any call to a function changing the state of the FMU will fail.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_33terminate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("terminate (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_32terminate(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2562
 *         return capabilities
 * 
 *     def terminate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Calls the FMI function fmiTerminateSlave() on the FMU.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_32terminate(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("terminate", 0);

  /* "pyfmi\fmi.pyx":2567
 *         After this call, any call to a function changing the state of the FMU will fail.
 *         """
 *         if self._allocated_fmu == 1:             # <<<<<<<<<<<<<<
 *             FMIL.fmi1_import_terminate_slave(self._fmu)
 *             self._allocated_fmu = 0 #No longer initialized
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base._allocated_fmu == 1);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2568
 *         """
 *         if self._allocated_fmu == 1:
 *             FMIL.fmi1_import_terminate_slave(self._fmu)             # <<<<<<<<<<<<<<
 *             self._allocated_fmu = 0 #No longer initialized
 * 
 */
    fmi1_import_terminate_slave(__pyx_v_self->__pyx_base._fmu);

    /* "pyfmi\fmi.pyx":2569
 *         if self._allocated_fmu == 1:
 *             FMIL.fmi1_import_terminate_slave(self._fmu)
 *             self._allocated_fmu = 0 #No longer initialized             # <<<<<<<<<<<<<<
 * 
 *     def free_instance(self):
 */
    __pyx_v_self->__pyx_base._allocated_fmu = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_35free_instance(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS1_34free_instance[] = "\n        Calls the FMI function fmiFreeSlaveInstance on the FMU.\n        Note that this is not needed in general as it is done automatically.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_35free_instance(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("free_instance (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS1_34free_instance(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2571
 *             self._allocated_fmu = 0 #No longer initialized
 * 
 *     def free_instance(self):             # <<<<<<<<<<<<<<
 *         """
 *         Calls the FMI function fmiFreeSlaveInstance on the FMU.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS1_34free_instance(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("free_instance", 0);

  /* "pyfmi\fmi.pyx":2576
 *         Note that this is not needed in general as it is done automatically.
 *         """
 *         if self._instantiated_fmu == 1:             # <<<<<<<<<<<<<<
 *             FMIL.fmi1_import_free_slave_instance(self._fmu)
 *             self._instantiated_fmu = 0
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base._instantiated_fmu == 1);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2577
 *         """
 *         if self._instantiated_fmu == 1:
 *             FMIL.fmi1_import_free_slave_instance(self._fmu)             # <<<<<<<<<<<<<<
 *             self._instantiated_fmu = 0
 * 
 */
    fmi1_import_free_slave_instance(__pyx_v_self->__pyx_base._fmu);

    /* "pyfmi\fmi.pyx":2578
 *         if self._instantiated_fmu == 1:
 *             FMIL.fmi1_import_free_slave_instance(self._fmu)
 *             self._instantiated_fmu = 0             # <<<<<<<<<<<<<<
 * 
 * cdef class FMUModelME1(FMUModelBase):
 */
    __pyx_v_self->__pyx_base._instantiated_fmu = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_11FMUModelME1_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_11FMUModelME1_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fmu = 0;
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_enable_logging = 0;
  PyObject *__pyx_v_log_file_name = 0;
  PyObject *__pyx_v_log_level = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fmu,&__pyx_n_s__path,&__pyx_n_s__enable_logging,&__pyx_n_s__log_file_name,&__pyx_n_s__log_level,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_kp_s_30);

    /* "pyfmi\fmi.pyx":2585
 *     """
 * 
 *     def __init__(self, fmu, path='.', enable_logging=None, log_file_name="", log_level=FMI_DEFAULT_LOG_LEVEL):             # <<<<<<<<<<<<<<
 *         #Call super
 *         FMUModelBase.__init__(self,fmu,path,enable_logging,log_file_name, log_level)
 */
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)__pyx_kp_s_12);
    values[4] = __pyx_k_151;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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__fmu)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__enable_logging);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__log_file_name);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__log_level);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      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 = 2585; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_fmu = values[0];
    __pyx_v_path = values[1];
    __pyx_v_enable_logging = values[2];
    __pyx_v_log_file_name = values[3];
    __pyx_v_log_level = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2585; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1___init__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self), __pyx_v_fmu, __pyx_v_path, __pyx_v_enable_logging, __pyx_v_log_file_name, __pyx_v_log_level);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_11FMUModelME1___init__(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, PyObject *__pyx_v_fmu, PyObject *__pyx_v_path, PyObject *__pyx_v_enable_logging, PyObject *__pyx_v_log_file_name, PyObject *__pyx_v_log_level) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyfmi\fmi.pyx":2587
 *     def __init__(self, fmu, path='.', enable_logging=None, log_file_name="", log_level=FMI_DEFAULT_LOG_LEVEL):
 *         #Call super
 *         FMUModelBase.__init__(self,fmu,path,enable_logging,log_file_name, log_level)             # <<<<<<<<<<<<<<
 * 
 *         if self._fmu_kind != FMI_ME:
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelBase)), __pyx_n_s____init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __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_fmu);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_fmu);
  __Pyx_GIVEREF(__pyx_v_fmu);
  __Pyx_INCREF(__pyx_v_path);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  __Pyx_INCREF(__pyx_v_enable_logging);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_enable_logging);
  __Pyx_GIVEREF(__pyx_v_enable_logging);
  __Pyx_INCREF(__pyx_v_log_file_name);
  PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_log_file_name);
  __Pyx_GIVEREF(__pyx_v_log_file_name);
  __Pyx_INCREF(__pyx_v_log_level);
  PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_v_log_level);
  __Pyx_GIVEREF(__pyx_v_log_level);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":2589
 *         FMUModelBase.__init__(self,fmu,path,enable_logging,log_file_name, log_level)
 * 
 *         if self._fmu_kind != FMI_ME:             # <<<<<<<<<<<<<<
 *             raise FMUException("This class only supports FMI 1.0 for Model Exchange.")
 * 
 */
  __pyx_t_3 = PyInt_FromLong(__pyx_v_self->__pyx_base._fmu_kind); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_ME); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":2590
 * 
 *         if self._fmu_kind != FMI_ME:
 *             raise FMUException("This class only supports FMI 1.0 for Model Exchange.")             # <<<<<<<<<<<<<<
 * 
 *         self.instantiate_model(logging = self._enable_logging)
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_153), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2592
 *             raise FMUException("This class only supports FMI 1.0 for Model Exchange.")
 * 
 *         self.instantiate_model(logging = self._enable_logging)             # <<<<<<<<<<<<<<
 * 
 *     def _get_model_types_platform(self):
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__instantiate_model); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__logging), __pyx_v_self->__pyx_base._enable_logging) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2592; __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 = 2592; __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;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_3_get_model_types_platform(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME1_2_get_model_types_platform[] = "\n        Returns the set of valid compatible platforms for the Model, extracted\n        from the XML.\n\n        Returns::\n\n            model_types_platform --\n                The valid platforms.\n\n        Example::\n\n            model.model_types_platform\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_3_get_model_types_platform(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_model_types_platform (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_2_get_model_types_platform(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2594
 *         self.instantiate_model(logging = self._enable_logging)
 * 
 *     def _get_model_types_platform(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the set of valid compatible platforms for the Model, extracted
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_2_get_model_types_platform(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__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("_get_model_types_platform", 0);

  /* "pyfmi\fmi.pyx":2608
 *             model.model_types_platform
 *         """
 *         return FMIL.fmi1_import_get_model_types_platform(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *     model_types_platform = property(fget=_get_model_types_platform)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromString(fmi1_import_get_model_types_platform(__pyx_v_self->__pyx_base._fmu)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1._get_model_types_platform", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_5reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME1_4reset[] = "\n        This metod resets the FMU by first calling fmiTerminate and\n        fmiFreeModelInstance and then reloads the DLL and finally\n        re-instantiates using fmiInstantiateModel.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_5reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_4reset(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2612
 *     model_types_platform = property(fget=_get_model_types_platform)
 * 
 *     def reset(self):             # <<<<<<<<<<<<<<
 *         """
 *         This metod resets the FMU by first calling fmiTerminate and
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_4reset(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self) {
  int __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reset", 0);

  /* "pyfmi\fmi.pyx":2618
 *         re-instantiates using fmiInstantiateModel.
 *         """
 *         if self._allocated_fmu == 1:             # <<<<<<<<<<<<<<
 *             FMIL.fmi1_import_terminate(self._fmu)
 *             self._allocated_fmu = 0
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base._allocated_fmu == 1);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2619
 *         """
 *         if self._allocated_fmu == 1:
 *             FMIL.fmi1_import_terminate(self._fmu)             # <<<<<<<<<<<<<<
 *             self._allocated_fmu = 0
 * 
 */
    fmi1_import_terminate(__pyx_v_self->__pyx_base._fmu);

    /* "pyfmi\fmi.pyx":2620
 *         if self._allocated_fmu == 1:
 *             FMIL.fmi1_import_terminate(self._fmu)
 *             self._allocated_fmu = 0             # <<<<<<<<<<<<<<
 * 
 *         if self._instantiated_fmu == 1:
 */
    __pyx_v_self->__pyx_base._allocated_fmu = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2622
 *             self._allocated_fmu = 0
 * 
 *         if self._instantiated_fmu == 1:             # <<<<<<<<<<<<<<
 *             FMIL.fmi1_import_free_model_instance(self._fmu)
 *             self._instantiated_fmu = 0
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base._instantiated_fmu == 1);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2623
 * 
 *         if self._instantiated_fmu == 1:
 *             FMIL.fmi1_import_free_model_instance(self._fmu)             # <<<<<<<<<<<<<<
 *             self._instantiated_fmu = 0
 * 
 */
    fmi1_import_free_model_instance(__pyx_v_self->__pyx_base._fmu);

    /* "pyfmi\fmi.pyx":2624
 *         if self._instantiated_fmu == 1:
 *             FMIL.fmi1_import_free_model_instance(self._fmu)
 *             self._instantiated_fmu = 0             # <<<<<<<<<<<<<<
 * 
 *         if self._allocated_dll == 1:
 */
    __pyx_v_self->__pyx_base._instantiated_fmu = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":2626
 *             self._instantiated_fmu = 0
 * 
 *         if self._allocated_dll == 1:             # <<<<<<<<<<<<<<
 *             FMIL.fmi1_import_destroy_dllfmu(self._fmu)
 * 
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base._allocated_dll == 1);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2627
 * 
 *         if self._allocated_dll == 1:
 *             FMIL.fmi1_import_destroy_dllfmu(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         global FMI_REGISTER_GLOBALLY
 */
    fmi1_import_destroy_dllfmu(__pyx_v_self->__pyx_base._fmu);
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":2630
 * 
 *         global FMI_REGISTER_GLOBALLY
 *         status = FMIL.fmi1_import_create_dllfmu(self._fmu, self.callBackFunctions, FMI_REGISTER_GLOBALLY);             # <<<<<<<<<<<<<<
 *         if status == FMIL.jm_status_error:
 *             raise FMUException("The DLL could not be reloaded, check the log for more information.")
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s_48); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_status = fmi1_import_create_dllfmu(__pyx_v_self->__pyx_base._fmu, __pyx_v_self->__pyx_base.callBackFunctions, __pyx_t_3);

  /* "pyfmi\fmi.pyx":2631
 *         global FMI_REGISTER_GLOBALLY
 *         status = FMIL.fmi1_import_create_dllfmu(self._fmu, self.callBackFunctions, FMI_REGISTER_GLOBALLY);
 *         if status == FMIL.jm_status_error:             # <<<<<<<<<<<<<<
 *             raise FMUException("The DLL could not be reloaded, check the log for more information.")
 *         FMI_REGISTER_GLOBALLY += 1 #Update the global register of FMUs
 */
  __pyx_t_1 = (__pyx_v_status == jm_status_error);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2632
 *         status = FMIL.fmi1_import_create_dllfmu(self._fmu, self.callBackFunctions, FMI_REGISTER_GLOBALLY);
 *         if status == FMIL.jm_status_error:
 *             raise FMUException("The DLL could not be reloaded, check the log for more information.")             # <<<<<<<<<<<<<<
 *         FMI_REGISTER_GLOBALLY += 1 #Update the global register of FMUs
 * 
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_155), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pyfmi\fmi.pyx":2633
 *         if status == FMIL.jm_status_error:
 *             raise FMUException("The DLL could not be reloaded, check the log for more information.")
 *         FMI_REGISTER_GLOBALLY += 1 #Update the global register of FMUs             # <<<<<<<<<<<<<<
 * 
 *         #Default values
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s_48); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_48, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":2636
 * 
 *         #Default values
 *         self.__t = None             # <<<<<<<<<<<<<<
 * 
 *         #Internal values
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.__t);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.__t);
  __pyx_v_self->__pyx_base.__t = Py_None;

  /* "pyfmi\fmi.pyx":2639
 * 
 *         #Internal values
 *         self._file_open = False             # <<<<<<<<<<<<<<
 *         self._npoints = 0
 *         self._log = []
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base._file_open);
  __Pyx_DECREF(__pyx_v_self->__pyx_base._file_open);
  __pyx_v_self->__pyx_base._file_open = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":2640
 *         #Internal values
 *         self._file_open = False
 *         self._npoints = 0             # <<<<<<<<<<<<<<
 *         self._log = []
 * 
 */
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base._npoints);
  __Pyx_DECREF(__pyx_v_self->__pyx_base._npoints);
  __pyx_v_self->__pyx_base._npoints = __pyx_int_0;

  /* "pyfmi\fmi.pyx":2641
 *         self._file_open = False
 *         self._npoints = 0
 *         self._log = []             # <<<<<<<<<<<<<<
 * 
 *         #Instantiates the model
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.__pyx_base._log);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base._log));
  __pyx_v_self->__pyx_base.__pyx_base._log = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":2644
 * 
 *         #Instantiates the model
 *         self.instantiate_model(logging = self._enable_logging)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__instantiate_model); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__logging), __pyx_v_self->__pyx_base._enable_logging) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static void __pyx_pw_5pyfmi_3fmi_11FMUModelME1_7__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_5pyfmi_3fmi_11FMUModelME1_7__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_5pyfmi_3fmi_11FMUModelME1_6__dealloc__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
}

/* "pyfmi\fmi.pyx":2647
 * 
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Deallocate memory allocated
 */

static void __pyx_pf_5pyfmi_3fmi_11FMUModelME1_6__dealloc__(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pyfmi\fmi.pyx":2651
 *         Deallocate memory allocated
 *         """
 *         if self._allocated_fmu == 1:             # <<<<<<<<<<<<<<
 *             FMIL.fmi1_import_terminate(self._fmu)
 * 
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base._allocated_fmu == 1);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2652
 *         """
 *         if self._allocated_fmu == 1:
 *             FMIL.fmi1_import_terminate(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if self._instantiated_fmu == 1:
 */
    fmi1_import_terminate(__pyx_v_self->__pyx_base._fmu);
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2654
 *             FMIL.fmi1_import_terminate(self._fmu)
 * 
 *         if self._instantiated_fmu == 1:             # <<<<<<<<<<<<<<
 *             FMIL.fmi1_import_free_model_instance(self._fmu)
 * 
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base._instantiated_fmu == 1);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2655
 * 
 *         if self._instantiated_fmu == 1:
 *             FMIL.fmi1_import_free_model_instance(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if self._allocated_dll == 1:
 */
    fmi1_import_free_model_instance(__pyx_v_self->__pyx_base._fmu);
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":2657
 *             FMIL.fmi1_import_free_model_instance(self._fmu)
 * 
 *         if self._allocated_dll == 1:             # <<<<<<<<<<<<<<
 *             FMIL.fmi1_import_destroy_dllfmu(self._fmu)
 * 
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base._allocated_dll == 1);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2658
 * 
 *         if self._allocated_dll == 1:
 *             FMIL.fmi1_import_destroy_dllfmu(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if self._allocated_xml == 1:
 */
    fmi1_import_destroy_dllfmu(__pyx_v_self->__pyx_base._fmu);
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":2660
 *             FMIL.fmi1_import_destroy_dllfmu(self._fmu)
 * 
 *         if self._allocated_xml == 1:             # <<<<<<<<<<<<<<
 *             FMIL.fmi1_import_free(self._fmu)
 * 
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base._allocated_xml == 1);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2661
 * 
 *         if self._allocated_xml == 1:
 *             FMIL.fmi1_import_free(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if self._fmu_temp_dir != NULL:
 */
    fmi1_import_free(__pyx_v_self->__pyx_base._fmu);
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pyfmi\fmi.pyx":2663
 *             FMIL.fmi1_import_free(self._fmu)
 * 
 *         if self._fmu_temp_dir != NULL:             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_rmdir(&self.callbacks, self._fmu_temp_dir)
 *             FMIL.free(self._fmu_temp_dir)
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base._fmu_temp_dir != NULL);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2664
 * 
 *         if self._fmu_temp_dir != NULL:
 *             FMIL.fmi_import_rmdir(&self.callbacks, self._fmu_temp_dir)             # <<<<<<<<<<<<<<
 *             FMIL.free(self._fmu_temp_dir)
 *             self._fmu_temp_dir = NULL
 */
    fmi_import_rmdir((&__pyx_v_self->__pyx_base.__pyx_base.callbacks), __pyx_v_self->__pyx_base._fmu_temp_dir);

    /* "pyfmi\fmi.pyx":2665
 *         if self._fmu_temp_dir != NULL:
 *             FMIL.fmi_import_rmdir(&self.callbacks, self._fmu_temp_dir)
 *             FMIL.free(self._fmu_temp_dir)             # <<<<<<<<<<<<<<
 *             self._fmu_temp_dir = NULL
 * 
 */
    free(__pyx_v_self->__pyx_base._fmu_temp_dir);

    /* "pyfmi\fmi.pyx":2666
 *             FMIL.fmi_import_rmdir(&self.callbacks, self._fmu_temp_dir)
 *             FMIL.free(self._fmu_temp_dir)
 *             self._fmu_temp_dir = NULL             # <<<<<<<<<<<<<<
 * 
 *         if self._allocated_context == 1:
 */
    __pyx_v_self->__pyx_base._fmu_temp_dir = NULL;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "pyfmi\fmi.pyx":2668
 *             self._fmu_temp_dir = NULL
 * 
 *         if self._allocated_context == 1:             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_free_context(self.context)
 * 
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base._allocated_context == 1);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2669
 * 
 *         if self._allocated_context == 1:
 *             FMIL.fmi_import_free_context(self.context)             # <<<<<<<<<<<<<<
 * 
 *         if self._fmu_log_name != NULL:
 */
    fmi_import_free_context(__pyx_v_self->__pyx_base.context);
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "pyfmi\fmi.pyx":2671
 *             FMIL.fmi_import_free_context(self.context)
 * 
 *         if self._fmu_log_name != NULL:             # <<<<<<<<<<<<<<
 *             FMIL.free(self._fmu_log_name)
 *             self._fmu_log_name = NULL
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base.__pyx_base._fmu_log_name != NULL);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2672
 * 
 *         if self._fmu_log_name != NULL:
 *             FMIL.free(self._fmu_log_name)             # <<<<<<<<<<<<<<
 *             self._fmu_log_name = NULL
 * 
 */
    free(__pyx_v_self->__pyx_base.__pyx_base._fmu_log_name);

    /* "pyfmi\fmi.pyx":2673
 *         if self._fmu_log_name != NULL:
 *             FMIL.free(self._fmu_log_name)
 *             self._fmu_log_name = NULL             # <<<<<<<<<<<<<<
 * 
 *     cpdef _get_time(self):
 */
    __pyx_v_self->__pyx_base.__pyx_base._fmu_log_name = NULL;
    goto __pyx_L9;
  }
  __pyx_L9:;

  __Pyx_RefNannyFinishContext();
}

/* "pyfmi\fmi.pyx":2675
 *             self._fmu_log_name = NULL
 * 
 *     cpdef _get_time(self):             # <<<<<<<<<<<<<<
 *         return self.__t
 * 
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_9_get_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_11FMUModelME1__get_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_time", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___get_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_9_get_time)) {
      __Pyx_XDECREF(__pyx_r);
      __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 = 2675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":2676
 * 
 *     cpdef _get_time(self):
 *         return self.__t             # <<<<<<<<<<<<<<
 * 
 *     cpdef _set_time(self, FMIL.fmi1_real_t t):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.__t);
  __pyx_r = __pyx_v_self->__pyx_base.__t;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1._get_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_9_get_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_9_get_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_time (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_8_get_time(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2675
 *             self._fmu_log_name = NULL
 * 
 *     cpdef _get_time(self):             # <<<<<<<<<<<<<<
 *         return self.__t
 * 
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_8_get_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__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("_get_time", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_get_time(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1._get_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2678
 *         return self.__t
 * 
 *     cpdef _set_time(self, FMIL.fmi1_real_t t):             # <<<<<<<<<<<<<<
 *         cdef int status
 *         self.__t = t
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_11_set_time(PyObject *__pyx_v_self, PyObject *__pyx_arg_t); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_11FMUModelME1__set_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, fmi1_real_t __pyx_v_t, int __pyx_skip_dispatch) {
  int __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_time", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___set_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_11_set_time)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":2680
 *     cpdef _set_time(self, FMIL.fmi1_real_t t):
 *         cdef int status
 *         self.__t = t             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi1_import_set_time(self._fmu,t)
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.__t);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.__t);
  __pyx_v_self->__pyx_base.__t = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2682
 *         self.__t = t
 * 
 *         status = FMIL.fmi1_import_set_time(self._fmu,t)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi1_import_set_time(__pyx_v_self->__pyx_base._fmu, __pyx_v_t);

  /* "pyfmi\fmi.pyx":2684
 *         status = FMIL.fmi1_import_set_time(self._fmu,t)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to set the time.')
 * 
 */
  __pyx_t_4 = (__pyx_v_status != 0);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":2685
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the time.')             # <<<<<<<<<<<<<<
 * 
 *     time = property(_get_time,_set_time, doc =
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_157), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1._set_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_11_set_time(PyObject *__pyx_v_self, PyObject *__pyx_arg_t); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_11_set_time(PyObject *__pyx_v_self, PyObject *__pyx_arg_t) {
  fmi1_real_t __pyx_v_t;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set_time (wrapper)", 0);
  assert(__pyx_arg_t); {
    __pyx_v_t = __pyx_PyFloat_AsDouble(__pyx_arg_t); if (unlikely((__pyx_v_t == (fmi1_real_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2678; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1._set_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_10_set_time(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self), ((fmi1_real_t)__pyx_v_t));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2678
 *         return self.__t
 * 
 *     cpdef _set_time(self, FMIL.fmi1_real_t t):             # <<<<<<<<<<<<<<
 *         cdef int status
 *         self.__t = t
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_10_set_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, fmi1_real_t __pyx_v_t) {
  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("_set_time", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_set_time(__pyx_v_self, __pyx_v_t, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1._set_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_13_get_continuous_states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_13_get_continuous_states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_continuous_states (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_12_get_continuous_states(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2693
 *     """)
 * 
 *     def _get_continuous_states(self):             # <<<<<<<<<<<<<<
 *         cdef int status
 *         cdef N.ndarray[double, ndim=1,mode='c'] ndx = N.zeros(self._nContinuousStates, dtype=N.double)
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_12_get_continuous_states(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self) {
  int __pyx_v_status;
  PyArrayObject *__pyx_v_ndx = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_ndx;
  __Pyx_Buffer __pyx_pybuffer_ndx;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_continuous_states", 0);
  __pyx_pybuffer_ndx.pybuffer.buf = NULL;
  __pyx_pybuffer_ndx.refcount = 0;
  __pyx_pybuffernd_ndx.data = NULL;
  __pyx_pybuffernd_ndx.rcbuffer = &__pyx_pybuffer_ndx;

  /* "pyfmi\fmi.pyx":2695
 *     def _get_continuous_states(self):
 *         cdef int status
 *         cdef N.ndarray[double, ndim=1,mode='c'] ndx = N.zeros(self._nContinuousStates, dtype=N.double)             # <<<<<<<<<<<<<<
 *         status = FMIL.fmi1_import_get_continuous_states(self._fmu, <FMIL.fmi1_real_t*>ndx.data ,self._nContinuousStates)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_self->__pyx_base._nContinuousStates); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ndx.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_ndx = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_ndx.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_ndx.diminfo[0].strides = __pyx_pybuffernd_ndx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ndx.diminfo[0].shape = __pyx_pybuffernd_ndx.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_ndx = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":2696
 *         cdef int status
 *         cdef N.ndarray[double, ndim=1,mode='c'] ndx = N.zeros(self._nContinuousStates, dtype=N.double)
 *         status = FMIL.fmi1_import_get_continuous_states(self._fmu, <FMIL.fmi1_real_t*>ndx.data ,self._nContinuousStates)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi1_import_get_continuous_states(__pyx_v_self->__pyx_base._fmu, ((fmi1_real_t *)__pyx_v_ndx->data), __pyx_v_self->__pyx_base._nContinuousStates);

  /* "pyfmi\fmi.pyx":2698
 *         status = FMIL.fmi1_import_get_continuous_states(self._fmu, <FMIL.fmi1_real_t*>ndx.data ,self._nContinuousStates)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to retrieve the continuous states.')
 * 
 */
  __pyx_t_7 = (__pyx_v_status != 0);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":2699
 * 
 *         if status != 0:
 *             raise FMUException('Failed to retrieve the continuous states.')             # <<<<<<<<<<<<<<
 * 
 *         return ndx
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_159), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2701
 *             raise FMUException('Failed to retrieve the continuous states.')
 * 
 *         return ndx             # <<<<<<<<<<<<<<
 * 
 *     def _set_continuous_states(self, N.ndarray[FMIL.fmi1_real_t] values):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ndx));
  __pyx_r = ((PyObject *)__pyx_v_ndx);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ndx.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1._get_continuous_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ndx.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_ndx);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_15_set_continuous_states(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_15_set_continuous_states(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set_continuous_states (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_14_set_continuous_states(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values));
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2703
 *         return ndx
 * 
 *     def _set_continuous_states(self, N.ndarray[FMIL.fmi1_real_t] values):             # <<<<<<<<<<<<<<
 *         cdef int status
 *         cdef N.ndarray[FMIL.fmi1_real_t, ndim=1,mode='c'] ndx = values#N.array(values,dtype=N.double,ndmin=1).flatten()
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_14_set_continuous_states(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, PyArrayObject *__pyx_v_values) {
  int __pyx_v_status;
  PyArrayObject *__pyx_v_ndx = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_ndx;
  __Pyx_Buffer __pyx_pybuffer_ndx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_continuous_states", 0);
  __pyx_pybuffer_ndx.pybuffer.buf = NULL;
  __pyx_pybuffer_ndx.refcount = 0;
  __pyx_pybuffernd_ndx.data = NULL;
  __pyx_pybuffernd_ndx.rcbuffer = &__pyx_pybuffer_ndx;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn_fmi1_real_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];

  /* "pyfmi\fmi.pyx":2705
 *     def _set_continuous_states(self, N.ndarray[FMIL.fmi1_real_t] values):
 *         cdef int status
 *         cdef N.ndarray[FMIL.fmi1_real_t, ndim=1,mode='c'] ndx = values#N.array(values,dtype=N.double,ndmin=1).flatten()             # <<<<<<<<<<<<<<
 * 
 *         if ndx.size != self._nContinuousStates:
 */
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ndx.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_values), &__Pyx_TypeInfo_nn_fmi1_real_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_ndx = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_ndx.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_ndx.diminfo[0].strides = __pyx_pybuffernd_ndx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ndx.diminfo[0].shape = __pyx_pybuffernd_ndx.rcbuffer->pybuffer.shape[0];
    }
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_values));
  __pyx_v_ndx = ((PyArrayObject *)__pyx_v_values);

  /* "pyfmi\fmi.pyx":2707
 *         cdef N.ndarray[FMIL.fmi1_real_t, ndim=1,mode='c'] ndx = values#N.array(values,dtype=N.double,ndmin=1).flatten()
 * 
 *         if ndx.size != self._nContinuousStates:             # <<<<<<<<<<<<<<
 *             raise FMUException(
 *                 'Failed to set the new continuous states. ' \
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_ndx), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyLong_FromUnsignedLong(__pyx_v_self->__pyx_base._nContinuousStates); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":2708
 * 
 *         if ndx.size != self._nContinuousStates:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'Failed to set the new continuous states. ' \
 *                 'The number of values are not consistent with the number of '\
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_161), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2713
 *                 'continuous states.')
 * 
 *         status = FMIL.fmi1_import_set_continuous_states(self._fmu, <FMIL.fmi1_real_t*>ndx.data ,self._nContinuousStates)             # <<<<<<<<<<<<<<
 * 
 *         if status >= 3:
 */
  __pyx_v_status = fmi1_import_set_continuous_states(__pyx_v_self->__pyx_base._fmu, ((fmi1_real_t *)__pyx_v_ndx->data), __pyx_v_self->__pyx_base._nContinuousStates);

  /* "pyfmi\fmi.pyx":2715
 *         status = FMIL.fmi1_import_set_continuous_states(self._fmu, <FMIL.fmi1_real_t*>ndx.data ,self._nContinuousStates)
 * 
 *         if status >= 3:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to set the new continuous states.')
 * 
 */
  __pyx_t_4 = (__pyx_v_status >= 3);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":2716
 * 
 *         if status >= 3:
 *             raise FMUException('Failed to set the new continuous states.')             # <<<<<<<<<<<<<<
 * 
 *     continuous_states = property(_get_continuous_states, _set_continuous_states,
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_163), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ndx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1._set_continuous_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ndx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_ndx);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_17_get_nominal_continuous_states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_17_get_nominal_continuous_states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_nominal_continuous_states (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_16_get_nominal_continuous_states(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2725
 *     """)
 * 
 *     def _get_nominal_continuous_states(self):             # <<<<<<<<<<<<<<
 *         cdef int status
 *         cdef N.ndarray[FMIL.fmi1_real_t, ndim=1,mode='c'] ndx = N.zeros(self._nContinuousStates,dtype=N.double)
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_16_get_nominal_continuous_states(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self) {
  int __pyx_v_status;
  PyArrayObject *__pyx_v_ndx = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_ndx;
  __Pyx_Buffer __pyx_pybuffer_ndx;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_nominal_continuous_states", 0);
  __pyx_pybuffer_ndx.pybuffer.buf = NULL;
  __pyx_pybuffer_ndx.refcount = 0;
  __pyx_pybuffernd_ndx.data = NULL;
  __pyx_pybuffernd_ndx.rcbuffer = &__pyx_pybuffer_ndx;

  /* "pyfmi\fmi.pyx":2727
 *     def _get_nominal_continuous_states(self):
 *         cdef int status
 *         cdef N.ndarray[FMIL.fmi1_real_t, ndim=1,mode='c'] ndx = N.zeros(self._nContinuousStates,dtype=N.double)             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi1_import_get_nominal_continuous_states(
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_self->__pyx_base._nContinuousStates); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ndx.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_fmi1_real_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_ndx = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_ndx.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_ndx.diminfo[0].strides = __pyx_pybuffernd_ndx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ndx.diminfo[0].shape = __pyx_pybuffernd_ndx.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_ndx = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":2730
 * 
 *         status = FMIL.fmi1_import_get_nominal_continuous_states(
 *                 self._fmu, <FMIL.fmi1_real_t*>ndx.data, self._nContinuousStates)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi1_import_get_nominal_continuous_states(__pyx_v_self->__pyx_base._fmu, ((fmi1_real_t *)__pyx_v_ndx->data), __pyx_v_self->__pyx_base._nContinuousStates);

  /* "pyfmi\fmi.pyx":2732
 *                 self._fmu, <FMIL.fmi1_real_t*>ndx.data, self._nContinuousStates)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to get the nominal values.')
 * 
 */
  __pyx_t_7 = (__pyx_v_status != 0);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":2733
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the nominal values.')             # <<<<<<<<<<<<<<
 * 
 *         return ndx
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_165), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2735
 *             raise FMUException('Failed to get the nominal values.')
 * 
 *         return ndx             # <<<<<<<<<<<<<<
 * 
 *     nominal_continuous_states = property(_get_nominal_continuous_states, doc =
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ndx));
  __pyx_r = ((PyObject *)__pyx_v_ndx);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ndx.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1._get_nominal_continuous_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ndx.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_ndx);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2743
 *     """)
 * 
 *     cpdef get_derivatives(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the derivative of the continuous states.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_19get_derivatives(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_11FMUModelME1_get_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, int __pyx_skip_dispatch) {
  int __pyx_v_status;
  PyArrayObject *__pyx_v_values = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_derivatives", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_derivatives); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_19get_derivatives)) {
      __Pyx_XDECREF(__pyx_r);
      __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 = 2743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":2759
 *         """
 *         cdef int status
 *         cdef N.ndarray[FMIL.fmi1_real_t, ndim=1,mode='c'] values = N.empty(self._nContinuousStates,dtype=N.double)             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi1_import_get_derivatives(self._fmu, <FMIL.fmi1_real_t*>values.data, self._nContinuousStates)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_self->__pyx_base._nContinuousStates); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_fmi1_real_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_values = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_values.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_values = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":2761
 *         cdef N.ndarray[FMIL.fmi1_real_t, ndim=1,mode='c'] values = N.empty(self._nContinuousStates,dtype=N.double)
 * 
 *         status = FMIL.fmi1_import_get_derivatives(self._fmu, <FMIL.fmi1_real_t*>values.data, self._nContinuousStates)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi1_import_get_derivatives(__pyx_v_self->__pyx_base._fmu, ((fmi1_real_t *)__pyx_v_values->data), __pyx_v_self->__pyx_base._nContinuousStates);

  /* "pyfmi\fmi.pyx":2763
 *         status = FMIL.fmi1_import_get_derivatives(self._fmu, <FMIL.fmi1_real_t*>values.data, self._nContinuousStates)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to get the derivative values at time: %E.'%self.time)
 * 
 */
  __pyx_t_7 = (__pyx_v_status != 0);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":2764
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the derivative values at time: %E.'%self.time)             # <<<<<<<<<<<<<<
 * 
 *         return values
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_166), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2766
 *             raise FMUException('Failed to get the derivative values at time: %E.'%self.time)
 * 
 *         return values             # <<<<<<<<<<<<<<
 * 
 *     def get_event_indicators(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_values));
  __pyx_r = ((PyObject *)__pyx_v_values);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1.get_derivatives", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_values);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_19get_derivatives(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME1_18get_derivatives[] = "\n        Returns the derivative of the continuous states.\n\n        Returns::\n\n            dx --\n                The derivative as an array.\n\n        Example::\n\n            dx = model.get_derivatives()\n\n        Calls the low-level FMI function: fmiGetDerivatives\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_19get_derivatives(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_derivatives (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_18get_derivatives(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2743
 *     """)
 * 
 *     cpdef get_derivatives(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the derivative of the continuous states.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_18get_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__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("get_derivatives", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->get_derivatives(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1.get_derivatives", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_21get_event_indicators(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME1_20get_event_indicators[] = "\n        Returns the event indicators at the current time-point.\n\n        Return::\n\n            evInd --\n                The event indicators as an array.\n\n        Example::\n\n            evInd = model.get_event_indicators()\n\n        Calls the low-level FMI function: fmiGetEventIndicators\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_21get_event_indicators(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_event_indicators (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_20get_event_indicators(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2768
 *         return values
 * 
 *     def get_event_indicators(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the event indicators at the current time-point.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_20get_event_indicators(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self) {
  int __pyx_v_status;
  PyArrayObject *__pyx_v_values = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_event_indicators", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;

  /* "pyfmi\fmi.pyx":2784
 *         """
 *         cdef int status
 *         cdef N.ndarray[FMIL.fmi1_real_t, ndim=1,mode='c'] values = N.empty(self._nEventIndicators,dtype=N.double)             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi1_import_get_event_indicators(self._fmu, <FMIL.fmi1_real_t*>values.data, self._nEventIndicators)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_self->__pyx_base._nEventIndicators); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_fmi1_real_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_values = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_values.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_values = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":2786
 *         cdef N.ndarray[FMIL.fmi1_real_t, ndim=1,mode='c'] values = N.empty(self._nEventIndicators,dtype=N.double)
 * 
 *         status = FMIL.fmi1_import_get_event_indicators(self._fmu, <FMIL.fmi1_real_t*>values.data, self._nEventIndicators)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi1_import_get_event_indicators(__pyx_v_self->__pyx_base._fmu, ((fmi1_real_t *)__pyx_v_values->data), __pyx_v_self->__pyx_base._nEventIndicators);

  /* "pyfmi\fmi.pyx":2788
 *         status = FMIL.fmi1_import_get_event_indicators(self._fmu, <FMIL.fmi1_real_t*>values.data, self._nEventIndicators)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to get the event indicators.')
 * 
 */
  __pyx_t_7 = (__pyx_v_status != 0);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":2789
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the event indicators.')             # <<<<<<<<<<<<<<
 * 
 *         return values
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_168), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2791
 *             raise FMUException('Failed to get the event indicators.')
 * 
 *         return values             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_values));
  __pyx_r = ((PyObject *)__pyx_v_values);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1.get_event_indicators", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_values);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_23get_tolerances(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME1_22get_tolerances[] = "\n        Returns the relative and absolute tolerances. If the relative tolerance\n        is defined in the XML-file it is used, otherwise a default of 1.e-4 is\n        used. The absolute tolerance is calculated and returned according to\n        the FMI specification, atol = 0.01*rtol*(nominal values of the\n        continuous states).\n\n        Returns::\n\n            rtol --\n                The relative tolerance.\n\n            atol --\n                The absolute tolerance.\n\n        Example::\n\n            [rtol, atol] = model.get_tolerances()\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_23get_tolerances(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_tolerances (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_22get_tolerances(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2794
 * 
 * 
 *     def get_tolerances(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the relative and absolute tolerances. If the relative tolerance
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_22get_tolerances(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self) {
  PyObject *__pyx_v_rtol = NULL;
  PyObject *__pyx_v_atol = NULL;
  PyObject *__pyx_r = NULL;
  __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("get_tolerances", 0);

  /* "pyfmi\fmi.pyx":2815
 *         """
 *         #rtol = FMIL.fmi1_import_get_default_experiment_tolerance(self._fmu)
 *         rtol = self.get_default_experiment_tolerance()             # <<<<<<<<<<<<<<
 *         atol = 0.01*rtol*self.nominal_continuous_states
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_169); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2815; __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 = 2815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_rtol = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":2816
 *         #rtol = FMIL.fmi1_import_get_default_experiment_tolerance(self._fmu)
 *         rtol = self.get_default_experiment_tolerance()
 *         atol = 0.01*rtol*self.nominal_continuous_states             # <<<<<<<<<<<<<<
 * 
 *         return [rtol, atol]
 */
  __pyx_t_2 = PyFloat_FromDouble(0.01); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_v_rtol); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_170); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_atol = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":2818
 *         atol = 0.01*rtol*self.nominal_continuous_states
 * 
 *         return [rtol, atol]             # <<<<<<<<<<<<<<
 * 
 *     def event_update(self, intermediateResult=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_rtol);
  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_rtol);
  __Pyx_GIVEREF(__pyx_v_rtol);
  __Pyx_INCREF(__pyx_v_atol);
  PyList_SET_ITEM(__pyx_t_3, 1, __pyx_v_atol);
  __Pyx_GIVEREF(__pyx_v_atol);
  __pyx_r = ((PyObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1.get_tolerances", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_rtol);
  __Pyx_XDECREF(__pyx_v_atol);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_25event_update(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME1_24event_update[] = "\n        Updates the event information at the current time-point. If\n        intermediateResult is set to True the update_event will stop at each\n        event iteration which would require to loop until\n        event_info.iterationConverged == fmiTrue.\n\n        Parameters::\n\n            intermediateResult --\n                If set to True, the update_event will stop at each event\n                iteration.\n                Default: False.\n\n        Example::\n\n            model.event_update()\n\n        Calls the low-level FMI function: fmiEventUpdate\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_25event_update(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_intermediateResult = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("event_update (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__intermediateResult,0};
    PyObject* values[1] = {0};
    values[0] = __pyx_k_171;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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 (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__intermediateResult);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "event_update") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2820; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_intermediateResult = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("event_update", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2820; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1.event_update", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_24event_update(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self), __pyx_v_intermediateResult);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2820
 *         return [rtol, atol]
 * 
 *     def event_update(self, intermediateResult=False):             # <<<<<<<<<<<<<<
 *         """
 *         Updates the event information at the current time-point. If
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_24event_update(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, PyObject *__pyx_v_intermediateResult) {
  int __pyx_v_status;
  fmi1_boolean_t __pyx_v_intermediate_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("event_update", 0);

  /* "pyfmi\fmi.pyx":2843
 *         cdef FMIL.fmi1_boolean_t intermediate_result
 * 
 *         if intermediateResult:             # <<<<<<<<<<<<<<
 *             intermediate_result = 1
 *             status = FMIL.fmi1_import_eventUpdate(self._fmu, intermediate_result, &self._eventInfo)
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_intermediateResult); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2844
 * 
 *         if intermediateResult:
 *             intermediate_result = 1             # <<<<<<<<<<<<<<
 *             status = FMIL.fmi1_import_eventUpdate(self._fmu, intermediate_result, &self._eventInfo)
 *         else:
 */
    __pyx_v_intermediate_result = 1;

    /* "pyfmi\fmi.pyx":2845
 *         if intermediateResult:
 *             intermediate_result = 1
 *             status = FMIL.fmi1_import_eventUpdate(self._fmu, intermediate_result, &self._eventInfo)             # <<<<<<<<<<<<<<
 *         else:
 *             intermediate_result = 0
 */
    __pyx_v_status = fmi1_import_eventUpdate(__pyx_v_self->__pyx_base._fmu, __pyx_v_intermediate_result, (&__pyx_v_self->__pyx_base._eventInfo));
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":2847
 *             status = FMIL.fmi1_import_eventUpdate(self._fmu, intermediate_result, &self._eventInfo)
 *         else:
 *             intermediate_result = 0             # <<<<<<<<<<<<<<
 *             status = FMIL.fmi1_import_eventUpdate(self._fmu, intermediate_result, &self._eventInfo)
 * 
 */
    __pyx_v_intermediate_result = 0;

    /* "pyfmi\fmi.pyx":2848
 *         else:
 *             intermediate_result = 0
 *             status = FMIL.fmi1_import_eventUpdate(self._fmu, intermediate_result, &self._eventInfo)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
    __pyx_v_status = fmi1_import_eventUpdate(__pyx_v_self->__pyx_base._fmu, __pyx_v_intermediate_result, (&__pyx_v_self->__pyx_base._eventInfo));
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2850
 *             status = FMIL.fmi1_import_eventUpdate(self._fmu, intermediate_result, &self._eventInfo)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to update the events at time: %E.'%self.time)
 * 
 */
  __pyx_t_1 = (__pyx_v_status != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2851
 * 
 *         if status != 0:
 *             raise FMUException('Failed to update the events at time: %E.'%self.time)             # <<<<<<<<<<<<<<
 * 
 *     def get_event_info(self):
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_172), __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1.event_update", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_27get_event_info(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME1_26get_event_info[] = "\n        Returns the event information from the FMU.\n\n        Returns::\n\n            The event information, a struct which contains:\n\n            iterationConverged --\n                Event iteration converged (if True).\n\n            stateValueReferencesChanged --\n                ValueReferences of states x changed (if True).\n\n            stateValuesChanged --\n                Values of states x have changed (if True).\n\n            terminateSimulation --\n                Error, terminate simulation (if True).\n\n            upcomingTimeEvent -\n                If True, nextEventTime is the next time event.\n\n            nextEventTime --\n                The next time event.\n\n        Example::\n\n            event_info    = model.event_info\n            nextEventTime = model.event_info.nextEventTime\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_27get_event_info(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_event_info (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_26get_event_info(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2853
 *             raise FMUException('Failed to update the events at time: %E.'%self.time)
 * 
 *     def get_event_info(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the event information from the FMU.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_26get_event_info(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__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("get_event_info", 0);

  /* "pyfmi\fmi.pyx":2885
 *         """
 * 
 *         self._pyEventInfo.iterationConverged          = self._eventInfo.iterationConverged == 1             # <<<<<<<<<<<<<<
 *         self._pyEventInfo.stateValueReferencesChanged = self._eventInfo.stateValueReferencesChanged == 1
 *         self._pyEventInfo.stateValuesChanged          = self._eventInfo.stateValuesChanged == 1
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->__pyx_base._eventInfo.iterationConverged == 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_v_self->__pyx_base._pyEventInfo, __pyx_n_s__iterationConverged, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2886
 * 
 *         self._pyEventInfo.iterationConverged          = self._eventInfo.iterationConverged == 1
 *         self._pyEventInfo.stateValueReferencesChanged = self._eventInfo.stateValueReferencesChanged == 1             # <<<<<<<<<<<<<<
 *         self._pyEventInfo.stateValuesChanged          = self._eventInfo.stateValuesChanged == 1
 *         self._pyEventInfo.terminateSimulation         = self._eventInfo.terminateSimulation == 1
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->__pyx_base._eventInfo.stateValueReferencesChanged == 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_v_self->__pyx_base._pyEventInfo, __pyx_n_s_173, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2887
 *         self._pyEventInfo.iterationConverged          = self._eventInfo.iterationConverged == 1
 *         self._pyEventInfo.stateValueReferencesChanged = self._eventInfo.stateValueReferencesChanged == 1
 *         self._pyEventInfo.stateValuesChanged          = self._eventInfo.stateValuesChanged == 1             # <<<<<<<<<<<<<<
 *         self._pyEventInfo.terminateSimulation         = self._eventInfo.terminateSimulation == 1
 *         self._pyEventInfo.upcomingTimeEvent           = self._eventInfo.upcomingTimeEvent == 1
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->__pyx_base._eventInfo.stateValuesChanged == 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_v_self->__pyx_base._pyEventInfo, __pyx_n_s__stateValuesChanged, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2888
 *         self._pyEventInfo.stateValueReferencesChanged = self._eventInfo.stateValueReferencesChanged == 1
 *         self._pyEventInfo.stateValuesChanged          = self._eventInfo.stateValuesChanged == 1
 *         self._pyEventInfo.terminateSimulation         = self._eventInfo.terminateSimulation == 1             # <<<<<<<<<<<<<<
 *         self._pyEventInfo.upcomingTimeEvent           = self._eventInfo.upcomingTimeEvent == 1
 *         self._pyEventInfo.nextEventTime               = self._eventInfo.nextEventTime
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->__pyx_base._eventInfo.terminateSimulation == 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_v_self->__pyx_base._pyEventInfo, __pyx_n_s__terminateSimulation, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2889
 *         self._pyEventInfo.stateValuesChanged          = self._eventInfo.stateValuesChanged == 1
 *         self._pyEventInfo.terminateSimulation         = self._eventInfo.terminateSimulation == 1
 *         self._pyEventInfo.upcomingTimeEvent           = self._eventInfo.upcomingTimeEvent == 1             # <<<<<<<<<<<<<<
 *         self._pyEventInfo.nextEventTime               = self._eventInfo.nextEventTime
 * 
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->__pyx_base._eventInfo.upcomingTimeEvent == 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_v_self->__pyx_base._pyEventInfo, __pyx_n_s__upcomingTimeEvent, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2890
 *         self._pyEventInfo.terminateSimulation         = self._eventInfo.terminateSimulation == 1
 *         self._pyEventInfo.upcomingTimeEvent           = self._eventInfo.upcomingTimeEvent == 1
 *         self._pyEventInfo.nextEventTime               = self._eventInfo.nextEventTime             # <<<<<<<<<<<<<<
 * 
 *         return self._pyEventInfo
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->__pyx_base._eventInfo.nextEventTime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_v_self->__pyx_base._pyEventInfo, __pyx_n_s__nextEventTime, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2892
 *         self._pyEventInfo.nextEventTime               = self._eventInfo.nextEventTime
 * 
 *         return self._pyEventInfo             # <<<<<<<<<<<<<<
 * 
 *     def get_state_value_references(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->__pyx_base._pyEventInfo);
  __pyx_r = __pyx_v_self->__pyx_base._pyEventInfo;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1.get_event_info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_29get_state_value_references(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME1_28get_state_value_references[] = "\n        Returns the continuous states valuereferences.\n\n        Returns::\n\n            val --\n                The references to the continuous states.\n\n        Example::\n\n            val = model.get_continuous_value_reference()\n\n        Calls the low-level FMI function: fmiGetStateValueReferences\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_29get_state_value_references(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_state_value_references (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_28get_state_value_references(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2894
 *         return self._pyEventInfo
 * 
 *     def get_state_value_references(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the continuous states valuereferences.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_28get_state_value_references(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self) {
  int __pyx_v_status;
  PyArrayObject *__pyx_v_values = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_state_value_references", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;

  /* "pyfmi\fmi.pyx":2910
 *         """
 *         cdef int status
 *         cdef N.ndarray[FMIL.fmi1_value_reference_t, ndim=1,mode='c'] values = N.zeros(self._nContinuousStates,dtype=N.uint32)             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi1_import_get_state_value_references(
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_self->__pyx_base._nContinuousStates); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__uint32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_fmi1_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_values = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_values.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_values = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":2913
 * 
 *         status = FMIL.fmi1_import_get_state_value_references(
 *             self._fmu, <FMIL.fmi1_value_reference_t*>values.data, self._nContinuousStates)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi1_import_get_state_value_references(__pyx_v_self->__pyx_base._fmu, ((fmi1_value_reference_t *)__pyx_v_values->data), __pyx_v_self->__pyx_base._nContinuousStates);

  /* "pyfmi\fmi.pyx":2915
 *             self._fmu, <FMIL.fmi1_value_reference_t*>values.data, self._nContinuousStates)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException(
 *                 'Failed to get the continuous state reference values.')
 */
  __pyx_t_7 = (__pyx_v_status != 0);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":2916
 * 
 *         if status != 0:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'Failed to get the continuous state reference values.')
 * 
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_175), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2919
 *                 'Failed to get the continuous state reference values.')
 * 
 *         return values             # <<<<<<<<<<<<<<
 * 
 *     def completed_integrator_step(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_values));
  __pyx_r = ((PyObject *)__pyx_v_values);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1.get_state_value_references", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_values);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_31completed_integrator_step(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME1_30completed_integrator_step[] = "\n        This method must be called by the environment after every completed step\n        of the integrator. If the return is True, then the environment must call\n        event_update() otherwise, no action is needed.\n\n        Returns::\n\n            True -> Call event_update().\n            False -> Do nothing.\n\n        Calls the low-level FMI function: fmiCompletedIntegratorStep.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_31completed_integrator_step(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("completed_integrator_step (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_30completed_integrator_step(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":2921
 *         return values
 * 
 *     def completed_integrator_step(self):             # <<<<<<<<<<<<<<
 *         """
 *         This method must be called by the environment after every completed step
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_30completed_integrator_step(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self) {
  int __pyx_v_status;
  fmi1_boolean_t __pyx_v_callEventUpdate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  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("completed_integrator_step", 0);

  /* "pyfmi\fmi.pyx":2937
 *         cdef FMIL.fmi1_boolean_t callEventUpdate
 * 
 *         status = FMIL.fmi1_import_completed_integrator_step(self._fmu, &callEventUpdate)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi1_import_completed_integrator_step(__pyx_v_self->__pyx_base._fmu, (&__pyx_v_callEventUpdate));

  /* "pyfmi\fmi.pyx":2939
 *         status = FMIL.fmi1_import_completed_integrator_step(self._fmu, &callEventUpdate)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to call FMI Completed Step.')
 * 
 */
  __pyx_t_1 = (__pyx_v_status != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2940
 * 
 *         if status != 0:
 *             raise FMUException('Failed to call FMI Completed Step.')             # <<<<<<<<<<<<<<
 * 
 *         if callEventUpdate == 1:
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_177), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2942
 *             raise FMUException('Failed to call FMI Completed Step.')
 * 
 *         if callEventUpdate == 1:             # <<<<<<<<<<<<<<
 *             return True
 *         else:
 */
  __pyx_t_1 = (__pyx_v_callEventUpdate == 1);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":2943
 * 
 *         if callEventUpdate == 1:
 *             return True             # <<<<<<<<<<<<<<
 *         else:
 *             return False
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":2945
 *             return True
 *         else:
 *             return False             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }
  __pyx_L4:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1.completed_integrator_step", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_33initialize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME1_32initialize[] = "\n        Initializes the model and computes initial values for all variables,\n        including setting the start values of variables defined with a the start\n        attribute in the XML-file.\n\n        Parameters::\n\n            tolControlled --\n                If the model are going to be called by numerical solver using\n                step-size control. Boolean flag.\n            relativeTolerance --\n                If the model are controlled by a numerical solver using\n                step-size control, the same tolerance should be provided here.\n                Else the default tolerance from the XML-file are used.\n\n        Calls the low-level FMI function: fmiInitialize.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_33initialize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_tolControlled = 0;
  PyObject *__pyx_v_relativeTolerance = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("initialize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__tolControlled,&__pyx_n_s__relativeTolerance,0};
    PyObject* values[2] = {0,0};
    values[0] = __pyx_k_178;

    /* "pyfmi\fmi.pyx":2948
 * 
 * 
 *     def initialize(self, tolControlled=True, relativeTolerance=None):             # <<<<<<<<<<<<<<
 *         """
 *         Initializes the model and computes initial values for all variables,
 */
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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 (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tolControlled);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__relativeTolerance);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "initialize") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2948; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        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;
      }
    }
    __pyx_v_tolControlled = values[0];
    __pyx_v_relativeTolerance = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("initialize", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2948; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1.initialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_32initialize(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self), __pyx_v_tolControlled, __pyx_v_relativeTolerance);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_32initialize(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, PyObject *__pyx_v_tolControlled, PyObject *__pyx_v_relativeTolerance) {
  char __pyx_v_tolerance_controlled;
  fmi1_real_t __pyx_v_tolerance;
  int __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  fmi1_real_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("initialize", 0);

  /* "pyfmi\fmi.pyx":2970
 * 
 *         #Trying to set the initial time from the xml file, else 0.0
 *         if self.time == None:             # <<<<<<<<<<<<<<
 *             self.time = FMIL.fmi1_import_get_default_experiment_start(self._fmu)
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":2971
 *         #Trying to set the initial time from the xml file, else 0.0
 *         if self.time == None:
 *             self.time = FMIL.fmi1_import_get_default_experiment_start(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if tolControlled:
 */
    __pyx_t_2 = PyFloat_FromDouble(fmi1_import_get_default_experiment_start(__pyx_v_self->__pyx_base._fmu)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (PyObject_SetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__time, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":2973
 *             self.time = FMIL.fmi1_import_get_default_experiment_start(self._fmu)
 * 
 *         if tolControlled:             # <<<<<<<<<<<<<<
 *             tolerance_controlled = 1
 *             if relativeTolerance == None:
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_tolControlled); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":2974
 * 
 *         if tolControlled:
 *             tolerance_controlled = 1             # <<<<<<<<<<<<<<
 *             if relativeTolerance == None:
 *                 tolerance = FMIL.fmi1_import_get_default_experiment_tolerance(self._fmu)
 */
    __pyx_v_tolerance_controlled = 1;

    /* "pyfmi\fmi.pyx":2975
 *         if tolControlled:
 *             tolerance_controlled = 1
 *             if relativeTolerance == None:             # <<<<<<<<<<<<<<
 *                 tolerance = FMIL.fmi1_import_get_default_experiment_tolerance(self._fmu)
 *             else:
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_relativeTolerance, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_3) {

      /* "pyfmi\fmi.pyx":2976
 *             tolerance_controlled = 1
 *             if relativeTolerance == None:
 *                 tolerance = FMIL.fmi1_import_get_default_experiment_tolerance(self._fmu)             # <<<<<<<<<<<<<<
 *             else:
 *                 tolerance = relativeTolerance
 */
      __pyx_v_tolerance = fmi1_import_get_default_experiment_tolerance(__pyx_v_self->__pyx_base._fmu);
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":2978
 *                 tolerance = FMIL.fmi1_import_get_default_experiment_tolerance(self._fmu)
 *             else:
 *                 tolerance = relativeTolerance             # <<<<<<<<<<<<<<
 *         else:
 *             tolerance_controlled = 0
 */
      __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_relativeTolerance); if (unlikely((__pyx_t_4 == (fmi1_real_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_tolerance = __pyx_t_4;
    }
    __pyx_L5:;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":2980
 *                 tolerance = relativeTolerance
 *         else:
 *             tolerance_controlled = 0             # <<<<<<<<<<<<<<
 *             tolerance = 0.0
 * 
 */
    __pyx_v_tolerance_controlled = 0;

    /* "pyfmi\fmi.pyx":2981
 *         else:
 *             tolerance_controlled = 0
 *             tolerance = 0.0             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi1_import_initialize(self._fmu, tolerance_controlled, tolerance, &self._eventInfo)
 */
    __pyx_v_tolerance = 0.0;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":2983
 *             tolerance = 0.0
 * 
 *         status = FMIL.fmi1_import_initialize(self._fmu, tolerance_controlled, tolerance, &self._eventInfo)             # <<<<<<<<<<<<<<
 * 
 *         if status == 1:
 */
  __pyx_v_status = fmi1_import_initialize(__pyx_v_self->__pyx_base._fmu, __pyx_v_tolerance_controlled, __pyx_v_tolerance, (&__pyx_v_self->__pyx_base._eventInfo));

  /* "pyfmi\fmi.pyx":2985
 *         status = FMIL.fmi1_import_initialize(self._fmu, tolerance_controlled, tolerance, &self._eventInfo)
 * 
 *         if status == 1:             # <<<<<<<<<<<<<<
 *             if self._enable_logging:
 *                 logging.warning(
 */
  __pyx_t_3 = (__pyx_v_status == 1);
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":2986
 * 
 *         if status == 1:
 *             if self._enable_logging:             # <<<<<<<<<<<<<<
 *                 logging.warning(
 *                     'Initialize returned with a warning.' \
 */
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->__pyx_base._enable_logging); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_3) {

      /* "pyfmi\fmi.pyx":2987
 *         if status == 1:
 *             if self._enable_logging:
 *                 logging.warning(             # <<<<<<<<<<<<<<
 *                     'Initialize returned with a warning.' \
 *                     ' Check the log for information (FMUModel.get_log).')
 */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logging); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__warning); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_180), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L7;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":2991
 *                     ' Check the log for information (FMUModel.get_log).')
 *             else:
 *                 logging.warning('Initialize returned with a warning.' \             # <<<<<<<<<<<<<<
 *                     ' Enable logging for more information, (FMUModel(..., enable_logging=True)).')
 * 
 */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logging); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__warning); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_182), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_L7:;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pyfmi\fmi.pyx":2994
 *                     ' Enable logging for more information, (FMUModel(..., enable_logging=True)).')
 * 
 *         if status > 1:             # <<<<<<<<<<<<<<
 *             if self._enable_logging:
 *                 raise FMUException(
 */
  __pyx_t_3 = (__pyx_v_status > 1);
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":2995
 * 
 *         if status > 1:
 *             if self._enable_logging:             # <<<<<<<<<<<<<<
 *                 raise FMUException(
 *                     'Initialize returned with an error.' \
 */
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->__pyx_base._enable_logging); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_3) {

      /* "pyfmi\fmi.pyx":2996
 *         if status > 1:
 *             if self._enable_logging:
 *                 raise FMUException(             # <<<<<<<<<<<<<<
 *                     'Initialize returned with an error.' \
 *                     ' Check the log for information (FMUModel.get_log).')
 */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_184), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L9;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":3000
 *                     ' Check the log for information (FMUModel.get_log).')
 *             else:
 *                 raise FMUException('Initialize returned with an error.' \             # <<<<<<<<<<<<<<
 *                     ' Enable logging for more information, (FMUModel(..., enable_logging=True)).')
 * 
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_186), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L9:;
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "pyfmi\fmi.pyx":3003
 *                     ' Enable logging for more information, (FMUModel(..., enable_logging=True)).')
 * 
 *         self._allocated_fmu = 1             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->__pyx_base._allocated_fmu = 1;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1.initialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_35instantiate_model(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME1_34instantiate_model[] = "\n        Instantiate the model.\n\n        Parameters::\n\n            name --\n                The name of the instance.\n                Default: 'Model'\n\n            logging --\n                Defines if the logging should be turned on or off.\n                Default: False, no logging.\n\n        Calls the low-level FMI function: fmiInstantiateModel.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_35instantiate_model(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_logging = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("instantiate_model (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__name,&__pyx_n_s__logging,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)__pyx_n_s__Model);
    values[1] = __pyx_k_187;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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 (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__name);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__logging);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "instantiate_model") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3006; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        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;
      }
    }
    __pyx_v_name = values[0];
    __pyx_v_logging = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("instantiate_model", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3006; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1.instantiate_model", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_34instantiate_model(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self), __pyx_v_name, __pyx_v_logging);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3006
 * 
 * 
 *     def instantiate_model(self, name='Model', logging=False):             # <<<<<<<<<<<<<<
 *         """
 *         Instantiate the model.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_34instantiate_model(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_logging) {
  fmi1_boolean_t __pyx_v_log;
  int __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  fmi1_string_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("instantiate_model", 0);
  __Pyx_INCREF(__pyx_v_name);

  /* "pyfmi\fmi.pyx":3025
 *         cdef int status
 * 
 *         if logging:             # <<<<<<<<<<<<<<
 *             log = 1
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_logging); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":3026
 * 
 *         if logging:
 *             log = 1             # <<<<<<<<<<<<<<
 *         else:
 *             log = 0
 */
    __pyx_v_log = 1;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":3028
 *             log = 1
 *         else:
 *             log = 0             # <<<<<<<<<<<<<<
 * 
 *         name = encode(name)
 */
    __pyx_v_log = 0;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":3030
 *             log = 0
 * 
 *         name = encode(name)             # <<<<<<<<<<<<<<
 *         status = FMIL.fmi1_import_instantiate_model(self._fmu, name)
 * 
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_name);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_v_name);
  __pyx_v_name = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":3031
 * 
 *         name = encode(name)
 *         status = FMIL.fmi1_import_instantiate_model(self._fmu, name)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_t_5 = PyBytes_AsString(__pyx_v_name); if (unlikely((__pyx_t_5 == (fmi1_string_t)NULL) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_status = fmi1_import_instantiate_model(__pyx_v_self->__pyx_base._fmu, __pyx_t_5);

  /* "pyfmi\fmi.pyx":3033
 *         status = FMIL.fmi1_import_instantiate_model(self._fmu, name)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to instantiate the model. See the log for possibly more information.')
 * 
 */
  __pyx_t_1 = (__pyx_v_status != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":3034
 * 
 *         if status != 0:
 *             raise FMUException('Failed to instantiate the model. See the log for possibly more information.')             # <<<<<<<<<<<<<<
 * 
 *         #The FMU is instantiated
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_189), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":3037
 * 
 *         #The FMU is instantiated
 *         self._instantiated_fmu = 1             # <<<<<<<<<<<<<<
 * 
 *         #Just to be safe, some problems with Dymola (2012) FMUs not reacting
 */
  __pyx_v_self->__pyx_base._instantiated_fmu = 1;

  /* "pyfmi\fmi.pyx":3041
 *         #Just to be safe, some problems with Dymola (2012) FMUs not reacting
 *         #to logging when set to the instantiate method.
 *         status = FMIL.fmi1_import_set_debug_logging(self._fmu, log)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi1_import_set_debug_logging(__pyx_v_self->__pyx_base._fmu, __pyx_v_log);

  /* "pyfmi\fmi.pyx":3043
 *         status = FMIL.fmi1_import_set_debug_logging(self._fmu, log)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to set the debugging option. See the log for possibly more information.')
 * 
 */
  __pyx_t_1 = (__pyx_v_status != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":3044
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the debugging option. See the log for possibly more information.')             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_190), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1.instantiate_model", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_37simulate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME1_36simulate[] = "\n        Compact function for model simulation.\n\n        The simulation method depends on which algorithm is used, this can be\n        set with the function argument 'algorithm'. Options for the algorithm\n        are passed as option classes or as pure dicts. See\n        FMUModel.simulate_options for more details.\n\n        The default algorithm for this function is AssimuloFMIAlg.\n\n        Parameters::\n\n            start_time --\n                Start time for the simulation.\n                Default: Start time defined in the default experiment from\n                        the ModelDescription file.\n\n            final_time --\n                Final time for the simulation.\n                Default: Stop time defined in the default experiment from\n                        the ModelDescription file.\n\n            input --\n                Input signal for the simulation. The input should be a 2-tuple\n                consisting of first the names of the input variable(s) and then\n                the data matrix or a function. If a data matrix, the first\n                column should be a time vector and then the variable vectors as\n                columns. If instead a function, the argument should correspond\n                to time and the output the variable data. See the users-guide\n                for examples.\n                Default: Empty tuple.\n\n            algorithm --\n                The algorithm which will be used for the simulation is specified\n                by passing the algorithm class as string or class object in this\n                argument. 'algorithm' can be any class which implements the\n                abstract class AlgorithmBase (found in algorithm_drivers.py). In\n                this way it is possible to write own algorithms and use them\n                with this function.\n                Default: 'AssimuloFMIAlg'\n\n            options --\n                The options that should be used in the algorithm. Fo""r details on\n                the options do:\n\n                    >> myModel = FMUModel(...)\n                    >> opts = myModel.simulate_options()\n                    >> opts?\n\n                Valid values are:\n                    - A dict which gives AssimuloFMIAlgOptions with\n                      default values on all options except the ones\n                      listed in the dict. Empty dict will thus give all\n                      options with default values.\n                    - An options object.\n                Default: Empty dict\n\n        Returns::\n\n            Result object, subclass of common.algorithm_drivers.ResultBase.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_37simulate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start_time = 0;
  PyObject *__pyx_v_final_time = 0;
  PyObject *__pyx_v_input = 0;
  PyObject *__pyx_v_algorithm = 0;
  PyObject *__pyx_v_options = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("simulate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start_time,&__pyx_n_s__final_time,&__pyx_n_s__input,&__pyx_n_s__algorithm,&__pyx_n_s__options,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[0] = ((PyObject *)__pyx_n_s__Default);
    values[1] = ((PyObject *)__pyx_n_s__Default);

    /* "pyfmi\fmi.pyx":3051
 *                  start_time="Default",
 *                  final_time="Default",
 *                  input=(),             # <<<<<<<<<<<<<<
 *                  algorithm='AssimuloFMIAlg',
 *                  options={}):
 */
    values[2] = ((PyObject *)__pyx_empty_tuple);
    values[3] = ((PyObject *)__pyx_n_s__AssimuloFMIAlg);
    values[4] = __pyx_k_191;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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 (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start_time);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__final_time);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__input);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__algorithm);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__options);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "simulate") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3048; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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;
      }
    }
    __pyx_v_start_time = values[0];
    __pyx_v_final_time = values[1];
    __pyx_v_input = values[2];
    __pyx_v_algorithm = values[3];
    __pyx_v_options = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("simulate", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3048; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1.simulate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_36simulate(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self), __pyx_v_start_time, __pyx_v_final_time, __pyx_v_input, __pyx_v_algorithm, __pyx_v_options);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3048
 * 
 * 
 *     def simulate(self,             # <<<<<<<<<<<<<<
 *                  start_time="Default",
 *                  final_time="Default",
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_36simulate(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, PyObject *__pyx_v_start_time, PyObject *__pyx_v_final_time, PyObject *__pyx_v_input, PyObject *__pyx_v_algorithm, PyObject *__pyx_v_options) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("simulate", 0);
  __Pyx_INCREF(__pyx_v_start_time);
  __Pyx_INCREF(__pyx_v_final_time);

  /* "pyfmi\fmi.pyx":3115
 *             Result object, subclass of common.algorithm_drivers.ResultBase.
 *         """
 *         if start_time == "Default":             # <<<<<<<<<<<<<<
 *             start_time = self.get_default_experiment_start_time()
 *         if final_time == "Default":
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_start_time, ((PyObject *)__pyx_n_s__Default), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":3116
 *         """
 *         if start_time == "Default":
 *             start_time = self.get_default_experiment_start_time()             # <<<<<<<<<<<<<<
 *         if final_time == "Default":
 *             final_time = self.get_default_experiment_stop_time()
 */
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_129); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_v_start_time);
    __pyx_v_start_time = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":3117
 *         if start_time == "Default":
 *             start_time = self.get_default_experiment_start_time()
 *         if final_time == "Default":             # <<<<<<<<<<<<<<
 *             final_time = self.get_default_experiment_stop_time()
 * 
 */
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_final_time, ((PyObject *)__pyx_n_s__Default), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":3118
 *             start_time = self.get_default_experiment_start_time()
 *         if final_time == "Default":
 *             final_time = self.get_default_experiment_stop_time()             # <<<<<<<<<<<<<<
 * 
 *         return self._exec_simulate_algorithm(start_time,
 */
    __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_130); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3118; __pyx_clineno = __LINE__; goto __pyx_L1_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 = 3118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_v_final_time);
    __pyx_v_final_time = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":3120
 *             final_time = self.get_default_experiment_stop_time()
 * 
 *         return self._exec_simulate_algorithm(start_time,             # <<<<<<<<<<<<<<
 *                                              final_time,
 *                                              input,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_131); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyfmi\fmi.pyx":3125
 *                                              'pyfmi.fmi_algorithm_drivers',
 *                                              algorithm,
 *                                              options)             # <<<<<<<<<<<<<<
 * 
 *     def simulate_options(self, algorithm='AssimuloFMIAlg'):
 */
  __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_start_time);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_start_time);
  __Pyx_GIVEREF(__pyx_v_start_time);
  __Pyx_INCREF(__pyx_v_final_time);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_final_time);
  __Pyx_GIVEREF(__pyx_v_final_time);
  __Pyx_INCREF(__pyx_v_input);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_input);
  __Pyx_GIVEREF(__pyx_v_input);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_9));
  PyTuple_SET_ITEM(__pyx_t_3, 3, ((PyObject *)__pyx_kp_s_9));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9));
  __Pyx_INCREF(__pyx_v_algorithm);
  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_algorithm);
  __Pyx_GIVEREF(__pyx_v_algorithm);
  __Pyx_INCREF(__pyx_v_options);
  PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_v_options);
  __Pyx_GIVEREF(__pyx_v_options);
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1.simulate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_start_time);
  __Pyx_XDECREF(__pyx_v_final_time);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_39simulate_options(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME1_38simulate_options[] = "\n        Get an instance of the simulate options class, filled with default\n        values. If called without argument then the options class for the\n        default simulation algorithm will be returned.\n\n        Parameters::\n\n            algorithm --\n                The algorithm for which the options class should be fetched.\n                Possible values are: 'AssimuloFMIAlg'.\n                Default: 'AssimuloFMIAlg'\n\n        Returns::\n\n            Options class for the algorithm specified with default values.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_39simulate_options(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_algorithm = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("simulate_options (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__algorithm,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_n_s__AssimuloFMIAlg);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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 (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__algorithm);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "simulate_options") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3127; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_algorithm = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("simulate_options", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3127; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1.simulate_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_38simulate_options(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self), __pyx_v_algorithm);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3127
 *                                              options)
 * 
 *     def simulate_options(self, algorithm='AssimuloFMIAlg'):             # <<<<<<<<<<<<<<
 *         """
 *         Get an instance of the simulate options class, filled with default
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_38simulate_options(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self, PyObject *__pyx_v_algorithm) {
  PyObject *__pyx_r = NULL;
  __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("simulate_options", 0);

  /* "pyfmi\fmi.pyx":3144
 *             Options class for the algorithm specified with default values.
 *         """
 *         return self._default_options('pyfmi.fmi_algorithm_drivers', algorithm)             # <<<<<<<<<<<<<<
 * 
 *     def terminate(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___default_options); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3144; __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 = 3144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_9));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_9));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9));
  __Pyx_INCREF(__pyx_v_algorithm);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_algorithm);
  __Pyx_GIVEREF(__pyx_v_algorithm);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME1.simulate_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_41terminate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME1_40terminate[] = "\n        Calls the FMI function fmiTerminate() on the FMU.\n        After this call, any call to a function changing the state of the FMU will fail.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_41terminate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("terminate (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_40terminate(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3146
 *         return self._default_options('pyfmi.fmi_algorithm_drivers', algorithm)
 * 
 *     def terminate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Calls the FMI function fmiTerminate() on the FMU.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_40terminate(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("terminate", 0);

  /* "pyfmi\fmi.pyx":3151
 *         After this call, any call to a function changing the state of the FMU will fail.
 *         """
 *         if self._allocated_fmu == 1:             # <<<<<<<<<<<<<<
 *             FMIL.fmi1_import_terminate(self._fmu)
 *             self._allocated_fmu = 0 #No longer initialized
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base._allocated_fmu == 1);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":3152
 *         """
 *         if self._allocated_fmu == 1:
 *             FMIL.fmi1_import_terminate(self._fmu)             # <<<<<<<<<<<<<<
 *             self._allocated_fmu = 0 #No longer initialized
 * 
 */
    fmi1_import_terminate(__pyx_v_self->__pyx_base._fmu);

    /* "pyfmi\fmi.pyx":3153
 *         if self._allocated_fmu == 1:
 *             FMIL.fmi1_import_terminate(self._fmu)
 *             self._allocated_fmu = 0 #No longer initialized             # <<<<<<<<<<<<<<
 * 
 *     def free_instance(self):
 */
    __pyx_v_self->__pyx_base._allocated_fmu = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_43free_instance(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME1_42free_instance[] = "\n        Calls the FMI function fmiFreeModelInstance on the FMU.\n        Note that this is not needed in general as it is done automatically.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME1_43free_instance(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("free_instance (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME1_42free_instance(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3155
 *             self._allocated_fmu = 0 #No longer initialized
 * 
 *     def free_instance(self):             # <<<<<<<<<<<<<<
 *         """
 *         Calls the FMI function fmiFreeModelInstance on the FMU.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME1_42free_instance(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("free_instance", 0);

  /* "pyfmi\fmi.pyx":3160
 *         Note that this is not needed in general as it is done automatically.
 *         """
 *         if self._instantiated_fmu == 1:             # <<<<<<<<<<<<<<
 *             FMIL.fmi1_import_free_model_instance(self._fmu)
 *             self._instantiated_fmu = 0
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base._instantiated_fmu == 1);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":3161
 *         """
 *         if self._instantiated_fmu == 1:
 *             FMIL.fmi1_import_free_model_instance(self._fmu)             # <<<<<<<<<<<<<<
 *             self._instantiated_fmu = 0
 * 
 */
    fmi1_import_free_model_instance(__pyx_v_self->__pyx_base._fmu);

    /* "pyfmi\fmi.pyx":3162
 *         if self._instantiated_fmu == 1:
 *             FMIL.fmi1_import_free_model_instance(self._fmu)
 *             self._instantiated_fmu = 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_v_self->__pyx_base._instantiated_fmu = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2___init__[] = "\n        Constructor of the model.\n\n        Parameters::\n\n            fmu --\n                Name of the fmu as a string.\n\n            path --\n                Path to the fmu-directory.\n                Default: '.' (working directory)\n\n            enable_logging --\n                Boolean for acesss to logging-messages.\n                Default: True\n\n            log_file_name --\n                Filename for file used to save logmessages.\n                Default: \"\" (Generates automatically)\n\n        Returns::\n\n            A model as an object from the class FMUModelFMU2\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_5pyfmi_3fmi_13FMUModelBase2___init__;
#endif
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fmu = 0;
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_enable_logging = 0;
  PyObject *__pyx_v_log_file_name = 0;
  PyObject *__pyx_v_log_level = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fmu,&__pyx_n_s__path,&__pyx_n_s__enable_logging,&__pyx_n_s__log_file_name,&__pyx_n_s__log_level,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_kp_s_30);

    /* "pyfmi\fmi.pyx":3170
 *     FMI Model loaded from a dll.
 *     """
 *     def __init__(self, fmu, path='.', enable_logging=None, log_file_name="", log_level=FMI_DEFAULT_LOG_LEVEL):             # <<<<<<<<<<<<<<
 *         """
 *         Constructor of the model.
 */
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)__pyx_kp_s_12);
    values[4] = __pyx_k_192;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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__fmu)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__enable_logging);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__log_file_name);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__log_level);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      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 = 3170; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_fmu = values[0];
    __pyx_v_path = values[1];
    __pyx_v_enable_logging = values[2];
    __pyx_v_log_file_name = values[3];
    __pyx_v_log_level = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3170; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2___init__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_v_fmu, __pyx_v_path, __pyx_v_enable_logging, __pyx_v_log_file_name, __pyx_v_log_level);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2___init__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_fmu, PyObject *__pyx_v_path, PyObject *__pyx_v_enable_logging, PyObject *__pyx_v_log_file_name, PyObject *__pyx_v_log_level) {
  int __pyx_v_status;
  PyObject *__pyx_v_fmu_temp_dir = NULL;
  PyObject *__pyx_v_last_error = NULL;
  PyObject *__pyx_v_fmu_log_name = NULL;
  PyObject *__pyx_v_file = NULL;
  PyObject *__pyx_v_i = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  jm_log_level_enu_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  char *__pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  Py_ssize_t __pyx_t_15;
  PyObject *(*__pyx_t_16)(PyObject *);
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);
  __Pyx_INCREF(__pyx_v_enable_logging);

  /* "pyfmi\fmi.pyx":3203
 * 
 *         #Contains the log information
 *         self._log               = []             # <<<<<<<<<<<<<<
 *         self._enable_logging    = enable_logging
 *         self._categories        = []
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_self->__pyx_base._log);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base._log));
  __pyx_v_self->__pyx_base._log = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":3204
 *         #Contains the log information
 *         self._log               = []
 *         self._enable_logging    = enable_logging             # <<<<<<<<<<<<<<
 *         self._categories        = []
 * 
 */
  __Pyx_INCREF(__pyx_v_enable_logging);
  __Pyx_GIVEREF(__pyx_v_enable_logging);
  __Pyx_GOTREF(__pyx_v_self->_enable_logging);
  __Pyx_DECREF(__pyx_v_self->_enable_logging);
  __pyx_v_self->_enable_logging = __pyx_v_enable_logging;

  /* "pyfmi\fmi.pyx":3205
 *         self._log               = []
 *         self._enable_logging    = enable_logging
 *         self._categories        = []             # <<<<<<<<<<<<<<
 * 
 *         #Used for deallocation
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_self->_categories);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_categories));
  __pyx_v_self->_categories = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":3208
 * 
 *         #Used for deallocation
 *         self._allocated_context = 0             # <<<<<<<<<<<<<<
 *         self._allocated_dll = 0
 *         self._allocated_xml = 0
 */
  __pyx_v_self->_allocated_context = 0;

  /* "pyfmi\fmi.pyx":3209
 *         #Used for deallocation
 *         self._allocated_context = 0
 *         self._allocated_dll = 0             # <<<<<<<<<<<<<<
 *         self._allocated_xml = 0
 *         self._allocated_fmu = 0
 */
  __pyx_v_self->_allocated_dll = 0;

  /* "pyfmi\fmi.pyx":3210
 *         self._allocated_context = 0
 *         self._allocated_dll = 0
 *         self._allocated_xml = 0             # <<<<<<<<<<<<<<
 *         self._allocated_fmu = 0
 *         self._fmu_temp_dir = NULL
 */
  __pyx_v_self->_allocated_xml = 0;

  /* "pyfmi\fmi.pyx":3211
 *         self._allocated_dll = 0
 *         self._allocated_xml = 0
 *         self._allocated_fmu = 0             # <<<<<<<<<<<<<<
 *         self._fmu_temp_dir = NULL
 *         self._fmu_log_name = NULL
 */
  __pyx_v_self->_allocated_fmu = 0;

  /* "pyfmi\fmi.pyx":3212
 *         self._allocated_xml = 0
 *         self._allocated_fmu = 0
 *         self._fmu_temp_dir = NULL             # <<<<<<<<<<<<<<
 *         self._fmu_log_name = NULL
 * 
 */
  __pyx_v_self->_fmu_temp_dir = NULL;

  /* "pyfmi\fmi.pyx":3213
 *         self._allocated_fmu = 0
 *         self._fmu_temp_dir = NULL
 *         self._fmu_log_name = NULL             # <<<<<<<<<<<<<<
 * 
 *         #Default values
 */
  __pyx_v_self->__pyx_base._fmu_log_name = NULL;

  /* "pyfmi\fmi.pyx":3216
 * 
 *         #Default values
 *         self.__t = None             # <<<<<<<<<<<<<<
 *         self._A = None
 *         self._mask_A = None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->__pyx___t);
  __Pyx_DECREF(__pyx_v_self->__pyx___t);
  __pyx_v_self->__pyx___t = Py_None;

  /* "pyfmi\fmi.pyx":3217
 *         #Default values
 *         self.__t = None
 *         self._A = None             # <<<<<<<<<<<<<<
 *         self._mask_A = None
 *         self._B = None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_A);
  __Pyx_DECREF(__pyx_v_self->_A);
  __pyx_v_self->_A = Py_None;

  /* "pyfmi\fmi.pyx":3218
 *         self.__t = None
 *         self._A = None
 *         self._mask_A = None             # <<<<<<<<<<<<<<
 *         self._B = None
 *         self._C = None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_mask_A);
  __Pyx_DECREF(__pyx_v_self->_mask_A);
  __pyx_v_self->_mask_A = Py_None;

  /* "pyfmi\fmi.pyx":3219
 *         self._A = None
 *         self._mask_A = None
 *         self._B = None             # <<<<<<<<<<<<<<
 *         self._C = None
 *         self._D = None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_B);
  __Pyx_DECREF(__pyx_v_self->_B);
  __pyx_v_self->_B = Py_None;

  /* "pyfmi\fmi.pyx":3220
 *         self._mask_A = None
 *         self._B = None
 *         self._C = None             # <<<<<<<<<<<<<<
 *         self._D = None
 *         self._states_references = None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_C);
  __Pyx_DECREF(__pyx_v_self->_C);
  __pyx_v_self->_C = Py_None;

  /* "pyfmi\fmi.pyx":3221
 *         self._B = None
 *         self._C = None
 *         self._D = None             # <<<<<<<<<<<<<<
 *         self._states_references = None
 *         self._derivatives_references = None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_D);
  __Pyx_DECREF(__pyx_v_self->_D);
  __pyx_v_self->_D = Py_None;

  /* "pyfmi\fmi.pyx":3222
 *         self._C = None
 *         self._D = None
 *         self._states_references = None             # <<<<<<<<<<<<<<
 *         self._derivatives_references = None
 *         self._outputs_references = None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_states_references);
  __Pyx_DECREF(__pyx_v_self->_states_references);
  __pyx_v_self->_states_references = Py_None;

  /* "pyfmi\fmi.pyx":3223
 *         self._D = None
 *         self._states_references = None
 *         self._derivatives_references = None             # <<<<<<<<<<<<<<
 *         self._outputs_references = None
 *         self._inputs_references = None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_derivatives_references);
  __Pyx_DECREF(__pyx_v_self->_derivatives_references);
  __pyx_v_self->_derivatives_references = Py_None;

  /* "pyfmi\fmi.pyx":3224
 *         self._states_references = None
 *         self._derivatives_references = None
 *         self._outputs_references = None             # <<<<<<<<<<<<<<
 *         self._inputs_references = None
 *         self._derivatives_states_dependencies = None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_outputs_references);
  __Pyx_DECREF(__pyx_v_self->_outputs_references);
  __pyx_v_self->_outputs_references = Py_None;

  /* "pyfmi\fmi.pyx":3225
 *         self._derivatives_references = None
 *         self._outputs_references = None
 *         self._inputs_references = None             # <<<<<<<<<<<<<<
 *         self._derivatives_states_dependencies = None
 *         self._derivatives_inputs_dependencies = None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_inputs_references);
  __Pyx_DECREF(__pyx_v_self->_inputs_references);
  __pyx_v_self->_inputs_references = Py_None;

  /* "pyfmi\fmi.pyx":3226
 *         self._outputs_references = None
 *         self._inputs_references = None
 *         self._derivatives_states_dependencies = None             # <<<<<<<<<<<<<<
 *         self._derivatives_inputs_dependencies = None
 *         self._outputs_states_dependencies = None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_derivatives_states_dependencies);
  __Pyx_DECREF(__pyx_v_self->_derivatives_states_dependencies);
  __pyx_v_self->_derivatives_states_dependencies = Py_None;

  /* "pyfmi\fmi.pyx":3227
 *         self._inputs_references = None
 *         self._derivatives_states_dependencies = None
 *         self._derivatives_inputs_dependencies = None             # <<<<<<<<<<<<<<
 *         self._outputs_states_dependencies = None
 *         self._outputs_inputs_dependencies = None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_derivatives_inputs_dependencies);
  __Pyx_DECREF(__pyx_v_self->_derivatives_inputs_dependencies);
  __pyx_v_self->_derivatives_inputs_dependencies = Py_None;

  /* "pyfmi\fmi.pyx":3228
 *         self._derivatives_states_dependencies = None
 *         self._derivatives_inputs_dependencies = None
 *         self._outputs_states_dependencies = None             # <<<<<<<<<<<<<<
 *         self._outputs_inputs_dependencies = None
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_outputs_states_dependencies);
  __Pyx_DECREF(__pyx_v_self->_outputs_states_dependencies);
  __pyx_v_self->_outputs_states_dependencies = Py_None;

  /* "pyfmi\fmi.pyx":3229
 *         self._derivatives_inputs_dependencies = None
 *         self._outputs_states_dependencies = None
 *         self._outputs_inputs_dependencies = None             # <<<<<<<<<<<<<<
 * 
 *         #Internal values
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_outputs_inputs_dependencies);
  __Pyx_DECREF(__pyx_v_self->_outputs_inputs_dependencies);
  __pyx_v_self->_outputs_inputs_dependencies = Py_None;

  /* "pyfmi\fmi.pyx":3232
 * 
 *         #Internal values
 *         self._pyEventInfo = PyEventInfo()             # <<<<<<<<<<<<<<
 * 
 *         #Specify the general callback functions
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__PyEventInfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3232; __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 = 3232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->_pyEventInfo);
  __Pyx_DECREF(__pyx_v_self->_pyEventInfo);
  __pyx_v_self->_pyEventInfo = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":3235
 * 
 *         #Specify the general callback functions
 *         self.callbacks.malloc           = FMIL.malloc             # <<<<<<<<<<<<<<
 *         self.callbacks.calloc           = FMIL.calloc
 *         self.callbacks.realloc          = FMIL.realloc
 */
  __pyx_v_self->__pyx_base.callbacks.malloc = malloc;

  /* "pyfmi\fmi.pyx":3236
 *         #Specify the general callback functions
 *         self.callbacks.malloc           = FMIL.malloc
 *         self.callbacks.calloc           = FMIL.calloc             # <<<<<<<<<<<<<<
 *         self.callbacks.realloc          = FMIL.realloc
 *         self.callbacks.free             = FMIL.free
 */
  __pyx_v_self->__pyx_base.callbacks.calloc = calloc;

  /* "pyfmi\fmi.pyx":3237
 *         self.callbacks.malloc           = FMIL.malloc
 *         self.callbacks.calloc           = FMIL.calloc
 *         self.callbacks.realloc          = FMIL.realloc             # <<<<<<<<<<<<<<
 *         self.callbacks.free             = FMIL.free
 *         self.callbacks.logger           = importlogger2
 */
  __pyx_v_self->__pyx_base.callbacks.realloc = realloc;

  /* "pyfmi\fmi.pyx":3238
 *         self.callbacks.calloc           = FMIL.calloc
 *         self.callbacks.realloc          = FMIL.realloc
 *         self.callbacks.free             = FMIL.free             # <<<<<<<<<<<<<<
 *         self.callbacks.logger           = importlogger2
 *         self.callbacks.context          = <void*> self
 */
  __pyx_v_self->__pyx_base.callbacks.free = free;

  /* "pyfmi\fmi.pyx":3239
 *         self.callbacks.realloc          = FMIL.realloc
 *         self.callbacks.free             = FMIL.free
 *         self.callbacks.logger           = importlogger2             # <<<<<<<<<<<<<<
 *         self.callbacks.context          = <void*> self
 * 
 */
  __pyx_v_self->__pyx_base.callbacks.logger = __pyx_f_5pyfmi_3fmi_importlogger2;

  /* "pyfmi\fmi.pyx":3240
 *         self.callbacks.free             = FMIL.free
 *         self.callbacks.logger           = importlogger2
 *         self.callbacks.context          = <void*> self             # <<<<<<<<<<<<<<
 * 
 *         #Specify FMI2 related callbacks
 */
  __pyx_v_self->__pyx_base.callbacks.context = ((void *)__pyx_v_self);

  /* "pyfmi\fmi.pyx":3243
 * 
 *         #Specify FMI2 related callbacks
 *         self.callBackFunctions.logger               = FMIL.fmi2_log_forwarding             # <<<<<<<<<<<<<<
 *         #self.callBackFunctions.logger               = importlogger_fmi2
 *         #self.callBackFunctions.logger               = FMIL.fmi2_default_callback_logger
 */
  __pyx_v_self->callBackFunctions.logger = fmi2_log_forwarding;

  /* "pyfmi\fmi.pyx":3246
 *         #self.callBackFunctions.logger               = importlogger_fmi2
 *         #self.callBackFunctions.logger               = FMIL.fmi2_default_callback_logger
 *         self.callBackFunctions.allocateMemory       = FMIL.calloc             # <<<<<<<<<<<<<<
 *         self.callBackFunctions.freeMemory           = FMIL.free
 *         self.callBackFunctions.stepFinished         = NULL
 */
  __pyx_v_self->callBackFunctions.allocateMemory = calloc;

  /* "pyfmi\fmi.pyx":3247
 *         #self.callBackFunctions.logger               = FMIL.fmi2_default_callback_logger
 *         self.callBackFunctions.allocateMemory       = FMIL.calloc
 *         self.callBackFunctions.freeMemory           = FMIL.free             # <<<<<<<<<<<<<<
 *         self.callBackFunctions.stepFinished         = NULL
 *         self.callBackFunctions.componentEnvironment = NULL
 */
  __pyx_v_self->callBackFunctions.freeMemory = free;

  /* "pyfmi\fmi.pyx":3248
 *         self.callBackFunctions.allocateMemory       = FMIL.calloc
 *         self.callBackFunctions.freeMemory           = FMIL.free
 *         self.callBackFunctions.stepFinished         = NULL             # <<<<<<<<<<<<<<
 *         self.callBackFunctions.componentEnvironment = NULL
 * 
 */
  __pyx_v_self->callBackFunctions.stepFinished = NULL;

  /* "pyfmi\fmi.pyx":3249
 *         self.callBackFunctions.freeMemory           = FMIL.free
 *         self.callBackFunctions.stepFinished         = NULL
 *         self.callBackFunctions.componentEnvironment = NULL             # <<<<<<<<<<<<<<
 * 
 *         if enable_logging==None:
 */
  __pyx_v_self->callBackFunctions.componentEnvironment = NULL;

  /* "pyfmi\fmi.pyx":3251
 *         self.callBackFunctions.componentEnvironment = NULL
 * 
 *         if enable_logging==None:             # <<<<<<<<<<<<<<
 *             if log_level >= FMIL.jm_log_level_nothing and log_level <= FMIL.jm_log_level_all:
 *                 if log_level == FMIL.jm_log_level_nothing:
 */
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_enable_logging, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":3252
 * 
 *         if enable_logging==None:
 *             if log_level >= FMIL.jm_log_level_nothing and log_level <= FMIL.jm_log_level_all:             # <<<<<<<<<<<<<<
 *                 if log_level == FMIL.jm_log_level_nothing:
 *                     enable_logging = False
 */
    __pyx_t_2 = PyInt_FromLong(jm_log_level_nothing); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_log_level, __pyx_t_2, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_3) {
      __pyx_t_1 = PyInt_FromLong(jm_log_level_all); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_log_level, __pyx_t_1, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_5 = __pyx_t_4;
    } else {
      __pyx_t_5 = __pyx_t_3;
    }
    if (__pyx_t_5) {

      /* "pyfmi\fmi.pyx":3253
 *         if enable_logging==None:
 *             if log_level >= FMIL.jm_log_level_nothing and log_level <= FMIL.jm_log_level_all:
 *                 if log_level == FMIL.jm_log_level_nothing:             # <<<<<<<<<<<<<<
 *                     enable_logging = False
 *                 else:
 */
      __pyx_t_2 = PyInt_FromLong(jm_log_level_nothing); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyObject_RichCompare(__pyx_v_log_level, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_5) {

        /* "pyfmi\fmi.pyx":3254
 *             if log_level >= FMIL.jm_log_level_nothing and log_level <= FMIL.jm_log_level_all:
 *                 if log_level == FMIL.jm_log_level_nothing:
 *                     enable_logging = False             # <<<<<<<<<<<<<<
 *                 else:
 *                     enable_logging = True
 */
        __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_v_enable_logging);
        __pyx_v_enable_logging = __pyx_t_1;
        __pyx_t_1 = 0;
        goto __pyx_L5;
      }
      /*else*/ {

        /* "pyfmi\fmi.pyx":3256
 *                     enable_logging = False
 *                 else:
 *                     enable_logging = True             # <<<<<<<<<<<<<<
 *                 self.callbacks.log_level = log_level
 *             else:
 */
        __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_v_enable_logging);
        __pyx_v_enable_logging = __pyx_t_1;
        __pyx_t_1 = 0;
      }
      __pyx_L5:;

      /* "pyfmi\fmi.pyx":3257
 *                 else:
 *                     enable_logging = True
 *                 self.callbacks.log_level = log_level             # <<<<<<<<<<<<<<
 *             else:
 *                 raise FMUException("The log level must be between %d and %d"%(FMIL.jm_log_level_nothing, FMIL.jm_log_level_all))
 */
      __pyx_t_6 = ((jm_log_level_enu_t)PyInt_AsLong(__pyx_v_log_level)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_self->__pyx_base.callbacks.log_level = __pyx_t_6;
      goto __pyx_L4;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":3259
 *                 self.callbacks.log_level = log_level
 *             else:
 *                 raise FMUException("The log level must be between %d and %d"%(FMIL.jm_log_level_nothing, FMIL.jm_log_level_all))             # <<<<<<<<<<<<<<
 *         else:
 *             logging.warning("The attribute 'enable_logging' is deprecated. Please use 'log_level' instead. Setting 'log_level' to INFO...")
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyInt_FromLong(jm_log_level_nothing); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = PyInt_FromLong(jm_log_level_all); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      __pyx_t_2 = 0;
      __pyx_t_7 = 0;
      __pyx_t_7 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_32), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_7));
      __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_7));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
      __pyx_t_7 = 0;
      __pyx_t_7 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
      __Pyx_Raise(__pyx_t_7, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":3261
 *                 raise FMUException("The log level must be between %d and %d"%(FMIL.jm_log_level_nothing, FMIL.jm_log_level_all))
 *         else:
 *             logging.warning("The attribute 'enable_logging' is deprecated. Please use 'log_level' instead. Setting 'log_level' to INFO...")             # <<<<<<<<<<<<<<
 *             self.callbacks.log_level = FMIL.jm_log_level_info if enable_logging else FMIL.jm_log_level_error
 * 
 */
    __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__logging); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__warning); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_k_tuple_193), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "pyfmi\fmi.pyx":3262
 *         else:
 *             logging.warning("The attribute 'enable_logging' is deprecated. Please use 'log_level' instead. Setting 'log_level' to INFO...")
 *             self.callbacks.log_level = FMIL.jm_log_level_info if enable_logging else FMIL.jm_log_level_error             # <<<<<<<<<<<<<<
 * 
 *         # Check that the file referenced by fmu has the correct file-ending
 */
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_enable_logging); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_5) {
      __pyx_t_6 = jm_log_level_info;
    } else {
      __pyx_t_6 = jm_log_level_error;
    }
    __pyx_v_self->__pyx_base.callbacks.log_level = __pyx_t_6;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":3265
 * 
 *         # Check that the file referenced by fmu has the correct file-ending
 *         if not fmu.endswith('.fmu'):             # <<<<<<<<<<<<<<
 *             raise FMUException("FMUModel must be instantiated with an FMU (.fmu) file.")
 * 
 */
  __pyx_t_7 = PyObject_GetAttr(__pyx_v_fmu, __pyx_n_s__endswith); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_k_tuple_194), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_3 = (!__pyx_t_5);
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":3266
 *         # Check that the file referenced by fmu has the correct file-ending
 *         if not fmu.endswith('.fmu'):
 *             raise FMUException("FMUModel must be instantiated with an FMU (.fmu) file.")             # <<<<<<<<<<<<<<
 * 
 *         #Check that the file exists
 */
    __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_k_tuple_195), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pyfmi\fmi.pyx":3269
 * 
 *         #Check that the file exists
 *         self._fmu_full_path = encode(os.path.abspath(os.path.join(path,fmu)))             # <<<<<<<<<<<<<<
 *         if not os.path.isfile(self._fmu_full_path):
 *             raise FMUException('Could not locate the FMU in the specified directory.')
 */
  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__encode); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__path); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__abspath); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_path);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  __Pyx_INCREF(__pyx_v_fmu);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_fmu);
  __Pyx_GIVEREF(__pyx_v_fmu);
  __pyx_t_9 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_9);
  __pyx_t_9 = 0;
  __pyx_t_9 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_9);
  __pyx_t_9 = 0;
  __pyx_t_9 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_9);
  __Pyx_GOTREF(__pyx_v_self->_fmu_full_path);
  __Pyx_DECREF(__pyx_v_self->_fmu_full_path);
  __pyx_v_self->_fmu_full_path = __pyx_t_9;
  __pyx_t_9 = 0;

  /* "pyfmi\fmi.pyx":3270
 *         #Check that the file exists
 *         self._fmu_full_path = encode(os.path.abspath(os.path.join(path,fmu)))
 *         if not os.path.isfile(self._fmu_full_path):             # <<<<<<<<<<<<<<
 *             raise FMUException('Could not locate the FMU in the specified directory.')
 * 
 */
  __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__isfile); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_self->_fmu_full_path);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->_fmu_full_path);
  __Pyx_GIVEREF(__pyx_v_self->_fmu_full_path);
  __pyx_t_7 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_5 = (!__pyx_t_3);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":3271
 *         self._fmu_full_path = encode(os.path.abspath(os.path.join(path,fmu)))
 *         if not os.path.isfile(self._fmu_full_path):
 *             raise FMUException('Could not locate the FMU in the specified directory.')             # <<<<<<<<<<<<<<
 * 
 *         # Create a struct for allocation
 */
    __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_k_tuple_197), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "pyfmi\fmi.pyx":3274
 * 
 *         # Create a struct for allocation
 *         self._context           = FMIL.fmi_import_allocate_context(&self.callbacks)             # <<<<<<<<<<<<<<
 *         self._allocated_context = 1
 * 
 */
  __pyx_v_self->_context = fmi_import_allocate_context((&__pyx_v_self->__pyx_base.callbacks));

  /* "pyfmi\fmi.pyx":3275
 *         # Create a struct for allocation
 *         self._context           = FMIL.fmi_import_allocate_context(&self.callbacks)
 *         self._allocated_context = 1             # <<<<<<<<<<<<<<
 * 
 *         #Get the FMI version of the provided model
 */
  __pyx_v_self->_allocated_context = 1;

  /* "pyfmi\fmi.pyx":3278
 * 
 *         #Get the FMI version of the provided model
 *         fmu_temp_dir  = encode(create_temp_dir())             # <<<<<<<<<<<<<<
 *         self._fmu_temp_dir = <char*>FMIL.malloc((FMIL.strlen(fmu_temp_dir)+1)*sizeof(char))
 *         FMIL.strcpy(self._fmu_temp_dir, fmu_temp_dir)
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__create_temp_dir); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_9 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_9);
  __pyx_t_9 = 0;
  __pyx_t_9 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
  __pyx_v_fmu_temp_dir = __pyx_t_9;
  __pyx_t_9 = 0;

  /* "pyfmi\fmi.pyx":3279
 *         #Get the FMI version of the provided model
 *         fmu_temp_dir  = encode(create_temp_dir())
 *         self._fmu_temp_dir = <char*>FMIL.malloc((FMIL.strlen(fmu_temp_dir)+1)*sizeof(char))             # <<<<<<<<<<<<<<
 *         FMIL.strcpy(self._fmu_temp_dir, fmu_temp_dir)
 *         self._version      = FMIL.fmi_import_get_fmi_version(self._context, self._fmu_full_path, self._fmu_temp_dir)
 */
  __pyx_t_10 = PyBytes_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_fmu_temp_dir = ((char *)malloc(((strlen(__pyx_t_10) + 1) * (sizeof(char)))));

  /* "pyfmi\fmi.pyx":3280
 *         fmu_temp_dir  = encode(create_temp_dir())
 *         self._fmu_temp_dir = <char*>FMIL.malloc((FMIL.strlen(fmu_temp_dir)+1)*sizeof(char))
 *         FMIL.strcpy(self._fmu_temp_dir, fmu_temp_dir)             # <<<<<<<<<<<<<<
 *         self._version      = FMIL.fmi_import_get_fmi_version(self._context, self._fmu_full_path, self._fmu_temp_dir)
 * 
 */
  __pyx_t_10 = PyBytes_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  strcpy(__pyx_v_self->_fmu_temp_dir, __pyx_t_10);

  /* "pyfmi\fmi.pyx":3281
 *         self._fmu_temp_dir = <char*>FMIL.malloc((FMIL.strlen(fmu_temp_dir)+1)*sizeof(char))
 *         FMIL.strcpy(self._fmu_temp_dir, fmu_temp_dir)
 *         self._version      = FMIL.fmi_import_get_fmi_version(self._context, self._fmu_full_path, self._fmu_temp_dir)             # <<<<<<<<<<<<<<
 * 
 *         #Check the version
 */
  __pyx_t_10 = PyBytes_AsString(__pyx_v_self->_fmu_full_path); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_version = fmi_import_get_fmi_version(__pyx_v_self->_context, __pyx_t_10, __pyx_v_self->_fmu_temp_dir);

  /* "pyfmi\fmi.pyx":3284
 * 
 *         #Check the version
 *         if self._version == FMIL.fmi_version_unknown_enu:             # <<<<<<<<<<<<<<
 *             last_error = decode(FMIL.jm_get_last_error(&self.callbacks))
 *             if enable_logging:
 */
  __pyx_t_5 = (__pyx_v_self->_version == fmi_version_unknown_enu);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":3285
 *         #Check the version
 *         if self._version == FMIL.fmi_version_unknown_enu:
 *             last_error = decode(FMIL.jm_get_last_error(&self.callbacks))             # <<<<<<<<<<<<<<
 *             if enable_logging:
 *                 raise FMUException("The FMU version could not be determined. "+last_error)
 */
    __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_7 = PyBytes_FromString(jm_get_last_error((&__pyx_v_self->__pyx_base.callbacks))); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_7));
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_7));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
    __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_v_last_error = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "pyfmi\fmi.pyx":3286
 *         if self._version == FMIL.fmi_version_unknown_enu:
 *             last_error = decode(FMIL.jm_get_last_error(&self.callbacks))
 *             if enable_logging:             # <<<<<<<<<<<<<<
 *                 raise FMUException("The FMU version could not be determined. "+last_error)
 *             else:
 */
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_enable_logging); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_5) {

      /* "pyfmi\fmi.pyx":3287
 *             last_error = decode(FMIL.jm_get_last_error(&self.callbacks))
 *             if enable_logging:
 *                 raise FMUException("The FMU version could not be determined. "+last_error)             # <<<<<<<<<<<<<<
 *             else:
 *                 raise FMUException("The FMU version could not be determined. Enable logging for possibly more information.")
 */
      __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_kp_s_39), __pyx_v_last_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L9;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":3289
 *                 raise FMUException("The FMU version could not be determined. "+last_error)
 *             else:
 *                 raise FMUException("The FMU version could not be determined. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 * 
 *         if self._version != FMIL.fmi_version_2_0_enu:
 */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_9 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_198), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L9:;
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "pyfmi\fmi.pyx":3291
 *                 raise FMUException("The FMU version could not be determined. Enable logging for possibly more information.")
 * 
 *         if self._version != FMIL.fmi_version_2_0_enu:             # <<<<<<<<<<<<<<
 *             last_error = decode(FMIL.jm_get_last_error(&self.callbacks))
 *             if enable_logging:
 */
  __pyx_t_5 = (__pyx_v_self->_version != fmi_version_2_0_enu);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":3292
 * 
 *         if self._version != FMIL.fmi_version_2_0_enu:
 *             last_error = decode(FMIL.jm_get_last_error(&self.callbacks))             # <<<<<<<<<<<<<<
 *             if enable_logging:
 *                 raise FMUException("The FMU version is not supported by this class. "+last_error)
 */
    __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_2 = PyBytes_FromString(jm_get_last_error((&__pyx_v_self->__pyx_base.callbacks))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __pyx_v_last_error = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyfmi\fmi.pyx":3293
 *         if self._version != FMIL.fmi_version_2_0_enu:
 *             last_error = decode(FMIL.jm_get_last_error(&self.callbacks))
 *             if enable_logging:             # <<<<<<<<<<<<<<
 *                 raise FMUException("The FMU version is not supported by this class. "+last_error)
 *             else:
 */
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_enable_logging); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_5) {

      /* "pyfmi\fmi.pyx":3294
 *             last_error = decode(FMIL.jm_get_last_error(&self.callbacks))
 *             if enable_logging:
 *                 raise FMUException("The FMU version is not supported by this class. "+last_error)             # <<<<<<<<<<<<<<
 *             else:
 *                 raise FMUException("The FMU version is not supported by this class. Enable logging for possibly more information.")
 */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = PyNumber_Add(((PyObject *)__pyx_kp_s_199), __pyx_v_last_error); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_7 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
      __Pyx_Raise(__pyx_t_7, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L11;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":3296
 *                 raise FMUException("The FMU version is not supported by this class. "+last_error)
 *             else:
 *                 raise FMUException("The FMU version is not supported by this class. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 * 
 *         #Parse xml and check fmu-kind
 */
      __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_k_tuple_201), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L11:;
    goto __pyx_L10;
  }
  __pyx_L10:;

  /* "pyfmi\fmi.pyx":3299
 * 
 *         #Parse xml and check fmu-kind
 *         self._fmu           = FMIL.fmi2_import_parse_xml(self._context, self._fmu_temp_dir, NULL)             # <<<<<<<<<<<<<<
 * 
 *         if self._fmu is NULL:
 */
  __pyx_v_self->_fmu = fmi2_import_parse_xml(__pyx_v_self->_context, __pyx_v_self->_fmu_temp_dir, NULL);

  /* "pyfmi\fmi.pyx":3301
 *         self._fmu           = FMIL.fmi2_import_parse_xml(self._context, self._fmu_temp_dir, NULL)
 * 
 *         if self._fmu is NULL:             # <<<<<<<<<<<<<<
 *             last_error = decode(FMIL.jm_get_last_error(&self.callbacks))
 *             if enable_logging:
 */
  __pyx_t_5 = (__pyx_v_self->_fmu == NULL);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":3302
 * 
 *         if self._fmu is NULL:
 *             last_error = decode(FMIL.jm_get_last_error(&self.callbacks))             # <<<<<<<<<<<<<<
 *             if enable_logging:
 *                 raise FMUException("The XML-could not be read. "+last_error)
 */
    __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_7 = PyBytes_FromString(jm_get_last_error((&__pyx_v_self->__pyx_base.callbacks))); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_7));
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_7));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
    __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_v_last_error = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "pyfmi\fmi.pyx":3303
 *         if self._fmu is NULL:
 *             last_error = decode(FMIL.jm_get_last_error(&self.callbacks))
 *             if enable_logging:             # <<<<<<<<<<<<<<
 *                 raise FMUException("The XML-could not be read. "+last_error)
 *             else:
 */
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_enable_logging); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_5) {

      /* "pyfmi\fmi.pyx":3304
 *             last_error = decode(FMIL.jm_get_last_error(&self.callbacks))
 *             if enable_logging:
 *                 raise FMUException("The XML-could not be read. "+last_error)             # <<<<<<<<<<<<<<
 *             else:
 *                 raise FMUException('The XML-could not be read. Enable logging for possible nore information.')
 */
      __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_kp_s_202), __pyx_v_last_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L13;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":3306
 *                 raise FMUException("The XML-could not be read. "+last_error)
 *             else:
 *                 raise FMUException('The XML-could not be read. Enable logging for possible nore information.')             # <<<<<<<<<<<<<<
 * 
 *         self.callBackFunctions.componentEnvironment = <FMIL.fmi2_component_environment_t>self._fmu
 */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_9 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_204), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L13:;
    goto __pyx_L12;
  }
  __pyx_L12:;

  /* "pyfmi\fmi.pyx":3308
 *                 raise FMUException('The XML-could not be read. Enable logging for possible nore information.')
 * 
 *         self.callBackFunctions.componentEnvironment = <FMIL.fmi2_component_environment_t>self._fmu             # <<<<<<<<<<<<<<
 *         #self.callBackFunctions.componentEnvironment = <FMIL.fmi2_component_environment_t>self
 *         self._fmu_kind      = FMIL.fmi2_import_get_fmu_kind(self._fmu)
 */
  __pyx_v_self->callBackFunctions.componentEnvironment = ((fmi2_component_environment_t)__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":3310
 *         self.callBackFunctions.componentEnvironment = <FMIL.fmi2_component_environment_t>self._fmu
 *         #self.callBackFunctions.componentEnvironment = <FMIL.fmi2_component_environment_t>self
 *         self._fmu_kind      = FMIL.fmi2_import_get_fmu_kind(self._fmu)             # <<<<<<<<<<<<<<
 *         self._allocated_xml = 1
 * 
 */
  __pyx_v_self->_fmu_kind = fmi2_import_get_fmu_kind(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":3311
 *         #self.callBackFunctions.componentEnvironment = <FMIL.fmi2_component_environment_t>self
 *         self._fmu_kind      = FMIL.fmi2_import_get_fmu_kind(self._fmu)
 *         self._allocated_xml = 1             # <<<<<<<<<<<<<<
 * 
 *         #FMU kind is unknown
 */
  __pyx_v_self->_allocated_xml = 1;

  /* "pyfmi\fmi.pyx":3314
 * 
 *         #FMU kind is unknown
 *         if self._fmu_kind == FMIL.fmi2_fmu_kind_unknown:             # <<<<<<<<<<<<<<
 *             last_error = decode(FMIL.jm_get_last_error(&self.callbacks))
 *             if enable_logging:
 */
  __pyx_t_5 = (__pyx_v_self->_fmu_kind == fmi2_fmu_kind_unknown);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":3315
 *         #FMU kind is unknown
 *         if self._fmu_kind == FMIL.fmi2_fmu_kind_unknown:
 *             last_error = decode(FMIL.jm_get_last_error(&self.callbacks))             # <<<<<<<<<<<<<<
 *             if enable_logging:
 *                 raise FMUException("The FMU kind could not be determined. "+last_error)
 */
    __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_2 = PyBytes_FromString(jm_get_last_error((&__pyx_v_self->__pyx_base.callbacks))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __pyx_v_last_error = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyfmi\fmi.pyx":3316
 *         if self._fmu_kind == FMIL.fmi2_fmu_kind_unknown:
 *             last_error = decode(FMIL.jm_get_last_error(&self.callbacks))
 *             if enable_logging:             # <<<<<<<<<<<<<<
 *                 raise FMUException("The FMU kind could not be determined. "+last_error)
 *             else:
 */
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_enable_logging); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_5) {

      /* "pyfmi\fmi.pyx":3317
 *             last_error = decode(FMIL.jm_get_last_error(&self.callbacks))
 *             if enable_logging:
 *                 raise FMUException("The FMU kind could not be determined. "+last_error)             # <<<<<<<<<<<<<<
 *             else:
 *                 raise FMUException("The FMU kind could not be determined. Enable logging for possibly more information.")
 */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = PyNumber_Add(((PyObject *)__pyx_kp_s_205), __pyx_v_last_error); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_7 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
      __Pyx_Raise(__pyx_t_7, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L15;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":3319
 *                 raise FMUException("The FMU kind could not be determined. "+last_error)
 *             else:
 *                 raise FMUException("The FMU kind could not be determined. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 *         elif self._fmu_kind == FMIL.fmi2_fmu_kind_me_and_cs:
 *             if isinstance(self,FMUModelME2):
 */
      __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_k_tuple_207), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L15:;
    goto __pyx_L14;
  }

  /* "pyfmi\fmi.pyx":3320
 *             else:
 *                 raise FMUException("The FMU kind could not be determined. Enable logging for possibly more information.")
 *         elif self._fmu_kind == FMIL.fmi2_fmu_kind_me_and_cs:             # <<<<<<<<<<<<<<
 *             if isinstance(self,FMUModelME2):
 *                 self._fmu_kind = FMIL.fmi2_fmu_kind_me
 */
  __pyx_t_5 = (__pyx_v_self->_fmu_kind == fmi2_fmu_kind_me_and_cs);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":3321
 *                 raise FMUException("The FMU kind could not be determined. Enable logging for possibly more information.")
 *         elif self._fmu_kind == FMIL.fmi2_fmu_kind_me_and_cs:
 *             if isinstance(self,FMUModelME2):             # <<<<<<<<<<<<<<
 *                 self._fmu_kind = FMIL.fmi2_fmu_kind_me
 *             elif isinstance(self,FMUModelCS2):
 */
    __pyx_t_5 = __Pyx_TypeCheck(((PyObject *)__pyx_v_self), ((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelME2)); 
    if (__pyx_t_5) {

      /* "pyfmi\fmi.pyx":3322
 *         elif self._fmu_kind == FMIL.fmi2_fmu_kind_me_and_cs:
 *             if isinstance(self,FMUModelME2):
 *                 self._fmu_kind = FMIL.fmi2_fmu_kind_me             # <<<<<<<<<<<<<<
 *             elif isinstance(self,FMUModelCS2):
 *                 self._fmu_kind = FMIL.fmi2_fmu_kind_cs
 */
      __pyx_v_self->_fmu_kind = fmi2_fmu_kind_me;
      goto __pyx_L16;
    }

    /* "pyfmi\fmi.pyx":3323
 *             if isinstance(self,FMUModelME2):
 *                 self._fmu_kind = FMIL.fmi2_fmu_kind_me
 *             elif isinstance(self,FMUModelCS2):             # <<<<<<<<<<<<<<
 *                 self._fmu_kind = FMIL.fmi2_fmu_kind_cs
 *             else:
 */
    __pyx_t_5 = __Pyx_TypeCheck(((PyObject *)__pyx_v_self), ((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelCS2)); 
    if (__pyx_t_5) {

      /* "pyfmi\fmi.pyx":3324
 *                 self._fmu_kind = FMIL.fmi2_fmu_kind_me
 *             elif isinstance(self,FMUModelCS2):
 *                 self._fmu_kind = FMIL.fmi2_fmu_kind_cs             # <<<<<<<<<<<<<<
 *             else:
 *                 raise FMUException("FMUModelBase2 cannot be used directly, use FMUModelME2 or FMUModelCS2.")
 */
      __pyx_v_self->_fmu_kind = fmi2_fmu_kind_cs;
      goto __pyx_L16;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":3326
 *                 self._fmu_kind = FMIL.fmi2_fmu_kind_cs
 *             else:
 *                 raise FMUException("FMUModelBase2 cannot be used directly, use FMUModelME2 or FMUModelCS2.")             # <<<<<<<<<<<<<<
 * 
 *         #Connect the DLL
 */
      __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_7 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_k_tuple_209), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_Raise(__pyx_t_7, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L16:;
    goto __pyx_L14;
  }
  __pyx_L14:;

  /* "pyfmi\fmi.pyx":3329
 * 
 *         #Connect the DLL
 *         status = FMIL.fmi2_import_create_dllfmu(self._fmu, self._fmu_kind, &self.callBackFunctions)             # <<<<<<<<<<<<<<
 *         if status == FMIL.jm_status_error:
 *             last_error = decode(FMIL.fmi2_import_get_last_error(self._fmu))
 */
  __pyx_v_status = fmi2_import_create_dllfmu(__pyx_v_self->_fmu, __pyx_v_self->_fmu_kind, (&__pyx_v_self->callBackFunctions));

  /* "pyfmi\fmi.pyx":3330
 *         #Connect the DLL
 *         status = FMIL.fmi2_import_create_dllfmu(self._fmu, self._fmu_kind, &self.callBackFunctions)
 *         if status == FMIL.jm_status_error:             # <<<<<<<<<<<<<<
 *             last_error = decode(FMIL.fmi2_import_get_last_error(self._fmu))
 *             if enable_logging:
 */
  __pyx_t_5 = (__pyx_v_status == jm_status_error);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":3331
 *         status = FMIL.fmi2_import_create_dllfmu(self._fmu, self._fmu_kind, &self.callBackFunctions)
 *         if status == FMIL.jm_status_error:
 *             last_error = decode(FMIL.fmi2_import_get_last_error(self._fmu))             # <<<<<<<<<<<<<<
 *             if enable_logging:
 *                 raise FMUException("Error loading the binary. " + last_error)
 */
    __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = PyBytes_FromString(fmi2_import_get_last_error(__pyx_v_self->_fmu)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_9));
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_9));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
    __pyx_t_9 = 0;
    __pyx_t_9 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_v_last_error = __pyx_t_9;
    __pyx_t_9 = 0;

    /* "pyfmi\fmi.pyx":3332
 *         if status == FMIL.jm_status_error:
 *             last_error = decode(FMIL.fmi2_import_get_last_error(self._fmu))
 *             if enable_logging:             # <<<<<<<<<<<<<<
 *                 raise FMUException("Error loading the binary. " + last_error)
 *             else:
 */
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_enable_logging); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_5) {

      /* "pyfmi\fmi.pyx":3333
 *             last_error = decode(FMIL.fmi2_import_get_last_error(self._fmu))
 *             if enable_logging:
 *                 raise FMUException("Error loading the binary. " + last_error)             # <<<<<<<<<<<<<<
 *             else:
 *                 raise FMUException("Error loading the binary. Enable logging for possibly more information.")
 */
      __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_kp_s_210), __pyx_v_last_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L18;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":3335
 *                 raise FMUException("Error loading the binary. " + last_error)
 *             else:
 *                 raise FMUException("Error loading the binary. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 *         self._allocated_dll = 1
 * 
 */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_211), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_t_7, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L18:;
    goto __pyx_L17;
  }
  __pyx_L17:;

  /* "pyfmi\fmi.pyx":3336
 *             else:
 *                 raise FMUException("Error loading the binary. Enable logging for possibly more information.")
 *         self._allocated_dll = 1             # <<<<<<<<<<<<<<
 * 
 *         #Load information from model
 */
  __pyx_v_self->_allocated_dll = 1;

  /* "pyfmi\fmi.pyx":3339
 * 
 *         #Load information from model
 *         if isinstance(self,FMUModelME2):             # <<<<<<<<<<<<<<
 *             self._modelId           = decode(FMIL.fmi2_import_get_model_identifier_ME(self._fmu))
 *         elif isinstance(self,FMUModelCS2):
 */
  __pyx_t_5 = __Pyx_TypeCheck(((PyObject *)__pyx_v_self), ((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelME2)); 
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":3340
 *         #Load information from model
 *         if isinstance(self,FMUModelME2):
 *             self._modelId           = decode(FMIL.fmi2_import_get_model_identifier_ME(self._fmu))             # <<<<<<<<<<<<<<
 *         elif isinstance(self,FMUModelCS2):
 *             self._modelId           = decode(FMIL.fmi2_import_get_model_identifier_CS(self._fmu))
 */
    __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = PyBytes_FromString(fmi2_import_get_model_identifier_ME(__pyx_v_self->_fmu)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->_modelId);
    __Pyx_DECREF(__pyx_v_self->_modelId);
    __pyx_v_self->_modelId = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L19;
  }

  /* "pyfmi\fmi.pyx":3341
 *         if isinstance(self,FMUModelME2):
 *             self._modelId           = decode(FMIL.fmi2_import_get_model_identifier_ME(self._fmu))
 *         elif isinstance(self,FMUModelCS2):             # <<<<<<<<<<<<<<
 *             self._modelId           = decode(FMIL.fmi2_import_get_model_identifier_CS(self._fmu))
 *         else:
 */
  __pyx_t_5 = __Pyx_TypeCheck(((PyObject *)__pyx_v_self), ((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelCS2)); 
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":3342
 *             self._modelId           = decode(FMIL.fmi2_import_get_model_identifier_ME(self._fmu))
 *         elif isinstance(self,FMUModelCS2):
 *             self._modelId           = decode(FMIL.fmi2_import_get_model_identifier_CS(self._fmu))             # <<<<<<<<<<<<<<
 *         else:
 *             raise FMUException("FMUModelBase2 cannot be used directly, use FMUModelME2 or FMUModelCS2.")
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = PyBytes_FromString(fmi2_import_get_model_identifier_CS(__pyx_v_self->_fmu)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_9));
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_t_9));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
    __pyx_t_9 = 0;
    __pyx_t_9 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __Pyx_GIVEREF(__pyx_t_9);
    __Pyx_GOTREF(__pyx_v_self->_modelId);
    __Pyx_DECREF(__pyx_v_self->_modelId);
    __pyx_v_self->_modelId = __pyx_t_9;
    __pyx_t_9 = 0;
    goto __pyx_L19;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":3344
 *             self._modelId           = decode(FMIL.fmi2_import_get_model_identifier_CS(self._fmu))
 *         else:
 *             raise FMUException("FMUModelBase2 cannot be used directly, use FMUModelME2 or FMUModelCS2.")             # <<<<<<<<<<<<<<
 * 
 *         #Connect the DLL
 */
    __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_7 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_k_tuple_212), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L19:;

  /* "pyfmi\fmi.pyx":3347
 * 
 *         #Connect the DLL
 *         self._modelName         = decode(FMIL.fmi2_import_get_model_name(self._fmu))             # <<<<<<<<<<<<<<
 *         self._nEventIndicators  = FMIL.fmi2_import_get_number_of_event_indicators(self._fmu)
 *         self._nContinuousStates = FMIL.fmi2_import_get_number_of_continuous_states(self._fmu)
 */
  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_9 = PyBytes_FromString(fmi2_import_get_model_name(__pyx_v_self->_fmu)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_9));
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_9));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
  __pyx_t_9 = 0;
  __pyx_t_9 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_9);
  __Pyx_GOTREF(__pyx_v_self->_modelName);
  __Pyx_DECREF(__pyx_v_self->_modelName);
  __pyx_v_self->_modelName = __pyx_t_9;
  __pyx_t_9 = 0;

  /* "pyfmi\fmi.pyx":3348
 *         #Connect the DLL
 *         self._modelName         = decode(FMIL.fmi2_import_get_model_name(self._fmu))
 *         self._nEventIndicators  = FMIL.fmi2_import_get_number_of_event_indicators(self._fmu)             # <<<<<<<<<<<<<<
 *         self._nContinuousStates = FMIL.fmi2_import_get_number_of_continuous_states(self._fmu)
 *         self._nCategories       = FMIL.fmi2_import_get_log_categories_num(self._fmu)
 */
  __pyx_v_self->_nEventIndicators = fmi2_import_get_number_of_event_indicators(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":3349
 *         self._modelName         = decode(FMIL.fmi2_import_get_model_name(self._fmu))
 *         self._nEventIndicators  = FMIL.fmi2_import_get_number_of_event_indicators(self._fmu)
 *         self._nContinuousStates = FMIL.fmi2_import_get_number_of_continuous_states(self._fmu)             # <<<<<<<<<<<<<<
 *         self._nCategories       = FMIL.fmi2_import_get_log_categories_num(self._fmu)
 *         fmu_log_name = encode((self._modelId + "_log.txt") if log_file_name=="" else log_file_name)
 */
  __pyx_v_self->_nContinuousStates = fmi2_import_get_number_of_continuous_states(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":3350
 *         self._nEventIndicators  = FMIL.fmi2_import_get_number_of_event_indicators(self._fmu)
 *         self._nContinuousStates = FMIL.fmi2_import_get_number_of_continuous_states(self._fmu)
 *         self._nCategories       = FMIL.fmi2_import_get_log_categories_num(self._fmu)             # <<<<<<<<<<<<<<
 *         fmu_log_name = encode((self._modelId + "_log.txt") if log_file_name=="" else log_file_name)
 *         self._fmu_log_name = <char*>FMIL.malloc((FMIL.strlen(fmu_log_name)+1)*sizeof(char))
 */
  __pyx_v_self->_nCategories = fmi2_import_get_log_categories_num(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":3351
 *         self._nContinuousStates = FMIL.fmi2_import_get_number_of_continuous_states(self._fmu)
 *         self._nCategories       = FMIL.fmi2_import_get_log_categories_num(self._fmu)
 *         fmu_log_name = encode((self._modelId + "_log.txt") if log_file_name=="" else log_file_name)             # <<<<<<<<<<<<<<
 *         self._fmu_log_name = <char*>FMIL.malloc((FMIL.strlen(fmu_log_name)+1)*sizeof(char))
 *         FMIL.strcpy(self._fmu_log_name, fmu_log_name)
 */
  __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__encode); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_7 = PyObject_RichCompare(__pyx_v_log_file_name, ((PyObject *)__pyx_kp_s_12), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__pyx_t_5) {
    __pyx_t_7 = PyNumber_Add(__pyx_v_self->_modelId, ((PyObject *)__pyx_kp_s_51)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = __pyx_t_7;
    __pyx_t_7 = 0;
  } else {
    __Pyx_INCREF(__pyx_v_log_file_name);
    __pyx_t_2 = __pyx_v_log_file_name;
  }
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
  __pyx_v_fmu_log_name = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":3352
 *         self._nCategories       = FMIL.fmi2_import_get_log_categories_num(self._fmu)
 *         fmu_log_name = encode((self._modelId + "_log.txt") if log_file_name=="" else log_file_name)
 *         self._fmu_log_name = <char*>FMIL.malloc((FMIL.strlen(fmu_log_name)+1)*sizeof(char))             # <<<<<<<<<<<<<<
 *         FMIL.strcpy(self._fmu_log_name, fmu_log_name)
 * 
 */
  __pyx_t_10 = PyBytes_AsString(__pyx_v_fmu_log_name); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->__pyx_base._fmu_log_name = ((char *)malloc(((strlen(__pyx_t_10) + 1) * (sizeof(char)))));

  /* "pyfmi\fmi.pyx":3353
 *         fmu_log_name = encode((self._modelId + "_log.txt") if log_file_name=="" else log_file_name)
 *         self._fmu_log_name = <char*>FMIL.malloc((FMIL.strlen(fmu_log_name)+1)*sizeof(char))
 *         FMIL.strcpy(self._fmu_log_name, fmu_log_name)             # <<<<<<<<<<<<<<
 * 
 *         #Create the log file
 */
  __pyx_t_10 = PyBytes_AsString(__pyx_v_fmu_log_name); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  strcpy(__pyx_v_self->__pyx_base._fmu_log_name, __pyx_t_10);

  /* "pyfmi\fmi.pyx":3356
 * 
 *         #Create the log file
 *         with open(self._fmu_log_name,'w') as file:             # <<<<<<<<<<<<<<
 *             for i in range(len(self._log)):
 *                 file.write("FMIL: module = %s, log level = %d: %s\n"%(self._log[i][0], self._log[i][1], self._log[i][2]))
 */
  /*with:*/ {
    __pyx_t_2 = PyBytes_FromString(__pyx_v_self->__pyx_base._fmu_log_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __Pyx_INCREF(((PyObject *)__pyx_n_s__w));
    PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_n_s__w));
    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__w));
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_builtin_open, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __pyx_t_11 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s____exit__); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_7 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s____enter__); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3356; __pyx_clineno = __LINE__; goto __pyx_L20_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3356; __pyx_clineno = __LINE__; goto __pyx_L20_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /*try:*/ {
      {
        __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
        __Pyx_XGOTREF(__pyx_t_12);
        __Pyx_XGOTREF(__pyx_t_13);
        __Pyx_XGOTREF(__pyx_t_14);
        /*try:*/ {
          __Pyx_INCREF(__pyx_t_9);
          __pyx_v_file = __pyx_t_9;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

          /* "pyfmi\fmi.pyx":3357
 *         #Create the log file
 *         with open(self._fmu_log_name,'w') as file:
 *             for i in range(len(self._log)):             # <<<<<<<<<<<<<<
 *                 file.write("FMIL: module = %s, log level = %d: %s\n"%(self._log[i][0], self._log[i][1], self._log[i][2]))
 *             self._log = []
 */
          __pyx_t_9 = ((PyObject *)__pyx_v_self->__pyx_base._log);
          __Pyx_INCREF(__pyx_t_9);
          if (unlikely(__pyx_t_9 == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3357; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
          }
          __pyx_t_15 = PyList_GET_SIZE(__pyx_t_9); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3357; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_15); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3357; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3357; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
          __Pyx_GOTREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_9);
          __pyx_t_9 = 0;
          __pyx_t_9 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3357; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
          if (PyList_CheckExact(__pyx_t_9) || PyTuple_CheckExact(__pyx_t_9)) {
            __pyx_t_2 = __pyx_t_9; __Pyx_INCREF(__pyx_t_2); __pyx_t_15 = 0;
            __pyx_t_16 = NULL;
          } else {
            __pyx_t_15 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3357; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_16 = Py_TYPE(__pyx_t_2)->tp_iternext;
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          for (;;) {
            if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_2)) {
              if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_2)) break;
              #if CYTHON_COMPILING_IN_CPYTHON
              __pyx_t_9 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_15); __Pyx_INCREF(__pyx_t_9); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3357; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
              #else
              __pyx_t_9 = PySequence_ITEM(__pyx_t_2, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3357; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
              #endif
            } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_2)) {
              if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
              #if CYTHON_COMPILING_IN_CPYTHON
              __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_15); __Pyx_INCREF(__pyx_t_9); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3357; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
              #else
              __pyx_t_9 = PySequence_ITEM(__pyx_t_2, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3357; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
              #endif
            } else {
              __pyx_t_9 = __pyx_t_16(__pyx_t_2);
              if (unlikely(!__pyx_t_9)) {
                if (PyErr_Occurred()) {
                  if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
                  else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3357; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
                }
                break;
              }
              __Pyx_GOTREF(__pyx_t_9);
            }
            __Pyx_XDECREF(__pyx_v_i);
            __pyx_v_i = __pyx_t_9;
            __pyx_t_9 = 0;

            /* "pyfmi\fmi.pyx":3358
 *         with open(self._fmu_log_name,'w') as file:
 *             for i in range(len(self._log)):
 *                 file.write("FMIL: module = %s, log level = %d: %s\n"%(self._log[i][0], self._log[i][1], self._log[i][2]))             # <<<<<<<<<<<<<<
 *             self._log = []
 * 
 */
            __pyx_t_9 = PyObject_GetAttr(__pyx_v_file, __pyx_n_s__write); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3358; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
            __Pyx_GOTREF(__pyx_t_9);
            if (unlikely(((PyObject *)__pyx_v_self->__pyx_base._log) == Py_None)) {
              PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3358; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
            }
            __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self->__pyx_base._log), __pyx_v_i); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3358; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_7, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3358; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (unlikely(((PyObject *)__pyx_v_self->__pyx_base._log) == Py_None)) {
              PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3358; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
            }
            __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self->__pyx_base._log), __pyx_v_i); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3358; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_7, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3358; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (unlikely(((PyObject *)__pyx_v_self->__pyx_base._log) == Py_None)) {
              PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3358; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
            }
            __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self->__pyx_base._log), __pyx_v_i); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3358; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_17 = __Pyx_GetItemInt(__pyx_t_7, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3358; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
            __Pyx_GOTREF(__pyx_t_17);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3358; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
            __Pyx_GOTREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
            __Pyx_GIVEREF(__pyx_t_8);
            PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_1);
            PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_17);
            __Pyx_GIVEREF(__pyx_t_17);
            __pyx_t_8 = 0;
            __pyx_t_1 = 0;
            __pyx_t_17 = 0;
            __pyx_t_17 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_2), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3358; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
            __Pyx_GOTREF(((PyObject *)__pyx_t_17));
            __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
            __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3358; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
            __Pyx_GOTREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_t_17));
            __Pyx_GIVEREF(((PyObject *)__pyx_t_17));
            __pyx_t_17 = 0;
            __pyx_t_17 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3358; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
            __Pyx_GOTREF(__pyx_t_17);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
            __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "pyfmi\fmi.pyx":3359
 *             for i in range(len(self._log)):
 *                 file.write("FMIL: module = %s, log level = %d: %s\n"%(self._log[i][0], self._log[i][1], self._log[i][2]))
 *             self._log = []             # <<<<<<<<<<<<<<
 * 
 *     cpdef N.ndarray get_real(self, valueref):
 */
          __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3359; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
          __Pyx_GOTREF(__pyx_v_self->__pyx_base._log);
          __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base._log));
          __pyx_v_self->__pyx_base._log = ((PyObject*)__pyx_t_2);
          __pyx_t_2 = 0;
        }
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        goto __pyx_L31_try_end;
        __pyx_L24_error:;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "pyfmi\fmi.pyx":3356
 * 
 *         #Create the log file
 *         with open(self._fmu_log_name,'w') as file:             # <<<<<<<<<<<<<<
 *             for i in range(len(self._log)):
 *                 file.write("FMIL: module = %s, log level = %d: %s\n"%(self._log[i][0], self._log[i][1], self._log[i][2]))
 */
        /*except:*/ {
          __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_17, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3356; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GOTREF(__pyx_t_17);
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3356; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_17);
          PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_17);
          __Pyx_GIVEREF(__pyx_t_17);
          __Pyx_INCREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_7);
          __pyx_t_18 = PyObject_Call(__pyx_t_11, __pyx_t_9, NULL);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3356; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
          __Pyx_GOTREF(__pyx_t_18);
          __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_18);
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3356; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
          __pyx_t_3 = (!__pyx_t_5);
          if (__pyx_t_3) {
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_17);
            __Pyx_GIVEREF(__pyx_t_7);
            __Pyx_ErrRestore(__pyx_t_2, __pyx_t_17, __pyx_t_7);
            __pyx_t_2 = 0; __pyx_t_17 = 0; __pyx_t_7 = 0; 
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3356; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;}
            goto __pyx_L37;
          }
          __pyx_L37:;
          __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          goto __pyx_L25_exception_handled;
        }
        __pyx_L26_except_error:;
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_XGIVEREF(__pyx_t_14);
        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
        goto __pyx_L1_error;
        __pyx_L25_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_XGIVEREF(__pyx_t_14);
        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
        __pyx_L31_try_end:;
      }
    }
    /*finally:*/ {
      if (__pyx_t_11) {
        __pyx_t_14 = PyObject_Call(__pyx_t_11, __pyx_k_tuple_213, NULL);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
    }
    goto __pyx_L38;
    __pyx_L20_error:;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    goto __pyx_L1_error;
    __pyx_L38:;
  }

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fmu_temp_dir);
  __Pyx_XDECREF(__pyx_v_last_error);
  __Pyx_XDECREF(__pyx_v_fmu_log_name);
  __Pyx_XDECREF(__pyx_v_file);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_enable_logging);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3361
 *             self._log = []
 * 
 *     cpdef N.ndarray get_real(self, valueref):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the real-values from the valuereference(s).
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_3get_real(PyObject *__pyx_v_self, PyObject *__pyx_v_valueref); /*proto*/
static PyArrayObject *__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_real(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_valueref, int __pyx_skip_dispatch) {
  int __pyx_v_status;
  PyArrayObject *__pyx_v_input_valueref = 0;
  PyArrayObject *__pyx_v_output_value = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_input_valueref;
  __Pyx_Buffer __pyx_pybuffer_input_valueref;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_output_value;
  __Pyx_Buffer __pyx_pybuffer_output_value;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_real", 0);
  __pyx_pybuffer_input_valueref.pybuffer.buf = NULL;
  __pyx_pybuffer_input_valueref.refcount = 0;
  __pyx_pybuffernd_input_valueref.data = NULL;
  __pyx_pybuffernd_input_valueref.rcbuffer = &__pyx_pybuffer_input_valueref;
  __pyx_pybuffer_output_value.pybuffer.buf = NULL;
  __pyx_pybuffer_output_value.refcount = 0;
  __pyx_pybuffernd_output_value.data = NULL;
  __pyx_pybuffernd_output_value.rcbuffer = &__pyx_pybuffer_output_value;
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_real); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_3get_real)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_valueref);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_valueref);
      __Pyx_GIVEREF(__pyx_v_valueref);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":3383
 *         cdef int         status
 * 
 *         cdef N.ndarray[FMIL.fmi2_value_reference_t, ndim=1,mode='c'] input_valueref = N.array(valueref, dtype=N.uint32,ndmin=1).ravel()             # <<<<<<<<<<<<<<
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1,mode='c']            output_value   = N.zeros(input_valueref.size)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_valueref);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_valueref);
  __Pyx_GIVEREF(__pyx_v_valueref);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__uint32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__ravel); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input_valueref.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_fmi2_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_input_valueref = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_input_valueref.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_input_valueref.diminfo[0].strides = __pyx_pybuffernd_input_valueref.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input_valueref.diminfo[0].shape = __pyx_pybuffernd_input_valueref.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_input_valueref = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":3384
 * 
 *         cdef N.ndarray[FMIL.fmi2_value_reference_t, ndim=1,mode='c'] input_valueref = N.array(valueref, dtype=N.uint32,ndmin=1).ravel()
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1,mode='c']            output_value   = N.zeros(input_valueref.size)             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_get_real(self._fmu, <FMIL.fmi2_value_reference_t*> input_valueref.data, input_valueref.size, <FMIL.fmi2_real_t*> output_value.data)
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_input_valueref), __pyx_n_s__size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output_value.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn_fmi2_real_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_output_value = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_output_value.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_output_value.diminfo[0].strides = __pyx_pybuffernd_output_value.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output_value.diminfo[0].shape = __pyx_pybuffernd_output_value.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_7 = 0;
  __pyx_v_output_value = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":3386
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1,mode='c']            output_value   = N.zeros(input_valueref.size)
 * 
 *         status = FMIL.fmi2_import_get_real(self._fmu, <FMIL.fmi2_value_reference_t*> input_valueref.data, input_valueref.size, <FMIL.fmi2_real_t*> output_value.data)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_input_valueref), __pyx_n_s__size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_8 = __Pyx_PyInt_AsSize_t(__pyx_t_5); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_status = fmi2_import_get_real(__pyx_v_self->_fmu, ((fmi2_value_reference_t *)__pyx_v_input_valueref->data), __pyx_t_8, ((fmi2_real_t *)__pyx_v_output_value->data));

  /* "pyfmi\fmi.pyx":3388
 *         status = FMIL.fmi2_import_get_real(self._fmu, <FMIL.fmi2_value_reference_t*> input_valueref.data, input_valueref.size, <FMIL.fmi2_real_t*> output_value.data)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to get the Real values.')
 * 
 */
  __pyx_t_9 = (__pyx_v_status != 0);
  if (__pyx_t_9) {

    /* "pyfmi\fmi.pyx":3389
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Real values.')             # <<<<<<<<<<<<<<
 * 
 *         return output_value
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_214), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":3391
 *             raise FMUException('Failed to get the Real values.')
 * 
 *         return output_value             # <<<<<<<<<<<<<<
 * 
 *     cpdef set_real(self, valueref, values):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_output_value));
  __pyx_r = ((PyArrayObject *)__pyx_v_output_value);
  goto __pyx_L0;

  __pyx_r = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_valueref.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output_value.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_real", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_valueref.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output_value.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_input_valueref);
  __Pyx_XDECREF((PyObject *)__pyx_v_output_value);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_3get_real(PyObject *__pyx_v_self, PyObject *__pyx_v_valueref); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_2get_real[] = "\n        Returns the real-values from the valuereference(s).\n\n        Parameters::\n\n            valueref --\n                A list of valuereferences.\n\n        Returns::\n\n            values --\n                The values retrieved from the FMU.\n\n        Example::\n\n            val = model.get_real([232])\n\n        Calls the low-level FMI function: fmi2GetReal\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_3get_real(PyObject *__pyx_v_self, PyObject *__pyx_v_valueref) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_real (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_2get_real(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_valueref));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3361
 *             self._log = []
 * 
 *     cpdef N.ndarray get_real(self, valueref):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the real-values from the valuereference(s).
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_2get_real(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_valueref) {
  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("get_real", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_real(__pyx_v_self, __pyx_v_valueref, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_real", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3393
 *         return output_value
 * 
 *     cpdef set_real(self, valueref, values):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the real-values in the FMU as defined by the valuereference(s).
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_5set_real(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_13FMUModelBase2_set_real(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_valueref, PyObject *__pyx_v_values, int __pyx_skip_dispatch) {
  int __pyx_v_status;
  PyArrayObject *__pyx_v_input_valueref = 0;
  PyArrayObject *__pyx_v_set_value = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_input_valueref;
  __Pyx_Buffer __pyx_pybuffer_input_valueref;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_set_value;
  __Pyx_Buffer __pyx_pybuffer_set_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  size_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_real", 0);
  __pyx_pybuffer_input_valueref.pybuffer.buf = NULL;
  __pyx_pybuffer_input_valueref.refcount = 0;
  __pyx_pybuffernd_input_valueref.data = NULL;
  __pyx_pybuffernd_input_valueref.rcbuffer = &__pyx_pybuffer_input_valueref;
  __pyx_pybuffer_set_value.pybuffer.buf = NULL;
  __pyx_pybuffer_set_value.refcount = 0;
  __pyx_pybuffernd_set_value.data = NULL;
  __pyx_pybuffernd_set_value.rcbuffer = &__pyx_pybuffer_set_value;
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__set_real); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_5set_real)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_valueref);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_valueref);
      __Pyx_GIVEREF(__pyx_v_valueref);
      __Pyx_INCREF(__pyx_v_values);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_values);
      __Pyx_GIVEREF(__pyx_v_values);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":3413
 *         cdef int status
 * 
 *         cdef N.ndarray[FMIL.fmi2_value_reference_t, ndim=1,mode='c'] input_valueref = N.array(valueref, dtype=N.uint32,ndmin=1).ravel()             # <<<<<<<<<<<<<<
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1,mode='c']            set_value      = N.array(values, dtype=N.float, ndmin=1).ravel()
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_valueref);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_valueref);
  __Pyx_GIVEREF(__pyx_v_valueref);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__uint32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__ravel); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input_valueref.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_fmi2_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_input_valueref = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_input_valueref.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_input_valueref.diminfo[0].strides = __pyx_pybuffernd_input_valueref.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input_valueref.diminfo[0].shape = __pyx_pybuffernd_input_valueref.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_input_valueref = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":3414
 * 
 *         cdef N.ndarray[FMIL.fmi2_value_reference_t, ndim=1,mode='c'] input_valueref = N.array(valueref, dtype=N.uint32,ndmin=1).ravel()
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1,mode='c']            set_value      = N.array(values, dtype=N.float, ndmin=1).ravel()             # <<<<<<<<<<<<<<
 * 
 *         if input_valueref.size != set_value.size:
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__float); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__ravel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_set_value.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn_fmi2_real_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_set_value = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_set_value.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_set_value.diminfo[0].strides = __pyx_pybuffernd_set_value.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_set_value.diminfo[0].shape = __pyx_pybuffernd_set_value.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_7 = 0;
  __pyx_v_set_value = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":3416
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1,mode='c']            set_value      = N.array(values, dtype=N.float, ndmin=1).ravel()
 * 
 *         if input_valueref.size != set_value.size:             # <<<<<<<<<<<<<<
 *             raise FMUException('The length of valueref and values are inconsistent.')
 * 
 */
  __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_input_valueref), __pyx_n_s__size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_set_value), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_8) {

    /* "pyfmi\fmi.pyx":3417
 * 
 *         if input_valueref.size != set_value.size:
 *             raise FMUException('The length of valueref and values are inconsistent.')             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_set_real(self._fmu, <FMIL.fmi2_value_reference_t*> input_valueref.data, input_valueref.size, <FMIL.fmi2_real_t*> set_value.data)
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_215), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":3419
 *             raise FMUException('The length of valueref and values are inconsistent.')
 * 
 *         status = FMIL.fmi2_import_set_real(self._fmu, <FMIL.fmi2_value_reference_t*> input_valueref.data, input_valueref.size, <FMIL.fmi2_real_t*> set_value.data)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_input_valueref), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_9 = __Pyx_PyInt_AsSize_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_status = fmi2_import_set_real(__pyx_v_self->_fmu, ((fmi2_value_reference_t *)__pyx_v_input_valueref->data), __pyx_t_9, ((fmi2_real_t *)__pyx_v_set_value->data));

  /* "pyfmi\fmi.pyx":3421
 *         status = FMIL.fmi2_import_set_real(self._fmu, <FMIL.fmi2_value_reference_t*> input_valueref.data, input_valueref.size, <FMIL.fmi2_real_t*> set_value.data)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to set the Real values.')
 * 
 */
  __pyx_t_8 = (__pyx_v_status != 0);
  if (__pyx_t_8) {

    /* "pyfmi\fmi.pyx":3422
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Real values.')             # <<<<<<<<<<<<<<
 * 
 *     def get_integer(self, valueref):
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_216), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_valueref.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_set_value.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.set_real", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_valueref.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_set_value.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_input_valueref);
  __Pyx_XDECREF((PyObject *)__pyx_v_set_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_5set_real(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_4set_real[] = "\n        Sets the real-values in the FMU as defined by the valuereference(s).\n\n        Parameters::\n\n            valueref --\n                A list of valuereferences.\n\n            values --\n                Values to be set.\n\n        Example::\n\n            model.set_real([234,235],[2.34,10.4])\n\n        Calls the low-level FMI function: fmi2SetReal\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_5set_real(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_valueref = 0;
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_real (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__valueref,&__pyx_n_s__values,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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__valueref)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_real", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3393; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_real") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3393; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_valueref = values[0];
    __pyx_v_values = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_real", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3393; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.set_real", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_4set_real(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_v_valueref, __pyx_v_values);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3393
 *         return output_value
 * 
 *     cpdef set_real(self, valueref, values):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the real-values in the FMU as defined by the valuereference(s).
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_4set_real(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_valueref, PyObject *__pyx_v_values) {
  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("set_real", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_real(__pyx_v_self, __pyx_v_valueref, __pyx_v_values, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.set_real", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_7get_integer(PyObject *__pyx_v_self, PyObject *__pyx_v_valueref); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_6get_integer[] = "\n        Returns the integer-values from the valuereference(s).\n\n        Parameters::\n\n            valueref --\n                A list of valuereferences.\n\n        Returns::\n\n            values --\n                The values retrieved from the FMU.\n\n        Example::\n\n            val = model.get_integer([232])\n\n        Calls the low-level FMI function: fmi2GetInteger\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_7get_integer(PyObject *__pyx_v_self, PyObject *__pyx_v_valueref) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_integer (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_6get_integer(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_valueref));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3424
 *             raise FMUException('Failed to set the Real values.')
 * 
 *     def get_integer(self, valueref):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the integer-values from the valuereference(s).
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_6get_integer(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_valueref) {
  int __pyx_v_status;
  size_t __pyx_v_nref;
  PyArrayObject *__pyx_v_input_valueref = 0;
  PyArrayObject *__pyx_v_output_value = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_input_valueref;
  __Pyx_Buffer __pyx_pybuffer_input_valueref;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_output_value;
  __Pyx_Buffer __pyx_pybuffer_output_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  PyArrayObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_integer", 0);
  __pyx_pybuffer_input_valueref.pybuffer.buf = NULL;
  __pyx_pybuffer_input_valueref.refcount = 0;
  __pyx_pybuffernd_input_valueref.data = NULL;
  __pyx_pybuffernd_input_valueref.rcbuffer = &__pyx_pybuffer_input_valueref;
  __pyx_pybuffer_output_value.pybuffer.buf = NULL;
  __pyx_pybuffer_output_value.refcount = 0;
  __pyx_pybuffernd_output_value.data = NULL;
  __pyx_pybuffernd_output_value.rcbuffer = &__pyx_pybuffer_output_value;

  /* "pyfmi\fmi.pyx":3447
 *         cdef FMIL.size_t nref
 * 
 *         cdef N.ndarray[FMIL.fmi2_value_reference_t, ndim=1,mode='c'] input_valueref = N.array(valueref, dtype=N.uint32,ndmin=1).ravel()             # <<<<<<<<<<<<<<
 *         nref = input_valueref.size
 *         cdef N.ndarray[FMIL.fmi2_integer_t, ndim=1,mode='c']         output_value   = N.array([0]*nref, dtype=int,ndmin=1)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_valueref);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_valueref);
  __Pyx_GIVEREF(__pyx_v_valueref);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__uint32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input_valueref.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_fmi2_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_input_valueref = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_input_valueref.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_input_valueref.diminfo[0].strides = __pyx_pybuffernd_input_valueref.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input_valueref.diminfo[0].shape = __pyx_pybuffernd_input_valueref.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_input_valueref = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":3448
 * 
 *         cdef N.ndarray[FMIL.fmi2_value_reference_t, ndim=1,mode='c'] input_valueref = N.array(valueref, dtype=N.uint32,ndmin=1).ravel()
 *         nref = input_valueref.size             # <<<<<<<<<<<<<<
 *         cdef N.ndarray[FMIL.fmi2_integer_t, ndim=1,mode='c']         output_value   = N.array([0]*nref, dtype=int,ndmin=1)
 * 
 */
  __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_input_valueref), __pyx_n_s__size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_PyInt_from_py_size_t(__pyx_t_5); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_nref = __pyx_t_7;

  /* "pyfmi\fmi.pyx":3449
 *         cdef N.ndarray[FMIL.fmi2_value_reference_t, ndim=1,mode='c'] input_valueref = N.array(valueref, dtype=N.uint32,ndmin=1).ravel()
 *         nref = input_valueref.size
 *         cdef N.ndarray[FMIL.fmi2_integer_t, ndim=1,mode='c']         output_value   = N.array([0]*nref, dtype=int,ndmin=1)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyList_New(1 * ((__pyx_v_nref<0) ? 0:__pyx_v_nref)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  { Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < __pyx_v_nref; __pyx_temp++) {
      __Pyx_INCREF(__pyx_int_0);
      PyList_SET_ITEM(__pyx_t_5, __pyx_temp, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
    }
  }
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
  __pyx_t_5 = 0;
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__int); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output_value.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn_fmi2_integer_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_output_value = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_output_value.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_output_value.diminfo[0].strides = __pyx_pybuffernd_output_value.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output_value.diminfo[0].shape = __pyx_pybuffernd_output_value.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_8 = 0;
  __pyx_v_output_value = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":3452
 * 
 * 
 *         status = FMIL.fmi2_import_get_integer(self._fmu, <FMIL.fmi2_value_reference_t*> input_valueref.data, nref, <FMIL.fmi2_integer_t*> output_value.data)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi2_import_get_integer(__pyx_v_self->_fmu, ((fmi2_value_reference_t *)__pyx_v_input_valueref->data), __pyx_v_nref, ((fmi2_integer_t *)__pyx_v_output_value->data));

  /* "pyfmi\fmi.pyx":3454
 *         status = FMIL.fmi2_import_get_integer(self._fmu, <FMIL.fmi2_value_reference_t*> input_valueref.data, nref, <FMIL.fmi2_integer_t*> output_value.data)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to get the Integer values.')
 * 
 */
  __pyx_t_9 = (__pyx_v_status != 0);
  if (__pyx_t_9) {

    /* "pyfmi\fmi.pyx":3455
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Integer values.')             # <<<<<<<<<<<<<<
 * 
 *         return output_value
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_217), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":3457
 *             raise FMUException('Failed to get the Integer values.')
 * 
 *         return output_value             # <<<<<<<<<<<<<<
 * 
 *     def set_integer(self, valueref, values):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_output_value));
  __pyx_r = ((PyObject *)__pyx_v_output_value);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_valueref.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output_value.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_integer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_valueref.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_output_value.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_input_valueref);
  __Pyx_XDECREF((PyObject *)__pyx_v_output_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_9set_integer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_8set_integer[] = "\n        Sets the integer-values in the FMU as defined by the valuereference(s).\n\n        Parameters::\n\n            valueref --\n                A list of valuereferences.\n\n            values --\n                Values to be set.\n\n        Example::\n\n            model.set_integer([234,235],[12,-3])\n\n        Calls the low-level FMI function: fmi2SetInteger\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_9set_integer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_valueref = 0;
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_integer (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__valueref,&__pyx_n_s__values,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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__valueref)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_integer", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3459; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_integer") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3459; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_valueref = values[0];
    __pyx_v_values = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_integer", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3459; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.set_integer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8set_integer(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_v_valueref, __pyx_v_values);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3459
 *         return output_value
 * 
 *     def set_integer(self, valueref, values):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the integer-values in the FMU as defined by the valuereference(s).
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8set_integer(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_valueref, PyObject *__pyx_v_values) {
  int __pyx_v_status;
  size_t __pyx_v_nref;
  PyArrayObject *__pyx_v_input_valueref = 0;
  PyArrayObject *__pyx_v_set_value = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_input_valueref;
  __Pyx_Buffer __pyx_pybuffer_input_valueref;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_set_value;
  __Pyx_Buffer __pyx_pybuffer_set_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_integer", 0);
  __pyx_pybuffer_input_valueref.pybuffer.buf = NULL;
  __pyx_pybuffer_input_valueref.refcount = 0;
  __pyx_pybuffernd_input_valueref.data = NULL;
  __pyx_pybuffernd_input_valueref.rcbuffer = &__pyx_pybuffer_input_valueref;
  __pyx_pybuffer_set_value.pybuffer.buf = NULL;
  __pyx_pybuffer_set_value.refcount = 0;
  __pyx_pybuffernd_set_value.data = NULL;
  __pyx_pybuffernd_set_value.rcbuffer = &__pyx_pybuffer_set_value;

  /* "pyfmi\fmi.pyx":3480
 *         cdef FMIL.size_t nref
 * 
 *         cdef N.ndarray[FMIL.fmi2_value_reference_t, ndim=1,mode='c'] input_valueref = N.array(valueref, dtype=N.uint32,ndmin=1).ravel()             # <<<<<<<<<<<<<<
 *         cdef N.ndarray[FMIL.fmi2_integer_t, ndim=1,mode='c']         set_value      = N.array(values, dtype=int,ndmin=1).ravel()
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_valueref);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_valueref);
  __Pyx_GIVEREF(__pyx_v_valueref);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__uint32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input_valueref.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_fmi2_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_input_valueref = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_input_valueref.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_input_valueref.diminfo[0].strides = __pyx_pybuffernd_input_valueref.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input_valueref.diminfo[0].shape = __pyx_pybuffernd_input_valueref.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_input_valueref = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":3481
 * 
 *         cdef N.ndarray[FMIL.fmi2_value_reference_t, ndim=1,mode='c'] input_valueref = N.array(valueref, dtype=N.uint32,ndmin=1).ravel()
 *         cdef N.ndarray[FMIL.fmi2_integer_t, ndim=1,mode='c']         set_value      = N.array(values, dtype=int,ndmin=1).ravel()             # <<<<<<<<<<<<<<
 * 
 *         nref = input_valueref.size
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__int); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ravel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __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 = 3481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_set_value.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn_fmi2_integer_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_set_value = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_set_value.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_set_value.diminfo[0].strides = __pyx_pybuffernd_set_value.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_set_value.diminfo[0].shape = __pyx_pybuffernd_set_value.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_7 = 0;
  __pyx_v_set_value = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":3483
 *         cdef N.ndarray[FMIL.fmi2_integer_t, ndim=1,mode='c']         set_value      = N.array(values, dtype=int,ndmin=1).ravel()
 * 
 *         nref = input_valueref.size             # <<<<<<<<<<<<<<
 * 
 *         if input_valueref.size != set_value.size:
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_input_valueref), __pyx_n_s__size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_PyInt_from_py_size_t(__pyx_t_2); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_nref = __pyx_t_8;

  /* "pyfmi\fmi.pyx":3485
 *         nref = input_valueref.size
 * 
 *         if input_valueref.size != set_value.size:             # <<<<<<<<<<<<<<
 *             raise FMUException('The length of valueref and values are inconsistent.')
 * 
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_input_valueref), __pyx_n_s__size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_set_value), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_9) {

    /* "pyfmi\fmi.pyx":3486
 * 
 *         if input_valueref.size != set_value.size:
 *             raise FMUException('The length of valueref and values are inconsistent.')             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_set_integer(self._fmu, <FMIL.fmi2_value_reference_t*> input_valueref.data, nref, <FMIL.fmi2_integer_t*> set_value.data)
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_218), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":3488
 *             raise FMUException('The length of valueref and values are inconsistent.')
 * 
 *         status = FMIL.fmi2_import_set_integer(self._fmu, <FMIL.fmi2_value_reference_t*> input_valueref.data, nref, <FMIL.fmi2_integer_t*> set_value.data)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi2_import_set_integer(__pyx_v_self->_fmu, ((fmi2_value_reference_t *)__pyx_v_input_valueref->data), __pyx_v_nref, ((fmi2_integer_t *)__pyx_v_set_value->data));

  /* "pyfmi\fmi.pyx":3490
 *         status = FMIL.fmi2_import_set_integer(self._fmu, <FMIL.fmi2_value_reference_t*> input_valueref.data, nref, <FMIL.fmi2_integer_t*> set_value.data)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to set the Integer values.')
 * 
 */
  __pyx_t_9 = (__pyx_v_status != 0);
  if (__pyx_t_9) {

    /* "pyfmi\fmi.pyx":3491
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Integer values.')             # <<<<<<<<<<<<<<
 * 
 *     def get_boolean(self, valueref):
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_219), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_valueref.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_set_value.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.set_integer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_valueref.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_set_value.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_input_valueref);
  __Pyx_XDECREF((PyObject *)__pyx_v_set_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_11get_boolean(PyObject *__pyx_v_self, PyObject *__pyx_v_valueref); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_10get_boolean[] = "\n        Returns the boolean-values from the valuereference(s).\n\n        Parameters::\n\n            valueref --\n                A list of valuereferences.\n\n        Returns::\n\n            values --\n                The values retrieved from the FMU.\n\n        Example::\n\n            val = model.get_boolean([232])\n\n        Calls the low-level FMI function: fmi2GetBoolean\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_11get_boolean(PyObject *__pyx_v_self, PyObject *__pyx_v_valueref) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_boolean (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_10get_boolean(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_valueref));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3493
 *             raise FMUException('Failed to set the Integer values.')
 * 
 *     def get_boolean(self, valueref):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the boolean-values from the valuereference(s).
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_10get_boolean(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_valueref) {
  int __pyx_v_status;
  size_t __pyx_v_nref;
  PyArrayObject *__pyx_v_input_valueref = 0;
  void *__pyx_v_output_value;
  PyObject *__pyx_v_return_values = NULL;
  size_t __pyx_v_i;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_input_valueref;
  __Pyx_Buffer __pyx_pybuffer_input_valueref;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  size_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_boolean", 0);
  __pyx_pybuffer_input_valueref.pybuffer.buf = NULL;
  __pyx_pybuffer_input_valueref.refcount = 0;
  __pyx_pybuffernd_input_valueref.data = NULL;
  __pyx_pybuffernd_input_valueref.rcbuffer = &__pyx_pybuffer_input_valueref;

  /* "pyfmi\fmi.pyx":3516
 *         cdef FMIL.size_t nref
 * 
 *         cdef N.ndarray[FMIL.fmi2_value_reference_t, ndim=1,mode='c'] input_valueref = N.array(valueref, dtype=N.uint32, ndmin=1).ravel()             # <<<<<<<<<<<<<<
 *         nref = input_valueref.size
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_valueref);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_valueref);
  __Pyx_GIVEREF(__pyx_v_valueref);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__uint32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input_valueref.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_fmi2_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_input_valueref = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_input_valueref.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_input_valueref.diminfo[0].strides = __pyx_pybuffernd_input_valueref.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input_valueref.diminfo[0].shape = __pyx_pybuffernd_input_valueref.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_input_valueref = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":3517
 * 
 *         cdef N.ndarray[FMIL.fmi2_value_reference_t, ndim=1,mode='c'] input_valueref = N.array(valueref, dtype=N.uint32, ndmin=1).ravel()
 *         nref = input_valueref.size             # <<<<<<<<<<<<<<
 * 
 *         #cdef N.ndarray[FMIL.fmi1_boolean_t, ndim=1,mode='c'] val = N.array(['0']*nref, dtype=N.char.character,ndmin=1)
 */
  __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_input_valueref), __pyx_n_s__size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_PyInt_from_py_size_t(__pyx_t_5); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_nref = __pyx_t_7;

  /* "pyfmi\fmi.pyx":3520
 * 
 *         #cdef N.ndarray[FMIL.fmi1_boolean_t, ndim=1,mode='c'] val = N.array(['0']*nref, dtype=N.char.character,ndmin=1)
 *         cdef void* output_value = FMIL.malloc(sizeof(FMIL.fmi2_boolean_t)*nref)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_output_value = malloc(((sizeof(fmi2_boolean_t)) * __pyx_v_nref));

  /* "pyfmi\fmi.pyx":3524
 * 
 *         #status = FMIL.fmi1_import_get_boolean(self._fmu, <FMIL.fmi1_value_reference_t*>val_ref.data, nref, <FMIL.fmi1_boolean_t*>val.data)
 *         status = FMIL.fmi2_import_get_boolean(self._fmu, <FMIL.fmi2_value_reference_t*> input_valueref.data, nref, <FMIL.fmi2_boolean_t*> output_value)             # <<<<<<<<<<<<<<
 * 
 *         return_values = []
 */
  __pyx_v_status = fmi2_import_get_boolean(__pyx_v_self->_fmu, ((fmi2_value_reference_t *)__pyx_v_input_valueref->data), __pyx_v_nref, ((fmi2_boolean_t *)__pyx_v_output_value));

  /* "pyfmi\fmi.pyx":3526
 *         status = FMIL.fmi2_import_get_boolean(self._fmu, <FMIL.fmi2_value_reference_t*> input_valueref.data, nref, <FMIL.fmi2_boolean_t*> output_value)
 * 
 *         return_values = []             # <<<<<<<<<<<<<<
 *         for i in range(nref):
 *             return_values.append((<FMIL.fmi2_boolean_t*> output_value)[i]==1)
 */
  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_return_values = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":3527
 * 
 *         return_values = []
 *         for i in range(nref):             # <<<<<<<<<<<<<<
 *             return_values.append((<FMIL.fmi2_boolean_t*> output_value)[i]==1)
 *             #print (<FMIL.fmi1_boolean_t*>val)[i], (<FMIL.fmi1_boolean_t*>val)[i]==1
 */
  __pyx_t_7 = __pyx_v_nref;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;

    /* "pyfmi\fmi.pyx":3528
 *         return_values = []
 *         for i in range(nref):
 *             return_values.append((<FMIL.fmi2_boolean_t*> output_value)[i]==1)             # <<<<<<<<<<<<<<
 *             #print (<FMIL.fmi1_boolean_t*>val)[i], (<FMIL.fmi1_boolean_t*>val)[i]==1
 * 
 */
    __pyx_t_5 = __Pyx_PyBool_FromLong(((((fmi2_boolean_t *)__pyx_v_output_value)[__pyx_v_i]) == 1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = PyList_Append(__pyx_v_return_values, __pyx_t_5); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }

  /* "pyfmi\fmi.pyx":3534
 * 
 *         #Dealloc
 *         FMIL.free(output_value)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  free(__pyx_v_output_value);

  /* "pyfmi\fmi.pyx":3536
 *         FMIL.free(output_value)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to get the Boolean values.')
 * 
 */
  __pyx_t_10 = (__pyx_v_status != 0);
  if (__pyx_t_10) {

    /* "pyfmi\fmi.pyx":3537
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Boolean values.')             # <<<<<<<<<<<<<<
 * 
 *         #return val==FMI_TRUE
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_220), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":3540
 * 
 *         #return val==FMI_TRUE
 *         return N.array(return_values)             # <<<<<<<<<<<<<<
 * 
 *     def set_boolean(self, valueref, values):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_return_values));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_return_values));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_return_values));
  __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_valueref.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_boolean", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_valueref.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_input_valueref);
  __Pyx_XDECREF(__pyx_v_return_values);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_13set_boolean(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_12set_boolean[] = "\n        Sets the boolean-values in the FMU as defined by the valuereference(s).\n\n        Parameters::\n\n            valueref --\n                A list of valuereferences.\n\n            values --\n                Values to be set.\n\n        Example::\n\n            model.set_boolean([234,235],[True,False])\n\n        Calls the low-level FMI function: fmi2SetBoolean\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_13set_boolean(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_valueref = 0;
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_boolean (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__valueref,&__pyx_n_s__values,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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__valueref)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_boolean", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3542; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_boolean") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3542; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_valueref = values[0];
    __pyx_v_values = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_boolean", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3542; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.set_boolean", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_12set_boolean(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_v_valueref, __pyx_v_values);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3542
 *         return N.array(return_values)
 * 
 *     def set_boolean(self, valueref, values):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the boolean-values in the FMU as defined by the valuereference(s).
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_12set_boolean(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_valueref, PyObject *__pyx_v_values) {
  int __pyx_v_status;
  size_t __pyx_v_nref;
  PyArrayObject *__pyx_v_input_valueref = 0;
  void *__pyx_v_set_value;
  size_t __pyx_v_i;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_input_valueref;
  __Pyx_Buffer __pyx_pybuffer_input_valueref;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  size_t __pyx_t_8;
  size_t __pyx_t_9;
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_boolean", 0);
  __Pyx_INCREF(__pyx_v_values);
  __pyx_pybuffer_input_valueref.pybuffer.buf = NULL;
  __pyx_pybuffer_input_valueref.refcount = 0;
  __pyx_pybuffernd_input_valueref.data = NULL;
  __pyx_pybuffernd_input_valueref.rcbuffer = &__pyx_pybuffer_input_valueref;

  /* "pyfmi\fmi.pyx":3563
 *         cdef FMIL.size_t nref
 * 
 *         cdef N.ndarray[FMIL.fmi2_value_reference_t, ndim=1,mode='c'] input_valueref = N.array(valueref, dtype=N.uint32,ndmin=1).flatten()             # <<<<<<<<<<<<<<
 *         nref = len(input_valueref)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_valueref);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_valueref);
  __Pyx_GIVEREF(__pyx_v_valueref);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__uint32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__flatten); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input_valueref.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_fmi2_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_input_valueref = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_input_valueref.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_input_valueref.diminfo[0].strides = __pyx_pybuffernd_input_valueref.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input_valueref.diminfo[0].shape = __pyx_pybuffernd_input_valueref.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_input_valueref = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":3564
 * 
 *         cdef N.ndarray[FMIL.fmi2_value_reference_t, ndim=1,mode='c'] input_valueref = N.array(valueref, dtype=N.uint32,ndmin=1).flatten()
 *         nref = len(input_valueref)             # <<<<<<<<<<<<<<
 * 
 *         #cdef N.ndarray[FMIL.fmi1_boolean_t, ndim=1,mode='c'] val = N.array(['0']*nref, dtype=N.char.character,ndmin=1).flatten()
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_input_valueref)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nref = __pyx_t_7;

  /* "pyfmi\fmi.pyx":3567
 * 
 *         #cdef N.ndarray[FMIL.fmi1_boolean_t, ndim=1,mode='c'] val = N.array(['0']*nref, dtype=N.char.character,ndmin=1).flatten()
 *         cdef void* set_value = FMIL.malloc(sizeof(FMIL.fmi2_boolean_t)*nref)             # <<<<<<<<<<<<<<
 * 
 *         values = N.array(values,ndmin=1).ravel()
 */
  __pyx_v_set_value = malloc(((sizeof(fmi2_boolean_t)) * __pyx_v_nref));

  /* "pyfmi\fmi.pyx":3569
 *         cdef void* set_value = FMIL.malloc(sizeof(FMIL.fmi2_boolean_t)*nref)
 * 
 *         values = N.array(values,ndmin=1).ravel()             # <<<<<<<<<<<<<<
 *         for i in range(nref):
 *             if values[i]:
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ravel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __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 = 3569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_v_values);
  __pyx_v_values = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":3570
 * 
 *         values = N.array(values,ndmin=1).ravel()
 *         for i in range(nref):             # <<<<<<<<<<<<<<
 *             if values[i]:
 *                 #val[i]=1
 */
  __pyx_t_8 = __pyx_v_nref;
  for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
    __pyx_v_i = __pyx_t_9;

    /* "pyfmi\fmi.pyx":3571
 *         values = N.array(values,ndmin=1).ravel()
 *         for i in range(nref):
 *             if values[i]:             # <<<<<<<<<<<<<<
 *                 #val[i]=1
 *                 (<FMIL.fmi2_boolean_t*> set_value)[i] = 1
 */
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_values, __pyx_v_i, sizeof(size_t)+1, __Pyx_PyInt_to_py_size_t); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_10) {

      /* "pyfmi\fmi.pyx":3573
 *             if values[i]:
 *                 #val[i]=1
 *                 (<FMIL.fmi2_boolean_t*> set_value)[i] = 1             # <<<<<<<<<<<<<<
 *             else:
 *                 #val[i]=0
 */
      (((fmi2_boolean_t *)__pyx_v_set_value)[__pyx_v_i]) = 1;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":3576
 *             else:
 *                 #val[i]=0
 *                 (<FMIL.fmi2_boolean_t*> set_value)[i] = 0             # <<<<<<<<<<<<<<
 * 
 *         if len(input_valueref) != len(values):
 */
      (((fmi2_boolean_t *)__pyx_v_set_value)[__pyx_v_i]) = 0;
    }
    __pyx_L5:;
  }

  /* "pyfmi\fmi.pyx":3578
 *                 (<FMIL.fmi2_boolean_t*> set_value)[i] = 0
 * 
 *         if len(input_valueref) != len(values):             # <<<<<<<<<<<<<<
 *             raise FMUException('The length of valueref and values are inconsistent.')
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_input_valueref)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_10 = (__pyx_t_7 != __pyx_t_11);
  if (__pyx_t_10) {

    /* "pyfmi\fmi.pyx":3579
 * 
 *         if len(input_valueref) != len(values):
 *             raise FMUException('The length of valueref and values are inconsistent.')             # <<<<<<<<<<<<<<
 * 
 *         #status = FMIL.fmi1_import_set_boolean(self._fmu, <FMIL.fmi1_value_reference_t*>val_ref.data, nref, <FMIL.fmi1_boolean_t*>val.data)
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_221), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pyfmi\fmi.pyx":3582
 * 
 *         #status = FMIL.fmi1_import_set_boolean(self._fmu, <FMIL.fmi1_value_reference_t*>val_ref.data, nref, <FMIL.fmi1_boolean_t*>val.data)
 *         status = FMIL.fmi2_import_set_boolean(self._fmu, <FMIL.fmi2_value_reference_t*> input_valueref.data, nref, <FMIL.fmi2_boolean_t*> set_value)             # <<<<<<<<<<<<<<
 * 
 *         FMIL.free(set_value)
 */
  __pyx_v_status = fmi2_import_set_boolean(__pyx_v_self->_fmu, ((fmi2_value_reference_t *)__pyx_v_input_valueref->data), __pyx_v_nref, ((fmi2_boolean_t *)__pyx_v_set_value));

  /* "pyfmi\fmi.pyx":3584
 *         status = FMIL.fmi2_import_set_boolean(self._fmu, <FMIL.fmi2_value_reference_t*> input_valueref.data, nref, <FMIL.fmi2_boolean_t*> set_value)
 * 
 *         FMIL.free(set_value)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  free(__pyx_v_set_value);

  /* "pyfmi\fmi.pyx":3586
 *         FMIL.free(set_value)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to set the Boolean values.')
 * 
 */
  __pyx_t_10 = (__pyx_v_status != 0);
  if (__pyx_t_10) {

    /* "pyfmi\fmi.pyx":3587
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Boolean values.')             # <<<<<<<<<<<<<<
 * 
 *     def get_string(self, valueref):
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_222), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_valueref.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.set_boolean", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_valueref.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_input_valueref);
  __Pyx_XDECREF(__pyx_v_values);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_15get_string(PyObject *__pyx_v_self, PyObject *__pyx_v_valueref); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_14get_string[] = "\n        Returns the string-values from the valuereference(s).\n\n        Parameters::\n\n            valueref --\n                A list of valuereferences.\n\n        Returns::\n\n            values --\n                The values retrieved from the FMU.\n\n        Example::\n\n            val = model.get_string([232])\n\n        Calls the low-level FMI function: fmi2GetString\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_15get_string(PyObject *__pyx_v_self, PyObject *__pyx_v_valueref) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_string (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_14get_string(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_valueref));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3589
 *             raise FMUException('Failed to set the Boolean values.')
 * 
 *     def get_string(self, valueref):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the string-values from the valuereference(s).
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_14get_string(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_valueref) {
  int __pyx_v_status;
  PyArrayObject *__pyx_v_input_valueref = 0;
  fmi2_string_t *__pyx_v_output_value;
  PyObject *__pyx_v_out = NULL;
  PyObject *__pyx_v_i = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_input_valueref;
  __Pyx_Buffer __pyx_pybuffer_input_valueref;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  Py_ssize_t __pyx_t_11;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_string", 0);
  __pyx_pybuffer_input_valueref.pybuffer.buf = NULL;
  __pyx_pybuffer_input_valueref.refcount = 0;
  __pyx_pybuffernd_input_valueref.data = NULL;
  __pyx_pybuffernd_input_valueref.rcbuffer = &__pyx_pybuffer_input_valueref;

  /* "pyfmi\fmi.pyx":3610
 *         """
 *         cdef int         status
 *         cdef N.ndarray[FMIL.fmi2_value_reference_t, ndim=1, mode='c'] input_valueref = N.array(valueref, dtype=N.uint32, ndmin=1).ravel()             # <<<<<<<<<<<<<<
 *         cdef FMIL.fmi2_string_t* output_value = <FMIL.fmi2_string_t*>FMIL.malloc(sizeof(FMIL.fmi2_string_t)*input_valueref.size)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_valueref);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_valueref);
  __Pyx_GIVEREF(__pyx_v_valueref);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__uint32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input_valueref.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_fmi2_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_input_valueref = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_input_valueref.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_input_valueref.diminfo[0].strides = __pyx_pybuffernd_input_valueref.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input_valueref.diminfo[0].shape = __pyx_pybuffernd_input_valueref.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_input_valueref = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":3611
 *         cdef int         status
 *         cdef N.ndarray[FMIL.fmi2_value_reference_t, ndim=1, mode='c'] input_valueref = N.array(valueref, dtype=N.uint32, ndmin=1).ravel()
 *         cdef FMIL.fmi2_string_t* output_value = <FMIL.fmi2_string_t*>FMIL.malloc(sizeof(FMIL.fmi2_string_t)*input_valueref.size)             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_get_string(self._fmu, <FMIL.fmi2_value_reference_t*> input_valueref.data, input_valueref.size, output_value)
 */
  __pyx_t_5 = __Pyx_PyInt_FromSize_t((sizeof(fmi2_string_t))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_input_valueref), __pyx_n_s__size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyNumber_Multiply(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = __Pyx_PyInt_AsSize_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_output_value = ((fmi2_string_t *)malloc(__pyx_t_7));

  /* "pyfmi\fmi.pyx":3613
 *         cdef FMIL.fmi2_string_t* output_value = <FMIL.fmi2_string_t*>FMIL.malloc(sizeof(FMIL.fmi2_string_t)*input_valueref.size)
 * 
 *         status = FMIL.fmi2_import_get_string(self._fmu, <FMIL.fmi2_value_reference_t*> input_valueref.data, input_valueref.size, output_value)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_input_valueref), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyInt_AsSize_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_status = fmi2_import_get_string(__pyx_v_self->_fmu, ((fmi2_value_reference_t *)__pyx_v_input_valueref->data), __pyx_t_7, __pyx_v_output_value);

  /* "pyfmi\fmi.pyx":3615
 *         status = FMIL.fmi2_import_get_string(self._fmu, <FMIL.fmi2_value_reference_t*> input_valueref.data, input_valueref.size, output_value)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to get the String values.')
 * 
 */
  __pyx_t_8 = (__pyx_v_status != 0);
  if (__pyx_t_8) {

    /* "pyfmi\fmi.pyx":3616
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the String values.')             # <<<<<<<<<<<<<<
 * 
 *         out = []
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_223), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":3618
 *             raise FMUException('Failed to get the String values.')
 * 
 *         out = []             # <<<<<<<<<<<<<<
 *         for i in range(input_valueref.size):
 *             out.append(decode(output_value[i]))
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_out = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":3619
 * 
 *         out = []
 *         for i in range(input_valueref.size):             # <<<<<<<<<<<<<<
 *             out.append(decode(output_value[i]))
 * 
 */
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_input_valueref), __pyx_n_s__size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0;
    __pyx_t_10 = NULL;
  } else {
    __pyx_t_9 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_10 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (!__pyx_t_10 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_10 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_3 = __pyx_t_10(__pyx_t_1);
      if (unlikely(!__pyx_t_3)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF(__pyx_v_i);
    __pyx_v_i = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "pyfmi\fmi.pyx":3620
 *         out = []
 *         for i in range(input_valueref.size):
 *             out.append(decode(output_value[i]))             # <<<<<<<<<<<<<<
 * 
 *         FMIL.free(output_value)
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = PyBytes_FromString((__pyx_v_output_value[__pyx_t_11])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_5));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_12 = PyList_Append(__pyx_v_out, __pyx_t_5); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":3622
 *             out.append(decode(output_value[i]))
 * 
 *         FMIL.free(output_value)             # <<<<<<<<<<<<<<
 * 
 *         return out
 */
  free(__pyx_v_output_value);

  /* "pyfmi\fmi.pyx":3624
 *         FMIL.free(output_value)
 * 
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     def set_string(self, valueref, values):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = ((PyObject *)__pyx_v_out);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_valueref.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_valueref.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_input_valueref);
  __Pyx_XDECREF(__pyx_v_out);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_17set_string(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_16set_string[] = "\n        Sets the string-values in the FMU as defined by the valuereference(s).\n\n        Parameters::\n\n            valueref --\n                A list of valuereferences.\n\n            values --\n                Values to be set.\n\n        Example::\n\n            model.set_string([234,235],['text','text'])\n\n        Calls the low-level FMI function: fmi2SetString\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_17set_string(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_valueref = 0;
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_string (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__valueref,&__pyx_n_s__values,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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__valueref)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_string", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3626; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_string") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3626; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_valueref = values[0];
    __pyx_v_values = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_string", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3626; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.set_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_16set_string(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_v_valueref, __pyx_v_values);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3626
 *         return out
 * 
 *     def set_string(self, valueref, values):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the string-values in the FMU as defined by the valuereference(s).
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_16set_string(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_valueref, PyObject *__pyx_v_values) {
  int __pyx_v_status;
  PyArrayObject *__pyx_v_val_ref = 0;
  fmi2_string_t *__pyx_v_val;
  PyObject *__pyx_v_i = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_val_ref;
  __Pyx_Buffer __pyx_pybuffer_val_ref;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  fmi2_string_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_string", 0);
  __pyx_pybuffer_val_ref.pybuffer.buf = NULL;
  __pyx_pybuffer_val_ref.refcount = 0;
  __pyx_pybuffernd_val_ref.data = NULL;
  __pyx_pybuffernd_val_ref.rcbuffer = &__pyx_pybuffer_val_ref;

  /* "pyfmi\fmi.pyx":3645
 *         """
 *         cdef int status
 *         cdef N.ndarray[FMIL.fmi2_value_reference_t, ndim=1,mode='c'] val_ref = N.array(valueref, dtype=N.uint32,ndmin=1).ravel()             # <<<<<<<<<<<<<<
 *         cdef FMIL.fmi2_string_t* val = <FMIL.fmi2_string_t*>FMIL.malloc(sizeof(FMIL.fmi2_string_t)*val_ref.size)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_valueref);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_valueref);
  __Pyx_GIVEREF(__pyx_v_valueref);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__uint32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_val_ref.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_fmi2_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_val_ref = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_val_ref.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_val_ref.diminfo[0].strides = __pyx_pybuffernd_val_ref.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_val_ref.diminfo[0].shape = __pyx_pybuffernd_val_ref.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_val_ref = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":3646
 *         cdef int status
 *         cdef N.ndarray[FMIL.fmi2_value_reference_t, ndim=1,mode='c'] val_ref = N.array(valueref, dtype=N.uint32,ndmin=1).ravel()
 *         cdef FMIL.fmi2_string_t* val = <FMIL.fmi2_string_t*>FMIL.malloc(sizeof(FMIL.fmi2_string_t)*val_ref.size)             # <<<<<<<<<<<<<<
 * 
 *         if not isinstance(values, list):
 */
  __pyx_t_5 = __Pyx_PyInt_FromSize_t((sizeof(fmi2_string_t))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_val_ref), __pyx_n_s__size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyNumber_Multiply(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = __Pyx_PyInt_AsSize_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_val = ((fmi2_string_t *)malloc(__pyx_t_7));

  /* "pyfmi\fmi.pyx":3648
 *         cdef FMIL.fmi2_string_t* val = <FMIL.fmi2_string_t*>FMIL.malloc(sizeof(FMIL.fmi2_string_t)*val_ref.size)
 * 
 *         if not isinstance(values, list):             # <<<<<<<<<<<<<<
 *             raise FMUException(
 *                 'The values needs to be a list of values.')
 */
  __pyx_t_8 = PyList_Check(__pyx_v_values); 
  __pyx_t_9 = (!__pyx_t_8);
  if (__pyx_t_9) {

    /* "pyfmi\fmi.pyx":3649
 * 
 *         if not isinstance(values, list):
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'The values needs to be a list of values.')
 *         if len(values) != val_ref.size:
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_224), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":3651
 *             raise FMUException(
 *                 'The values needs to be a list of values.')
 *         if len(values) != val_ref.size:             # <<<<<<<<<<<<<<
 *             raise FMUException(
 *                 'The length of valueref and values are inconsistent.')
 */
  __pyx_t_10 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_val_ref), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_9) {

    /* "pyfmi\fmi.pyx":3652
 *                 'The values needs to be a list of values.')
 *         if len(values) != val_ref.size:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'The length of valueref and values are inconsistent.')
 * 
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_225), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":3655
 *                 'The length of valueref and values are inconsistent.')
 * 
 *         for i in range(val_ref.size):             # <<<<<<<<<<<<<<
 *             val[i] = values[i]
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_val_ref), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5); __pyx_t_10 = 0;
    __pyx_t_11 = NULL;
  } else {
    __pyx_t_10 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_11 = Py_TYPE(__pyx_t_5)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_5)) {
      if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_5)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_5)) {
      if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_11(__pyx_t_5);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF(__pyx_v_i);
    __pyx_v_i = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pyfmi\fmi.pyx":3656
 * 
 *         for i in range(val_ref.size):
 *             val[i] = values[i]             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_set_string(self._fmu, <FMIL.fmi2_value_reference_t*>val_ref.data, val_ref.size, val)
 */
    __pyx_t_1 = PyObject_GetItem(__pyx_v_values, __pyx_v_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_12 = PyBytes_AsString(__pyx_t_1); if (unlikely((__pyx_t_12 == (fmi2_string_t)NULL) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    (__pyx_v_val[__pyx_t_13]) = __pyx_t_12;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":3658
 *             val[i] = values[i]
 * 
 *         status = FMIL.fmi2_import_set_string(self._fmu, <FMIL.fmi2_value_reference_t*>val_ref.data, val_ref.size, val)             # <<<<<<<<<<<<<<
 * 
 *         FMIL.free(val)
 */
  __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_val_ref), __pyx_n_s__size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_PyInt_AsSize_t(__pyx_t_5); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_status = fmi2_import_set_string(__pyx_v_self->_fmu, ((fmi2_value_reference_t *)__pyx_v_val_ref->data), __pyx_t_7, __pyx_v_val);

  /* "pyfmi\fmi.pyx":3660
 *         status = FMIL.fmi2_import_set_string(self._fmu, <FMIL.fmi2_value_reference_t*>val_ref.data, val_ref.size, val)
 * 
 *         FMIL.free(val)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  free(__pyx_v_val);

  /* "pyfmi\fmi.pyx":3662
 *         FMIL.free(val)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to set the String values.')
 * 
 */
  __pyx_t_9 = (__pyx_v_status != 0);
  if (__pyx_t_9) {

    /* "pyfmi\fmi.pyx":3663
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the String values.')             # <<<<<<<<<<<<<<
 * 
 *     def _set(self, variable_name, value):
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_226), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_val_ref.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.set_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_val_ref.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_val_ref);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_19_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_18_set[] = "\n        Helper method to set, see docstring on set.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_19_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_variable_name = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__variable_name,&__pyx_n_s__value,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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__variable_name)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_set", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3665; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_set") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3665; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_variable_name = values[0];
    __pyx_v_value = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_set", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3665; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2._set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_18_set(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_v_variable_name, __pyx_v_value);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3665
 *             raise FMUException('Failed to set the String values.')
 * 
 *     def _set(self, variable_name, value):             # <<<<<<<<<<<<<<
 *         """
 *         Helper method to set, see docstring on set.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_18_set(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name, PyObject *__pyx_v_value) {
  fmi2_value_reference_t __pyx_v_ref;
  fmi2_base_type_enu_t __pyx_v_type;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  fmi2_value_reference_t __pyx_t_1;
  fmi2_base_type_enu_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set", 0);

  /* "pyfmi\fmi.pyx":3672
 *         cdef FMIL.fmi2_base_type_enu_t   type
 * 
 *         ref  = self.get_variable_valueref(variable_name)             # <<<<<<<<<<<<<<
 *         type = self.get_variable_data_type(variable_name)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_variable_valueref(__pyx_v_self, __pyx_v_variable_name, 0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_ref = __pyx_t_1;

  /* "pyfmi\fmi.pyx":3673
 * 
 *         ref  = self.get_variable_valueref(variable_name)
 *         type = self.get_variable_data_type(variable_name)             # <<<<<<<<<<<<<<
 * 
 *         if type == FMIL.fmi2_base_type_real:  #REAL
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_variable_data_type(__pyx_v_self, __pyx_v_variable_name, 0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_type = __pyx_t_2;

  /* "pyfmi\fmi.pyx":3675
 *         type = self.get_variable_data_type(variable_name)
 * 
 *         if type == FMIL.fmi2_base_type_real:  #REAL             # <<<<<<<<<<<<<<
 *             self.set_real([ref], [value])
 *         elif type == FMIL.fmi2_base_type_int or type == FMIL.fmi2_base_type_enum: #INTEGER
 */
  __pyx_t_3 = (__pyx_v_type == fmi2_base_type_real);
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":3676
 * 
 *         if type == FMIL.fmi2_base_type_real:  #REAL
 *             self.set_real([ref], [value])             # <<<<<<<<<<<<<<
 *         elif type == FMIL.fmi2_base_type_int or type == FMIL.fmi2_base_type_enum: #INTEGER
 *             self.set_integer([ref], [value])
 */
    __pyx_t_4 = __Pyx_PyInt_FromSize_t(__pyx_v_ref); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_value);
    PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_value);
    __Pyx_GIVEREF(__pyx_v_value);
    __pyx_t_6 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_real(__pyx_v_self, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_4), 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L3;
  }

  /* "pyfmi\fmi.pyx":3677
 *         if type == FMIL.fmi2_base_type_real:  #REAL
 *             self.set_real([ref], [value])
 *         elif type == FMIL.fmi2_base_type_int or type == FMIL.fmi2_base_type_enum: #INTEGER             # <<<<<<<<<<<<<<
 *             self.set_integer([ref], [value])
 *         elif type == FMIL.fmi2_base_type_str: #STRING
 */
  __pyx_t_3 = (__pyx_v_type == fmi2_base_type_int);
  if (!__pyx_t_3) {
    __pyx_t_7 = (__pyx_v_type == fmi2_base_type_enum);
    __pyx_t_8 = __pyx_t_7;
  } else {
    __pyx_t_8 = __pyx_t_3;
  }
  if (__pyx_t_8) {

    /* "pyfmi\fmi.pyx":3678
 *             self.set_real([ref], [value])
 *         elif type == FMIL.fmi2_base_type_int or type == FMIL.fmi2_base_type_enum: #INTEGER
 *             self.set_integer([ref], [value])             # <<<<<<<<<<<<<<
 *         elif type == FMIL.fmi2_base_type_str: #STRING
 *             self.set_string([ref], [value])
 */
    __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__set_integer); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_PyInt_FromSize_t(__pyx_v_ref); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_value);
    PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_value);
    __Pyx_GIVEREF(__pyx_v_value);
    __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_t_5));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
    PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_t_4));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
    __pyx_t_5 = 0;
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L3;
  }

  /* "pyfmi\fmi.pyx":3679
 *         elif type == FMIL.fmi2_base_type_int or type == FMIL.fmi2_base_type_enum: #INTEGER
 *             self.set_integer([ref], [value])
 *         elif type == FMIL.fmi2_base_type_str: #STRING             # <<<<<<<<<<<<<<
 *             self.set_string([ref], [value])
 *         elif type == FMIL.fmi2_base_type_bool: #BOOLEAN
 */
  __pyx_t_8 = (__pyx_v_type == fmi2_base_type_str);
  if (__pyx_t_8) {

    /* "pyfmi\fmi.pyx":3680
 *             self.set_integer([ref], [value])
 *         elif type == FMIL.fmi2_base_type_str: #STRING
 *             self.set_string([ref], [value])             # <<<<<<<<<<<<<<
 *         elif type == FMIL.fmi2_base_type_bool: #BOOLEAN
 *             self.set_boolean([ref], [value])
 */
    __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__set_string); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = __Pyx_PyInt_FromSize_t(__pyx_v_ref); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_9);
    __pyx_t_9 = 0;
    __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_INCREF(__pyx_v_value);
    PyList_SET_ITEM(__pyx_t_9, 0, __pyx_v_value);
    __Pyx_GIVEREF(__pyx_v_value);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_6));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
    PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_t_9));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
    __pyx_t_6 = 0;
    __pyx_t_9 = 0;
    __pyx_t_9 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    goto __pyx_L3;
  }

  /* "pyfmi\fmi.pyx":3681
 *         elif type == FMIL.fmi2_base_type_str: #STRING
 *             self.set_string([ref], [value])
 *         elif type == FMIL.fmi2_base_type_bool: #BOOLEAN             # <<<<<<<<<<<<<<
 *             self.set_boolean([ref], [value])
 *         else:
 */
  __pyx_t_8 = (__pyx_v_type == fmi2_base_type_bool);
  if (__pyx_t_8) {

    /* "pyfmi\fmi.pyx":3682
 *             self.set_string([ref], [value])
 *         elif type == FMIL.fmi2_base_type_bool: #BOOLEAN
 *             self.set_boolean([ref], [value])             # <<<<<<<<<<<<<<
 *         else:
 *             raise FMUException('Type not supported.')
 */
    __pyx_t_9 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__set_boolean); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_ref); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_value);
    PyList_SET_ITEM(__pyx_t_5, 0, __pyx_v_value);
    __Pyx_GIVEREF(__pyx_v_value);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_4));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
    PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_t_5));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":3684
 *             self.set_boolean([ref], [value])
 *         else:
 *             raise FMUException('Type not supported.')             # <<<<<<<<<<<<<<
 * 
 *     def _get(self, variable_name):
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_227), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2._set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_21_get(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_20_get[] = "\n        Helper method to get, see docstring on get.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_21_get(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_20_get(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3686
 *             raise FMUException('Type not supported.')
 * 
 *     def _get(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Helper method to get, see docstring on get.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_20_get(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  fmi2_value_reference_t __pyx_v_ref;
  fmi2_base_type_enu_t __pyx_v_type;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  fmi2_value_reference_t __pyx_t_1;
  fmi2_base_type_enu_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get", 0);

  /* "pyfmi\fmi.pyx":3693
 *         cdef FMIL.fmi2_base_type_enu_t type
 * 
 *         ref  = self.get_variable_valueref(variable_name)             # <<<<<<<<<<<<<<
 *         type = self.get_variable_data_type(variable_name)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_variable_valueref(__pyx_v_self, __pyx_v_variable_name, 0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_ref = __pyx_t_1;

  /* "pyfmi\fmi.pyx":3694
 * 
 *         ref  = self.get_variable_valueref(variable_name)
 *         type = self.get_variable_data_type(variable_name)             # <<<<<<<<<<<<<<
 * 
 *         if type == FMIL.fmi2_base_type_real:  #REAL
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_variable_data_type(__pyx_v_self, __pyx_v_variable_name, 0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_type = __pyx_t_2;

  /* "pyfmi\fmi.pyx":3696
 *         type = self.get_variable_data_type(variable_name)
 * 
 *         if type == FMIL.fmi2_base_type_real:  #REAL             # <<<<<<<<<<<<<<
 *             return self.get_real([ref])
 *         elif type == FMIL.fmi2_base_type_int or type == FMIL.fmi2_base_type_enum: #INTEGER
 */
  __pyx_t_3 = (__pyx_v_type == fmi2_base_type_real);
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":3697
 * 
 *         if type == FMIL.fmi2_base_type_real:  #REAL
 *             return self.get_real([ref])             # <<<<<<<<<<<<<<
 *         elif type == FMIL.fmi2_base_type_int or type == FMIL.fmi2_base_type_enum: #INTEGER
 *             return self.get_integer([ref])
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyInt_FromSize_t(__pyx_v_ref); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = ((PyObject *)((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_real(__pyx_v_self, ((PyObject *)__pyx_t_5), 0)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }

  /* "pyfmi\fmi.pyx":3698
 *         if type == FMIL.fmi2_base_type_real:  #REAL
 *             return self.get_real([ref])
 *         elif type == FMIL.fmi2_base_type_int or type == FMIL.fmi2_base_type_enum: #INTEGER             # <<<<<<<<<<<<<<
 *             return self.get_integer([ref])
 *         elif type == FMIL.fmi2_base_type_str: #STRING
 */
  __pyx_t_3 = (__pyx_v_type == fmi2_base_type_int);
  if (!__pyx_t_3) {
    __pyx_t_6 = (__pyx_v_type == fmi2_base_type_enum);
    __pyx_t_7 = __pyx_t_6;
  } else {
    __pyx_t_7 = __pyx_t_3;
  }
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":3699
 *             return self.get_real([ref])
 *         elif type == FMIL.fmi2_base_type_int or type == FMIL.fmi2_base_type_enum: #INTEGER
 *             return self.get_integer([ref])             # <<<<<<<<<<<<<<
 *         elif type == FMIL.fmi2_base_type_str: #STRING
 *             return self.get_string([ref])
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_integer); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_ref); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_8));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
    __pyx_t_8 = 0;
    __pyx_t_8 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_8;
    __pyx_t_8 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }

  /* "pyfmi\fmi.pyx":3700
 *         elif type == FMIL.fmi2_base_type_int or type == FMIL.fmi2_base_type_enum: #INTEGER
 *             return self.get_integer([ref])
 *         elif type == FMIL.fmi2_base_type_str: #STRING             # <<<<<<<<<<<<<<
 *             return self.get_string([ref])
 *         elif type == FMIL.fmi2_base_type_bool: #BOOLEAN
 */
  __pyx_t_7 = (__pyx_v_type == fmi2_base_type_str);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":3701
 *             return self.get_integer([ref])
 *         elif type == FMIL.fmi2_base_type_str: #STRING
 *             return self.get_string([ref])             # <<<<<<<<<<<<<<
 *         elif type == FMIL.fmi2_base_type_bool: #BOOLEAN
 *             return self.get_boolean([ref])
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_8 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_string); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_ref); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }

  /* "pyfmi\fmi.pyx":3702
 *         elif type == FMIL.fmi2_base_type_str: #STRING
 *             return self.get_string([ref])
 *         elif type == FMIL.fmi2_base_type_bool: #BOOLEAN             # <<<<<<<<<<<<<<
 *             return self.get_boolean([ref])
 *         else:
 */
  __pyx_t_7 = (__pyx_v_type == fmi2_base_type_bool);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":3703
 *             return self.get_string([ref])
 *         elif type == FMIL.fmi2_base_type_bool: #BOOLEAN
 *             return self.get_boolean([ref])             # <<<<<<<<<<<<<<
 *         else:
 *             raise FMUException('Type not supported.')
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_boolean); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_ref); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_8));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
    __pyx_t_8 = 0;
    __pyx_t_8 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_8;
    __pyx_t_8 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":3705
 *             return self.get_boolean([ref])
 *         else:
 *             raise FMUException('Type not supported.')             # <<<<<<<<<<<<<<
 * 
 *     def instantiate(self, name= 'Model', visible = False):
 */
    __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_k_tuple_228), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2._get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_23instantiate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_22instantiate[] = "\n        Instantiate the model.\n\n        Parameters::\n\n            name --\n                The name of the instance.\n                Default: 'Model'\n\n            visible --\n                Defines if the simulator application window should be visible or not.\n                Default: False, not visible.\n\n        Calls the low-level FMI function: fmi2Instantiate.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_23instantiate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_visible = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("instantiate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__name,&__pyx_n_s__visible,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)__pyx_n_s__Model);
    values[1] = __pyx_k_229;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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 (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__name);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__visible);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "instantiate") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3707; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        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;
      }
    }
    __pyx_v_name = values[0];
    __pyx_v_visible = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("instantiate", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3707; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.instantiate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_22instantiate(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_v_name, __pyx_v_visible);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3707
 *             raise FMUException('Type not supported.')
 * 
 *     def instantiate(self, name= 'Model', visible = False):             # <<<<<<<<<<<<<<
 *         """
 *         Instantiate the model.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_22instantiate(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_visible) {
  fmi2_boolean_t __pyx_v_vis;
  int __pyx_v_status;
  PyObject *__pyx_v_fmuType = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  fmi2_string_t __pyx_t_5;
  fmi2_type_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("instantiate", 0);
  __Pyx_INCREF(__pyx_v_name);

  /* "pyfmi\fmi.pyx":3728
 *         cdef int status
 * 
 *         if visible:             # <<<<<<<<<<<<<<
 *             vis = 1
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_visible); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":3729
 * 
 *         if visible:
 *             vis = 1             # <<<<<<<<<<<<<<
 *         else:
 *             vis = 0
 */
    __pyx_v_vis = 1;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":3731
 *             vis = 1
 *         else:
 *             vis = 0             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(self,FMUModelME2):
 */
    __pyx_v_vis = 0;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":3733
 *             vis = 0
 * 
 *         if isinstance(self,FMUModelME2):             # <<<<<<<<<<<<<<
 *             fmuType = FMIL.fmi2_model_exchange
 *         elif isinstance(self,FMUModelCS2):
 */
  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_self), ((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelME2)); 
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":3734
 * 
 *         if isinstance(self,FMUModelME2):
 *             fmuType = FMIL.fmi2_model_exchange             # <<<<<<<<<<<<<<
 *         elif isinstance(self,FMUModelCS2):
 *             fmuType = FMIL.fmi2_cosimulation
 */
    __pyx_t_2 = PyInt_FromLong(fmi2_model_exchange); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_fmuType = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L4;
  }

  /* "pyfmi\fmi.pyx":3735
 *         if isinstance(self,FMUModelME2):
 *             fmuType = FMIL.fmi2_model_exchange
 *         elif isinstance(self,FMUModelCS2):             # <<<<<<<<<<<<<<
 *             fmuType = FMIL.fmi2_cosimulation
 *         else:
 */
  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_self), ((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelCS2)); 
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":3736
 *             fmuType = FMIL.fmi2_model_exchange
 *         elif isinstance(self,FMUModelCS2):
 *             fmuType = FMIL.fmi2_cosimulation             # <<<<<<<<<<<<<<
 *         else:
 *             raise FMUException('The instance is not curent an instance of an ME-model or a CS-model. Use load_fmu for correct loading.')
 */
    __pyx_t_2 = PyInt_FromLong(fmi2_cosimulation); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_fmuType = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":3738
 *             fmuType = FMIL.fmi2_cosimulation
 *         else:
 *             raise FMUException('The instance is not curent an instance of an ME-model or a CS-model. Use load_fmu for correct loading.')             # <<<<<<<<<<<<<<
 * 
 *         name = encode(name)
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_231), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":3740
 *             raise FMUException('The instance is not curent an instance of an ME-model or a CS-model. Use load_fmu for correct loading.')
 * 
 *         name = encode(name)             # <<<<<<<<<<<<<<
 *         status =  FMIL.fmi2_import_instantiate(self._fmu, name, fmuType, NULL, vis)
 * 
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_name);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_v_name);
  __pyx_v_name = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":3741
 * 
 *         name = encode(name)
 *         status =  FMIL.fmi2_import_instantiate(self._fmu, name, fmuType, NULL, vis)             # <<<<<<<<<<<<<<
 * 
 *         if status != FMIL.jm_status_success:
 */
  __pyx_t_5 = PyBytes_AsString(__pyx_v_name); if (unlikely((__pyx_t_5 == (fmi2_string_t)NULL) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((fmi2_type_t)PyInt_AsLong(__pyx_v_fmuType)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_status = fmi2_import_instantiate(__pyx_v_self->_fmu, __pyx_t_5, __pyx_t_6, NULL, __pyx_v_vis);

  /* "pyfmi\fmi.pyx":3743
 *         status =  FMIL.fmi2_import_instantiate(self._fmu, name, fmuType, NULL, vis)
 * 
 *         if status != FMIL.jm_status_success:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to instantiate the model. See the log for possibly more information.')
 * 
 */
  __pyx_t_1 = (__pyx_v_status != jm_status_success);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":3744
 * 
 *         if status != FMIL.jm_status_success:
 *             raise FMUException('Failed to instantiate the model. See the log for possibly more information.')             # <<<<<<<<<<<<<<
 * 
 *     def setup_experiment(self, tolerance_defined=True, tolerance="Default", start_time="Default", stop_time_defined=False, stop_time="Default"):
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_232), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.instantiate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fmuType);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_25setup_experiment(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_24setup_experiment[] = "\n        Calls the underlying FMU method for creating an experiment.\n        \n        Parameters::\n        \n            tolerance_defined --\n            tolerance --\n            start_time --\n            stop_time_defined --\n            stop_time --\n            \n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_25setup_experiment(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_tolerance_defined = 0;
  PyObject *__pyx_v_tolerance = 0;
  PyObject *__pyx_v_start_time = 0;
  PyObject *__pyx_v_stop_time_defined = 0;
  PyObject *__pyx_v_stop_time = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setup_experiment (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__tolerance_defined,&__pyx_n_s__tolerance,&__pyx_n_s__start_time,&__pyx_n_s__stop_time_defined,&__pyx_n_s__stop_time,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[0] = __pyx_k_233;
    values[1] = ((PyObject *)__pyx_n_s__Default);
    values[2] = ((PyObject *)__pyx_n_s__Default);
    values[3] = __pyx_k_234;
    values[4] = ((PyObject *)__pyx_n_s__Default);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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 (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tolerance_defined);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tolerance);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start_time);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__stop_time_defined);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__stop_time);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setup_experiment") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3746; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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;
      }
    }
    __pyx_v_tolerance_defined = values[0];
    __pyx_v_tolerance = values[1];
    __pyx_v_start_time = values[2];
    __pyx_v_stop_time_defined = values[3];
    __pyx_v_stop_time = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setup_experiment", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3746; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.setup_experiment", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_24setup_experiment(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_v_tolerance_defined, __pyx_v_tolerance, __pyx_v_start_time, __pyx_v_stop_time_defined, __pyx_v_stop_time);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3746
 *             raise FMUException('Failed to instantiate the model. See the log for possibly more information.')
 * 
 *     def setup_experiment(self, tolerance_defined=True, tolerance="Default", start_time="Default", stop_time_defined=False, stop_time="Default"):             # <<<<<<<<<<<<<<
 *         """
 *         Calls the underlying FMU method for creating an experiment.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_24setup_experiment(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_tolerance_defined, PyObject *__pyx_v_tolerance, PyObject *__pyx_v_start_time, PyObject *__pyx_v_stop_time_defined, PyObject *__pyx_v_stop_time) {
  int __pyx_v_status;
  fmi2_boolean_t __pyx_v_stop_defined;
  fmi2_boolean_t __pyx_v_tol_defined;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  fmi2_boolean_t __pyx_t_4;
  fmi2_real_t __pyx_t_5;
  fmi2_real_t __pyx_t_6;
  fmi2_real_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setup_experiment", 0);
  __Pyx_INCREF(__pyx_v_tolerance);
  __Pyx_INCREF(__pyx_v_start_time);
  __Pyx_INCREF(__pyx_v_stop_time);

  /* "pyfmi\fmi.pyx":3761
 *         cdef int status
 * 
 *         cdef FMIL.fmi2_boolean_t stop_defined = FMI2_TRUE if stop_time_defined else FMI2_FALSE             # <<<<<<<<<<<<<<
 *         cdef FMIL.fmi2_boolean_t tol_defined = FMI2_TRUE if tolerance_defined else FMI2_FALSE
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_stop_time_defined); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI2_TRUE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI2_FALSE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_t_4 = __Pyx_PyInt_from_py_fmi2_boolean_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (fmi2_boolean_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_stop_defined = __pyx_t_4;

  /* "pyfmi\fmi.pyx":3762
 * 
 *         cdef FMIL.fmi2_boolean_t stop_defined = FMI2_TRUE if stop_time_defined else FMI2_FALSE
 *         cdef FMIL.fmi2_boolean_t tol_defined = FMI2_TRUE if tolerance_defined else FMI2_FALSE             # <<<<<<<<<<<<<<
 * 
 *         if tolerance == "Default":
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_tolerance_defined); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI2_TRUE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI2_FALSE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_t_4 = __Pyx_PyInt_from_py_fmi2_boolean_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (fmi2_boolean_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_tol_defined = __pyx_t_4;

  /* "pyfmi\fmi.pyx":3764
 *         cdef FMIL.fmi2_boolean_t tol_defined = FMI2_TRUE if tolerance_defined else FMI2_FALSE
 * 
 *         if tolerance == "Default":             # <<<<<<<<<<<<<<
 *             tolerance = self.get_default_experiment_tolerance()
 *         if start_time == "Default":
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_tolerance, ((PyObject *)__pyx_n_s__Default), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":3765
 * 
 *         if tolerance == "Default":
 *             tolerance = self.get_default_experiment_tolerance()             # <<<<<<<<<<<<<<
 *         if start_time == "Default":
 *             start_time = self.get_default_experiment_start_time()
 */
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_169); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_v_tolerance);
    __pyx_v_tolerance = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":3766
 *         if tolerance == "Default":
 *             tolerance = self.get_default_experiment_tolerance()
 *         if start_time == "Default":             # <<<<<<<<<<<<<<
 *             start_time = self.get_default_experiment_start_time()
 *         if stop_time == "Default":
 */
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_start_time, ((PyObject *)__pyx_n_s__Default), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":3767
 *             tolerance = self.get_default_experiment_tolerance()
 *         if start_time == "Default":
 *             start_time = self.get_default_experiment_start_time()             # <<<<<<<<<<<<<<
 *         if stop_time == "Default":
 *             stop_time = self.get_default_experiment_stop_time()
 */
    __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_129); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3767; __pyx_clineno = __LINE__; goto __pyx_L1_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 = 3767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_v_start_time);
    __pyx_v_start_time = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":3768
 *         if start_time == "Default":
 *             start_time = self.get_default_experiment_start_time()
 *         if stop_time == "Default":             # <<<<<<<<<<<<<<
 *             stop_time = self.get_default_experiment_stop_time()
 * 
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_stop_time, ((PyObject *)__pyx_n_s__Default), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":3769
 *             start_time = self.get_default_experiment_start_time()
 *         if stop_time == "Default":
 *             stop_time = self.get_default_experiment_stop_time()             # <<<<<<<<<<<<<<
 * 
 *         self.__t = start_time
 */
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_130); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_v_stop_time);
    __pyx_v_stop_time = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":3771
 *             stop_time = self.get_default_experiment_stop_time()
 * 
 *         self.__t = start_time             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_setup_experiment(self._fmu,
 */
  __Pyx_INCREF(__pyx_v_start_time);
  __Pyx_GIVEREF(__pyx_v_start_time);
  __Pyx_GOTREF(__pyx_v_self->__pyx___t);
  __Pyx_DECREF(__pyx_v_self->__pyx___t);
  __pyx_v_self->__pyx___t = __pyx_v_start_time;

  /* "pyfmi\fmi.pyx":3774
 * 
 *         status = FMIL.fmi2_import_setup_experiment(self._fmu,
 *                 tol_defined, tolerance, start_time, stop_defined, stop_time)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_tolerance); if (unlikely((__pyx_t_5 == (fmi2_real_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_start_time); if (unlikely((__pyx_t_6 == (fmi2_real_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_v_stop_time); if (unlikely((__pyx_t_7 == (fmi2_real_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_status = fmi2_import_setup_experiment(__pyx_v_self->_fmu, __pyx_v_tol_defined, __pyx_t_5, __pyx_t_6, __pyx_v_stop_defined, __pyx_t_7);

  /* "pyfmi\fmi.pyx":3776
 *                 tol_defined, tolerance, start_time, stop_defined, stop_time)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to setup the experiment.')
 * 
 */
  __pyx_t_2 = (__pyx_v_status != 0);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":3777
 * 
 *         if status != 0:
 *             raise FMUException('Failed to setup the experiment.')             # <<<<<<<<<<<<<<
 * 
 *     def reset(self):
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_236), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.setup_experiment", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tolerance);
  __Pyx_XDECREF(__pyx_v_start_time);
  __Pyx_XDECREF(__pyx_v_stop_time);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_27reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_26reset[] = "\n        Resets the FMU back to its original state. Note that the environment \n        has to initialize the FMU again after this function-call.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_27reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_26reset(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3779
 *             raise FMUException('Failed to setup the experiment.')
 * 
 *     def reset(self):             # <<<<<<<<<<<<<<
 *         """
 *         Resets the FMU back to its original state. Note that the environment
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_26reset(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  int __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  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("reset", 0);

  /* "pyfmi\fmi.pyx":3786
 *         cdef int status
 * 
 *         status = FMIL.fmi2_import_reset(self._fmu)             # <<<<<<<<<<<<<<
 *         if status != 0:
 *             raise FMUException('An error occured when reseting the model, see the log for possible more information')
 */
  __pyx_v_status = fmi2_import_reset(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":3787
 * 
 *         status = FMIL.fmi2_import_reset(self._fmu)
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('An error occured when reseting the model, see the log for possible more information')
 * 
 */
  __pyx_t_1 = (__pyx_v_status != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":3788
 *         status = FMIL.fmi2_import_reset(self._fmu)
 *         if status != 0:
 *             raise FMUException('An error occured when reseting the model, see the log for possible more information')             # <<<<<<<<<<<<<<
 * 
 *         #Default values
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_238), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":3791
 * 
 *         #Default values
 *         self.__t = None             # <<<<<<<<<<<<<<
 * 
 *         #Reseting the allocation flags
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->__pyx___t);
  __Pyx_DECREF(__pyx_v_self->__pyx___t);
  __pyx_v_self->__pyx___t = Py_None;

  /* "pyfmi\fmi.pyx":3794
 * 
 *         #Reseting the allocation flags
 *         self._allocated_fmu = 0             # <<<<<<<<<<<<<<
 * 
 *         #Internal values
 */
  __pyx_v_self->_allocated_fmu = 0;

  /* "pyfmi\fmi.pyx":3797
 * 
 *         #Internal values
 *         self._log = []             # <<<<<<<<<<<<<<
 * 
 *     def terminate(self):
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  __Pyx_GOTREF(__pyx_v_self->__pyx_base._log);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base._log));
  __pyx_v_self->__pyx_base._log = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_29terminate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_28terminate[] = "\n        Calls the FMI function fmi2Terminate() on the FMU.\n        After this call, any call to a function changing the state of the FMU will fail.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_29terminate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("terminate (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_28terminate(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3799
 *         self._log = []
 * 
 *     def terminate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Calls the FMI function fmi2Terminate() on the FMU.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_28terminate(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("terminate", 0);

  /* "pyfmi\fmi.pyx":3804
 *         After this call, any call to a function changing the state of the FMU will fail.
 *         """
 *         FMIL.fmi2_import_terminate(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *     def free_instance(self):
 */
  fmi2_import_terminate(__pyx_v_self->_fmu);

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_31free_instance(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_30free_instance[] = "\n        Calls the FMI function fmi2FreeInstance() on the FMU. Note that this is not\n        needed generally.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_31free_instance(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("free_instance (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_30free_instance(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3806
 *         FMIL.fmi2_import_terminate(self._fmu)
 * 
 *     def free_instance(self):             # <<<<<<<<<<<<<<
 *         """
 *         Calls the FMI function fmi2FreeInstance() on the FMU. Note that this is not
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_30free_instance(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("free_instance", 0);

  /* "pyfmi\fmi.pyx":3811
 *         needed generally.
 *         """
 *         FMIL.fmi2_import_free_instance(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *     def exit_initialization_mode(self):
 */
  fmi2_import_free_instance(__pyx_v_self->_fmu);

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_33exit_initialization_mode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_32exit_initialization_mode[] = "\n        Exit initialization mode by calling the low level FMI function\n        fmi2ExitInitializationMode.\n        \n        Note that the method initialize() performs both the enter and \n        exit of initialization mode.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_33exit_initialization_mode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("exit_initialization_mode (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_32exit_initialization_mode(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3813
 *         FMIL.fmi2_import_free_instance(self._fmu)
 * 
 *     def exit_initialization_mode(self):             # <<<<<<<<<<<<<<
 *         """
 *         Exit initialization mode by calling the low level FMI function
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_32exit_initialization_mode(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  int __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  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("exit_initialization_mode", 0);

  /* "pyfmi\fmi.pyx":3821
 *         exit of initialization mode.
 *         """
 *         status = FMIL.fmi2_import_exit_initialization_mode(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if status == 1:
 */
  __pyx_v_status = fmi2_import_exit_initialization_mode(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":3823
 *         status = FMIL.fmi2_import_exit_initialization_mode(self._fmu)
 * 
 *         if status == 1:             # <<<<<<<<<<<<<<
 *             if self._enable_logging:
 *                 logging.warning(
 */
  __pyx_t_1 = (__pyx_v_status == 1);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":3824
 * 
 *         if status == 1:
 *             if self._enable_logging:             # <<<<<<<<<<<<<<
 *                 logging.warning(
 *                     'Exit Initialize returned with a warning.' \
 */
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->_enable_logging); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_1) {

      /* "pyfmi\fmi.pyx":3825
 *         if status == 1:
 *             if self._enable_logging:
 *                 logging.warning(             # <<<<<<<<<<<<<<
 *                     'Exit Initialize returned with a warning.' \
 *                     ' Check the log for information (FMUModel.get_log).')
 */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logging); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__warning); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_240), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L4;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":3829
 *                     ' Check the log for information (FMUModel.get_log).')
 *             else:
 *                 logging.warning('Exit Initialize returned with a warning.' \             # <<<<<<<<<<<<<<
 *                     ' Enable logging for more information, (FMUModel(..., enable_logging=True)).')
 * 
 */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logging); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__warning); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_242), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":3832
 *                     ' Enable logging for more information, (FMUModel(..., enable_logging=True)).')
 * 
 *         if status > 1:             # <<<<<<<<<<<<<<
 *             if self._enable_logging:
 *                 raise FMUException(
 */
  __pyx_t_1 = (__pyx_v_status > 1);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":3833
 * 
 *         if status > 1:
 *             if self._enable_logging:             # <<<<<<<<<<<<<<
 *                 raise FMUException(
 *                     'Exit Initialize returned with an error.' \
 */
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->_enable_logging); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_1) {

      /* "pyfmi\fmi.pyx":3834
 *         if status > 1:
 *             if self._enable_logging:
 *                 raise FMUException(             # <<<<<<<<<<<<<<
 *                     'Exit Initialize returned with an error.' \
 *                     ' Check the log for information (FMUModel.get_log).')
 */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_244), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L6;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":3838
 *                     ' Check the log for information (FMUModel.get_log).')
 *             else:
 *                 raise FMUException('Exit Initialize returned with an error.' \             # <<<<<<<<<<<<<<
 *                     ' Enable logging for more information, (FMUModel(..., enable_logging=True)).')
 * 
 */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_246), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L6:;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":3842
 * 
 * 
 *         self._allocated_fmu = 1             # <<<<<<<<<<<<<<
 * 
 *         return status
 */
  __pyx_v_self->_allocated_fmu = 1;

  /* "pyfmi\fmi.pyx":3844
 *         self._allocated_fmu = 1
 * 
 *         return status             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyInt_FromLong(__pyx_v_status); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.exit_initialization_mode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_35enter_initialization_mode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_34enter_initialization_mode[] = "\n        Enters initialization mode by calling the low level FMI function\n        fmi2EnterInitializationMode.\n        \n        Note that the method initialize() performs both the enter and \n        exit of initialization mode.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_35enter_initialization_mode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("enter_initialization_mode (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_34enter_initialization_mode(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3847
 * 
 * 
 *     def enter_initialization_mode(self):             # <<<<<<<<<<<<<<
 *         """
 *         Enters initialization mode by calling the low level FMI function
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_34enter_initialization_mode(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  int __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("enter_initialization_mode", 0);

  /* "pyfmi\fmi.pyx":3855
 *         exit of initialization mode.
 *         """
 *         if self.time == None:             # <<<<<<<<<<<<<<
 *             raise FMUException("Setup Experiment has to be called prior to the initialization method.")
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":3856
 *         """
 *         if self.time == None:
 *             raise FMUException("Setup Experiment has to be called prior to the initialization method.")             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_enter_initialization_mode(self._fmu)
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_248), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":3858
 *             raise FMUException("Setup Experiment has to be called prior to the initialization method.")
 * 
 *         status = FMIL.fmi2_import_enter_initialization_mode(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if status == 1:
 */
  __pyx_v_status = fmi2_import_enter_initialization_mode(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":3860
 *         status = FMIL.fmi2_import_enter_initialization_mode(self._fmu)
 * 
 *         if status == 1:             # <<<<<<<<<<<<<<
 *             if self._enable_logging:
 *                 logging.warning(
 */
  __pyx_t_3 = (__pyx_v_status == 1);
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":3861
 * 
 *         if status == 1:
 *             if self._enable_logging:             # <<<<<<<<<<<<<<
 *                 logging.warning(
 *                     'Enter Initialize returned with a warning.' \
 */
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->_enable_logging); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_3) {

      /* "pyfmi\fmi.pyx":3862
 *         if status == 1:
 *             if self._enable_logging:
 *                 logging.warning(             # <<<<<<<<<<<<<<
 *                     'Enter Initialize returned with a warning.' \
 *                     ' Check the log for information (FMUModel.get_log).')
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logging); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__warning); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_250), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":3866
 *                     ' Check the log for information (FMUModel.get_log).')
 *             else:
 *                 logging.warning('Enter Initialize returned with a warning.' \             # <<<<<<<<<<<<<<
 *                     ' Enable logging for more information, (FMUModel(..., enable_logging=True)).')
 * 
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logging); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__warning); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_252), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_L5:;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":3869
 *                     ' Enable logging for more information, (FMUModel(..., enable_logging=True)).')
 * 
 *         if status > 1:             # <<<<<<<<<<<<<<
 *             if self._enable_logging:
 *                 raise FMUException(
 */
  __pyx_t_3 = (__pyx_v_status > 1);
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":3870
 * 
 *         if status > 1:
 *             if self._enable_logging:             # <<<<<<<<<<<<<<
 *                 raise FMUException(
 *                     'Enter Initialize returned with an error.' \
 */
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->_enable_logging); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_3) {

      /* "pyfmi\fmi.pyx":3871
 *         if status > 1:
 *             if self._enable_logging:
 *                 raise FMUException(             # <<<<<<<<<<<<<<
 *                     'Enter Initialize returned with an error.' \
 *                     ' Check the log for information (FMUModel.get_log).')
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_254), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L7;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":3875
 *                     ' Check the log for information (FMUModel.get_log).')
 *             else:
 *                 raise FMUException('Enter Initialize returned with an error.' \             # <<<<<<<<<<<<<<
 *                     ' Enable logging for more information, (FMUModel(..., enable_logging=True)).')
 * 
 */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_256), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L7:;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pyfmi\fmi.pyx":3878
 *                     ' Enable logging for more information, (FMUModel(..., enable_logging=True)).')
 * 
 *         return status             # <<<<<<<<<<<<<<
 * 
 *     def initialize(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(__pyx_v_status); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.enter_initialization_mode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_37initialize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_36initialize[] = "\n        Initializes the model and computes initial values for all variables.\n\n        Calls the low-level FMI functions: fmi2EnterInitializationMode,\n                                           fmi2ExitInitializationMode\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_37initialize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("initialize (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_36initialize(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3880
 *         return status
 * 
 *     def initialize(self):             # <<<<<<<<<<<<<<
 *         """
 *         Initializes the model and computes initial values for all variables.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_36initialize(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("initialize", 0);

  /* "pyfmi\fmi.pyx":3887
 *                                            fmi2ExitInitializationMode
 *         """
 *         self.enter_initialization_mode()             # <<<<<<<<<<<<<<
 *         self.exit_initialization_mode()
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_257); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3887; __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 = 3887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":3888
 *         """
 *         self.enter_initialization_mode()
 *         self.exit_initialization_mode()             # <<<<<<<<<<<<<<
 * 
 *     def set_fmil_log_level(self, FMIL.jm_log_level_enu_t level):
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_258); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3888; __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 = 3888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.initialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_39set_fmil_log_level(PyObject *__pyx_v_self, PyObject *__pyx_arg_level); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_39set_fmil_log_level(PyObject *__pyx_v_self, PyObject *__pyx_arg_level) {
  jm_log_level_enu_t __pyx_v_level;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_fmil_log_level (wrapper)", 0);
  assert(__pyx_arg_level); {
    __pyx_v_level = ((jm_log_level_enu_t)PyInt_AsLong(__pyx_arg_level)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3890; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.set_fmil_log_level", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_38set_fmil_log_level(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((jm_log_level_enu_t)__pyx_v_level));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3890
 *         self.exit_initialization_mode()
 * 
 *     def set_fmil_log_level(self, FMIL.jm_log_level_enu_t level):             # <<<<<<<<<<<<<<
 *         logging.warning("The method 'set_fmil_log_level' is deprecated, use 'set_log_level' instead.")
 *         self.set_log_level(level)
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_38set_fmil_log_level(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, jm_log_level_enu_t __pyx_v_level) {
  PyObject *__pyx_r = NULL;
  __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("set_fmil_log_level", 0);

  /* "pyfmi\fmi.pyx":3891
 * 
 *     def set_fmil_log_level(self, FMIL.jm_log_level_enu_t level):
 *         logging.warning("The method 'set_fmil_log_level' is deprecated, use 'set_log_level' instead.")             # <<<<<<<<<<<<<<
 *         self.set_log_level(level)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logging); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__warning); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_259), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":3892
 *     def set_fmil_log_level(self, FMIL.jm_log_level_enu_t level):
 *         logging.warning("The method 'set_fmil_log_level' is deprecated, use 'set_log_level' instead.")
 *         self.set_log_level(level)             # <<<<<<<<<<<<<<
 * 
 *     def get_fmil_log_level(self):
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__set_log_level); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromLong(__pyx_v_level); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.set_fmil_log_level", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_41get_fmil_log_level(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_40get_fmil_log_level[] = "\n        Returns::\n\n            The current fmil log-level.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_41get_fmil_log_level(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_fmil_log_level (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_40get_fmil_log_level(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3894
 *         self.set_log_level(level)
 * 
 *     def get_fmil_log_level(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns::
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_40get_fmil_log_level(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  int __pyx_v_level;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  jm_log_level_enu_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_fmil_log_level", 0);

  /* "pyfmi\fmi.pyx":3903
 *         cdef int level
 * 
 *         if self._enable_logging:             # <<<<<<<<<<<<<<
 *             level = self.callbacks.log_level
 *             return level
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->_enable_logging); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":3904
 * 
 *         if self._enable_logging:
 *             level = self.callbacks.log_level             # <<<<<<<<<<<<<<
 *             return level
 *         else:
 */
    __pyx_t_2 = __pyx_v_self->__pyx_base.callbacks.log_level;
    __pyx_v_level = __pyx_t_2;

    /* "pyfmi\fmi.pyx":3905
 *         if self._enable_logging:
 *             level = self.callbacks.log_level
 *             return level             # <<<<<<<<<<<<<<
 *         else:
 *             raise FMUException('Logging is not enabled')
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyInt_FromLong(__pyx_v_level); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":3907
 *             return level
 *         else:
 *             raise FMUException('Logging is not enabled')             # <<<<<<<<<<<<<<
 * 
 *     def set_debug_logging(self, logging_on, categories = []):
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_261), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_fmil_log_level", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_43set_debug_logging(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_42set_debug_logging[] = "\n        Specifies if the debugging should be turned on or off.\n        Currently the only allowed value for categories is an empty list.\n\n        Parameters::\n\n            logging_on --\n                Boolean value.\n\n            categories --\n                List of categories to log, call get_categories() for list of categories.\n                Default: [] (all categories)\n\n        Calls the low-level FMI function: fmi2SetDebuggLogging\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_43set_debug_logging(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_logging_on = 0;
  PyObject *__pyx_v_categories = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_debug_logging (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__logging_on,&__pyx_n_s__categories,0};
    PyObject* values[2] = {0,0};
    values[1] = __pyx_k_262;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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__logging_on)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__categories);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_debug_logging") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3909; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_logging_on = values[0];
    __pyx_v_categories = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_debug_logging", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3909; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.set_debug_logging", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_42set_debug_logging(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_v_logging_on, __pyx_v_categories);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3909
 *             raise FMUException('Logging is not enabled')
 * 
 *     def set_debug_logging(self, logging_on, categories = []):             # <<<<<<<<<<<<<<
 *         """
 *         Specifies if the debugging should be turned on or off.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_42set_debug_logging(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_logging_on, PyObject *__pyx_v_categories) {
  fmi2_boolean_t __pyx_v_log;
  int __pyx_v_status;
  size_t __pyx_v_nCat;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  jm_log_level_enu_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_debug_logging", 0);

  /* "pyfmi\fmi.pyx":3928
 *         cdef FMIL.fmi2_boolean_t  log
 *         cdef int                  status
 *         cdef FMIL.size_t          nCat = 0             # <<<<<<<<<<<<<<
 * 
 *         self.callbacks.log_level = FMIL.jm_log_level_warning if logging_on else FMIL.jm_log_level_nothing
 */
  __pyx_v_nCat = 0;

  /* "pyfmi\fmi.pyx":3930
 *         cdef FMIL.size_t          nCat = 0
 * 
 *         self.callbacks.log_level = FMIL.jm_log_level_warning if logging_on else FMIL.jm_log_level_nothing             # <<<<<<<<<<<<<<
 * 
 *         if logging_on:
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_logging_on); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {
    __pyx_t_1 = jm_log_level_warning;
  } else {
    __pyx_t_1 = jm_log_level_nothing;
  }
  __pyx_v_self->__pyx_base.callbacks.log_level = __pyx_t_1;

  /* "pyfmi\fmi.pyx":3932
 *         self.callbacks.log_level = FMIL.jm_log_level_warning if logging_on else FMIL.jm_log_level_nothing
 * 
 *         if logging_on:             # <<<<<<<<<<<<<<
 *             log = 1
 *         else:
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_logging_on); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":3933
 * 
 *         if logging_on:
 *             log = 1             # <<<<<<<<<<<<<<
 *         else:
 *             log = 0
 */
    __pyx_v_log = 1;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":3935
 *             log = 1
 *         else:
 *             log = 0             # <<<<<<<<<<<<<<
 * 
 *         self._enable_logging = bool(log)
 */
    __pyx_v_log = 0;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":3937
 *             log = 0
 * 
 *         self._enable_logging = bool(log)             # <<<<<<<<<<<<<<
 * 
 *         if len(categories) > 0:
 */
  __pyx_t_3 = __Pyx_PyInt_to_py_fmi2_boolean_t(__pyx_v_log); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->_enable_logging);
  __Pyx_DECREF(__pyx_v_self->_enable_logging);
  __pyx_v_self->_enable_logging = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":3939
 *         self._enable_logging = bool(log)
 * 
 *         if len(categories) > 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Currently the logging of categories is not availible. See the docstring for more information')
 * 
 */
  __pyx_t_4 = PyObject_Length(__pyx_v_categories); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (__pyx_t_4 > 0);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":3940
 * 
 *         if len(categories) > 0:
 *             raise FMUException('Currently the logging of categories is not availible. See the docstring for more information')             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_set_debug_logging(self._fmu, log, nCat, NULL)
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_264), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__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[0]; __pyx_lineno = 3940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":3942
 *             raise FMUException('Currently the logging of categories is not availible. See the docstring for more information')
 * 
 *         status = FMIL.fmi2_import_set_debug_logging(self._fmu, log, nCat, NULL)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi2_import_set_debug_logging(__pyx_v_self->_fmu, __pyx_v_log, __pyx_v_nCat, NULL);

  /* "pyfmi\fmi.pyx":3944
 *         status = FMIL.fmi2_import_set_debug_logging(self._fmu, log, nCat, NULL)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to set the debugging option.')
 * 
 */
  __pyx_t_2 = (__pyx_v_status != 0);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":3945
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the debugging option.')             # <<<<<<<<<<<<<<
 * 
 *     def get_categories(self):
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_265), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.set_debug_logging", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_45get_categories(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_44get_categories[] = "\n        Method used to retrieve the logging categories.\n\n        Returns::\n            A list with two objects. The first is the number of log categories\n            and the second is a list with the categories available for logging.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_45get_categories(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_categories (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_44get_categories(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":3947
 *             raise FMUException('Failed to set the debugging option.')
 * 
 *     def get_categories(self):             # <<<<<<<<<<<<<<
 *         """
 *         Method used to retrieve the logging categories.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_44get_categories(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  size_t __pyx_v_i;
  PyObject *__pyx_v_output = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  size_t __pyx_t_4;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_categories", 0);

  /* "pyfmi\fmi.pyx":3957
 *         cdef FMIL.size_t i
 * 
 *         if self._categories == []:             # <<<<<<<<<<<<<<
 *             for i in range(self._nCategories):
 *                 (self._categories).append(FMIL.fmi2_import_get_log_category(self._fmu, i))
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_v_self->_categories), ((PyObject *)__pyx_t_1), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":3958
 * 
 *         if self._categories == []:
 *             for i in range(self._nCategories):             # <<<<<<<<<<<<<<
 *                 (self._categories).append(FMIL.fmi2_import_get_log_category(self._fmu, i))
 *             output = [self._nCategories, self._categories]
 */
    __pyx_t_4 = __pyx_v_self->_nCategories;
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
      __pyx_v_i = __pyx_t_5;

      /* "pyfmi\fmi.pyx":3959
 *         if self._categories == []:
 *             for i in range(self._nCategories):
 *                 (self._categories).append(FMIL.fmi2_import_get_log_category(self._fmu, i))             # <<<<<<<<<<<<<<
 *             output = [self._nCategories, self._categories]
 *         else:
 */
      if (unlikely(((PyObject *)__pyx_v_self->_categories) == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = PyBytes_FromString(fmi2_import_get_log_category(__pyx_v_self->_fmu, __pyx_v_i)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __pyx_t_6 = PyList_Append(__pyx_v_self->_categories, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    }

    /* "pyfmi\fmi.pyx":3960
 *             for i in range(self._nCategories):
 *                 (self._categories).append(FMIL.fmi2_import_get_log_category(self._fmu, i))
 *             output = [self._nCategories, self._categories]             # <<<<<<<<<<<<<<
 *         else:
 *             output = [self._nCategories, self._categories]
 */
    __pyx_t_2 = __Pyx_PyInt_to_py_size_t(__pyx_v_self->_nCategories); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)__pyx_v_self->_categories));
    PyList_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self->_categories));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_categories));
    __pyx_t_2 = 0;
    __pyx_v_output = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":3962
 *             output = [self._nCategories, self._categories]
 *         else:
 *             output = [self._nCategories, self._categories]             # <<<<<<<<<<<<<<
 * 
 *         return output
 */
    __pyx_t_1 = __Pyx_PyInt_to_py_size_t(__pyx_v_self->_nCategories); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)__pyx_v_self->_categories));
    PyList_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self->_categories));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_categories));
    __pyx_t_1 = 0;
    __pyx_v_output = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":3964
 *             output = [self._nCategories, self._categories]
 * 
 *         return output             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_output));
  __pyx_r = ((PyObject *)__pyx_v_output);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_categories", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_output);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_47get_variable_nominal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_46get_variable_nominal[] = "\n        Returns the nominal value from a real variable determined by\n        either its value reference or its variable name.\n\n        Parameters::\n\n            variable_name --\n                The name of the variable.\n\n            valueref --\n                The value reference of the variable.\n\n        Returns::\n\n            The nominal value of the given variable.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_47get_variable_nominal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_variable_name = 0;
  PyObject *__pyx_v_valueref = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_nominal (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__variable_name,&__pyx_n_s__valueref,0};
    PyObject* values[2] = {0,0};

    /* "pyfmi\fmi.pyx":3967
 * 
 * 
 *     def get_variable_nominal(self, variable_name=None, valueref=None):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the nominal value from a real variable determined by
 */
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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 (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__variable_name);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__valueref);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_variable_nominal") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3967; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        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;
      }
    }
    __pyx_v_variable_name = values[0];
    __pyx_v_valueref = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_variable_nominal", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3967; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_nominal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_46get_variable_nominal(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_v_variable_name, __pyx_v_valueref);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_46get_variable_nominal(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name, PyObject *__pyx_v_valueref) {
  fmi2_import_variable_t *__pyx_v_variable;
  fmi2_import_real_variable_t *__pyx_v_real_variable;
  char *__pyx_v_variablename;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  fmi2_value_reference_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  char *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_nominal", 0);
  __Pyx_INCREF(__pyx_v_variable_name);

  /* "pyfmi\fmi.pyx":3988
 *         cdef char* variablename
 * 
 *         if valueref != None:             # <<<<<<<<<<<<<<
 *             variable = FMIL.fmi2_import_get_variable_by_vr(self._fmu, FMIL.fmi2_base_type_real, <FMIL.fmi2_value_reference_t>valueref)
 *             if variable == NULL:
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_valueref, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":3989
 * 
 *         if valueref != None:
 *             variable = FMIL.fmi2_import_get_variable_by_vr(self._fmu, FMIL.fmi2_base_type_real, <FMIL.fmi2_value_reference_t>valueref)             # <<<<<<<<<<<<<<
 *             if variable == NULL:
 *                 raise FMUException("The variable with value reference: %s, could not be found."%str(valueref))
 */
    __pyx_t_3 = __Pyx_PyInt_AsSize_t(__pyx_v_valueref); if (unlikely((__pyx_t_3 == (fmi2_value_reference_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_variable = fmi2_import_get_variable_by_vr(__pyx_v_self->_fmu, fmi2_base_type_real, ((fmi2_value_reference_t)__pyx_t_3));

    /* "pyfmi\fmi.pyx":3990
 *         if valueref != None:
 *             variable = FMIL.fmi2_import_get_variable_by_vr(self._fmu, FMIL.fmi2_base_type_real, <FMIL.fmi2_value_reference_t>valueref)
 *             if variable == NULL:             # <<<<<<<<<<<<<<
 *                 raise FMUException("The variable with value reference: %s, could not be found."%str(valueref))
 *         elif variable_name != None:
 */
    __pyx_t_2 = (__pyx_v_variable == NULL);
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":3991
 *             variable = FMIL.fmi2_import_get_variable_by_vr(self._fmu, FMIL.fmi2_base_type_real, <FMIL.fmi2_value_reference_t>valueref)
 *             if variable == NULL:
 *                 raise FMUException("The variable with value reference: %s, could not be found."%str(valueref))             # <<<<<<<<<<<<<<
 *         elif variable_name != None:
 *             variable_name = encode(variable_name)
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_valueref);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_valueref);
      __Pyx_GIVEREF(__pyx_v_valueref);
      __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_88), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
      __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L4;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }

  /* "pyfmi\fmi.pyx":3992
 *             if variable == NULL:
 *                 raise FMUException("The variable with value reference: %s, could not be found."%str(valueref))
 *         elif variable_name != None:             # <<<<<<<<<<<<<<
 *             variable_name = encode(variable_name)
 *             variablename = variable_name
 */
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_variable_name, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":3993
 *                 raise FMUException("The variable with value reference: %s, could not be found."%str(valueref))
 *         elif variable_name != None:
 *             variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *             variablename = variable_name
 * 
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_variable_name);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_variable_name);
    __Pyx_GIVEREF(__pyx_v_variable_name);
    __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_v_variable_name);
    __pyx_v_variable_name = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pyfmi\fmi.pyx":3994
 *         elif variable_name != None:
 *             variable_name = encode(variable_name)
 *             variablename = variable_name             # <<<<<<<<<<<<<<
 * 
 *             variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 */
    __pyx_t_6 = PyBytes_AsString(__pyx_v_variable_name); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_variablename = __pyx_t_6;

    /* "pyfmi\fmi.pyx":3996
 *             variablename = variable_name
 * 
 *             variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)             # <<<<<<<<<<<<<<
 *             if variable == NULL:
 *                 raise FMUException("The variable %s could not be found."%variablename)
 */
    __pyx_v_variable = fmi2_import_get_variable_by_name(__pyx_v_self->_fmu, __pyx_v_variablename);

    /* "pyfmi\fmi.pyx":3997
 * 
 *             variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 *             if variable == NULL:             # <<<<<<<<<<<<<<
 *                 raise FMUException("The variable %s could not be found."%variablename)
 *         else:
 */
    __pyx_t_2 = (__pyx_v_variable == NULL);
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":3998
 *             variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 *             if variable == NULL:
 *                 raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 *         else:
 *             raise FMUException('Either provide value reference or variable name.')
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_81), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
      __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L5;
    }
    __pyx_L5:;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":4000
 *                 raise FMUException("The variable %s could not be found."%variablename)
 *         else:
 *             raise FMUException('Either provide value reference or variable name.')             # <<<<<<<<<<<<<<
 * 
 *         real_variable = FMIL.fmi2_import_get_variable_as_real(variable)
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_266), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4002
 *             raise FMUException('Either provide value reference or variable name.')
 * 
 *         real_variable = FMIL.fmi2_import_get_variable_as_real(variable)             # <<<<<<<<<<<<<<
 *         if real_variable == NULL:
 *             raise FMUException("The variable is not a real variable.")
 */
  __pyx_v_real_variable = fmi2_import_get_variable_as_real(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":4003
 * 
 *         real_variable = FMIL.fmi2_import_get_variable_as_real(variable)
 *         if real_variable == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The variable is not a real variable.")
 * 
 */
  __pyx_t_2 = (__pyx_v_real_variable == NULL);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":4004
 *         real_variable = FMIL.fmi2_import_get_variable_as_real(variable)
 *         if real_variable == NULL:
 *             raise FMUException("The variable is not a real variable.")             # <<<<<<<<<<<<<<
 * 
 *         return  FMIL.fmi2_import_get_real_variable_nominal(real_variable)
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_267), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pyfmi\fmi.pyx":4006
 *             raise FMUException("The variable is not a real variable.")
 * 
 *         return  FMIL.fmi2_import_get_real_variable_nominal(real_variable)             # <<<<<<<<<<<<<<
 * 
 *     def get_variable_by_valueref(self, valueref, type = 0):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyFloat_FromDouble(fmi2_import_get_real_variable_nominal(__pyx_v_real_variable)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_nominal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_49get_variable_by_valueref(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_48get_variable_by_valueref[] = "\n        Get the name of a variable given a value reference. Note that it\n        returns the no-aliased variable.\n\n        Parameters::\n\n            valueref --\n                The value reference of the variable.\n\n            type --\n                The type of the variables (Real==0, Int==1, Bool==2,\n                String==3, Enumeration==4).\n                Default: 0 (i.e Real).\n\n        Returns::\n\n            The name of the variable.\n\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_49get_variable_by_valueref(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_valueref = 0;
  PyObject *__pyx_v_type = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_by_valueref (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__valueref,&__pyx_n_s__type,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_int_0);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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__valueref)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__type);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_variable_by_valueref") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4008; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_valueref = values[0];
    __pyx_v_type = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_variable_by_valueref", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4008; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_by_valueref", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_48get_variable_by_valueref(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_v_valueref, __pyx_v_type);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4008
 *         return  FMIL.fmi2_import_get_real_variable_nominal(real_variable)
 * 
 *     def get_variable_by_valueref(self, valueref, type = 0):             # <<<<<<<<<<<<<<
 *         """
 *         Get the name of a variable given a value reference. Note that it
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_48get_variable_by_valueref(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_valueref, PyObject *__pyx_v_type) {
  fmi2_import_variable_t *__pyx_v_variable;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  fmi2_base_type_enu_t __pyx_t_1;
  fmi2_value_reference_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_by_valueref", 0);

  /* "pyfmi\fmi.pyx":4030
 *         cdef FMIL.fmi2_import_variable_t* variable
 * 
 *         variable = FMIL.fmi2_import_get_variable_by_vr(self._fmu, <FMIL.fmi2_base_type_enu_t> type, <FMIL.fmi2_value_reference_t> valueref)             # <<<<<<<<<<<<<<
 *         if variable == NULL:
 *             raise FMUException("The variable with the valuref %i could not be found."%valueref)
 */
  __pyx_t_1 = ((fmi2_base_type_enu_t)PyInt_AsLong(__pyx_v_type)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyInt_AsSize_t(__pyx_v_valueref); if (unlikely((__pyx_t_2 == (fmi2_value_reference_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variable = fmi2_import_get_variable_by_vr(__pyx_v_self->_fmu, ((fmi2_base_type_enu_t)__pyx_t_1), ((fmi2_value_reference_t)__pyx_t_2));

  /* "pyfmi\fmi.pyx":4031
 * 
 *         variable = FMIL.fmi2_import_get_variable_by_vr(self._fmu, <FMIL.fmi2_base_type_enu_t> type, <FMIL.fmi2_value_reference_t> valueref)
 *         if variable == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The variable with the valuref %i could not be found."%valueref)
 * 
 */
  __pyx_t_3 = (__pyx_v_variable == NULL);
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":4032
 *         variable = FMIL.fmi2_import_get_variable_by_vr(self._fmu, <FMIL.fmi2_base_type_enu_t> type, <FMIL.fmi2_value_reference_t> valueref)
 *         if variable == NULL:
 *             raise FMUException("The variable with the valuref %i could not be found."%valueref)             # <<<<<<<<<<<<<<
 * 
 *         name = decode(FMIL.fmi2_import_get_variable_name(variable))
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_104), __pyx_v_valueref); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_5));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4034
 *             raise FMUException("The variable with the valuref %i could not be found."%valueref)
 * 
 *         name = decode(FMIL.fmi2_import_get_variable_name(variable))             # <<<<<<<<<<<<<<
 * 
 *         return name
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyBytes_FromString(fmi2_import_get_variable_name(__pyx_v_variable)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_6));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
  __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_v_name = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "pyfmi\fmi.pyx":4036
 *         name = decode(FMIL.fmi2_import_get_variable_name(variable))
 * 
 *         return name             # <<<<<<<<<<<<<<
 * 
 *     def get_variable_alias_base(self, char* variablename):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_name);
  __pyx_r = __pyx_v_name;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_by_valueref", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_51get_variable_alias_base(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_50get_variable_alias_base[] = "\n        Returns the base variable for the provided variable name.\n\n        Parameters::\n\n            variablename--\n                Name of the variable.\n\n        Returns:\n\n           The base variable.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_51get_variable_alias_base(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename) {
  char *__pyx_v_variablename;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_alias_base (wrapper)", 0);
  assert(__pyx_arg_variablename); {
    __pyx_v_variablename = PyBytes_AsString(__pyx_arg_variablename); if (unlikely((!__pyx_v_variablename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4038; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_alias_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_50get_variable_alias_base(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((char *)__pyx_v_variablename));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4038
 *         return name
 * 
 *     def get_variable_alias_base(self, char* variablename):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the base variable for the provided variable name.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_50get_variable_alias_base(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, char *__pyx_v_variablename) {
  fmi2_import_variable_t *__pyx_v_variable;
  fmi2_import_variable_t *__pyx_v_base_variable;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_alias_base", 0);

  /* "pyfmi\fmi.pyx":4055
 *         cdef FMIL.fmi2_value_reference_t vr
 * 
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)             # <<<<<<<<<<<<<<
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)
 */
  __pyx_v_variable = fmi2_import_get_variable_by_name(__pyx_v_self->_fmu, __pyx_v_variablename);

  /* "pyfmi\fmi.pyx":4056
 * 
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 */
  __pyx_t_1 = (__pyx_v_variable == NULL);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":4057
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 * 
 *         base_variable = FMIL.fmi2_import_get_variable_alias_base(self._fmu, variable)
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_81), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4059
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 *         base_variable = FMIL.fmi2_import_get_variable_alias_base(self._fmu, variable)             # <<<<<<<<<<<<<<
 *         if base_variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)
 */
  __pyx_v_base_variable = fmi2_import_get_variable_alias_base(__pyx_v_self->_fmu, __pyx_v_variable);

  /* "pyfmi\fmi.pyx":4060
 * 
 *         base_variable = FMIL.fmi2_import_get_variable_alias_base(self._fmu, variable)
 *         if base_variable == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 */
  __pyx_t_1 = (__pyx_v_base_variable == NULL);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":4061
 *         base_variable = FMIL.fmi2_import_get_variable_alias_base(self._fmu, variable)
 *         if base_variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 * 
 *         name = decode(FMIL.fmi2_import_get_variable_name(base_variable))
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_81), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":4063
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 *         name = decode(FMIL.fmi2_import_get_variable_name(base_variable))             # <<<<<<<<<<<<<<
 * 
 *         return name
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyBytes_FromString(fmi2_import_get_variable_name(__pyx_v_base_variable)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4063; __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_4)); __pyx_t_4 = 0;
  __pyx_v_name = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":4065
 *         name = decode(FMIL.fmi2_import_get_variable_name(base_variable))
 * 
 *         return name             # <<<<<<<<<<<<<<
 * 
 *     def get_variable_alias(self, char* variablename):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_name);
  __pyx_r = __pyx_v_name;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_alias_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_53get_variable_alias(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_52get_variable_alias[] = "\n        Return a dict of all alias variables belonging to the provided variable\n        where the key are the names and the value indicating whether the variable\n        should be negated or not.\n\n        Parameters::\n\n            variablename--\n                Name of the variable to find alias of.\n\n\n        Returns::\n\n            A dict consisting of the alias variables along with no alias variable.\n            The values indicates whether or not the variable should be negated or not.\n\n        Raises::\n\n            FMUException if the variable is not in the model.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_53get_variable_alias(PyObject *__pyx_v_self, PyObject *__pyx_arg_variablename) {
  char *__pyx_v_variablename;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_alias (wrapper)", 0);
  assert(__pyx_arg_variablename); {
    __pyx_v_variablename = PyBytes_AsString(__pyx_arg_variablename); if (unlikely((!__pyx_v_variablename) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4067; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_alias", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_52get_variable_alias(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((char *)__pyx_v_variablename));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4067
 *         return name
 * 
 *     def get_variable_alias(self, char* variablename):             # <<<<<<<<<<<<<<
 *         """
 *         Return a dict of all alias variables belonging to the provided variable
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_52get_variable_alias(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, char *__pyx_v_variablename) {
  fmi2_import_variable_t *__pyx_v_variable;
  fmi2_import_variable_list_t *__pyx_v_alias_list;
  size_t __pyx_v_alias_list_size;
  fmi2_variable_alias_kind_enu_t __pyx_v_alias_kind;
  PyObject *__pyx_v_ret_values = 0;
  size_t __pyx_v_i;
  PyObject *__pyx_v_alias_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_alias", 0);

  /* "pyfmi\fmi.pyx":4092
 *         cdef FMIL.size_t                         alias_list_size
 *         cdef FMIL.fmi2_variable_alias_kind_enu_t alias_kind
 *         cdef dict                                ret_values = {}             # <<<<<<<<<<<<<<
 *         cdef FMIL.size_t                         i
 * 
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_ret_values = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":4095
 *         cdef FMIL.size_t                         i
 * 
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)             # <<<<<<<<<<<<<<
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)
 */
  __pyx_v_variable = fmi2_import_get_variable_by_name(__pyx_v_self->_fmu, __pyx_v_variablename);

  /* "pyfmi\fmi.pyx":4096
 * 
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 */
  __pyx_t_2 = (__pyx_v_variable == NULL);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":4097
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 * 
 *         alias_list = FMIL.fmi2_import_get_variable_aliases(self._fmu, variable)
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_81), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4099
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 *         alias_list = FMIL.fmi2_import_get_variable_aliases(self._fmu, variable)             # <<<<<<<<<<<<<<
 * 
 *         alias_list_size = FMIL.fmi2_import_get_variable_list_size(alias_list)
 */
  __pyx_v_alias_list = fmi2_import_get_variable_aliases(__pyx_v_self->_fmu, __pyx_v_variable);

  /* "pyfmi\fmi.pyx":4101
 *         alias_list = FMIL.fmi2_import_get_variable_aliases(self._fmu, variable)
 * 
 *         alias_list_size = FMIL.fmi2_import_get_variable_list_size(alias_list)             # <<<<<<<<<<<<<<
 * 
 *         #Loop over all the alias variables
 */
  __pyx_v_alias_list_size = fmi2_import_get_variable_list_size(__pyx_v_alias_list);

  /* "pyfmi\fmi.pyx":4104
 * 
 *         #Loop over all the alias variables
 *         for i in range(alias_list_size):             # <<<<<<<<<<<<<<
 * 
 *             variable = FMIL.fmi2_import_get_variable(alias_list, i)
 */
  __pyx_t_5 = __pyx_v_alias_list_size;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "pyfmi\fmi.pyx":4106
 *         for i in range(alias_list_size):
 * 
 *             variable = FMIL.fmi2_import_get_variable(alias_list, i)             # <<<<<<<<<<<<<<
 * 
 *             alias_kind = FMIL.fmi2_import_get_variable_alias_kind(variable)
 */
    __pyx_v_variable = fmi2_import_get_variable(__pyx_v_alias_list, __pyx_v_i);

    /* "pyfmi\fmi.pyx":4108
 *             variable = FMIL.fmi2_import_get_variable(alias_list, i)
 * 
 *             alias_kind = FMIL.fmi2_import_get_variable_alias_kind(variable)             # <<<<<<<<<<<<<<
 *             alias_name = decode(FMIL.fmi2_import_get_variable_name(variable))
 * 
 */
    __pyx_v_alias_kind = fmi2_import_get_variable_alias_kind(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":4109
 * 
 *             alias_kind = FMIL.fmi2_import_get_variable_alias_kind(variable)
 *             alias_name = decode(FMIL.fmi2_import_get_variable_name(variable))             # <<<<<<<<<<<<<<
 * 
 *             ret_values[alias_name] = alias_kind
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyBytes_FromString(fmi2_import_get_variable_name(__pyx_v_variable)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_v_alias_name);
    __pyx_v_alias_name = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "pyfmi\fmi.pyx":4111
 *             alias_name = decode(FMIL.fmi2_import_get_variable_name(variable))
 * 
 *             ret_values[alias_name] = alias_kind             # <<<<<<<<<<<<<<
 * 
 *         #FREE VARIABLE LIST
 */
    __pyx_t_3 = PyInt_FromLong(__pyx_v_alias_kind); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(((PyObject *)__pyx_v_ret_values), __pyx_v_alias_name, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }

  /* "pyfmi\fmi.pyx":4114
 * 
 *         #FREE VARIABLE LIST
 *         FMIL.fmi2_import_free_variable_list(alias_list)             # <<<<<<<<<<<<<<
 * 
 *         return ret_values
 */
  fmi2_import_free_variable_list(__pyx_v_alias_list);

  /* "pyfmi\fmi.pyx":4116
 *         FMIL.fmi2_import_free_variable_list(alias_list)
 * 
 *         return ret_values             # <<<<<<<<<<<<<<
 * 
 *     def get_model_time_varying_value_references(self, filter=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ret_values));
  __pyx_r = ((PyObject *)__pyx_v_ret_values);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_alias", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret_values);
  __Pyx_XDECREF(__pyx_v_alias_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_55get_model_time_varying_value_references(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_54get_model_time_varying_value_references[] = "\n        Extract the value references of the variables in a model\n        that are time-varying. This method is typically used to\n        retrieve the variables for which the result can be stored.\n\n        Parameters::\n\n            filter --\n                Filter the variables using a unix filename pattern\n                matching (filter=\"*der*\"). Can also be a list of filters\n                See http://docs.python.org/2/library/fnmatch.html.\n                Default None\n\n        Returns::\n\n            Three lists with the real, integer and boolean value-references\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_55get_model_time_varying_value_references(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_filter = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_model_time_varying_value_references (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__filter,0};
    PyObject* values[1] = {0};

    /* "pyfmi\fmi.pyx":4118
 *         return ret_values
 * 
 *     def get_model_time_varying_value_references(self, filter=None):             # <<<<<<<<<<<<<<
 *         """
 *         Extract the value references of the variables in a model
 */
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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 (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__filter);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_model_time_varying_value_references") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4118; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_filter = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_model_time_varying_value_references", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4118; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_model_time_varying_value_references", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_54get_model_time_varying_value_references(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_v_filter);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_54get_model_time_varying_value_references(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_filter) {
  fmi2_import_variable_t *__pyx_v_variable;
  fmi2_import_variable_list_t *__pyx_v_variable_list;
  size_t __pyx_v_variable_list_size;
  fmi2_value_reference_t __pyx_v_value_ref;
  fmi2_base_type_enu_t __pyx_v_data_type;
  fmi2_variability_enu_t __pyx_v_data_variability;
  fmi2_variable_alias_kind_enu_t __pyx_v_alias_kind;
  int __pyx_v_i;
  int __pyx_v_selected_filter;
  int __pyx_v_length_filter;
  PyObject *__pyx_v_real_var_ref = 0;
  PyObject *__pyx_v_int_var_ref = 0;
  PyObject *__pyx_v_bool_var_ref = 0;
  PyObject *__pyx_v_filter_list = NULL;
  PyObject *__pyx_v_name = NULL;
  int __pyx_v_j;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  long __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  size_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_model_time_varying_value_references", 0);

  /* "pyfmi\fmi.pyx":4144
 *         cdef FMIL.fmi2_variable_alias_kind_enu_t alias_kind
 *         cdef int   i
 *         cdef int  selected_filter = 1 if filter else 0             # <<<<<<<<<<<<<<
 *         cdef int  length_filter = 0
 *         cdef dict real_var_ref = {}
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_filter); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {
    __pyx_t_1 = 1;
  } else {
    __pyx_t_1 = 0;
  }
  __pyx_v_selected_filter = __pyx_t_1;

  /* "pyfmi\fmi.pyx":4145
 *         cdef int   i
 *         cdef int  selected_filter = 1 if filter else 0
 *         cdef int  length_filter = 0             # <<<<<<<<<<<<<<
 *         cdef dict real_var_ref = {}
 *         cdef dict int_var_ref = {}
 */
  __pyx_v_length_filter = 0;

  /* "pyfmi\fmi.pyx":4146
 *         cdef int  selected_filter = 1 if filter else 0
 *         cdef int  length_filter = 0
 *         cdef dict real_var_ref = {}             # <<<<<<<<<<<<<<
 *         cdef dict int_var_ref = {}
 *         cdef dict bool_var_ref = {}
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_v_real_var_ref = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":4147
 *         cdef int  length_filter = 0
 *         cdef dict real_var_ref = {}
 *         cdef dict int_var_ref = {}             # <<<<<<<<<<<<<<
 *         cdef dict bool_var_ref = {}
 * 
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_v_int_var_ref = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":4148
 *         cdef dict real_var_ref = {}
 *         cdef dict int_var_ref = {}
 *         cdef dict bool_var_ref = {}             # <<<<<<<<<<<<<<
 * 
 *         variable_list      = FMIL.fmi2_import_get_variable_list(self._fmu, 0)
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_v_bool_var_ref = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":4150
 *         cdef dict bool_var_ref = {}
 * 
 *         variable_list      = FMIL.fmi2_import_get_variable_list(self._fmu, 0)             # <<<<<<<<<<<<<<
 *         variable_list_size = FMIL.fmi2_import_get_variable_list_size(variable_list)
 * 
 */
  __pyx_v_variable_list = fmi2_import_get_variable_list(__pyx_v_self->_fmu, 0);

  /* "pyfmi\fmi.pyx":4151
 * 
 *         variable_list      = FMIL.fmi2_import_get_variable_list(self._fmu, 0)
 *         variable_list_size = FMIL.fmi2_import_get_variable_list_size(variable_list)             # <<<<<<<<<<<<<<
 * 
 *         if selected_filter:
 */
  __pyx_v_variable_list_size = fmi2_import_get_variable_list_size(__pyx_v_variable_list);

  /* "pyfmi\fmi.pyx":4153
 *         variable_list_size = FMIL.fmi2_import_get_variable_list_size(variable_list)
 * 
 *         if selected_filter:             # <<<<<<<<<<<<<<
 *             filter_list = self._convert_filter(filter)
 *             length_filter = len(filter_list)
 */
  if (__pyx_v_selected_filter) {

    /* "pyfmi\fmi.pyx":4154
 * 
 *         if selected_filter:
 *             filter_list = self._convert_filter(filter)             # <<<<<<<<<<<<<<
 *             length_filter = len(filter_list)
 * 
 */
    __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___convert_filter); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_filter);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_filter);
    __Pyx_GIVEREF(__pyx_v_filter);
    __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __pyx_v_filter_list = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "pyfmi\fmi.pyx":4155
 *         if selected_filter:
 *             filter_list = self._convert_filter(filter)
 *             length_filter = len(filter_list)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(variable_list_size):
 */
    __pyx_t_6 = PyObject_Length(__pyx_v_filter_list); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_length_filter = __pyx_t_6;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4157
 *             length_filter = len(filter_list)
 * 
 *         for i in range(variable_list_size):             # <<<<<<<<<<<<<<
 * 
 *             variable = FMIL.fmi2_import_get_variable(variable_list, i)
 */
  __pyx_t_7 = __pyx_v_variable_list_size;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;

    /* "pyfmi\fmi.pyx":4159
 *         for i in range(variable_list_size):
 * 
 *             variable = FMIL.fmi2_import_get_variable(variable_list, i)             # <<<<<<<<<<<<<<
 * 
 *             alias_kind       = FMIL.fmi2_import_get_variable_alias_kind(variable)
 */
    __pyx_v_variable = fmi2_import_get_variable(__pyx_v_variable_list, __pyx_v_i);

    /* "pyfmi\fmi.pyx":4161
 *             variable = FMIL.fmi2_import_get_variable(variable_list, i)
 * 
 *             alias_kind       = FMIL.fmi2_import_get_variable_alias_kind(variable)             # <<<<<<<<<<<<<<
 *             name             = decode(FMIL.fmi2_import_get_variable_name(variable))
 *             value_ref        = FMIL.fmi2_import_get_variable_vr(variable)
 */
    __pyx_v_alias_kind = fmi2_import_get_variable_alias_kind(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":4162
 * 
 *             alias_kind       = FMIL.fmi2_import_get_variable_alias_kind(variable)
 *             name             = decode(FMIL.fmi2_import_get_variable_name(variable))             # <<<<<<<<<<<<<<
 *             value_ref        = FMIL.fmi2_import_get_variable_vr(variable)
 *             data_type        = FMIL.fmi2_import_get_variable_base_type(variable)
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyBytes_FromString(fmi2_import_get_variable_name(__pyx_v_variable)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_v_name);
    __pyx_v_name = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "pyfmi\fmi.pyx":4163
 *             alias_kind       = FMIL.fmi2_import_get_variable_alias_kind(variable)
 *             name             = decode(FMIL.fmi2_import_get_variable_name(variable))
 *             value_ref        = FMIL.fmi2_import_get_variable_vr(variable)             # <<<<<<<<<<<<<<
 *             data_type        = FMIL.fmi2_import_get_variable_base_type(variable)
 *             data_variability = FMIL.fmi2_import_get_variability(variable)
 */
    __pyx_v_value_ref = fmi2_import_get_variable_vr(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":4164
 *             name             = decode(FMIL.fmi2_import_get_variable_name(variable))
 *             value_ref        = FMIL.fmi2_import_get_variable_vr(variable)
 *             data_type        = FMIL.fmi2_import_get_variable_base_type(variable)             # <<<<<<<<<<<<<<
 *             data_variability = FMIL.fmi2_import_get_variability(variable)
 * 
 */
    __pyx_v_data_type = fmi2_import_get_variable_base_type(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":4165
 *             value_ref        = FMIL.fmi2_import_get_variable_vr(variable)
 *             data_type        = FMIL.fmi2_import_get_variable_base_type(variable)
 *             data_variability = FMIL.fmi2_import_get_variability(variable)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_v_data_variability = fmi2_import_get_variability(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":4168
 * 
 * 
 *             if data_type != FMI2_REAL and data_type != FMI2_INTEGER and data_type != FMI2_BOOLEAN and data_type != FMI2_ENUMERATION:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    __pyx_t_4 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI2_REAL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_2) {
      __pyx_t_5 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI2_INTEGER); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_9) {
        __pyx_t_4 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI2_BOOLEAN); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (__pyx_t_10) {
          __pyx_t_5 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI2_ENUMERATION); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_12 = __pyx_t_11;
        } else {
          __pyx_t_12 = __pyx_t_10;
        }
        __pyx_t_10 = __pyx_t_12;
      } else {
        __pyx_t_10 = __pyx_t_9;
      }
      __pyx_t_9 = __pyx_t_10;
    } else {
      __pyx_t_9 = __pyx_t_2;
    }
    if (__pyx_t_9) {

      /* "pyfmi\fmi.pyx":4169
 * 
 *             if data_type != FMI2_REAL and data_type != FMI2_INTEGER and data_type != FMI2_BOOLEAN and data_type != FMI2_ENUMERATION:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             if data_variability != FMI2_CONTINUOUS and data_variability != FMI2_DISCRETE and data_variability != FMI2_TUNABLE:
 */
      goto __pyx_L4_continue;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "pyfmi\fmi.pyx":4171
 *                 continue
 * 
 *             if data_variability != FMI2_CONTINUOUS and data_variability != FMI2_DISCRETE and data_variability != FMI2_TUNABLE:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    __pyx_t_4 = PyInt_FromLong(__pyx_v_data_variability); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI2_CONTINUOUS); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_9) {
      __pyx_t_5 = PyInt_FromLong(__pyx_v_data_variability); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI2_DISCRETE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_2) {
        __pyx_t_4 = PyInt_FromLong(__pyx_v_data_variability); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI2_TUNABLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_12 = __pyx_t_10;
      } else {
        __pyx_t_12 = __pyx_t_2;
      }
      __pyx_t_2 = __pyx_t_12;
    } else {
      __pyx_t_2 = __pyx_t_9;
    }
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":4172
 * 
 *             if data_variability != FMI2_CONTINUOUS and data_variability != FMI2_DISCRETE and data_variability != FMI2_TUNABLE:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             if selected_filter:
 */
      goto __pyx_L4_continue;
      goto __pyx_L7;
    }
    __pyx_L7:;

    /* "pyfmi\fmi.pyx":4174
 *                 continue
 * 
 *             if selected_filter:             # <<<<<<<<<<<<<<
 *                 for j in range(length_filter):
 *                     #if re.match(filter_list[j], name):
 */
    if (__pyx_v_selected_filter) {

      /* "pyfmi\fmi.pyx":4175
 * 
 *             if selected_filter:
 *                 for j in range(length_filter):             # <<<<<<<<<<<<<<
 *                     #if re.match(filter_list[j], name):
 *                     if filter_list[j].match(name):
 */
      __pyx_t_13 = __pyx_v_length_filter;
      for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
        __pyx_v_j = __pyx_t_14;

        /* "pyfmi\fmi.pyx":4177
 *                 for j in range(length_filter):
 *                     #if re.match(filter_list[j], name):
 *                     if filter_list[j].match(name):             # <<<<<<<<<<<<<<
 *                         break
 *                 else:
 */
        if (unlikely(!__pyx_v_filter_list)) { __Pyx_RaiseUnboundLocalError("filter_list"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
        __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_filter_list, __pyx_v_j, sizeof(int), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__match); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_v_name);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_name);
        __Pyx_GIVEREF(__pyx_v_name);
        __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
        __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (__pyx_t_2) {

          /* "pyfmi\fmi.pyx":4178
 *                     #if re.match(filter_list[j], name):
 *                     if filter_list[j].match(name):
 *                         break             # <<<<<<<<<<<<<<
 *                 else:
 *                     continue
 */
          goto __pyx_L10_break;
          goto __pyx_L11;
        }
        __pyx_L11:;
      }
      /*else*/ {

        /* "pyfmi\fmi.pyx":4180
 *                         break
 *                 else:
 *                     continue             # <<<<<<<<<<<<<<
 *             else:
 *                 if alias_kind != FMIL.fmi2_variable_is_not_alias:
 */
        goto __pyx_L4_continue;
      }
      __pyx_L10_break:;
      goto __pyx_L8;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":4182
 *                     continue
 *             else:
 *                 if alias_kind != FMIL.fmi2_variable_is_not_alias:             # <<<<<<<<<<<<<<
 *                     continue
 * 
 */
      __pyx_t_2 = (__pyx_v_alias_kind != fmi2_variable_is_not_alias);
      if (__pyx_t_2) {

        /* "pyfmi\fmi.pyx":4183
 *             else:
 *                 if alias_kind != FMIL.fmi2_variable_is_not_alias:
 *                     continue             # <<<<<<<<<<<<<<
 * 
 *             if data_type == FMI2_REAL:
 */
        goto __pyx_L4_continue;
        goto __pyx_L12;
      }
      __pyx_L12:;
    }
    __pyx_L8:;

    /* "pyfmi\fmi.pyx":4185
 *                     continue
 * 
 *             if data_type == FMI2_REAL:             # <<<<<<<<<<<<<<
 *                 real_var_ref[value_ref] = 1
 *             if data_type == FMI2_INTEGER or data_type == FMI2_ENUMERATION:
 */
    __pyx_t_4 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI2_REAL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":4186
 * 
 *             if data_type == FMI2_REAL:
 *                 real_var_ref[value_ref] = 1             # <<<<<<<<<<<<<<
 *             if data_type == FMI2_INTEGER or data_type == FMI2_ENUMERATION:
 *                 int_var_ref[value_ref] = 1
 */
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_real_var_ref), __pyx_v_value_ref, __pyx_int_1, sizeof(fmi2_value_reference_t)+1, __Pyx_PyInt_FromSize_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "pyfmi\fmi.pyx":4187
 *             if data_type == FMI2_REAL:
 *                 real_var_ref[value_ref] = 1
 *             if data_type == FMI2_INTEGER or data_type == FMI2_ENUMERATION:             # <<<<<<<<<<<<<<
 *                 int_var_ref[value_ref] = 1
 *             if data_type == FMI2_BOOLEAN:
 */
    __pyx_t_3 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI2_INTEGER); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!__pyx_t_2) {
      __pyx_t_4 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI2_ENUMERATION); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_12 = __pyx_t_9;
    } else {
      __pyx_t_12 = __pyx_t_2;
    }
    if (__pyx_t_12) {

      /* "pyfmi\fmi.pyx":4188
 *                 real_var_ref[value_ref] = 1
 *             if data_type == FMI2_INTEGER or data_type == FMI2_ENUMERATION:
 *                 int_var_ref[value_ref] = 1             # <<<<<<<<<<<<<<
 *             if data_type == FMI2_BOOLEAN:
 *                 bool_var_ref[value_ref] = 1
 */
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_int_var_ref), __pyx_v_value_ref, __pyx_int_1, sizeof(fmi2_value_reference_t)+1, __Pyx_PyInt_FromSize_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L14;
    }
    __pyx_L14:;

    /* "pyfmi\fmi.pyx":4189
 *             if data_type == FMI2_INTEGER or data_type == FMI2_ENUMERATION:
 *                 int_var_ref[value_ref] = 1
 *             if data_type == FMI2_BOOLEAN:             # <<<<<<<<<<<<<<
 *                 bool_var_ref[value_ref] = 1
 * 
 */
    __pyx_t_3 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI2_BOOLEAN); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_12) {

      /* "pyfmi\fmi.pyx":4190
 *                 int_var_ref[value_ref] = 1
 *             if data_type == FMI2_BOOLEAN:
 *                 bool_var_ref[value_ref] = 1             # <<<<<<<<<<<<<<
 * 
 *         #Free the variable list
 */
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_bool_var_ref), __pyx_v_value_ref, __pyx_int_1, sizeof(fmi2_value_reference_t)+1, __Pyx_PyInt_FromSize_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L15;
    }
    __pyx_L15:;
    __pyx_L4_continue:;
  }

  /* "pyfmi\fmi.pyx":4193
 * 
 *         #Free the variable list
 *         FMIL.fmi2_import_free_variable_list(variable_list)             # <<<<<<<<<<<<<<
 * 
 *         return list(real_var_ref.keys()) if python3_flag else real_var_ref.keys(), list(int_var_ref.keys()) if python3_flag else int_var_ref.keys(), list(bool_var_ref.keys()) if python3_flag else bool_var_ref.keys()
 */
  fmi2_import_free_variable_list(__pyx_v_variable_list);

  /* "pyfmi\fmi.pyx":4195
 *         FMIL.fmi2_import_free_variable_list(variable_list)
 * 
 *         return list(real_var_ref.keys()) if python3_flag else real_var_ref.keys(), list(int_var_ref.keys()) if python3_flag else int_var_ref.keys(), list(bool_var_ref.keys()) if python3_flag else bool_var_ref.keys()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__python3_flag); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_12) {
    __pyx_t_5 = PyDict_Keys(__pyx_v_real_var_ref); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_t_5 = 0;
  } else {
    __pyx_t_5 = PyDict_Keys(__pyx_v_real_var_ref); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__python3_flag); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_12) {
    __pyx_t_3 = PyDict_Keys(__pyx_v_int_var_ref); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
    PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
    __pyx_t_5 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __pyx_t_3 = PyDict_Keys(__pyx_v_int_var_ref); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s__python3_flag); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  if (__pyx_t_12) {
    __pyx_t_15 = PyDict_Keys(__pyx_v_bool_var_ref); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_16);
    PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15);
    __Pyx_GIVEREF(__pyx_t_15);
    __pyx_t_15 = 0;
    __pyx_t_15 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0;
    __pyx_t_3 = __pyx_t_15;
    __pyx_t_15 = 0;
  } else {
    __pyx_t_15 = PyDict_Keys(__pyx_v_bool_var_ref); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_3 = __pyx_t_15;
    __pyx_t_15 = 0;
  }
  __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_3 = 0;
  __pyx_r = ((PyObject *)__pyx_t_15);
  __pyx_t_15 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_model_time_varying_value_references", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_real_var_ref);
  __Pyx_XDECREF(__pyx_v_int_var_ref);
  __Pyx_XDECREF(__pyx_v_bool_var_ref);
  __Pyx_XDECREF(__pyx_v_filter_list);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_57get_model_variables(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_56get_model_variables[] = "\n        Extract the names of the variables in a model.\n\n        Parameters::\n\n            type --\n                The type of the variables (Real==0, Int==1, Bool==2,\n                String==3, Enumeration==4).\n                Default: None (i.e all).\n\n            include_alias --\n                If alias should be included or not.\n                Default: True\n\n            causality --\n                The causality of the variables (Parameter==0, \n                Calculated Parameter==1, Input==2, Output==3, Local==4, \n                Independent==5, Unknown==6).\n                Default: None (i.e all).\n\n            variability --\n                The variability of the variables (Constant==0,\n                Fixed==1, Tunable==2, Discrete==3, Continuous==4, Unknown==5).\n                Default: None (i.e. all)\n\n            only_start --\n                If only variables that has a start value should be\n                returned.\n                Default: False\n\n            only_fixed --\n                If only variables that has a start value that is fixed\n                should be returned.\n                Default: False\n\n            filter --\n                Filter the variables using a unix filename pattern\n                matching (filter=\"*der*\"). Can also be a list of filters\n                See http://docs.python.org/2/library/fnmatch.html.\n                Default None\n\n        Returns::\n\n            Dict with variable name as key and a ScalarVariable class as\n            value.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_57get_model_variables(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_type = 0;
  PyObject *__pyx_v_include_alias = 0;
  PyObject *__pyx_v_causality = 0;
  PyObject *__pyx_v_variability = 0;
  PyObject *__pyx_v_only_start = 0;
  PyObject *__pyx_v_only_fixed = 0;
  PyObject *__pyx_v_filter = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_model_variables (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__type,&__pyx_n_s__include_alias,&__pyx_n_s__causality,&__pyx_n_s__variability,&__pyx_n_s__only_start,&__pyx_n_s__only_fixed,&__pyx_n_s__filter,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};

    /* "pyfmi\fmi.pyx":4198
 * 
 * 
 *     def get_model_variables(self, type = None, include_alias = True,             # <<<<<<<<<<<<<<
 *                              causality = None,   variability = None,
 *                             only_start = False,   only_fixed = False,
 */
    values[0] = ((PyObject *)Py_None);
    values[1] = __pyx_k_268;

    /* "pyfmi\fmi.pyx":4199
 * 
 *     def get_model_variables(self, type = None, include_alias = True,
 *                              causality = None,   variability = None,             # <<<<<<<<<<<<<<
 *                             only_start = False,   only_fixed = False,
 *                             filter = None):
 */
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_None);
    values[4] = __pyx_k_269;
    values[5] = __pyx_k_270;

    /* "pyfmi\fmi.pyx":4201
 *                              causality = None,   variability = None,
 *                             only_start = False,   only_fixed = False,
 *                             filter = None):             # <<<<<<<<<<<<<<
 *         """
 *         Extract the names of the variables in a model.
 */
    values[6] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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 (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__type);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__include_alias);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__causality);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__variability);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__only_start);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__only_fixed);
          if (value) { values[5] = value; kw_args--; }
        }
        case  6:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__filter);
          if (value) { values[6] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_model_variables") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4198; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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;
      }
    }
    __pyx_v_type = values[0];
    __pyx_v_include_alias = values[1];
    __pyx_v_causality = values[2];
    __pyx_v_variability = values[3];
    __pyx_v_only_start = values[4];
    __pyx_v_only_fixed = values[5];
    __pyx_v_filter = values[6];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_model_variables", 0, 0, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4198; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_model_variables", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_56get_model_variables(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_v_type, __pyx_v_include_alias, __pyx_v_causality, __pyx_v_variability, __pyx_v_only_start, __pyx_v_only_fixed, __pyx_v_filter);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4198
 * 
 * 
 *     def get_model_variables(self, type = None, include_alias = True,             # <<<<<<<<<<<<<<
 *                              causality = None,   variability = None,
 *                             only_start = False,   only_fixed = False,
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_56get_model_variables(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_type, PyObject *__pyx_v_include_alias, PyObject *__pyx_v_causality, PyObject *__pyx_v_variability, PyObject *__pyx_v_only_start, PyObject *__pyx_v_only_fixed, PyObject *__pyx_v_filter) {
  fmi2_import_variable_t *__pyx_v_variable;
  fmi2_import_variable_list_t *__pyx_v_variable_list;
  size_t __pyx_v_variable_list_size;
  fmi2_value_reference_t __pyx_v_value_ref;
  fmi2_base_type_enu_t __pyx_v_data_type;
  fmi2_base_type_enu_t __pyx_v_target_type;
  fmi2_variability_enu_t __pyx_v_data_variability;
  fmi2_variability_enu_t __pyx_v_target_variability;
  fmi2_causality_enu_t __pyx_v_data_causality;
  fmi2_causality_enu_t __pyx_v_target_causality;
  fmi2_variable_alias_kind_enu_t __pyx_v_alias_kind;
  fmi2_initial_enu_t __pyx_v_initial;
  char *__pyx_v_desc;
  int __pyx_v_selected_type;
  int __pyx_v_selected_variability;
  int __pyx_v_selected_causality;
  int __pyx_v_has_start;
  int __pyx_v_i;
  int __pyx_v_j;
  int __pyx_v_selected_filter;
  int __pyx_v_length_filter;
  PyObject *__pyx_v_filter_list = 0;
  PyObject *__pyx_v_variable_dict = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  long __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  fmi2_base_type_enu_t __pyx_t_5;
  fmi2_causality_enu_t __pyx_t_6;
  fmi2_variability_enu_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  size_t __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  int __pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_model_variables", 0);

  /* "pyfmi\fmi.pyx":4258
 *         cdef FMIL.fmi2_initial_enu_t             initial
 *         cdef char* desc
 *         cdef int   selected_type = 0        #If a type has been selected             # <<<<<<<<<<<<<<
 *         cdef int   selected_variability = 0 #If a variability has been selected
 *         cdef int   selected_causality = 0   #If a causality has been selected
 */
  __pyx_v_selected_type = 0;

  /* "pyfmi\fmi.pyx":4259
 *         cdef char* desc
 *         cdef int   selected_type = 0        #If a type has been selected
 *         cdef int   selected_variability = 0 #If a variability has been selected             # <<<<<<<<<<<<<<
 *         cdef int   selected_causality = 0   #If a causality has been selected
 *         cdef int   has_start, is_fixed
 */
  __pyx_v_selected_variability = 0;

  /* "pyfmi\fmi.pyx":4260
 *         cdef int   selected_type = 0        #If a type has been selected
 *         cdef int   selected_variability = 0 #If a variability has been selected
 *         cdef int   selected_causality = 0   #If a causality has been selected             # <<<<<<<<<<<<<<
 *         cdef int   has_start, is_fixed
 *         cdef int   i, j
 */
  __pyx_v_selected_causality = 0;

  /* "pyfmi\fmi.pyx":4263
 *         cdef int   has_start, is_fixed
 *         cdef int   i, j
 *         cdef int  selected_filter = 1 if filter else 0             # <<<<<<<<<<<<<<
 *         cdef int  length_filter = 0
 *         cdef list filter_list
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_filter); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {
    __pyx_t_1 = 1;
  } else {
    __pyx_t_1 = 0;
  }
  __pyx_v_selected_filter = __pyx_t_1;

  /* "pyfmi\fmi.pyx":4264
 *         cdef int   i, j
 *         cdef int  selected_filter = 1 if filter else 0
 *         cdef int  length_filter = 0             # <<<<<<<<<<<<<<
 *         cdef list filter_list
 *         variable_dict = OrderedDict()
 */
  __pyx_v_length_filter = 0;

  /* "pyfmi\fmi.pyx":4266
 *         cdef int  length_filter = 0
 *         cdef list filter_list
 *         variable_dict = OrderedDict()             # <<<<<<<<<<<<<<
 * 
 *         variable_list      = FMIL.fmi2_import_get_variable_list(self._fmu, 0)
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__OrderedDict); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_variable_dict = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":4268
 *         variable_dict = OrderedDict()
 * 
 *         variable_list      = FMIL.fmi2_import_get_variable_list(self._fmu, 0)             # <<<<<<<<<<<<<<
 *         variable_list_size = FMIL.fmi2_import_get_variable_list_size(variable_list)
 * 
 */
  __pyx_v_variable_list = fmi2_import_get_variable_list(__pyx_v_self->_fmu, 0);

  /* "pyfmi\fmi.pyx":4269
 * 
 *         variable_list      = FMIL.fmi2_import_get_variable_list(self._fmu, 0)
 *         variable_list_size = FMIL.fmi2_import_get_variable_list_size(variable_list)             # <<<<<<<<<<<<<<
 * 
 *         if type != None:        #A type have has been selected
 */
  __pyx_v_variable_list_size = fmi2_import_get_variable_list_size(__pyx_v_variable_list);

  /* "pyfmi\fmi.pyx":4271
 *         variable_list_size = FMIL.fmi2_import_get_variable_list_size(variable_list)
 * 
 *         if type != None:        #A type have has been selected             # <<<<<<<<<<<<<<
 *             target_type = type
 *             selected_type = 1
 */
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_type, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":4272
 * 
 *         if type != None:        #A type have has been selected
 *             target_type = type             # <<<<<<<<<<<<<<
 *             selected_type = 1
 *         if causality != None:   #A causality has been selected
 */
    __pyx_t_5 = ((fmi2_base_type_enu_t)PyInt_AsLong(__pyx_v_type)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_target_type = __pyx_t_5;

    /* "pyfmi\fmi.pyx":4273
 *         if type != None:        #A type have has been selected
 *             target_type = type
 *             selected_type = 1             # <<<<<<<<<<<<<<
 *         if causality != None:   #A causality has been selected
 *             target_causality = causality
 */
    __pyx_v_selected_type = 1;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4274
 *             target_type = type
 *             selected_type = 1
 *         if causality != None:   #A causality has been selected             # <<<<<<<<<<<<<<
 *             target_causality = causality
 *             selected_causality = 1
 */
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_causality, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":4275
 *             selected_type = 1
 *         if causality != None:   #A causality has been selected
 *             target_causality = causality             # <<<<<<<<<<<<<<
 *             selected_causality = 1
 *         if variability != None: #A variability has been selected
 */
    __pyx_t_6 = ((fmi2_causality_enu_t)PyInt_AsLong(__pyx_v_causality)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_target_causality = __pyx_t_6;

    /* "pyfmi\fmi.pyx":4276
 *         if causality != None:   #A causality has been selected
 *             target_causality = causality
 *             selected_causality = 1             # <<<<<<<<<<<<<<
 *         if variability != None: #A variability has been selected
 *             target_variability = variability
 */
    __pyx_v_selected_causality = 1;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":4277
 *             target_causality = causality
 *             selected_causality = 1
 *         if variability != None: #A variability has been selected             # <<<<<<<<<<<<<<
 *             target_variability = variability
 *             selected_variability = 1
 */
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_variability, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":4278
 *             selected_causality = 1
 *         if variability != None: #A variability has been selected
 *             target_variability = variability             # <<<<<<<<<<<<<<
 *             selected_variability = 1
 *         if selected_filter:
 */
    __pyx_t_7 = ((fmi2_variability_enu_t)PyInt_AsLong(__pyx_v_variability)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_target_variability = __pyx_t_7;

    /* "pyfmi\fmi.pyx":4279
 *         if variability != None: #A variability has been selected
 *             target_variability = variability
 *             selected_variability = 1             # <<<<<<<<<<<<<<
 *         if selected_filter:
 *             filter_list = self._convert_filter(filter)
 */
    __pyx_v_selected_variability = 1;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":4280
 *             target_variability = variability
 *             selected_variability = 1
 *         if selected_filter:             # <<<<<<<<<<<<<<
 *             filter_list = self._convert_filter(filter)
 *             length_filter = len(filter_list)
 */
  if (__pyx_v_selected_filter) {

    /* "pyfmi\fmi.pyx":4281
 *             selected_variability = 1
 *         if selected_filter:
 *             filter_list = self._convert_filter(filter)             # <<<<<<<<<<<<<<
 *             length_filter = len(filter_list)
 * 
 */
    __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___convert_filter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_filter);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_filter);
    __Pyx_GIVEREF(__pyx_v_filter);
    __pyx_t_8 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    if (!(likely(PyList_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_t_8)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_filter_list = ((PyObject*)__pyx_t_8);
    __pyx_t_8 = 0;

    /* "pyfmi\fmi.pyx":4282
 *         if selected_filter:
 *             filter_list = self._convert_filter(filter)
 *             length_filter = len(filter_list)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(variable_list_size):
 */
    if (unlikely(((PyObject *)__pyx_v_filter_list) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_9 = PyList_GET_SIZE(((PyObject *)__pyx_v_filter_list)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_length_filter = __pyx_t_9;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pyfmi\fmi.pyx":4284
 *             length_filter = len(filter_list)
 * 
 *         for i in range(variable_list_size):             # <<<<<<<<<<<<<<
 * 
 *             variable = FMIL.fmi2_import_get_variable(variable_list, i)
 */
  __pyx_t_10 = __pyx_v_variable_list_size;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "pyfmi\fmi.pyx":4286
 *         for i in range(variable_list_size):
 * 
 *             variable = FMIL.fmi2_import_get_variable(variable_list, i)             # <<<<<<<<<<<<<<
 * 
 *             alias_kind       = FMIL.fmi2_import_get_variable_alias_kind(variable)
 */
    __pyx_v_variable = fmi2_import_get_variable(__pyx_v_variable_list, __pyx_v_i);

    /* "pyfmi\fmi.pyx":4288
 *             variable = FMIL.fmi2_import_get_variable(variable_list, i)
 * 
 *             alias_kind       = FMIL.fmi2_import_get_variable_alias_kind(variable)             # <<<<<<<<<<<<<<
 *             name             = decode(FMIL.fmi2_import_get_variable_name(variable))
 *             value_ref        = FMIL.fmi2_import_get_variable_vr(variable)
 */
    __pyx_v_alias_kind = fmi2_import_get_variable_alias_kind(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":4289
 * 
 *             alias_kind       = FMIL.fmi2_import_get_variable_alias_kind(variable)
 *             name             = decode(FMIL.fmi2_import_get_variable_name(variable))             # <<<<<<<<<<<<<<
 *             value_ref        = FMIL.fmi2_import_get_variable_vr(variable)
 *             data_type        = FMIL.fmi2_import_get_variable_base_type(variable)
 */
    __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_3 = PyBytes_FromString(fmi2_import_get_variable_name(__pyx_v_variable)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_v_name);
    __pyx_v_name = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "pyfmi\fmi.pyx":4290
 *             alias_kind       = FMIL.fmi2_import_get_variable_alias_kind(variable)
 *             name             = decode(FMIL.fmi2_import_get_variable_name(variable))
 *             value_ref        = FMIL.fmi2_import_get_variable_vr(variable)             # <<<<<<<<<<<<<<
 *             data_type        = FMIL.fmi2_import_get_variable_base_type(variable)
 *             has_start        = FMIL.fmi2_import_get_variable_has_start(variable)  #fmi2_import_get_initial, may be of interest
 */
    __pyx_v_value_ref = fmi2_import_get_variable_vr(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":4291
 *             name             = decode(FMIL.fmi2_import_get_variable_name(variable))
 *             value_ref        = FMIL.fmi2_import_get_variable_vr(variable)
 *             data_type        = FMIL.fmi2_import_get_variable_base_type(variable)             # <<<<<<<<<<<<<<
 *             has_start        = FMIL.fmi2_import_get_variable_has_start(variable)  #fmi2_import_get_initial, may be of interest
 *             data_variability = FMIL.fmi2_import_get_variability(variable)
 */
    __pyx_v_data_type = fmi2_import_get_variable_base_type(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":4292
 *             value_ref        = FMIL.fmi2_import_get_variable_vr(variable)
 *             data_type        = FMIL.fmi2_import_get_variable_base_type(variable)
 *             has_start        = FMIL.fmi2_import_get_variable_has_start(variable)  #fmi2_import_get_initial, may be of interest             # <<<<<<<<<<<<<<
 *             data_variability = FMIL.fmi2_import_get_variability(variable)
 *             data_causality   = FMIL.fmi2_import_get_causality(variable)
 */
    __pyx_v_has_start = fmi2_import_get_variable_has_start(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":4293
 *             data_type        = FMIL.fmi2_import_get_variable_base_type(variable)
 *             has_start        = FMIL.fmi2_import_get_variable_has_start(variable)  #fmi2_import_get_initial, may be of interest
 *             data_variability = FMIL.fmi2_import_get_variability(variable)             # <<<<<<<<<<<<<<
 *             data_causality   = FMIL.fmi2_import_get_causality(variable)
 *             desc             = FMIL.fmi2_import_get_variable_description(variable)
 */
    __pyx_v_data_variability = fmi2_import_get_variability(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":4294
 *             has_start        = FMIL.fmi2_import_get_variable_has_start(variable)  #fmi2_import_get_initial, may be of interest
 *             data_variability = FMIL.fmi2_import_get_variability(variable)
 *             data_causality   = FMIL.fmi2_import_get_causality(variable)             # <<<<<<<<<<<<<<
 *             desc             = FMIL.fmi2_import_get_variable_description(variable)
 *             initial          = FMIL.fmi2_import_get_initial(variable)
 */
    __pyx_v_data_causality = fmi2_import_get_causality(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":4295
 *             data_variability = FMIL.fmi2_import_get_variability(variable)
 *             data_causality   = FMIL.fmi2_import_get_causality(variable)
 *             desc             = FMIL.fmi2_import_get_variable_description(variable)             # <<<<<<<<<<<<<<
 *             initial          = FMIL.fmi2_import_get_initial(variable)
 * 
 */
    __pyx_v_desc = fmi2_import_get_variable_description(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":4296
 *             data_causality   = FMIL.fmi2_import_get_causality(variable)
 *             desc             = FMIL.fmi2_import_get_variable_description(variable)
 *             initial          = FMIL.fmi2_import_get_initial(variable)             # <<<<<<<<<<<<<<
 * 
 *             #If only variables with start are wanted, check if the variable has start
 */
    __pyx_v_initial = fmi2_import_get_initial(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":4299
 * 
 *             #If only variables with start are wanted, check if the variable has start
 *             if only_start and has_start != 1:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_only_start); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_2) {
      __pyx_t_12 = (__pyx_v_has_start != 1);
      __pyx_t_13 = __pyx_t_12;
    } else {
      __pyx_t_13 = __pyx_t_2;
    }
    if (__pyx_t_13) {

      /* "pyfmi\fmi.pyx":4300
 *             #If only variables with start are wanted, check if the variable has start
 *             if only_start and has_start != 1:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             if only_fixed:
 */
      goto __pyx_L7_continue;
      goto __pyx_L9;
    }
    __pyx_L9:;

    /* "pyfmi\fmi.pyx":4302
 *                 continue
 * 
 *             if only_fixed:             # <<<<<<<<<<<<<<
 *                 #fixed variability requires start-value
 *                 if has_start != 1:
 */
    __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_only_fixed); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_13) {

      /* "pyfmi\fmi.pyx":4304
 *             if only_fixed:
 *                 #fixed variability requires start-value
 *                 if has_start != 1:             # <<<<<<<<<<<<<<
 *                     continue
 *                 elif (FMIL.fmi2_import_get_variability(variable) != FMIL.fmi2_variability_enu_fixed):
 */
      __pyx_t_13 = (__pyx_v_has_start != 1);
      if (__pyx_t_13) {

        /* "pyfmi\fmi.pyx":4305
 *                 #fixed variability requires start-value
 *                 if has_start != 1:
 *                     continue             # <<<<<<<<<<<<<<
 *                 elif (FMIL.fmi2_import_get_variability(variable) != FMIL.fmi2_variability_enu_fixed):
 *                     continue
 */
        goto __pyx_L7_continue;
        goto __pyx_L11;
      }

      /* "pyfmi\fmi.pyx":4306
 *                 if has_start != 1:
 *                     continue
 *                 elif (FMIL.fmi2_import_get_variability(variable) != FMIL.fmi2_variability_enu_fixed):             # <<<<<<<<<<<<<<
 *                     continue
 * 
 */
      __pyx_t_13 = (fmi2_import_get_variability(__pyx_v_variable) != fmi2_variability_enu_fixed);
      if (__pyx_t_13) {

        /* "pyfmi\fmi.pyx":4307
 *                     continue
 *                 elif (FMIL.fmi2_import_get_variability(variable) != FMIL.fmi2_variability_enu_fixed):
 *                     continue             # <<<<<<<<<<<<<<
 * 
 *             if selected_type == 1 and data_type != target_type:
 */
        goto __pyx_L7_continue;
        goto __pyx_L11;
      }
      __pyx_L11:;
      goto __pyx_L10;
    }
    __pyx_L10:;

    /* "pyfmi\fmi.pyx":4309
 *                     continue
 * 
 *             if selected_type == 1 and data_type != target_type:             # <<<<<<<<<<<<<<
 *                 continue
 *             if selected_causality == 1 and data_causality != target_causality:
 */
    __pyx_t_13 = (__pyx_v_selected_type == 1);
    if (__pyx_t_13) {
      __pyx_t_2 = (__pyx_v_data_type != __pyx_v_target_type);
      __pyx_t_12 = __pyx_t_2;
    } else {
      __pyx_t_12 = __pyx_t_13;
    }
    if (__pyx_t_12) {

      /* "pyfmi\fmi.pyx":4310
 * 
 *             if selected_type == 1 and data_type != target_type:
 *                 continue             # <<<<<<<<<<<<<<
 *             if selected_causality == 1 and data_causality != target_causality:
 *                 continue
 */
      goto __pyx_L7_continue;
      goto __pyx_L12;
    }
    __pyx_L12:;

    /* "pyfmi\fmi.pyx":4311
 *             if selected_type == 1 and data_type != target_type:
 *                 continue
 *             if selected_causality == 1 and data_causality != target_causality:             # <<<<<<<<<<<<<<
 *                 continue
 *             if selected_variability == 1 and data_variability != target_variability:
 */
    __pyx_t_12 = (__pyx_v_selected_causality == 1);
    if (__pyx_t_12) {
      __pyx_t_13 = (__pyx_v_data_causality != __pyx_v_target_causality);
      __pyx_t_2 = __pyx_t_13;
    } else {
      __pyx_t_2 = __pyx_t_12;
    }
    if (__pyx_t_2) {

      /* "pyfmi\fmi.pyx":4312
 *                 continue
 *             if selected_causality == 1 and data_causality != target_causality:
 *                 continue             # <<<<<<<<<<<<<<
 *             if selected_variability == 1 and data_variability != target_variability:
 *                 continue
 */
      goto __pyx_L7_continue;
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "pyfmi\fmi.pyx":4313
 *             if selected_causality == 1 and data_causality != target_causality:
 *                 continue
 *             if selected_variability == 1 and data_variability != target_variability:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    __pyx_t_2 = (__pyx_v_selected_variability == 1);
    if (__pyx_t_2) {
      __pyx_t_12 = (__pyx_v_data_variability != __pyx_v_target_variability);
      __pyx_t_13 = __pyx_t_12;
    } else {
      __pyx_t_13 = __pyx_t_2;
    }
    if (__pyx_t_13) {

      /* "pyfmi\fmi.pyx":4314
 *                 continue
 *             if selected_variability == 1 and data_variability != target_variability:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             if selected_filter:
 */
      goto __pyx_L7_continue;
      goto __pyx_L14;
    }
    __pyx_L14:;

    /* "pyfmi\fmi.pyx":4316
 *                 continue
 * 
 *             if selected_filter:             # <<<<<<<<<<<<<<
 *                 for j in range(length_filter):
 *                     #if re.match(filter_list[j], name):
 */
    if (__pyx_v_selected_filter) {

      /* "pyfmi\fmi.pyx":4317
 * 
 *             if selected_filter:
 *                 for j in range(length_filter):             # <<<<<<<<<<<<<<
 *                     #if re.match(filter_list[j], name):
 *                     if filter_list[j].match(name):
 */
      __pyx_t_14 = __pyx_v_length_filter;
      for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
        __pyx_v_j = __pyx_t_15;

        /* "pyfmi\fmi.pyx":4319
 *                 for j in range(length_filter):
 *                     #if re.match(filter_list[j], name):
 *                     if filter_list[j].match(name):             # <<<<<<<<<<<<<<
 *                         break
 *                 else:
 */
        if (unlikely(!__pyx_v_filter_list)) { __Pyx_RaiseUnboundLocalError("filter_list"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
        if (unlikely(((PyObject *)__pyx_v_filter_list) == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_filter_list), __pyx_v_j, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__match); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_v_name);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_name);
        __Pyx_GIVEREF(__pyx_v_name);
        __pyx_t_8 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
        __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (__pyx_t_13) {

          /* "pyfmi\fmi.pyx":4320
 *                     #if re.match(filter_list[j], name):
 *                     if filter_list[j].match(name):
 *                         break             # <<<<<<<<<<<<<<
 *                 else:
 *                     continue
 */
          goto __pyx_L17_break;
          goto __pyx_L18;
        }
        __pyx_L18:;
      }
      /*else*/ {

        /* "pyfmi\fmi.pyx":4322
 *                         break
 *                 else:
 *                     continue             # <<<<<<<<<<<<<<
 * 
 *             if include_alias:
 */
        goto __pyx_L7_continue;
      }
      __pyx_L17_break:;
      goto __pyx_L15;
    }
    __pyx_L15:;

    /* "pyfmi\fmi.pyx":4324
 *                     continue
 * 
 *             if include_alias:             # <<<<<<<<<<<<<<
 *                 #variable_dict[name] = value_ref
 *                 variable_dict[name] = ScalarVariable2(name,
 */
    __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_include_alias); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_13) {

      /* "pyfmi\fmi.pyx":4327
 *                 #variable_dict[name] = value_ref
 *                 variable_dict[name] = ScalarVariable2(name,
 *                                        value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",             # <<<<<<<<<<<<<<
 *                                        data_variability, data_causality,
 *                                        alias_kind, initial)
 */
      __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_value_ref); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_3 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if ((__pyx_v_desc != NULL)) {
        __pyx_t_16 = ((PyObject *)__Pyx_decode_c_string(__pyx_v_desc, 0, strlen(__pyx_v_desc), NULL, NULL, PyUnicode_DecodeUTF8)); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_16));
        __pyx_t_4 = ((PyObject *)__pyx_t_16);
        __pyx_t_16 = 0;
      } else {
        __Pyx_INCREF(((PyObject *)__pyx_kp_s_12));
        __pyx_t_4 = ((PyObject *)__pyx_kp_s_12);
      }

      /* "pyfmi\fmi.pyx":4328
 *                 variable_dict[name] = ScalarVariable2(name,
 *                                        value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",
 *                                        data_variability, data_causality,             # <<<<<<<<<<<<<<
 *                                        alias_kind, initial)
 *             elif alias_kind == FMIL.fmi2_variable_is_not_alias:
 */
      __pyx_t_16 = PyInt_FromLong(__pyx_v_data_variability); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_17 = PyInt_FromLong(__pyx_v_data_causality); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_17);

      /* "pyfmi\fmi.pyx":4329
 *                                        value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",
 *                                        data_variability, data_causality,
 *                                        alias_kind, initial)             # <<<<<<<<<<<<<<
 *             elif alias_kind == FMIL.fmi2_variable_is_not_alias:
 *                 #Exclude alias
 */
      __pyx_t_18 = PyInt_FromLong(__pyx_v_alias_kind); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_18);
      __pyx_t_19 = PyInt_FromLong(__pyx_v_initial); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      __pyx_t_20 = PyTuple_New(8); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_INCREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_20, 2, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_20, 3, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_20, 4, __pyx_t_16);
      __Pyx_GIVEREF(__pyx_t_16);
      PyTuple_SET_ITEM(__pyx_t_20, 5, __pyx_t_17);
      __Pyx_GIVEREF(__pyx_t_17);
      PyTuple_SET_ITEM(__pyx_t_20, 6, __pyx_t_18);
      __Pyx_GIVEREF(__pyx_t_18);
      PyTuple_SET_ITEM(__pyx_t_20, 7, __pyx_t_19);
      __Pyx_GIVEREF(__pyx_t_19);
      __pyx_t_8 = 0;
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_16 = 0;
      __pyx_t_17 = 0;
      __pyx_t_18 = 0;
      __pyx_t_19 = 0;
      __pyx_t_19 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_ScalarVariable2)), ((PyObject *)__pyx_t_20), NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0;

      /* "pyfmi\fmi.pyx":4326
 *             if include_alias:
 *                 #variable_dict[name] = value_ref
 *                 variable_dict[name] = ScalarVariable2(name,             # <<<<<<<<<<<<<<
 *                                        value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",
 *                                        data_variability, data_causality,
 */
      if (PyObject_SetItem(__pyx_v_variable_dict, __pyx_v_name, __pyx_t_19) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      goto __pyx_L19;
    }

    /* "pyfmi\fmi.pyx":4330
 *                                        data_variability, data_causality,
 *                                        alias_kind, initial)
 *             elif alias_kind == FMIL.fmi2_variable_is_not_alias:             # <<<<<<<<<<<<<<
 *                 #Exclude alias
 *                 #variable_dict[name] = value_ref
 */
    __pyx_t_13 = (__pyx_v_alias_kind == fmi2_variable_is_not_alias);
    if (__pyx_t_13) {

      /* "pyfmi\fmi.pyx":4334
 *                 #variable_dict[name] = value_ref
 *                 variable_dict[name] = ScalarVariable2(name,
 *                                        value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",             # <<<<<<<<<<<<<<
 *                                        data_variability, data_causality,
 *                                        alias_kind, initial)
 */
      __pyx_t_19 = __Pyx_PyInt_FromSize_t(__pyx_v_value_ref); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      __pyx_t_20 = PyInt_FromLong(__pyx_v_data_type); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_20);
      if ((__pyx_v_desc != NULL)) {
        __pyx_t_17 = ((PyObject *)__Pyx_decode_c_string(__pyx_v_desc, 0, strlen(__pyx_v_desc), NULL, NULL, PyUnicode_DecodeUTF8)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_17));
        __pyx_t_18 = ((PyObject *)__pyx_t_17);
        __pyx_t_17 = 0;
      } else {
        __Pyx_INCREF(((PyObject *)__pyx_kp_s_12));
        __pyx_t_18 = ((PyObject *)__pyx_kp_s_12);
      }

      /* "pyfmi\fmi.pyx":4335
 *                 variable_dict[name] = ScalarVariable2(name,
 *                                        value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",
 *                                        data_variability, data_causality,             # <<<<<<<<<<<<<<
 *                                        alias_kind, initial)
 * 
 */
      __pyx_t_17 = PyInt_FromLong(__pyx_v_data_variability); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_17);
      __pyx_t_16 = PyInt_FromLong(__pyx_v_data_causality); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_16);

      /* "pyfmi\fmi.pyx":4336
 *                                        value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",
 *                                        data_variability, data_causality,
 *                                        alias_kind, initial)             # <<<<<<<<<<<<<<
 * 
 *         #Free the variable list
 */
      __pyx_t_4 = PyInt_FromLong(__pyx_v_alias_kind); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyInt_FromLong(__pyx_v_initial); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = PyTuple_New(8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_19);
      __Pyx_GIVEREF(__pyx_t_19);
      PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_20);
      __Pyx_GIVEREF(__pyx_t_20);
      PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_18);
      __Pyx_GIVEREF(__pyx_t_18);
      PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_t_17);
      __Pyx_GIVEREF(__pyx_t_17);
      PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_t_16);
      __Pyx_GIVEREF(__pyx_t_16);
      PyTuple_SET_ITEM(__pyx_t_8, 6, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_8, 7, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_19 = 0;
      __pyx_t_20 = 0;
      __pyx_t_18 = 0;
      __pyx_t_17 = 0;
      __pyx_t_16 = 0;
      __pyx_t_4 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_ScalarVariable2)), ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;

      /* "pyfmi\fmi.pyx":4333
 *                 #Exclude alias
 *                 #variable_dict[name] = value_ref
 *                 variable_dict[name] = ScalarVariable2(name,             # <<<<<<<<<<<<<<
 *                                        value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",
 *                                        data_variability, data_causality,
 */
      if (PyObject_SetItem(__pyx_v_variable_dict, __pyx_v_name, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L19;
    }
    __pyx_L19:;
    __pyx_L7_continue:;
  }

  /* "pyfmi\fmi.pyx":4339
 * 
 *         #Free the variable list
 *         FMIL.fmi2_import_free_variable_list(variable_list)             # <<<<<<<<<<<<<<
 * 
 *         return variable_dict
 */
  fmi2_import_free_variable_list(__pyx_v_variable_list);

  /* "pyfmi\fmi.pyx":4341
 *         FMIL.fmi2_import_free_variable_list(variable_list)
 * 
 *         return variable_dict             # <<<<<<<<<<<<<<
 * 
 *     def get_variable_references(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_variable_dict);
  __pyx_r = __pyx_v_variable_dict;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_model_variables", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_filter_list);
  __Pyx_XDECREF(__pyx_v_variable_dict);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_59get_variable_references(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_58get_variable_references[] = "\n        Retrieves the value references of all variables. The\n        information about the variables are retrieved from the XML-file.\n\n        Returns::\n\n            vr_real --\n                The Real-valued variables.\n\n            vr_int --\n                The Integer-valued variables.\n\n            vr_bool --\n                The Boolean-valued variables.\n\n            vr_str --\n                The String-valued variables.\n\n            vr_enum --\n                The Enum-valued variables\n\n        Example::\n\n            [r,i,b,s,e] = model.get_value_references()\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_59get_variable_references(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_references (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_58get_variable_references(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4343
 *         return variable_dict
 * 
 *     def get_variable_references(self):             # <<<<<<<<<<<<<<
 *         """
 *         Retrieves the value references of all variables. The
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_58get_variable_references(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  PyObject *__pyx_v_vr_real = NULL;
  PyObject *__pyx_v_vr_int = NULL;
  PyObject *__pyx_v_vr_bool = NULL;
  PyObject *__pyx_v_get_str_var = NULL;
  PyObject *__pyx_v_vr_str = NULL;
  PyObject *__pyx_v_get_enum_var = NULL;
  PyObject *__pyx_v_vr_enum = NULL;
  PyObject *__pyx_v_s = NULL;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_references", 0);

  /* "pyfmi\fmi.pyx":4369
 *             [r,i,b,s,e] = model.get_value_references()
 *         """
 *         vr_real = self._save_real_variables_val             # <<<<<<<<<<<<<<
 *         vr_int  = self._save_int_variables_val
 *         vr_bool = self._save_bool_variables_val
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->_save_real_variables_val);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_vr_real = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":4370
 *         """
 *         vr_real = self._save_real_variables_val
 *         vr_int  = self._save_int_variables_val             # <<<<<<<<<<<<<<
 *         vr_bool = self._save_bool_variables_val
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->_save_int_variables_val);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_vr_int = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":4371
 *         vr_real = self._save_real_variables_val
 *         vr_int  = self._save_int_variables_val
 *         vr_bool = self._save_bool_variables_val             # <<<<<<<<<<<<<<
 * 
 *         get_str_var = self.get_model_variables(type=3)
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->_save_bool_variables_val);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_vr_bool = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":4373
 *         vr_bool = self._save_bool_variables_val
 * 
 *         get_str_var = self.get_model_variables(type=3)             # <<<<<<<<<<<<<<
 *         vr_str  = [s.value_reference for s in get_str_var.values()]
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_model_variables); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__type), __pyx_int_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_get_str_var = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":4374
 * 
 *         get_str_var = self.get_model_variables(type=3)
 *         vr_str  = [s.value_reference for s in get_str_var.values()]             # <<<<<<<<<<<<<<
 * 
 *         get_enum_var = self.get_model_variables(type=4)
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_get_str_var, __pyx_n_s__values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4374; __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 = 4374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF(__pyx_v_s);
    __pyx_v_s = __pyx_t_1;
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_s, __pyx_n_s__value_reference); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(__Pyx_PyList_Append(__pyx_t_3, (PyObject*)__pyx_t_1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = ((PyObject *)__pyx_t_3);
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_v_vr_str = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":4376
 *         vr_str  = [s.value_reference for s in get_str_var.values()]
 * 
 *         get_enum_var = self.get_model_variables(type=4)             # <<<<<<<<<<<<<<
 *         vr_enum = [e.value_reference for e in get_enum_var.values()]
 * 
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_model_variables); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__type), __pyx_int_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_v_get_enum_var = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":4377
 * 
 *         get_enum_var = self.get_model_variables(type=4)
 *         vr_enum = [e.value_reference for e in get_enum_var.values()]             # <<<<<<<<<<<<<<
 * 
 *         return vr_real, vr_int, vr_bool, vr_str, vr_enum
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_get_enum_var, __pyx_n_s__values); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) {
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) {
      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF(__pyx_v_e);
    __pyx_v_e = __pyx_t_2;
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_e, __pyx_n_s__value_reference); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = ((PyObject *)__pyx_t_1);
  __Pyx_INCREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_v_vr_enum = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":4379
 *         vr_enum = [e.value_reference for e in get_enum_var.values()]
 * 
 *         return vr_real, vr_int, vr_bool, vr_str, vr_enum             # <<<<<<<<<<<<<<
 * 
 *     cpdef FMIL.fmi2_value_reference_t get_variable_valueref(self, variable_name) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_vr_real));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_vr_real));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_vr_real));
  __Pyx_INCREF(((PyObject *)__pyx_v_vr_int));
  PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_vr_int));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_vr_int));
  __Pyx_INCREF(((PyObject *)__pyx_v_vr_bool));
  PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_vr_bool));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_vr_bool));
  __Pyx_INCREF(((PyObject *)__pyx_v_vr_str));
  PyTuple_SET_ITEM(__pyx_t_3, 3, ((PyObject *)__pyx_v_vr_str));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_vr_str));
  __Pyx_INCREF(((PyObject *)__pyx_v_vr_enum));
  PyTuple_SET_ITEM(__pyx_t_3, 4, ((PyObject *)__pyx_v_vr_enum));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_vr_enum));
  __pyx_r = ((PyObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_references", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_vr_real);
  __Pyx_XDECREF(__pyx_v_vr_int);
  __Pyx_XDECREF(__pyx_v_vr_bool);
  __Pyx_XDECREF(__pyx_v_get_str_var);
  __Pyx_XDECREF(__pyx_v_vr_str);
  __Pyx_XDECREF(__pyx_v_get_enum_var);
  __Pyx_XDECREF(__pyx_v_vr_enum);
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4381
 *         return vr_real, vr_int, vr_bool, vr_str, vr_enum
 * 
 *     cpdef FMIL.fmi2_value_reference_t get_variable_valueref(self, variable_name) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Extract the ValueReference given a variable name.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_61get_variable_valueref(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static fmi2_value_reference_t __pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_valueref(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch) {
  fmi2_import_variable_t *__pyx_v_variable;
  fmi2_value_reference_t __pyx_v_vr;
  char *__pyx_v_variablename;
  fmi2_value_reference_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  fmi2_value_reference_t __pyx_t_4;
  char *__pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_valueref", 0);
  __Pyx_INCREF(__pyx_v_variable_name);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_87); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_61get_variable_valueref)) {
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_variable_name);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_variable_name);
      __Pyx_GIVEREF(__pyx_v_variable_name);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_t_4 = __Pyx_PyInt_AsSize_t(__pyx_t_3); if (unlikely((__pyx_t_4 == (fmi2_value_reference_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":4397
 *         cdef FMIL.fmi2_value_reference_t  vr
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_variable_name);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_variable_name);
  __Pyx_GIVEREF(__pyx_v_variable_name);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_v_variable_name);
  __pyx_v_variable_name = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":4398
 * 
 *         variable_name = encode(variable_name)
 *         cdef char* variablename = variable_name             # <<<<<<<<<<<<<<
 * 
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 */
  __pyx_t_5 = PyBytes_AsString(__pyx_v_variable_name); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_5;

  /* "pyfmi\fmi.pyx":4400
 *         cdef char* variablename = variable_name
 * 
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)             # <<<<<<<<<<<<<<
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)
 */
  __pyx_v_variable = fmi2_import_get_variable_by_name(__pyx_v_self->_fmu, __pyx_v_variablename);

  /* "pyfmi\fmi.pyx":4401
 * 
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The variable %s could not be found."%variablename)
 *         vr =  FMIL.fmi2_import_get_variable_vr(variable)
 */
  __pyx_t_6 = (__pyx_v_variable == NULL);
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":4402
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 *         vr =  FMIL.fmi2_import_get_variable_vr(variable)
 * 
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_81), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
    __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 = 4402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4403
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)
 *         vr =  FMIL.fmi2_import_get_variable_vr(variable)             # <<<<<<<<<<<<<<
 * 
 *         return vr
 */
  __pyx_v_vr = fmi2_import_get_variable_vr(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":4405
 *         vr =  FMIL.fmi2_import_get_variable_vr(variable)
 * 
 *         return vr             # <<<<<<<<<<<<<<
 * 
 *     cpdef FMIL.fmi2_base_type_enu_t get_variable_data_type(self, variable_name) except *:
 */
  __pyx_r = __pyx_v_vr;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_valueref", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_61get_variable_valueref(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_60get_variable_valueref[] = "\n        Extract the ValueReference given a variable name.\n\n        Parameters::\n\n            variable_name --\n                The name of the variable.\n\n        Returns::\n\n            The ValueReference for the variable passed as argument.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_61get_variable_valueref(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_valueref (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_60get_variable_valueref(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4381
 *         return vr_real, vr_int, vr_bool, vr_str, vr_enum
 * 
 *     cpdef FMIL.fmi2_value_reference_t get_variable_valueref(self, variable_name) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Extract the ValueReference given a variable name.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_60get_variable_valueref(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  fmi2_value_reference_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_valueref", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_variable_valueref(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_valueref", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4407
 *         return vr
 * 
 *     cpdef FMIL.fmi2_base_type_enu_t get_variable_data_type(self, variable_name) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Get data type of variable.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_63get_variable_data_type(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static fmi2_base_type_enu_t __pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_data_type(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch) {
  fmi2_import_variable_t *__pyx_v_variable;
  fmi2_base_type_enu_t __pyx_v_type;
  char *__pyx_v_variablename;
  fmi2_base_type_enu_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  fmi2_base_type_enu_t __pyx_t_4;
  char *__pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_data_type", 0);
  __Pyx_INCREF(__pyx_v_variable_name);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_86); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_63get_variable_data_type)) {
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_variable_name);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_variable_name);
      __Pyx_GIVEREF(__pyx_v_variable_name);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_t_4 = ((fmi2_base_type_enu_t)PyInt_AsLong(__pyx_t_3)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":4423
 *         cdef FMIL.fmi2_base_type_enu_t    type
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_variable_name);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_variable_name);
  __Pyx_GIVEREF(__pyx_v_variable_name);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_v_variable_name);
  __pyx_v_variable_name = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":4424
 * 
 *         variable_name = encode(variable_name)
 *         cdef char* variablename = variable_name             # <<<<<<<<<<<<<<
 * 
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 */
  __pyx_t_5 = PyBytes_AsString(__pyx_v_variable_name); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_5;

  /* "pyfmi\fmi.pyx":4426
 *         cdef char* variablename = variable_name
 * 
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)             # <<<<<<<<<<<<<<
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)
 */
  __pyx_v_variable = fmi2_import_get_variable_by_name(__pyx_v_self->_fmu, __pyx_v_variablename);

  /* "pyfmi\fmi.pyx":4427
 * 
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 */
  __pyx_t_6 = (__pyx_v_variable == NULL);
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":4428
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 * 
 *         type = FMIL.fmi2_import_get_variable_base_type(variable)
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_81), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
    __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 = 4428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4430
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 *         type = FMIL.fmi2_import_get_variable_base_type(variable)             # <<<<<<<<<<<<<<
 * 
 *         return type
 */
  __pyx_v_type = fmi2_import_get_variable_base_type(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":4432
 *         type = FMIL.fmi2_import_get_variable_base_type(variable)
 * 
 *         return type             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_description(self, variable_name):
 */
  __pyx_r = __pyx_v_type;
  goto __pyx_L0;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_data_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_63get_variable_data_type(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_62get_variable_data_type[] = "\n        Get data type of variable.\n\n        Parameter::\n\n            variable_name --\n                The name of the variable.\n\n        Returns::\n\n            The type of the variable.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_63get_variable_data_type(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_data_type (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_62get_variable_data_type(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4407
 *         return vr
 * 
 *     cpdef FMIL.fmi2_base_type_enu_t get_variable_data_type(self, variable_name) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Get data type of variable.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_62get_variable_data_type(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  fmi2_base_type_enu_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_data_type", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_variable_data_type(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_data_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4434
 *         return type
 * 
 *     cpdef get_variable_description(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Get the description of a given variable.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_65get_variable_description(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_description(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch) {
  fmi2_import_variable_t *__pyx_v_variable;
  char *__pyx_v_desc;
  char *__pyx_v_variablename;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_description", 0);
  __Pyx_INCREF(__pyx_v_variable_name);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_85); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_65get_variable_description)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_variable_name);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_variable_name);
      __Pyx_GIVEREF(__pyx_v_variable_name);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":4450
 *         cdef char* desc
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_variable_name);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_variable_name);
  __Pyx_GIVEREF(__pyx_v_variable_name);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_v_variable_name);
  __pyx_v_variable_name = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":4451
 * 
 *         variable_name = encode(variable_name)
 *         cdef char* variablename = variable_name             # <<<<<<<<<<<<<<
 * 
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 */
  __pyx_t_4 = PyBytes_AsString(__pyx_v_variable_name); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_4;

  /* "pyfmi\fmi.pyx":4453
 *         cdef char* variablename = variable_name
 * 
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)             # <<<<<<<<<<<<<<
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)
 */
  __pyx_v_variable = fmi2_import_get_variable_by_name(__pyx_v_self->_fmu, __pyx_v_variablename);

  /* "pyfmi\fmi.pyx":4454
 * 
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 */
  __pyx_t_5 = (__pyx_v_variable == NULL);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":4455
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 * 
 *         desc = FMIL.fmi2_import_get_variable_description(variable)
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_81), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
    __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 = 4455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4457
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 *         desc = FMIL.fmi2_import_get_variable_description(variable)             # <<<<<<<<<<<<<<
 * 
 *         return desc if desc != NULL else ""
 */
  __pyx_v_desc = fmi2_import_get_variable_description(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":4459
 *         desc = FMIL.fmi2_import_get_variable_description(variable)
 * 
 *         return desc if desc != NULL else ""             # <<<<<<<<<<<<<<
 * 
 *     cpdef FMIL.fmi2_variability_enu_t get_variable_variability(self, variable_name) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  if ((__pyx_v_desc != NULL)) {
    __pyx_t_3 = PyBytes_FromString(__pyx_v_desc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = ((PyObject *)__pyx_t_3);
    __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_12));
    __pyx_t_1 = ((PyObject *)__pyx_kp_s_12);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_description", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_65get_variable_description(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_64get_variable_description[] = "\n        Get the description of a given variable.\n\n        Parameter::\n\n            variable_name --\n                The name of the variable\n\n        Returns::\n\n            The description of the variable.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_65get_variable_description(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_description (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_64get_variable_description(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4434
 *         return type
 * 
 *     cpdef get_variable_description(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Get the description of a given variable.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_64get_variable_description(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  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("get_variable_description", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_variable_description(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_description", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4461
 *         return desc if desc != NULL else ""
 * 
 *     cpdef FMIL.fmi2_variability_enu_t get_variable_variability(self, variable_name) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Get variability of the variable.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_67get_variable_variability(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static fmi2_variability_enu_t __pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_variability(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch) {
  fmi2_import_variable_t *__pyx_v_variable;
  fmi2_variability_enu_t __pyx_v_variability;
  char *__pyx_v_variablename;
  fmi2_variability_enu_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  fmi2_variability_enu_t __pyx_t_4;
  char *__pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_variability", 0);
  __Pyx_INCREF(__pyx_v_variable_name);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_103); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_67get_variable_variability)) {
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_variable_name);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_variable_name);
      __Pyx_GIVEREF(__pyx_v_variable_name);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_t_4 = ((fmi2_variability_enu_t)PyInt_AsLong(__pyx_t_3)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":4478
 *         cdef FMIL.fmi2_variability_enu_t variability
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_variable_name);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_variable_name);
  __Pyx_GIVEREF(__pyx_v_variable_name);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_v_variable_name);
  __pyx_v_variable_name = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":4479
 * 
 *         variable_name = encode(variable_name)
 *         cdef char* variablename = variable_name             # <<<<<<<<<<<<<<
 * 
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 */
  __pyx_t_5 = PyBytes_AsString(__pyx_v_variable_name); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_5;

  /* "pyfmi\fmi.pyx":4481
 *         cdef char* variablename = variable_name
 * 
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)             # <<<<<<<<<<<<<<
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)
 */
  __pyx_v_variable = fmi2_import_get_variable_by_name(__pyx_v_self->_fmu, __pyx_v_variablename);

  /* "pyfmi\fmi.pyx":4482
 * 
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The variable %s could not be found."%variablename)
 *         variability = FMIL.fmi2_import_get_variability(variable)
 */
  __pyx_t_6 = (__pyx_v_variable == NULL);
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":4483
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 *         variability = FMIL.fmi2_import_get_variability(variable)
 * 
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_81), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
    __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 = 4483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4484
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)
 *         variability = FMIL.fmi2_import_get_variability(variable)             # <<<<<<<<<<<<<<
 * 
 *         return variability
 */
  __pyx_v_variability = fmi2_import_get_variability(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":4486
 *         variability = FMIL.fmi2_import_get_variability(variable)
 * 
 *         return variability             # <<<<<<<<<<<<<<
 * 
 *     cpdef FMIL.fmi2_initial_enu_t get_variable_initial(self, variable_name) except *:
 */
  __pyx_r = __pyx_v_variability;
  goto __pyx_L0;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_variability", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_67get_variable_variability(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_66get_variable_variability[] = "\n        Get variability of the variable.\n\n        Parameters::\n\n            variable_name --\n                The name of the variable.\n\n        Returns::\n\n            The variability of the variable: CONSTANT(0), FIXED(1),\n            TUNABLE(2), DISCRETE(3), CONTINUOUS(4) or UNKNOWN(5)\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_67get_variable_variability(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_variability (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_66get_variable_variability(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4461
 *         return desc if desc != NULL else ""
 * 
 *     cpdef FMIL.fmi2_variability_enu_t get_variable_variability(self, variable_name) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Get variability of the variable.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_66get_variable_variability(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  fmi2_variability_enu_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_variability", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_variable_variability(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_variability", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4488
 *         return variability
 * 
 *     cpdef FMIL.fmi2_initial_enu_t get_variable_initial(self, variable_name) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Get initial of the variable.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_69get_variable_initial(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static fmi2_initial_enu_t __pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_initial(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch) {
  fmi2_import_variable_t *__pyx_v_variable;
  fmi2_initial_enu_t __pyx_v_initial;
  char *__pyx_v_variablename;
  fmi2_initial_enu_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  fmi2_initial_enu_t __pyx_t_4;
  char *__pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_initial", 0);
  __Pyx_INCREF(__pyx_v_variable_name);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_271); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_69get_variable_initial)) {
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_variable_name);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_variable_name);
      __Pyx_GIVEREF(__pyx_v_variable_name);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_t_4 = ((fmi2_initial_enu_t)PyInt_AsLong(__pyx_t_3)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":4505
 *         cdef FMIL.fmi2_initial_enu_t initial
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_variable_name);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_variable_name);
  __Pyx_GIVEREF(__pyx_v_variable_name);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_v_variable_name);
  __pyx_v_variable_name = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":4506
 * 
 *         variable_name = encode(variable_name)
 *         cdef char* variablename = variable_name             # <<<<<<<<<<<<<<
 * 
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 */
  __pyx_t_5 = PyBytes_AsString(__pyx_v_variable_name); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_5;

  /* "pyfmi\fmi.pyx":4508
 *         cdef char* variablename = variable_name
 * 
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)             # <<<<<<<<<<<<<<
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)
 */
  __pyx_v_variable = fmi2_import_get_variable_by_name(__pyx_v_self->_fmu, __pyx_v_variablename);

  /* "pyfmi\fmi.pyx":4509
 * 
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The variable %s could not be found."%variablename)
 *         initial = FMIL.fmi2_import_get_initial(variable)
 */
  __pyx_t_6 = (__pyx_v_variable == NULL);
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":4510
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 *         initial = FMIL.fmi2_import_get_initial(variable)
 * 
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_81), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
    __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 = 4510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4511
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)
 *         initial = FMIL.fmi2_import_get_initial(variable)             # <<<<<<<<<<<<<<
 * 
 *         return initial
 */
  __pyx_v_initial = fmi2_import_get_initial(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":4513
 *         initial = FMIL.fmi2_import_get_initial(variable)
 * 
 *         return initial             # <<<<<<<<<<<<<<
 * 
 *     cpdef FMIL.fmi2_causality_enu_t get_variable_causality(self, variable_name) except *:
 */
  __pyx_r = __pyx_v_initial;
  goto __pyx_L0;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_initial", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_69get_variable_initial(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_68get_variable_initial[] = "\n        Get initial of the variable.\n        \n        Parameters::\n        \n            variable_name --\n                The name of the variable.\n                \n        Returns::\n        \n            The initial of the variable: EXACT(0), APPROX(1), \n            CALCULATED(2), UNKNOWN(3)\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_69get_variable_initial(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_initial (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_68get_variable_initial(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4488
 *         return variability
 * 
 *     cpdef FMIL.fmi2_initial_enu_t get_variable_initial(self, variable_name) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Get initial of the variable.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_68get_variable_initial(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  fmi2_initial_enu_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_initial", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_variable_initial(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_initial", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4515
 *         return initial
 * 
 *     cpdef FMIL.fmi2_causality_enu_t get_variable_causality(self, variable_name) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Get the causality of the variable.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_71get_variable_causality(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static fmi2_causality_enu_t __pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_causality(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch) {
  fmi2_import_variable_t *__pyx_v_variable;
  fmi2_causality_enu_t __pyx_v_causality;
  char *__pyx_v_variablename;
  fmi2_causality_enu_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  fmi2_causality_enu_t __pyx_t_4;
  char *__pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_causality", 0);
  __Pyx_INCREF(__pyx_v_variable_name);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_105); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_71get_variable_causality)) {
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_variable_name);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_variable_name);
      __Pyx_GIVEREF(__pyx_v_variable_name);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_t_4 = ((fmi2_causality_enu_t)PyInt_AsLong(__pyx_t_3)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":4532
 *         cdef FMIL.fmi2_causality_enu_t causality
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_variable_name);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_variable_name);
  __Pyx_GIVEREF(__pyx_v_variable_name);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_v_variable_name);
  __pyx_v_variable_name = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":4533
 * 
 *         variable_name = encode(variable_name)
 *         cdef char* variablename = variable_name             # <<<<<<<<<<<<<<
 * 
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 */
  __pyx_t_5 = PyBytes_AsString(__pyx_v_variable_name); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_5;

  /* "pyfmi\fmi.pyx":4535
 *         cdef char* variablename = variable_name
 * 
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)             # <<<<<<<<<<<<<<
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)
 */
  __pyx_v_variable = fmi2_import_get_variable_by_name(__pyx_v_self->_fmu, __pyx_v_variablename);

  /* "pyfmi\fmi.pyx":4536
 * 
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 */
  __pyx_t_6 = (__pyx_v_variable == NULL);
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":4537
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 * 
 *         causality = FMIL.fmi2_import_get_causality(variable)
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_81), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
    __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 = 4537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4539
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 *         causality = FMIL.fmi2_import_get_causality(variable)             # <<<<<<<<<<<<<<
 * 
 *         return causality
 */
  __pyx_v_causality = fmi2_import_get_causality(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":4541
 *         causality = FMIL.fmi2_import_get_causality(variable)
 * 
 *         return causality             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_start(self, variable_name):
 */
  __pyx_r = __pyx_v_causality;
  goto __pyx_L0;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_causality", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_71get_variable_causality(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_70get_variable_causality[] = "\n        Get the causality of the variable.\n\n        Parameters::\n\n            variable_name --\n                The name of the variable.\n\n        Returns::\n\n            The variability of the variable, PARAMETER(0), CALCULATED_PARAMETER(1), INPUT(2),\n            OUTPUT(3), LOCAL(4), INDEPENDENT(5), UNKNOWN(6)\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_71get_variable_causality(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_causality (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_70get_variable_causality(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4515
 *         return initial
 * 
 *     cpdef FMIL.fmi2_causality_enu_t get_variable_causality(self, variable_name) except *:             # <<<<<<<<<<<<<<
 *         """
 *         Get the causality of the variable.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_70get_variable_causality(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  fmi2_causality_enu_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_causality", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_variable_causality(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_causality", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4543
 *         return causality
 * 
 *     cpdef get_variable_start(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the start value for the variable or else raises
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_73get_variable_start(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_start(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch) {
  fmi2_import_variable_t *__pyx_v_variable;
  fmi2_base_type_enu_t __pyx_v_type;
  fmi2_import_integer_variable_t *__pyx_v_int_variable;
  fmi2_import_real_variable_t *__pyx_v_real_variable;
  fmi2_import_bool_variable_t *__pyx_v_bool_variable;
  fmi2_import_enum_variable_t *__pyx_v_enum_variable;
  fmi2_import_string_variable_t *__pyx_v_str_variable;
  int __pyx_v_status;
  fmi2_boolean_t __pyx_v_FMITRUE;
  char *__pyx_v_variablename;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_start", 0);
  __Pyx_INCREF(__pyx_v_variable_name);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_variable_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_73get_variable_start)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_variable_name);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_variable_name);
      __Pyx_GIVEREF(__pyx_v_variable_name);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":4565
 *         cdef FMIL.fmi2_import_string_variable_t*  str_variable
 *         cdef int                                  status
 *         cdef FMIL.fmi2_boolean_t                  FMITRUE = 1             # <<<<<<<<<<<<<<
 * 
 *         variable_name = encode(variable_name)
 */
  __pyx_v_FMITRUE = 1;

  /* "pyfmi\fmi.pyx":4567
 *         cdef FMIL.fmi2_boolean_t                  FMITRUE = 1
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_variable_name);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_variable_name);
  __Pyx_GIVEREF(__pyx_v_variable_name);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_v_variable_name);
  __pyx_v_variable_name = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":4568
 * 
 *         variable_name = encode(variable_name)
 *         cdef char* variablename = variable_name             # <<<<<<<<<<<<<<
 * 
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 */
  __pyx_t_4 = PyBytes_AsString(__pyx_v_variable_name); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_4;

  /* "pyfmi\fmi.pyx":4570
 *         cdef char* variablename = variable_name
 * 
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)             # <<<<<<<<<<<<<<
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)
 */
  __pyx_v_variable = fmi2_import_get_variable_by_name(__pyx_v_self->_fmu, __pyx_v_variablename);

  /* "pyfmi\fmi.pyx":4571
 * 
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 */
  __pyx_t_5 = (__pyx_v_variable == NULL);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":4572
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_get_variable_has_start(variable)
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_81), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
    __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 = 4572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4574
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 *         status = FMIL.fmi2_import_get_variable_has_start(variable)             # <<<<<<<<<<<<<<
 * 
 *         if status == 0:
 */
  __pyx_v_status = fmi2_import_get_variable_has_start(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":4576
 *         status = FMIL.fmi2_import_get_variable_has_start(variable)
 * 
 *         if status == 0:             # <<<<<<<<<<<<<<
 *             raise FMUException("The variable %s does not have a start value."%variablename)
 * 
 */
  __pyx_t_5 = (__pyx_v_status == 0);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":4577
 * 
 *         if status == 0:
 *             raise FMUException("The variable %s does not have a start value."%variablename)             # <<<<<<<<<<<<<<
 * 
 *         type = FMIL.fmi2_import_get_variable_base_type(variable)
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_93), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":4579
 *             raise FMUException("The variable %s does not have a start value."%variablename)
 * 
 *         type = FMIL.fmi2_import_get_variable_base_type(variable)             # <<<<<<<<<<<<<<
 * 
 *         if type == FMIL.fmi2_base_type_real:
 */
  __pyx_v_type = fmi2_import_get_variable_base_type(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":4581
 *         type = FMIL.fmi2_import_get_variable_base_type(variable)
 * 
 *         if type == FMIL.fmi2_base_type_real:             # <<<<<<<<<<<<<<
 *             real_variable = FMIL.fmi2_import_get_variable_as_real(variable)
 *             return FMIL.fmi2_import_get_real_variable_start(real_variable)
 */
  __pyx_t_5 = (__pyx_v_type == fmi2_base_type_real);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":4582
 * 
 *         if type == FMIL.fmi2_base_type_real:
 *             real_variable = FMIL.fmi2_import_get_variable_as_real(variable)             # <<<<<<<<<<<<<<
 *             return FMIL.fmi2_import_get_real_variable_start(real_variable)
 * 
 */
    __pyx_v_real_variable = fmi2_import_get_variable_as_real(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":4583
 *         if type == FMIL.fmi2_base_type_real:
 *             real_variable = FMIL.fmi2_import_get_variable_as_real(variable)
 *             return FMIL.fmi2_import_get_real_variable_start(real_variable)             # <<<<<<<<<<<<<<
 * 
 *         elif type == FMIL.fmi2_base_type_int:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble(fmi2_import_get_real_variable_start(__pyx_v_real_variable)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }

  /* "pyfmi\fmi.pyx":4585
 *             return FMIL.fmi2_import_get_real_variable_start(real_variable)
 * 
 *         elif type == FMIL.fmi2_base_type_int:             # <<<<<<<<<<<<<<
 *             int_variable = FMIL.fmi2_import_get_variable_as_integer(variable)
 *             return FMIL.fmi2_import_get_integer_variable_start(int_variable)
 */
  __pyx_t_5 = (__pyx_v_type == fmi2_base_type_int);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":4586
 * 
 *         elif type == FMIL.fmi2_base_type_int:
 *             int_variable = FMIL.fmi2_import_get_variable_as_integer(variable)             # <<<<<<<<<<<<<<
 *             return FMIL.fmi2_import_get_integer_variable_start(int_variable)
 * 
 */
    __pyx_v_int_variable = fmi2_import_get_variable_as_integer(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":4587
 *         elif type == FMIL.fmi2_base_type_int:
 *             int_variable = FMIL.fmi2_import_get_variable_as_integer(variable)
 *             return FMIL.fmi2_import_get_integer_variable_start(int_variable)             # <<<<<<<<<<<<<<
 * 
 *         elif type == FMIL.fmi2_base_type_bool:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyInt_FromLong(fmi2_import_get_integer_variable_start(__pyx_v_int_variable)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }

  /* "pyfmi\fmi.pyx":4589
 *             return FMIL.fmi2_import_get_integer_variable_start(int_variable)
 * 
 *         elif type == FMIL.fmi2_base_type_bool:             # <<<<<<<<<<<<<<
 *             bool_variable = FMIL.fmi2_import_get_variable_as_boolean(variable)
 *             return FMIL.fmi2_import_get_boolean_variable_start(bool_variable) == FMITRUE
 */
  __pyx_t_5 = (__pyx_v_type == fmi2_base_type_bool);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":4590
 * 
 *         elif type == FMIL.fmi2_base_type_bool:
 *             bool_variable = FMIL.fmi2_import_get_variable_as_boolean(variable)             # <<<<<<<<<<<<<<
 *             return FMIL.fmi2_import_get_boolean_variable_start(bool_variable) == FMITRUE
 * 
 */
    __pyx_v_bool_variable = fmi2_import_get_variable_as_boolean(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":4591
 *         elif type == FMIL.fmi2_base_type_bool:
 *             bool_variable = FMIL.fmi2_import_get_variable_as_boolean(variable)
 *             return FMIL.fmi2_import_get_boolean_variable_start(bool_variable) == FMITRUE             # <<<<<<<<<<<<<<
 * 
 *         elif type == FMIL.fmi2_base_type_enum:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyBool_FromLong((fmi2_import_get_boolean_variable_start(__pyx_v_bool_variable) == __pyx_v_FMITRUE)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }

  /* "pyfmi\fmi.pyx":4593
 *             return FMIL.fmi2_import_get_boolean_variable_start(bool_variable) == FMITRUE
 * 
 *         elif type == FMIL.fmi2_base_type_enum:             # <<<<<<<<<<<<<<
 *             enum_variable = FMIL.fmi2_import_get_variable_as_enum(variable)
 *             return FMIL.fmi2_import_get_enum_variable_start(enum_variable)
 */
  __pyx_t_5 = (__pyx_v_type == fmi2_base_type_enum);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":4594
 * 
 *         elif type == FMIL.fmi2_base_type_enum:
 *             enum_variable = FMIL.fmi2_import_get_variable_as_enum(variable)             # <<<<<<<<<<<<<<
 *             return FMIL.fmi2_import_get_enum_variable_start(enum_variable)
 * 
 */
    __pyx_v_enum_variable = fmi2_import_get_variable_as_enum(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":4595
 *         elif type == FMIL.fmi2_base_type_enum:
 *             enum_variable = FMIL.fmi2_import_get_variable_as_enum(variable)
 *             return FMIL.fmi2_import_get_enum_variable_start(enum_variable)             # <<<<<<<<<<<<<<
 * 
 *         elif type == FMIL.fmi2_base_type_str:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyInt_FromLong(fmi2_import_get_enum_variable_start(__pyx_v_enum_variable)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }

  /* "pyfmi\fmi.pyx":4597
 *             return FMIL.fmi2_import_get_enum_variable_start(enum_variable)
 * 
 *         elif type == FMIL.fmi2_base_type_str:             # <<<<<<<<<<<<<<
 *             str_variable = FMIL.fmi2_import_get_variable_as_string(variable)
 *             return FMIL.fmi2_import_get_string_variable_start(str_variable)
 */
  __pyx_t_5 = (__pyx_v_type == fmi2_base_type_str);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":4598
 * 
 *         elif type == FMIL.fmi2_base_type_str:
 *             str_variable = FMIL.fmi2_import_get_variable_as_string(variable)             # <<<<<<<<<<<<<<
 *             return FMIL.fmi2_import_get_string_variable_start(str_variable)
 * 
 */
    __pyx_v_str_variable = fmi2_import_get_variable_as_string(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":4599
 *         elif type == FMIL.fmi2_base_type_str:
 *             str_variable = FMIL.fmi2_import_get_variable_as_string(variable)
 *             return FMIL.fmi2_import_get_string_variable_start(str_variable)             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyBytes_FromString(fmi2_import_get_string_variable_start(__pyx_v_str_variable)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_r = ((PyObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":4602
 * 
 *         else:
 *             raise FMUException("Unknown variable type.")             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_max(self, variable_name):
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_272), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_73get_variable_start(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_72get_variable_start[] = "\n        Returns the start value for the variable or else raises\n        FMUException.\n\n        Parameters::\n\n            variable_name --\n                The name of the variable\n\n        Returns::\n\n            The start value.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_73get_variable_start(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_start (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_72get_variable_start(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4543
 *         return causality
 * 
 *     cpdef get_variable_start(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the start value for the variable or else raises
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_72get_variable_start(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  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("get_variable_start", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_variable_start(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4604
 *             raise FMUException("Unknown variable type.")
 * 
 *     cpdef get_variable_max(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the maximum value for the given variable.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_75get_variable_max(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_max(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch) {
  fmi2_import_variable_t *__pyx_v_variable;
  fmi2_import_integer_variable_t *__pyx_v_int_variable;
  fmi2_import_real_variable_t *__pyx_v_real_variable;
  fmi2_import_enum_variable_t *__pyx_v_enum_variable;
  fmi2_base_type_enu_t __pyx_v_type;
  char *__pyx_v_variablename;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_max", 0);
  __Pyx_INCREF(__pyx_v_variable_name);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_variable_max); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_75get_variable_max)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_variable_name);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_variable_name);
      __Pyx_GIVEREF(__pyx_v_variable_name);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":4623
 *         cdef FMIL.fmi2_base_type_enu_t            type
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_variable_name);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_variable_name);
  __Pyx_GIVEREF(__pyx_v_variable_name);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_v_variable_name);
  __pyx_v_variable_name = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":4624
 * 
 *         variable_name = encode(variable_name)
 *         cdef char* variablename = variable_name             # <<<<<<<<<<<<<<
 * 
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 */
  __pyx_t_4 = PyBytes_AsString(__pyx_v_variable_name); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_4;

  /* "pyfmi\fmi.pyx":4626
 *         cdef char* variablename = variable_name
 * 
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)             # <<<<<<<<<<<<<<
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)
 */
  __pyx_v_variable = fmi2_import_get_variable_by_name(__pyx_v_self->_fmu, __pyx_v_variablename);

  /* "pyfmi\fmi.pyx":4627
 * 
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 */
  __pyx_t_5 = (__pyx_v_variable == NULL);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":4628
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 * 
 *         type = FMIL.fmi2_import_get_variable_base_type(variable)
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_81), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
    __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 = 4628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4630
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 *         type = FMIL.fmi2_import_get_variable_base_type(variable)             # <<<<<<<<<<<<<<
 * 
 *         if type == FMIL.fmi2_base_type_real:
 */
  __pyx_v_type = fmi2_import_get_variable_base_type(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":4632
 *         type = FMIL.fmi2_import_get_variable_base_type(variable)
 * 
 *         if type == FMIL.fmi2_base_type_real:             # <<<<<<<<<<<<<<
 *             real_variable = FMIL.fmi2_import_get_variable_as_real(variable)
 *             return FMIL.fmi2_import_get_real_variable_max(real_variable)
 */
  __pyx_t_5 = (__pyx_v_type == fmi2_base_type_real);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":4633
 * 
 *         if type == FMIL.fmi2_base_type_real:
 *             real_variable = FMIL.fmi2_import_get_variable_as_real(variable)             # <<<<<<<<<<<<<<
 *             return FMIL.fmi2_import_get_real_variable_max(real_variable)
 * 
 */
    __pyx_v_real_variable = fmi2_import_get_variable_as_real(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":4634
 *         if type == FMIL.fmi2_base_type_real:
 *             real_variable = FMIL.fmi2_import_get_variable_as_real(variable)
 *             return FMIL.fmi2_import_get_real_variable_max(real_variable)             # <<<<<<<<<<<<<<
 * 
 *         elif type == FMIL.fmi2_base_type_int:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyFloat_FromDouble(fmi2_import_get_real_variable_max(__pyx_v_real_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }

  /* "pyfmi\fmi.pyx":4636
 *             return FMIL.fmi2_import_get_real_variable_max(real_variable)
 * 
 *         elif type == FMIL.fmi2_base_type_int:             # <<<<<<<<<<<<<<
 *             int_variable = FMIL.fmi2_import_get_variable_as_integer(variable)
 *             return FMIL.fmi2_import_get_integer_variable_max(int_variable)
 */
  __pyx_t_5 = (__pyx_v_type == fmi2_base_type_int);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":4637
 * 
 *         elif type == FMIL.fmi2_base_type_int:
 *             int_variable = FMIL.fmi2_import_get_variable_as_integer(variable)             # <<<<<<<<<<<<<<
 *             return FMIL.fmi2_import_get_integer_variable_max(int_variable)
 * 
 */
    __pyx_v_int_variable = fmi2_import_get_variable_as_integer(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":4638
 *         elif type == FMIL.fmi2_base_type_int:
 *             int_variable = FMIL.fmi2_import_get_variable_as_integer(variable)
 *             return FMIL.fmi2_import_get_integer_variable_max(int_variable)             # <<<<<<<<<<<<<<
 * 
 *         elif type == FMIL.fmi2_base_type_enum:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyInt_FromLong(fmi2_import_get_integer_variable_max(__pyx_v_int_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }

  /* "pyfmi\fmi.pyx":4640
 *             return FMIL.fmi2_import_get_integer_variable_max(int_variable)
 * 
 *         elif type == FMIL.fmi2_base_type_enum:             # <<<<<<<<<<<<<<
 *             enum_variable = FMIL.fmi2_import_get_variable_as_enum(variable)
 *             return FMIL.fmi2_import_get_enum_variable_max(enum_variable)
 */
  __pyx_t_5 = (__pyx_v_type == fmi2_base_type_enum);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":4641
 * 
 *         elif type == FMIL.fmi2_base_type_enum:
 *             enum_variable = FMIL.fmi2_import_get_variable_as_enum(variable)             # <<<<<<<<<<<<<<
 *             return FMIL.fmi2_import_get_enum_variable_max(enum_variable)
 * 
 */
    __pyx_v_enum_variable = fmi2_import_get_variable_as_enum(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":4642
 *         elif type == FMIL.fmi2_base_type_enum:
 *             enum_variable = FMIL.fmi2_import_get_variable_as_enum(variable)
 *             return FMIL.fmi2_import_get_enum_variable_max(enum_variable)             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyInt_FromLong(fmi2_import_get_enum_variable_max(__pyx_v_enum_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":4645
 * 
 *         else:
 *             raise FMUException("The variable type does not have a maximum value.")             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_min(self, variable_name):
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_273), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L4:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_75get_variable_max(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_74get_variable_max[] = "\n        Returns the maximum value for the given variable.\n\n        Parameters::\n\n            variable_name --\n                The name of the variable.\n\n        Returns::\n\n            The maximum value for the variable.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_75get_variable_max(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_max (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_74get_variable_max(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4604
 *             raise FMUException("Unknown variable type.")
 * 
 *     cpdef get_variable_max(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the maximum value for the given variable.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_74get_variable_max(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  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("get_variable_max", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_variable_max(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4647
 *             raise FMUException("The variable type does not have a maximum value.")
 * 
 *     cpdef get_variable_min(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the minimum value for the given variable.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_77get_variable_min(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_min(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name, int __pyx_skip_dispatch) {
  fmi2_import_variable_t *__pyx_v_variable;
  fmi2_import_integer_variable_t *__pyx_v_int_variable;
  fmi2_import_real_variable_t *__pyx_v_real_variable;
  fmi2_import_enum_variable_t *__pyx_v_enum_variable;
  fmi2_base_type_enu_t __pyx_v_type;
  char *__pyx_v_variablename;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_variable_min", 0);
  __Pyx_INCREF(__pyx_v_variable_name);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_variable_min); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_77get_variable_min)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_variable_name);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_variable_name);
      __Pyx_GIVEREF(__pyx_v_variable_name);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":4666
 *         cdef FMIL.fmi2_base_type_enu_t            type
 * 
 *         variable_name = encode(variable_name)             # <<<<<<<<<<<<<<
 *         cdef char* variablename = variable_name
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_variable_name);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_variable_name);
  __Pyx_GIVEREF(__pyx_v_variable_name);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_v_variable_name);
  __pyx_v_variable_name = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":4667
 * 
 *         variable_name = encode(variable_name)
 *         cdef char* variablename = variable_name             # <<<<<<<<<<<<<<
 * 
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 */
  __pyx_t_4 = PyBytes_AsString(__pyx_v_variable_name); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_variablename = __pyx_t_4;

  /* "pyfmi\fmi.pyx":4669
 *         cdef char* variablename = variable_name
 * 
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)             # <<<<<<<<<<<<<<
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)
 */
  __pyx_v_variable = fmi2_import_get_variable_by_name(__pyx_v_self->_fmu, __pyx_v_variablename);

  /* "pyfmi\fmi.pyx":4670
 * 
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 */
  __pyx_t_5 = (__pyx_v_variable == NULL);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":4671
 *         variable = FMIL.fmi2_import_get_variable_by_name(self._fmu, variablename)
 *         if variable == NULL:
 *             raise FMUException("The variable %s could not be found."%variablename)             # <<<<<<<<<<<<<<
 * 
 *         type = FMIL.fmi2_import_get_variable_base_type(variable)
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyBytes_FromString(__pyx_v_variablename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_81), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
    __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 = 4671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4673
 *             raise FMUException("The variable %s could not be found."%variablename)
 * 
 *         type = FMIL.fmi2_import_get_variable_base_type(variable)             # <<<<<<<<<<<<<<
 * 
 *         if type == FMIL.fmi2_base_type_real:
 */
  __pyx_v_type = fmi2_import_get_variable_base_type(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":4675
 *         type = FMIL.fmi2_import_get_variable_base_type(variable)
 * 
 *         if type == FMIL.fmi2_base_type_real:             # <<<<<<<<<<<<<<
 *             real_variable = FMIL.fmi2_import_get_variable_as_real(variable)
 *             return FMIL.fmi2_import_get_real_variable_min(real_variable)
 */
  __pyx_t_5 = (__pyx_v_type == fmi2_base_type_real);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":4676
 * 
 *         if type == FMIL.fmi2_base_type_real:
 *             real_variable = FMIL.fmi2_import_get_variable_as_real(variable)             # <<<<<<<<<<<<<<
 *             return FMIL.fmi2_import_get_real_variable_min(real_variable)
 * 
 */
    __pyx_v_real_variable = fmi2_import_get_variable_as_real(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":4677
 *         if type == FMIL.fmi2_base_type_real:
 *             real_variable = FMIL.fmi2_import_get_variable_as_real(variable)
 *             return FMIL.fmi2_import_get_real_variable_min(real_variable)             # <<<<<<<<<<<<<<
 * 
 *         elif type == FMIL.fmi2_base_type_int:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyFloat_FromDouble(fmi2_import_get_real_variable_min(__pyx_v_real_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }

  /* "pyfmi\fmi.pyx":4679
 *             return FMIL.fmi2_import_get_real_variable_min(real_variable)
 * 
 *         elif type == FMIL.fmi2_base_type_int:             # <<<<<<<<<<<<<<
 *             int_variable = FMIL.fmi2_import_get_variable_as_integer(variable)
 *             return FMIL.fmi2_import_get_integer_variable_min(int_variable)
 */
  __pyx_t_5 = (__pyx_v_type == fmi2_base_type_int);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":4680
 * 
 *         elif type == FMIL.fmi2_base_type_int:
 *             int_variable = FMIL.fmi2_import_get_variable_as_integer(variable)             # <<<<<<<<<<<<<<
 *             return FMIL.fmi2_import_get_integer_variable_min(int_variable)
 * 
 */
    __pyx_v_int_variable = fmi2_import_get_variable_as_integer(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":4681
 *         elif type == FMIL.fmi2_base_type_int:
 *             int_variable = FMIL.fmi2_import_get_variable_as_integer(variable)
 *             return FMIL.fmi2_import_get_integer_variable_min(int_variable)             # <<<<<<<<<<<<<<
 * 
 *         elif type == FMIL.fmi2_base_type_enum:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyInt_FromLong(fmi2_import_get_integer_variable_min(__pyx_v_int_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }

  /* "pyfmi\fmi.pyx":4683
 *             return FMIL.fmi2_import_get_integer_variable_min(int_variable)
 * 
 *         elif type == FMIL.fmi2_base_type_enum:             # <<<<<<<<<<<<<<
 *             enum_variable = FMIL.fmi2_import_get_variable_as_enum(variable)
 *             return FMIL.fmi2_import_get_enum_variable_min(enum_variable)
 */
  __pyx_t_5 = (__pyx_v_type == fmi2_base_type_enum);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":4684
 * 
 *         elif type == FMIL.fmi2_base_type_enum:
 *             enum_variable = FMIL.fmi2_import_get_variable_as_enum(variable)             # <<<<<<<<<<<<<<
 *             return FMIL.fmi2_import_get_enum_variable_min(enum_variable)
 * 
 */
    __pyx_v_enum_variable = fmi2_import_get_variable_as_enum(__pyx_v_variable);

    /* "pyfmi\fmi.pyx":4685
 *         elif type == FMIL.fmi2_base_type_enum:
 *             enum_variable = FMIL.fmi2_import_get_variable_as_enum(variable)
 *             return FMIL.fmi2_import_get_enum_variable_min(enum_variable)             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyInt_FromLong(fmi2_import_get_enum_variable_min(__pyx_v_enum_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":4688
 * 
 *         else:
 *             raise FMUException("The variable type does not have a minimum value.")             # <<<<<<<<<<<<<<
 * 
 *     def get_fmu_state(self, FMUState2 state = None):
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_274), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L4:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_min", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_77get_variable_min(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_76get_variable_min[] = "\n        Returns the minimum value for the given variable.\n\n        Parameters::\n\n            variable_name --\n                The name of the variable.\n\n        Returns::\n\n            The minimum value for the variable.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_77get_variable_min(PyObject *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_min (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_76get_variable_min(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_variable_name));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4647
 *             raise FMUException("The variable type does not have a maximum value.")
 * 
 *     cpdef get_variable_min(self, variable_name):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the minimum value for the given variable.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_76get_variable_min(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_variable_name) {
  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("get_variable_min", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_variable_min(__pyx_v_self, __pyx_v_variable_name, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_variable_min", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_79get_fmu_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_78get_fmu_state[] = "\n        Creates a copy of the recent FMU-state and returns\n        a pointer to this state which later can be used to\n        set the FMU to this state.\n        \n        Parameters::\n        \n            state --\n                Optionally a pointer to an already allocated FMU state\n        \n        Returns::\n\n            A pointer to a copy of the recent FMU state.\n\n        Example::\n\n            FMU_state = model.get_fmu_state()\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_79get_fmu_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_5pyfmi_3fmi_FMUState2 *__pyx_v_state = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_fmu_state (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__state,0};
    PyObject* values[1] = {0};

    /* "pyfmi\fmi.pyx":4690
 *             raise FMUException("The variable type does not have a minimum value.")
 * 
 *     def get_fmu_state(self, FMUState2 state = None):             # <<<<<<<<<<<<<<
 *         """
 *         Creates a copy of the recent FMU-state and returns
 */
    values[0] = (PyObject *)((struct __pyx_obj_5pyfmi_3fmi_FMUState2 *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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 (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__state);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_fmu_state") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4690; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_state = ((struct __pyx_obj_5pyfmi_3fmi_FMUState2 *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_fmu_state", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4690; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_fmu_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_state), __pyx_ptype_5pyfmi_3fmi_FMUState2, 1, "state", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_78get_fmu_state(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_v_state);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_78get_fmu_state(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, struct __pyx_obj_5pyfmi_3fmi_FMUState2 *__pyx_v_state) {
  int __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_fmu_state", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_state);

  /* "pyfmi\fmi.pyx":4711
 *         cdef int status
 * 
 *         if state is None:             # <<<<<<<<<<<<<<
 *             state = FMUState2()
 * 
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_state) == Py_None);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":4712
 * 
 *         if state is None:
 *             state = FMUState2()             # <<<<<<<<<<<<<<
 * 
 *         if not self._supports_get_set_FMU_state():
 */
    __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUState2)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_v_state));
    __pyx_v_state = ((struct __pyx_obj_5pyfmi_3fmi_FMUState2 *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4714
 *             state = FMUState2()
 * 
 *         if not self._supports_get_set_FMU_state():             # <<<<<<<<<<<<<<
 *             raise FMUException('This FMU does not support get and set FMU-state')
 * 
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_275); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = (!__pyx_t_1);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":4715
 * 
 *         if not self._supports_get_set_FMU_state():
 *             raise FMUException('This FMU does not support get and set FMU-state')             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_get_fmu_state(self._fmu, &(state.fmu_state))
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_277), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":4717
 *             raise FMUException('This FMU does not support get and set FMU-state')
 * 
 *         status = FMIL.fmi2_import_get_fmu_state(self._fmu, &(state.fmu_state))             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi2_import_get_fmu_state(__pyx_v_self->_fmu, (&__pyx_v_state->fmu_state));

  /* "pyfmi\fmi.pyx":4719
 *         status = FMIL.fmi2_import_get_fmu_state(self._fmu, &(state.fmu_state))
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('An error occured while trying to get the FMU-state, see the log for possible more information')
 * 
 */
  __pyx_t_4 = (__pyx_v_status != 0);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":4720
 * 
 *         if status != 0:
 *             raise FMUException('An error occured while trying to get the FMU-state, see the log for possible more information')             # <<<<<<<<<<<<<<
 * 
 *         return state
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_279), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":4722
 *             raise FMUException('An error occured while trying to get the FMU-state, see the log for possible more information')
 * 
 *         return state             # <<<<<<<<<<<<<<
 * 
 *     def set_fmu_state(self, FMUState2 state):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_state));
  __pyx_r = ((PyObject *)__pyx_v_state);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_fmu_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_state);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_81set_fmu_state(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_80set_fmu_state[] = "\n        Set the FMU to a previous saved state.\n\n        Parameter::\n\n            state--\n                A pointer to a FMU-state.\n\n        Example::\n\n            FMU_state = Model.get_fmu_state()\n            Model.set_fmu_state(FMU_state)\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_81set_fmu_state(PyObject *__pyx_v_self, PyObject *__pyx_v_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_fmu_state (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_state), __pyx_ptype_5pyfmi_3fmi_FMUState2, 1, "state", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_80set_fmu_state(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((struct __pyx_obj_5pyfmi_3fmi_FMUState2 *)__pyx_v_state));
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4724
 *         return state
 * 
 *     def set_fmu_state(self, FMUState2 state):             # <<<<<<<<<<<<<<
 *         """
 *         Set the FMU to a previous saved state.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_80set_fmu_state(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, struct __pyx_obj_5pyfmi_3fmi_FMUState2 *__pyx_v_state) {
  int __pyx_v_status;
  fmi2_FMU_state_t __pyx_v_internal_state;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  fmi2_FMU_state_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_fmu_state", 0);

  /* "pyfmi\fmi.pyx":4739
 *         """
 *         cdef int status
 *         cdef FMIL.fmi2_FMU_state_t internal_state = state.fmu_state             # <<<<<<<<<<<<<<
 * 
 *         if not self._supports_get_set_FMU_state():
 */
  __pyx_t_1 = __pyx_v_state->fmu_state;
  __pyx_v_internal_state = __pyx_t_1;

  /* "pyfmi\fmi.pyx":4741
 *         cdef FMIL.fmi2_FMU_state_t internal_state = state.fmu_state
 * 
 *         if not self._supports_get_set_FMU_state():             # <<<<<<<<<<<<<<
 *             raise FMUException('This FMU dos not support get and set FMU-state')
 * 
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_275); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = (!__pyx_t_4);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":4742
 * 
 *         if not self._supports_get_set_FMU_state():
 *             raise FMUException('This FMU dos not support get and set FMU-state')             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_set_fmu_state(self._fmu, internal_state)
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_281), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4744
 *             raise FMUException('This FMU dos not support get and set FMU-state')
 * 
 *         status = FMIL.fmi2_import_set_fmu_state(self._fmu, internal_state)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi2_import_set_fmu_state(__pyx_v_self->_fmu, __pyx_v_internal_state);

  /* "pyfmi\fmi.pyx":4746
 *         status = FMIL.fmi2_import_set_fmu_state(self._fmu, internal_state)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('An error occured while trying to set the FMU-state, see the log for possible more information')
 * 
 */
  __pyx_t_5 = (__pyx_v_status != 0);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":4747
 * 
 *         if status != 0:
 *             raise FMUException('An error occured while trying to set the FMU-state, see the log for possible more information')             # <<<<<<<<<<<<<<
 * 
 *     def free_fmu_state(self, FMUState2 state):
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_283), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.set_fmu_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_83free_fmu_state(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_82free_fmu_state[] = "\n        Free a previously saved FMU-state from the memory.\n\n        Parameters::\n\n            state--\n                A pointer to the FMU-state to be set free.\n\n        Example::\n\n            FMU_state = Model.get_fmu_state()\n            Model.free_fmu_state(FMU_state)\n\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_83free_fmu_state(PyObject *__pyx_v_self, PyObject *__pyx_v_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("free_fmu_state (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_state), __pyx_ptype_5pyfmi_3fmi_FMUState2, 1, "state", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_82free_fmu_state(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((struct __pyx_obj_5pyfmi_3fmi_FMUState2 *)__pyx_v_state));
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4749
 *             raise FMUException('An error occured while trying to set the FMU-state, see the log for possible more information')
 * 
 *     def free_fmu_state(self, FMUState2 state):             # <<<<<<<<<<<<<<
 *         """
 *         Free a previously saved FMU-state from the memory.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_82free_fmu_state(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, struct __pyx_obj_5pyfmi_3fmi_FMUState2 *__pyx_v_state) {
  int __pyx_v_status;
  fmi2_FMU_state_t __pyx_v_internal_state;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  fmi2_FMU_state_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("free_fmu_state", 0);

  /* "pyfmi\fmi.pyx":4765
 *         """
 *         cdef int status
 *         cdef FMIL.fmi2_FMU_state_t internal_state = state.fmu_state             # <<<<<<<<<<<<<<
 * 
 *         if not self._supports_get_set_FMU_state():
 */
  __pyx_t_1 = __pyx_v_state->fmu_state;
  __pyx_v_internal_state = __pyx_t_1;

  /* "pyfmi\fmi.pyx":4767
 *         cdef FMIL.fmi2_FMU_state_t internal_state = state.fmu_state
 * 
 *         if not self._supports_get_set_FMU_state():             # <<<<<<<<<<<<<<
 *             raise FMUException('This FMU does not support get and set FMU-state')
 *         if internal_state == NULL:
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_275); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = (!__pyx_t_4);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":4768
 * 
 *         if not self._supports_get_set_FMU_state():
 *             raise FMUException('This FMU does not support get and set FMU-state')             # <<<<<<<<<<<<<<
 *         if internal_state == NULL:
 *             print("FMU-state does not seem to be allocated.")
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_284), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4769
 *         if not self._supports_get_set_FMU_state():
 *             raise FMUException('This FMU does not support get and set FMU-state')
 *         if internal_state == NULL:             # <<<<<<<<<<<<<<
 *             print("FMU-state does not seem to be allocated.")
 *             return
 */
  __pyx_t_5 = (__pyx_v_internal_state == NULL);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":4770
 *             raise FMUException('This FMU does not support get and set FMU-state')
 *         if internal_state == NULL:
 *             print("FMU-state does not seem to be allocated.")             # <<<<<<<<<<<<<<
 *             return
 * 
 */
    if (__Pyx_PrintOne(0, ((PyObject *)__pyx_kp_s_285)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pyfmi\fmi.pyx":4771
 *         if internal_state == NULL:
 *             print("FMU-state does not seem to be allocated.")
 *             return             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_free_fmu_state(self._fmu, &internal_state)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":4773
 *             return
 * 
 *         status = FMIL.fmi2_import_free_fmu_state(self._fmu, &internal_state)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi2_import_free_fmu_state(__pyx_v_self->_fmu, (&__pyx_v_internal_state));

  /* "pyfmi\fmi.pyx":4775
 *         status = FMIL.fmi2_import_free_fmu_state(self._fmu, &internal_state)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('An error occured while trying to free the FMU-state, see the log for possible more information')
 * 
 */
  __pyx_t_5 = (__pyx_v_status != 0);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":4776
 * 
 *         if status != 0:
 *             raise FMUException('An error occured while trying to free the FMU-state, see the log for possible more information')             # <<<<<<<<<<<<<<
 * 
 *         #Memory has been released
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_287), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":4779
 * 
 *         #Memory has been released
 *         state.fmu_state = NULL             # <<<<<<<<<<<<<<
 * 
 *     cpdef serialize_fmu_state(self, state):
 */
  __pyx_v_state->fmu_state = NULL;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.free_fmu_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4781
 *         state.fmu_state = NULL
 * 
 *     cpdef serialize_fmu_state(self, state):             # <<<<<<<<<<<<<<
 *         """
 *         Serialize the data referenced by the input argument.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_85serialize_fmu_state(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_13FMUModelBase2_serialize_fmu_state(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_state, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __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("serialize_fmu_state", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__serialize_fmu_state); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_85serialize_fmu_state)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_state);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_state);
      __Pyx_GIVEREF(__pyx_v_state);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":4797
 *             serialized_fmu = Model.serialize_fmu_state(FMU_state)
 *         """
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *         cdef int status
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.serialize_fmu_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_85serialize_fmu_state(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_84serialize_fmu_state[] = "\n        Serialize the data referenced by the input argument.\n\n        Parameters::\n\n            state --\n                A FMU-state.\n\n        Returns::\n            A vector with the serialized FMU-state.\n\n        Example::\n            FMU_state = Model.get_fmu_state()\n            serialized_fmu = Model.serialize_fmu_state(FMU_state)\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_85serialize_fmu_state(PyObject *__pyx_v_self, PyObject *__pyx_v_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("serialize_fmu_state (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_84serialize_fmu_state(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_state));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4781
 *         state.fmu_state = NULL
 * 
 *     cpdef serialize_fmu_state(self, state):             # <<<<<<<<<<<<<<
 *         """
 *         Serialize the data referenced by the input argument.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_84serialize_fmu_state(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_state) {
  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("serialize_fmu_state", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self->__pyx_base.__pyx_vtab)->serialize_fmu_state(__pyx_v_self, __pyx_v_state, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.serialize_fmu_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4821
 *         return serialized_fmu
 * 
 *     cpdef deserialize_fmu_state(self, serialized_fmu):             # <<<<<<<<<<<<<<
 *         """
 *         De-serialize the provided byte-vector and returns the corresponding FMU-state.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_87deserialize_fmu_state(PyObject *__pyx_v_self, PyObject *__pyx_v_serialized_fmu); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_13FMUModelBase2_deserialize_fmu_state(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_serialized_fmu, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __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("deserialize_fmu_state", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_288); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_87deserialize_fmu_state)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_serialized_fmu);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_serialized_fmu);
      __Pyx_GIVEREF(__pyx_v_serialized_fmu);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":4840
 *             FMU_state = Model.deserialize_fmu_state(serialized_fmu)
 *         """
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *         cdef int status
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.deserialize_fmu_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_87deserialize_fmu_state(PyObject *__pyx_v_self, PyObject *__pyx_v_serialized_fmu); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_86deserialize_fmu_state[] = "\n        De-serialize the provided byte-vector and returns the corresponding FMU-state.\n\n        Parameters::\n\n            serialized_fmu--\n                A serialized FMU-state.\n\n        Returns::\n\n            A deserialized FMU-state.\n\n        Example::\n\n            FMU_state = Model.get_fmu_state()\n            serialized_fmu = Model.serialize_fmu_state(FMU_state)\n            FMU_state = Model.deserialize_fmu_state(serialized_fmu)\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_87deserialize_fmu_state(PyObject *__pyx_v_self, PyObject *__pyx_v_serialized_fmu) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("deserialize_fmu_state (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_86deserialize_fmu_state(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_serialized_fmu));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4821
 *         return serialized_fmu
 * 
 *     cpdef deserialize_fmu_state(self, serialized_fmu):             # <<<<<<<<<<<<<<
 *         """
 *         De-serialize the provided byte-vector and returns the corresponding FMU-state.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_86deserialize_fmu_state(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_serialized_fmu) {
  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("deserialize_fmu_state", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self->__pyx_base.__pyx_vtab)->deserialize_fmu_state(__pyx_v_self, __pyx_v_serialized_fmu, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.deserialize_fmu_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4854
 *         return state
 * 
 *     cpdef serialized_fmu_state_size(self, state):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the required size of a vector needed to serialize the specified FMU-state
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_89serialized_fmu_state_size(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_13FMUModelBase2_serialized_fmu_state_size(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_state, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __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("serialized_fmu_state_size", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_289); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_89serialized_fmu_state_size)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_state);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_state);
      __Pyx_GIVEREF(__pyx_v_state);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":4867
 *             The size of teh vector.
 *         """
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *         cdef int status
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.serialized_fmu_state_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_89serialized_fmu_state_size(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_88serialized_fmu_state_size[] = "\n        Returns the required size of a vector needed to serialize the specified FMU-state\n\n        Parameters::\n\n            state--\n                A FMU-state\n\n        Returns::\n\n            The size of teh vector.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_89serialized_fmu_state_size(PyObject *__pyx_v_self, PyObject *__pyx_v_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("serialized_fmu_state_size (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_88serialized_fmu_state_size(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_state));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4854
 *         return state
 * 
 *     cpdef serialized_fmu_state_size(self, state):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the required size of a vector needed to serialize the specified FMU-state
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_88serialized_fmu_state_size(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_state) {
  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("serialized_fmu_state_size", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self->__pyx_base.__pyx_vtab)->serialized_fmu_state_size(__pyx_v_self, __pyx_v_state, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.serialized_fmu_state_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_91get_ode_sizes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_90get_ode_sizes[] = "\n        Returns the number of continuous states and the number of event\n        indicators.\n\n        Returns::\n\n            nbr_cont --\n                The number of continuous states.\n\n            nbr_ind --\n                The number of event indicators.\n\n        Example::\n\n            [nCont, nEvent] = model.get_ode_sizes()\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_91get_ode_sizes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_ode_sizes (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_90get_ode_sizes(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4880
 *         return n_bytes
 * 
 *     def get_ode_sizes(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the number of continuous states and the number of event
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_90get_ode_sizes(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __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("get_ode_sizes", 0);

  /* "pyfmi\fmi.pyx":4897
 *             [nCont, nEvent] = model.get_ode_sizes()
 *         """
 *         return self._nContinuousStates, self._nEventIndicators             # <<<<<<<<<<<<<<
 * 
 *     def get_default_experiment_start_time(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_size_t(__pyx_v_self->_nContinuousStates); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_to_py_size_t(__pyx_v_self->_nEventIndicators); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_ode_sizes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_93get_default_experiment_start_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_92get_default_experiment_start_time[] = "\n        Returns the default experiment start time as defined the XML\n        description.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_93get_default_experiment_start_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_default_experiment_start_time (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_92get_default_experiment_start_time(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4899
 *         return self._nContinuousStates, self._nEventIndicators
 * 
 *     def get_default_experiment_start_time(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the default experiment start time as defined the XML
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_92get_default_experiment_start_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__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("get_default_experiment_start_time", 0);

  /* "pyfmi\fmi.pyx":4904
 *         description.
 *         """
 *         return FMIL.fmi2_import_get_default_experiment_start(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *     def get_default_experiment_stop_time(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(fmi2_import_get_default_experiment_start(__pyx_v_self->_fmu)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_default_experiment_start_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_95get_default_experiment_stop_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_94get_default_experiment_stop_time[] = "\n        Returns the default experiment stop time as defined the XML\n        description.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_95get_default_experiment_stop_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_default_experiment_stop_time (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_94get_default_experiment_stop_time(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4906
 *         return FMIL.fmi2_import_get_default_experiment_start(self._fmu)
 * 
 *     def get_default_experiment_stop_time(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the default experiment stop time as defined the XML
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_94get_default_experiment_stop_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__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("get_default_experiment_stop_time", 0);

  /* "pyfmi\fmi.pyx":4911
 *         description.
 *         """
 *         return FMIL.fmi2_import_get_default_experiment_stop(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *     def get_default_experiment_tolerance(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(fmi2_import_get_default_experiment_stop(__pyx_v_self->_fmu)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_default_experiment_stop_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_97get_default_experiment_tolerance(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_96get_default_experiment_tolerance[] = "\n        Returns the default experiment tolerance as defined in the XML\n        description.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_97get_default_experiment_tolerance(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_default_experiment_tolerance (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_96get_default_experiment_tolerance(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4913
 *         return FMIL.fmi2_import_get_default_experiment_stop(self._fmu)
 * 
 *     def get_default_experiment_tolerance(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the default experiment tolerance as defined in the XML
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_96get_default_experiment_tolerance(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__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("get_default_experiment_tolerance", 0);

  /* "pyfmi\fmi.pyx":4918
 *         description.
 *         """
 *         return FMIL.fmi2_import_get_default_experiment_tolerance(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *     def get_default_experiment_step(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(fmi2_import_get_default_experiment_tolerance(__pyx_v_self->_fmu)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_default_experiment_tolerance", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_99get_default_experiment_step(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_98get_default_experiment_step[] = "\n        Returns the default experiment step as defined in the XML\n        description.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_99get_default_experiment_step(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_default_experiment_step (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_98get_default_experiment_step(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4920
 *         return FMIL.fmi2_import_get_default_experiment_tolerance(self._fmu)
 * 
 *     def get_default_experiment_step(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the default experiment step as defined in the XML
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_98get_default_experiment_step(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__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("get_default_experiment_step", 0);

  /* "pyfmi\fmi.pyx":4925
 *         description.
 *         """
 *         return FMIL.fmi2_import_get_default_experiment_step(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *     cdef _add_scalar_variables(self, FMIL.fmi2_import_variable_list_t*   variable_list):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(fmi2_import_get_default_experiment_step(__pyx_v_self->_fmu)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_default_experiment_step", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4927
 *         return FMIL.fmi2_import_get_default_experiment_step(self._fmu)
 * 
 *     cdef _add_scalar_variables(self, FMIL.fmi2_import_variable_list_t*   variable_list):             # <<<<<<<<<<<<<<
 *         """
 *         Helper method to create scalar variables from a variable list.
 */

static PyObject *__pyx_f_5pyfmi_3fmi_13FMUModelBase2__add_scalar_variables(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, fmi2_import_variable_list_t *__pyx_v_variable_list) {
  size_t __pyx_v_variable_list_size;
  PyObject *__pyx_v_variable_dict = NULL;
  size_t __pyx_v_i;
  fmi2_import_variable_t *__pyx_v_variable;
  PyObject *__pyx_v_scalar_variable = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_add_scalar_variables", 0);

  /* "pyfmi\fmi.pyx":4932
 *         """
 *         cdef FMIL.size_t             variable_list_size
 *         variable_dict = OrderedDict()             # <<<<<<<<<<<<<<
 * 
 *         variable_list_size = FMIL.fmi2_import_get_variable_list_size(variable_list)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__OrderedDict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4932; __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 = 4932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_variable_dict = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":4934
 *         variable_dict = OrderedDict()
 * 
 *         variable_list_size = FMIL.fmi2_import_get_variable_list_size(variable_list)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(variable_list_size):
 */
  __pyx_v_variable_list_size = fmi2_import_get_variable_list_size(__pyx_v_variable_list);

  /* "pyfmi\fmi.pyx":4936
 *         variable_list_size = FMIL.fmi2_import_get_variable_list_size(variable_list)
 * 
 *         for i in range(variable_list_size):             # <<<<<<<<<<<<<<
 * 
 *             variable = FMIL.fmi2_import_get_variable(variable_list, i)
 */
  __pyx_t_3 = __pyx_v_variable_list_size;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "pyfmi\fmi.pyx":4938
 *         for i in range(variable_list_size):
 * 
 *             variable = FMIL.fmi2_import_get_variable(variable_list, i)             # <<<<<<<<<<<<<<
 *             scalar_variable = self._add_scalar_variable(variable)
 *             variable_dict[scalar_variable.name] = scalar_variable
 */
    __pyx_v_variable = fmi2_import_get_variable(__pyx_v_variable_list, __pyx_v_i);

    /* "pyfmi\fmi.pyx":4939
 * 
 *             variable = FMIL.fmi2_import_get_variable(variable_list, i)
 *             scalar_variable = self._add_scalar_variable(variable)             # <<<<<<<<<<<<<<
 *             variable_dict[scalar_variable.name] = scalar_variable
 * 
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self->__pyx_base.__pyx_vtab)->_add_scalar_variable(__pyx_v_self, __pyx_v_variable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_v_scalar_variable);
    __pyx_v_scalar_variable = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyfmi\fmi.pyx":4940
 *             variable = FMIL.fmi2_import_get_variable(variable_list, i)
 *             scalar_variable = self._add_scalar_variable(variable)
 *             variable_dict[scalar_variable.name] = scalar_variable             # <<<<<<<<<<<<<<
 * 
 *         return variable_dict
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_scalar_variable, __pyx_n_s__name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (PyObject_SetItem(__pyx_v_variable_dict, __pyx_t_2, __pyx_v_scalar_variable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "pyfmi\fmi.pyx":4942
 *             variable_dict[scalar_variable.name] = scalar_variable
 * 
 *         return variable_dict             # <<<<<<<<<<<<<<
 * 
 *     cdef _add_scalar_variable(self, FMIL.fmi2_import_variable_t* variable):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_variable_dict);
  __pyx_r = __pyx_v_variable_dict;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2._add_scalar_variables", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_dict);
  __Pyx_XDECREF(__pyx_v_scalar_variable);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4944
 *         return variable_dict
 * 
 *     cdef _add_scalar_variable(self, FMIL.fmi2_import_variable_t* variable):             # <<<<<<<<<<<<<<
 * 
 *         if variable == NULL:
 */

static PyObject *__pyx_f_5pyfmi_3fmi_13FMUModelBase2__add_scalar_variable(CYTHON_UNUSED struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, fmi2_import_variable_t *__pyx_v_variable) {
  PyObject *__pyx_v_alias_kind = NULL;
  PyObject *__pyx_v_name = NULL;
  fmi2_value_reference_t __pyx_v_value_ref;
  PyObject *__pyx_v_data_type = NULL;
  PyObject *__pyx_v_data_variability = NULL;
  PyObject *__pyx_v_data_causality = NULL;
  char *__pyx_v_desc;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_add_scalar_variable", 0);

  /* "pyfmi\fmi.pyx":4946
 *     cdef _add_scalar_variable(self, FMIL.fmi2_import_variable_t* variable):
 * 
 *         if variable == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("Unknown variable. Please verify the correctness of the XML file and check the log.")
 * 
 */
  __pyx_t_1 = (__pyx_v_variable == NULL);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":4947
 * 
 *         if variable == NULL:
 *             raise FMUException("Unknown variable. Please verify the correctness of the XML file and check the log.")             # <<<<<<<<<<<<<<
 * 
 *         alias_kind       = FMIL.fmi2_import_get_variable_alias_kind(variable)
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_291), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4949
 *             raise FMUException("Unknown variable. Please verify the correctness of the XML file and check the log.")
 * 
 *         alias_kind       = FMIL.fmi2_import_get_variable_alias_kind(variable)             # <<<<<<<<<<<<<<
 *         name             = decode(FMIL.fmi2_import_get_variable_name(variable))
 *         value_ref        = FMIL.fmi2_import_get_variable_vr(variable)
 */
  __pyx_t_3 = PyInt_FromLong(fmi2_import_get_variable_alias_kind(__pyx_v_variable)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_alias_kind = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":4950
 * 
 *         alias_kind       = FMIL.fmi2_import_get_variable_alias_kind(variable)
 *         name             = decode(FMIL.fmi2_import_get_variable_name(variable))             # <<<<<<<<<<<<<<
 *         value_ref        = FMIL.fmi2_import_get_variable_vr(variable)
 *         data_type        = FMIL.fmi2_import_get_variable_base_type(variable)
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyBytes_FromString(fmi2_import_get_variable_name(__pyx_v_variable)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_v_name = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":4951
 *         alias_kind       = FMIL.fmi2_import_get_variable_alias_kind(variable)
 *         name             = decode(FMIL.fmi2_import_get_variable_name(variable))
 *         value_ref        = FMIL.fmi2_import_get_variable_vr(variable)             # <<<<<<<<<<<<<<
 *         data_type        = FMIL.fmi2_import_get_variable_base_type(variable)
 *         data_variability = FMIL.fmi2_import_get_variability(variable)
 */
  __pyx_v_value_ref = fmi2_import_get_variable_vr(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":4952
 *         name             = decode(FMIL.fmi2_import_get_variable_name(variable))
 *         value_ref        = FMIL.fmi2_import_get_variable_vr(variable)
 *         data_type        = FMIL.fmi2_import_get_variable_base_type(variable)             # <<<<<<<<<<<<<<
 *         data_variability = FMIL.fmi2_import_get_variability(variable)
 *         data_causality   = FMIL.fmi2_import_get_causality(variable)
 */
  __pyx_t_2 = PyInt_FromLong(fmi2_import_get_variable_base_type(__pyx_v_variable)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_data_type = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":4953
 *         value_ref        = FMIL.fmi2_import_get_variable_vr(variable)
 *         data_type        = FMIL.fmi2_import_get_variable_base_type(variable)
 *         data_variability = FMIL.fmi2_import_get_variability(variable)             # <<<<<<<<<<<<<<
 *         data_causality   = FMIL.fmi2_import_get_causality(variable)
 *         desc             = FMIL.fmi2_import_get_variable_description(variable)
 */
  __pyx_t_2 = PyInt_FromLong(fmi2_import_get_variability(__pyx_v_variable)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_data_variability = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":4954
 *         data_type        = FMIL.fmi2_import_get_variable_base_type(variable)
 *         data_variability = FMIL.fmi2_import_get_variability(variable)
 *         data_causality   = FMIL.fmi2_import_get_causality(variable)             # <<<<<<<<<<<<<<
 *         desc             = FMIL.fmi2_import_get_variable_description(variable)
 * 
 */
  __pyx_t_2 = PyInt_FromLong(fmi2_import_get_causality(__pyx_v_variable)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_data_causality = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":4955
 *         data_variability = FMIL.fmi2_import_get_variability(variable)
 *         data_causality   = FMIL.fmi2_import_get_causality(variable)
 *         desc             = FMIL.fmi2_import_get_variable_description(variable)             # <<<<<<<<<<<<<<
 * 
 *         return ScalarVariable2(name, value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",
 */
  __pyx_v_desc = fmi2_import_get_variable_description(__pyx_v_variable);

  /* "pyfmi\fmi.pyx":4957
 *         desc             = FMIL.fmi2_import_get_variable_description(variable)
 * 
 *         return ScalarVariable2(name, value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",             # <<<<<<<<<<<<<<
 *                                     data_variability, data_causality,
 *                                     alias_kind)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_value_ref); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if ((__pyx_v_desc != NULL)) {
    __pyx_t_3 = ((PyObject *)__Pyx_decode_c_string(__pyx_v_desc, 0, strlen(__pyx_v_desc), NULL, NULL, PyUnicode_DecodeUTF8)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_12));
    __pyx_t_4 = ((PyObject *)__pyx_kp_s_12);
  }

  /* "pyfmi\fmi.pyx":4959
 *         return ScalarVariable2(name, value_ref, data_type, desc.decode('UTF-8') if desc!=NULL else "",
 *                                     data_variability, data_causality,
 *                                     alias_kind)             # <<<<<<<<<<<<<<
 * 
 *     def get_derivatives_list(self):
 */
  __pyx_t_3 = PyTuple_New(7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_name);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_data_type);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_data_type);
  __Pyx_GIVEREF(__pyx_v_data_type);
  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_data_variability);
  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_data_variability);
  __Pyx_GIVEREF(__pyx_v_data_variability);
  __Pyx_INCREF(__pyx_v_data_causality);
  PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_v_data_causality);
  __Pyx_GIVEREF(__pyx_v_data_causality);
  __Pyx_INCREF(__pyx_v_alias_kind);
  PyTuple_SET_ITEM(__pyx_t_3, 6, __pyx_v_alias_kind);
  __Pyx_GIVEREF(__pyx_v_alias_kind);
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_ScalarVariable2)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2._add_scalar_variable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_alias_kind);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_data_type);
  __Pyx_XDECREF(__pyx_v_data_variability);
  __Pyx_XDECREF(__pyx_v_data_causality);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_101get_derivatives_list(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_100get_derivatives_list[] = "\n        Returns a dictionary with the states derivatives.\n\n        Returns::\n\n            An ordered dictionary with the derivative variables.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_101get_derivatives_list(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_derivatives_list (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_100get_derivatives_list(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4961
 *                                     alias_kind)
 * 
 *     def get_derivatives_list(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a dictionary with the states derivatives.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_100get_derivatives_list(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  fmi2_import_variable_list_t *__pyx_v_variable_list;
  PyObject *__pyx_v_variable_dict = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  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("get_derivatives_list", 0);

  /* "pyfmi\fmi.pyx":4971
 *         cdef FMIL.fmi2_import_variable_list_t*   variable_list
 * 
 *         variable_list = FMIL.fmi2_import_get_derivatives_list(self._fmu)             # <<<<<<<<<<<<<<
 *         if variable_list == NULL:
 *             raise FMUException("The returned states list is NULL.")
 */
  __pyx_v_variable_list = fmi2_import_get_derivatives_list(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":4972
 * 
 *         variable_list = FMIL.fmi2_import_get_derivatives_list(self._fmu)
 *         if variable_list == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The returned states list is NULL.")
 * 
 */
  __pyx_t_1 = (__pyx_v_variable_list == NULL);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":4973
 *         variable_list = FMIL.fmi2_import_get_derivatives_list(self._fmu)
 *         if variable_list == NULL:
 *             raise FMUException("The returned states list is NULL.")             # <<<<<<<<<<<<<<
 * 
 *         variable_dict = self._add_scalar_variables(variable_list)
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_293), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4975
 *             raise FMUException("The returned states list is NULL.")
 * 
 *         variable_dict = self._add_scalar_variables(variable_list)             # <<<<<<<<<<<<<<
 * 
 *         #Free the variable list
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self->__pyx_base.__pyx_vtab)->_add_scalar_variables(__pyx_v_self, __pyx_v_variable_list); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_variable_dict = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":4978
 * 
 *         #Free the variable list
 *         FMIL.fmi2_import_free_variable_list(variable_list)             # <<<<<<<<<<<<<<
 * 
 *         return variable_dict
 */
  fmi2_import_free_variable_list(__pyx_v_variable_list);

  /* "pyfmi\fmi.pyx":4980
 *         FMIL.fmi2_import_free_variable_list(variable_list)
 * 
 *         return variable_dict             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_output_dependencies(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_variable_dict);
  __pyx_r = __pyx_v_variable_dict;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_derivatives_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4982
 *         return variable_dict
 * 
 *     cpdef get_output_dependencies(self):             # <<<<<<<<<<<<<<
 *         """
 *         Retrieve the list of variables that the outputs are
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_103get_output_dependencies(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_output_dependencies(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, int __pyx_skip_dispatch) {
  size_t *__pyx_v_dependencyp;
  size_t *__pyx_v_start_indexp;
  char *__pyx_v_factor_kindp;
  fmi2_import_variable_t *__pyx_v_variable;
  fmi2_import_variable_list_t *__pyx_v_variable_list;
  PyObject *__pyx_v_outputs = NULL;
  PyObject *__pyx_v_states_list = NULL;
  PyObject *__pyx_v_inputs_list = NULL;
  PyObject *__pyx_v_states = NULL;
  PyObject *__pyx_v_inputs = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_j = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_output_dependencies", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_294); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_103get_output_dependencies)) {
      __Pyx_XDECREF(__pyx_r);
      __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 = 4982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":4988
 *         one with the inputs.
 *         """
 *         if (self._outputs_states_dependencies is not None and             # <<<<<<<<<<<<<<
 *             self._outputs_inputs_dependencies is not None):
 *                return self._outputs_states_dependencies, self._outputs_inputs_dependencies
 */
  __pyx_t_3 = (__pyx_v_self->_outputs_states_dependencies != Py_None);
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":4989
 *         """
 *         if (self._outputs_states_dependencies is not None and
 *             self._outputs_inputs_dependencies is not None):             # <<<<<<<<<<<<<<
 *                return self._outputs_states_dependencies, self._outputs_inputs_dependencies
 * 
 */
    __pyx_t_4 = (__pyx_v_self->_outputs_inputs_dependencies != Py_None);
    __pyx_t_5 = __pyx_t_4;
  } else {
    __pyx_t_5 = __pyx_t_3;
  }
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":4990
 *         if (self._outputs_states_dependencies is not None and
 *             self._outputs_inputs_dependencies is not None):
 *                return self._outputs_states_dependencies, self._outputs_inputs_dependencies             # <<<<<<<<<<<<<<
 * 
 *         cdef size_t *dependencyp
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_self->_outputs_states_dependencies);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->_outputs_states_dependencies);
    __Pyx_GIVEREF(__pyx_v_self->_outputs_states_dependencies);
    __Pyx_INCREF(__pyx_v_self->_outputs_inputs_dependencies);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->_outputs_inputs_dependencies);
    __Pyx_GIVEREF(__pyx_v_self->_outputs_inputs_dependencies);
    __pyx_r = ((PyObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":4996
 *         cdef char   *factor_kindp
 *         cdef FMIL.fmi2_import_variable_t *variable
 *         cdef FMIL.fmi2_import_variable_list_t *variable_list = FMIL.fmi2_import_get_variable_list(self._fmu, 0)             # <<<<<<<<<<<<<<
 * 
 *         if python3_flag:
 */
  __pyx_v_variable_list = fmi2_import_get_variable_list(__pyx_v_self->_fmu, 0);

  /* "pyfmi\fmi.pyx":4998
 *         cdef FMIL.fmi2_import_variable_list_t *variable_list = FMIL.fmi2_import_get_variable_list(self._fmu, 0)
 * 
 *         if python3_flag:             # <<<<<<<<<<<<<<
 *             outputs = list(self.get_output_list().keys())
 *         else:
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__python3_flag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":4999
 * 
 *         if python3_flag:
 *             outputs = list(self.get_output_list().keys())             # <<<<<<<<<<<<<<
 *         else:
 *             outputs = self.get_output_list().keys()
 */
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_output_list); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4999; __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 = 4999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__keys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __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 = 4999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_v_outputs = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":5001
 *             outputs = list(self.get_output_list().keys())
 *         else:
 *             outputs = self.get_output_list().keys()             # <<<<<<<<<<<<<<
 *         states_list = self.get_states_list()
 *         inputs_list = self.get_input_list()
 */
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_output_list); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5001; __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 = 5001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__keys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_outputs = __pyx_t_1;
    __pyx_t_1 = 0;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":5002
 *         else:
 *             outputs = self.get_output_list().keys()
 *         states_list = self.get_states_list()             # <<<<<<<<<<<<<<
 *         inputs_list = self.get_input_list()
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_states_list); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5002; __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 = 5002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_states_list = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":5003
 *             outputs = self.get_output_list().keys()
 *         states_list = self.get_states_list()
 *         inputs_list = self.get_input_list()             # <<<<<<<<<<<<<<
 * 
 *         states = OrderedDict()
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_input_list); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5003; __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 = 5003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_inputs_list = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5005
 *         inputs_list = self.get_input_list()
 * 
 *         states = OrderedDict()             # <<<<<<<<<<<<<<
 *         inputs = OrderedDict()
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__OrderedDict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5005; __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 = 5005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_states = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":5006
 * 
 *         states = OrderedDict()
 *         inputs = OrderedDict()             # <<<<<<<<<<<<<<
 * 
 *         if len(outputs) != 0: #If there are no outputs, return empty dicts
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__OrderedDict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5006; __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 = 5006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_inputs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5008
 *         inputs = OrderedDict()
 * 
 *         if len(outputs) != 0: #If there are no outputs, return empty dicts             # <<<<<<<<<<<<<<
 * 
 *             FMIL.fmi2_import_get_outputs_dependencies(self._fmu, &start_indexp, &dependencyp, &factor_kindp)
 */
  __pyx_t_6 = PyObject_Length(__pyx_v_outputs); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = (__pyx_t_6 != 0);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":5010
 *         if len(outputs) != 0: #If there are no outputs, return empty dicts
 * 
 *             FMIL.fmi2_import_get_outputs_dependencies(self._fmu, &start_indexp, &dependencyp, &factor_kindp)             # <<<<<<<<<<<<<<
 * 
 *             if start_indexp == NULL:
 */
    fmi2_import_get_outputs_dependencies(__pyx_v_self->_fmu, (&__pyx_v_start_indexp), (&__pyx_v_dependencyp), (&__pyx_v_factor_kindp));

    /* "pyfmi\fmi.pyx":5012
 *             FMIL.fmi2_import_get_outputs_dependencies(self._fmu, &start_indexp, &dependencyp, &factor_kindp)
 * 
 *             if start_indexp == NULL:             # <<<<<<<<<<<<<<
 *                 logging.warning(
 *                         'No dependency information for the outputs was found in the model description.' \
 */
    __pyx_t_5 = (__pyx_v_start_indexp == NULL);
    if (__pyx_t_5) {

      /* "pyfmi\fmi.pyx":5013
 * 
 *             if start_indexp == NULL:
 *                 logging.warning(             # <<<<<<<<<<<<<<
 *                         'No dependency information for the outputs was found in the model description.' \
 *                         ' Assuming complete dependency.')
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logging); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__warning); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_296), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "pyfmi\fmi.pyx":5016
 *                         'No dependency information for the outputs was found in the model description.' \
 *                         ' Assuming complete dependency.')
 *                 for i in range(0,len(outputs)):             # <<<<<<<<<<<<<<
 *                         states[outputs[i]]  = states_list.keys()
 *                         inputs[outputs[i]]  = inputs_list.keys()
 */
      __pyx_t_6 = PyObject_Length(__pyx_v_outputs); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5016; __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 = 5016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
        __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
        __pyx_t_7 = NULL;
      } else {
        __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      for (;;) {
        if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_2)) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_2)) {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        } else {
          __pyx_t_1 = __pyx_t_7(__pyx_t_2);
          if (unlikely(!__pyx_t_1)) {
            if (PyErr_Occurred()) {
              if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_XDECREF(__pyx_v_i);
        __pyx_v_i = __pyx_t_1;
        __pyx_t_1 = 0;

        /* "pyfmi\fmi.pyx":5017
 *                         ' Assuming complete dependency.')
 *                 for i in range(0,len(outputs)):
 *                         states[outputs[i]]  = states_list.keys()             # <<<<<<<<<<<<<<
 *                         inputs[outputs[i]]  = inputs_list.keys()
 *             else:
 */
        __pyx_t_1 = PyObject_GetAttr(__pyx_v_states_list, __pyx_n_s__keys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyObject_GetItem(__pyx_v_outputs, __pyx_v_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        if (PyObject_SetItem(__pyx_v_states, __pyx_t_1, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "pyfmi\fmi.pyx":5018
 *                 for i in range(0,len(outputs)):
 *                         states[outputs[i]]  = states_list.keys()
 *                         inputs[outputs[i]]  = inputs_list.keys()             # <<<<<<<<<<<<<<
 *             else:
 *                 for i in range(0,len(outputs)):
 */
        __pyx_t_8 = PyObject_GetAttr(__pyx_v_inputs_list, __pyx_n_s__keys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyObject_GetItem(__pyx_v_outputs, __pyx_v_i); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        if (PyObject_SetItem(__pyx_v_inputs, __pyx_t_8, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L6;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":5020
 *                         inputs[outputs[i]]  = inputs_list.keys()
 *             else:
 *                 for i in range(0,len(outputs)):             # <<<<<<<<<<<<<<
 *                     states[outputs[i]]  = []
 *                     inputs[outputs[i]] = []
 */
      __pyx_t_6 = PyObject_Length(__pyx_v_outputs); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
        __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
        __pyx_t_7 = NULL;
      } else {
        __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      for (;;) {
        if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_1)) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_1)) {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        } else {
          __pyx_t_2 = __pyx_t_7(__pyx_t_1);
          if (unlikely(!__pyx_t_2)) {
            if (PyErr_Occurred()) {
              if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_XDECREF(__pyx_v_i);
        __pyx_v_i = __pyx_t_2;
        __pyx_t_2 = 0;

        /* "pyfmi\fmi.pyx":5021
 *             else:
 *                 for i in range(0,len(outputs)):
 *                     states[outputs[i]]  = []             # <<<<<<<<<<<<<<
 *                     inputs[outputs[i]] = []
 * 
 */
        __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_8 = PyObject_GetItem(__pyx_v_outputs, __pyx_v_i); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        if (PyObject_SetItem(__pyx_v_states, __pyx_t_8, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

        /* "pyfmi\fmi.pyx":5022
 *                 for i in range(0,len(outputs)):
 *                     states[outputs[i]]  = []
 *                     inputs[outputs[i]] = []             # <<<<<<<<<<<<<<
 * 
 *                     for j in range(0, start_indexp[i+1]-start_indexp[i]):
 */
        __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_8 = PyObject_GetItem(__pyx_v_outputs, __pyx_v_i); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        if (PyObject_SetItem(__pyx_v_inputs, __pyx_t_8, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

        /* "pyfmi\fmi.pyx":5024
 *                     inputs[outputs[i]] = []
 * 
 *                     for j in range(0, start_indexp[i+1]-start_indexp[i]):             # <<<<<<<<<<<<<<
 *                         if dependencyp[start_indexp[i]+j] != 0:
 *                             variable = FMIL.fmi2_import_get_variable(variable_list, dependencyp[start_indexp[i]+j]-1)
 */
        __pyx_t_2 = PyNumber_Add(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_2 = __Pyx_PyInt_FromSize_t(((__pyx_v_start_indexp[__pyx_t_9]) - (__pyx_v_start_indexp[__pyx_t_10]))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_2 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
        if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
          __pyx_t_8 = __pyx_t_2; __Pyx_INCREF(__pyx_t_8); __pyx_t_10 = 0;
          __pyx_t_11 = NULL;
        } else {
          __pyx_t_10 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_11 = Py_TYPE(__pyx_t_8)->tp_iternext;
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        for (;;) {
          if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_8)) {
            if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_8)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_2 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #else
            __pyx_t_2 = PySequence_ITEM(__pyx_t_8, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #endif
          } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_8)) {
            if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #else
            __pyx_t_2 = PySequence_ITEM(__pyx_t_8, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #endif
          } else {
            __pyx_t_2 = __pyx_t_11(__pyx_t_8);
            if (unlikely(!__pyx_t_2)) {
              if (PyErr_Occurred()) {
                if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
                else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_2);
          }
          __Pyx_XDECREF(__pyx_v_j);
          __pyx_v_j = __pyx_t_2;
          __pyx_t_2 = 0;

          /* "pyfmi\fmi.pyx":5025
 * 
 *                     for j in range(0, start_indexp[i+1]-start_indexp[i]):
 *                         if dependencyp[start_indexp[i]+j] != 0:             # <<<<<<<<<<<<<<
 *                             variable = FMIL.fmi2_import_get_variable(variable_list, dependencyp[start_indexp[i]+j]-1)
 *                             name             = decode(FMIL.fmi2_import_get_variable_name(variable))
 */
          __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_t_2 = __Pyx_PyInt_FromSize_t((__pyx_v_start_indexp[__pyx_t_9])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_12 = PyNumber_Add(__pyx_t_2, __pyx_v_j); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_12); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_5 = ((__pyx_v_dependencyp[__pyx_t_9]) != 0);
          if (__pyx_t_5) {

            /* "pyfmi\fmi.pyx":5026
 *                     for j in range(0, start_indexp[i+1]-start_indexp[i]):
 *                         if dependencyp[start_indexp[i]+j] != 0:
 *                             variable = FMIL.fmi2_import_get_variable(variable_list, dependencyp[start_indexp[i]+j]-1)             # <<<<<<<<<<<<<<
 *                             name             = decode(FMIL.fmi2_import_get_variable_name(variable))
 * 
 */
            __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __pyx_t_12 = __Pyx_PyInt_FromSize_t((__pyx_v_start_indexp[__pyx_t_9])); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_12);
            __pyx_t_2 = PyNumber_Add(__pyx_t_12, __pyx_v_j); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_v_variable = fmi2_import_get_variable(__pyx_v_variable_list, ((__pyx_v_dependencyp[__pyx_t_9]) - 1));

            /* "pyfmi\fmi.pyx":5027
 *                         if dependencyp[start_indexp[i]+j] != 0:
 *                             variable = FMIL.fmi2_import_get_variable(variable_list, dependencyp[start_indexp[i]+j]-1)
 *                             name             = decode(FMIL.fmi2_import_get_variable_name(variable))             # <<<<<<<<<<<<<<
 * 
 *                             if name in states_list:
 */
            __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_12 = PyBytes_FromString(fmi2_import_get_variable_name(__pyx_v_variable)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(((PyObject *)__pyx_t_12));
            __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_13);
            PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)__pyx_t_12));
            __Pyx_GIVEREF(((PyObject *)__pyx_t_12));
            __pyx_t_12 = 0;
            __pyx_t_12 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
            __Pyx_XDECREF(__pyx_v_name);
            __pyx_v_name = __pyx_t_12;
            __pyx_t_12 = 0;

            /* "pyfmi\fmi.pyx":5029
 *                             name             = decode(FMIL.fmi2_import_get_variable_name(variable))
 * 
 *                             if name in states_list:             # <<<<<<<<<<<<<<
 *                                 states[outputs[i]].append(name)
 *                             elif name in inputs_list:
 */
            __pyx_t_5 = (__Pyx_PySequence_Contains(__pyx_v_name, __pyx_v_states_list, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            if (__pyx_t_5) {

              /* "pyfmi\fmi.pyx":5030
 * 
 *                             if name in states_list:
 *                                 states[outputs[i]].append(name)             # <<<<<<<<<<<<<<
 *                             elif name in inputs_list:
 *                                 inputs[outputs[i]].append(name)
 */
              __pyx_t_12 = PyObject_GetItem(__pyx_v_outputs, __pyx_v_i); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_12);
              __pyx_t_13 = PyObject_GetItem(__pyx_v_states, __pyx_t_12); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
              __pyx_t_12 = __Pyx_PyObject_Append(__pyx_t_13, __pyx_v_name); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
              goto __pyx_L14;
            }

            /* "pyfmi\fmi.pyx":5031
 *                             if name in states_list:
 *                                 states[outputs[i]].append(name)
 *                             elif name in inputs_list:             # <<<<<<<<<<<<<<
 *                                 inputs[outputs[i]].append(name)
 * 
 */
            __pyx_t_5 = (__Pyx_PySequence_Contains(__pyx_v_name, __pyx_v_inputs_list, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            if (__pyx_t_5) {

              /* "pyfmi\fmi.pyx":5032
 *                                 states[outputs[i]].append(name)
 *                             elif name in inputs_list:
 *                                 inputs[outputs[i]].append(name)             # <<<<<<<<<<<<<<
 * 
 *         #Caching
 */
              __pyx_t_12 = PyObject_GetItem(__pyx_v_outputs, __pyx_v_i); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_12);
              __pyx_t_13 = PyObject_GetItem(__pyx_v_inputs, __pyx_t_12); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
              __pyx_t_12 = __Pyx_PyObject_Append(__pyx_t_13, __pyx_v_name); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
              goto __pyx_L14;
            }
            __pyx_L14:;
            goto __pyx_L13;
          }
          __pyx_L13:;
        }
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_L6:;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":5035
 * 
 *         #Caching
 *         self._outputs_states_dependencies = states             # <<<<<<<<<<<<<<
 *         self._outputs_inputs_dependencies = inputs
 * 
 */
  __Pyx_INCREF(__pyx_v_states);
  __Pyx_GIVEREF(__pyx_v_states);
  __Pyx_GOTREF(__pyx_v_self->_outputs_states_dependencies);
  __Pyx_DECREF(__pyx_v_self->_outputs_states_dependencies);
  __pyx_v_self->_outputs_states_dependencies = __pyx_v_states;

  /* "pyfmi\fmi.pyx":5036
 *         #Caching
 *         self._outputs_states_dependencies = states
 *         self._outputs_inputs_dependencies = inputs             # <<<<<<<<<<<<<<
 * 
 *         return states, inputs
 */
  __Pyx_INCREF(__pyx_v_inputs);
  __Pyx_GIVEREF(__pyx_v_inputs);
  __Pyx_GOTREF(__pyx_v_self->_outputs_inputs_dependencies);
  __Pyx_DECREF(__pyx_v_self->_outputs_inputs_dependencies);
  __pyx_v_self->_outputs_inputs_dependencies = __pyx_v_inputs;

  /* "pyfmi\fmi.pyx":5038
 *         self._outputs_inputs_dependencies = inputs
 * 
 *         return states, inputs             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_derivatives_dependencies(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_states);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_states);
  __Pyx_GIVEREF(__pyx_v_states);
  __Pyx_INCREF(__pyx_v_inputs);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_inputs);
  __Pyx_GIVEREF(__pyx_v_inputs);
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_output_dependencies", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_outputs);
  __Pyx_XDECREF(__pyx_v_states_list);
  __Pyx_XDECREF(__pyx_v_inputs_list);
  __Pyx_XDECREF(__pyx_v_states);
  __Pyx_XDECREF(__pyx_v_inputs);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_j);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_103get_output_dependencies(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_102get_output_dependencies[] = "\n        Retrieve the list of variables that the outputs are \n        dependent on. Returns two dictionaries, one with the states and \n        one with the inputs.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_103get_output_dependencies(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_output_dependencies (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_102get_output_dependencies(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":4982
 *         return variable_dict
 * 
 *     cpdef get_output_dependencies(self):             # <<<<<<<<<<<<<<
 *         """
 *         Retrieve the list of variables that the outputs are
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_102get_output_dependencies(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__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("get_output_dependencies", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_output_dependencies(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_output_dependencies", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5040
 *         return states, inputs
 * 
 *     cpdef get_derivatives_dependencies(self):             # <<<<<<<<<<<<<<
 *         """
 *         Retrieve the list of variables that the derivatives are
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_105get_derivatives_dependencies(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_derivatives_dependencies(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, int __pyx_skip_dispatch) {
  size_t *__pyx_v_dependencyp;
  size_t *__pyx_v_start_indexp;
  char *__pyx_v_factor_kindp;
  fmi2_import_variable_t *__pyx_v_variable;
  fmi2_import_variable_list_t *__pyx_v_variable_list;
  PyObject *__pyx_v_derivatives = NULL;
  PyObject *__pyx_v_states_list = NULL;
  PyObject *__pyx_v_inputs_list = NULL;
  PyObject *__pyx_v_states = NULL;
  PyObject *__pyx_v_inputs = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_j = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_derivatives_dependencies", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_297); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_105get_derivatives_dependencies)) {
      __Pyx_XDECREF(__pyx_r);
      __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 = 5040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":5046
 *         and one with the inputs.
 *         """
 *         if (self._derivatives_states_dependencies is not None and             # <<<<<<<<<<<<<<
 *             self._derivatives_inputs_dependencies is not None):
 *                return self._derivatives_states_dependencies, self._derivatives_inputs_dependencies
 */
  __pyx_t_3 = (__pyx_v_self->_derivatives_states_dependencies != Py_None);
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":5047
 *         """
 *         if (self._derivatives_states_dependencies is not None and
 *             self._derivatives_inputs_dependencies is not None):             # <<<<<<<<<<<<<<
 *                return self._derivatives_states_dependencies, self._derivatives_inputs_dependencies
 * 
 */
    __pyx_t_4 = (__pyx_v_self->_derivatives_inputs_dependencies != Py_None);
    __pyx_t_5 = __pyx_t_4;
  } else {
    __pyx_t_5 = __pyx_t_3;
  }
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":5048
 *         if (self._derivatives_states_dependencies is not None and
 *             self._derivatives_inputs_dependencies is not None):
 *                return self._derivatives_states_dependencies, self._derivatives_inputs_dependencies             # <<<<<<<<<<<<<<
 * 
 *         cdef size_t *dependencyp
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_self->_derivatives_states_dependencies);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->_derivatives_states_dependencies);
    __Pyx_GIVEREF(__pyx_v_self->_derivatives_states_dependencies);
    __Pyx_INCREF(__pyx_v_self->_derivatives_inputs_dependencies);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->_derivatives_inputs_dependencies);
    __Pyx_GIVEREF(__pyx_v_self->_derivatives_inputs_dependencies);
    __pyx_r = ((PyObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5054
 *         cdef char   *factor_kindp
 *         cdef FMIL.fmi2_import_variable_t *variable
 *         cdef FMIL.fmi2_import_variable_list_t *variable_list = FMIL.fmi2_import_get_variable_list(self._fmu, 0)             # <<<<<<<<<<<<<<
 * 
 *         if python3_flag:
 */
  __pyx_v_variable_list = fmi2_import_get_variable_list(__pyx_v_self->_fmu, 0);

  /* "pyfmi\fmi.pyx":5056
 *         cdef FMIL.fmi2_import_variable_list_t *variable_list = FMIL.fmi2_import_get_variable_list(self._fmu, 0)
 * 
 *         if python3_flag:             # <<<<<<<<<<<<<<
 *             derivatives = list(self.get_derivatives_list().keys())
 *         else:
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__python3_flag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":5057
 * 
 *         if python3_flag:
 *             derivatives = list(self.get_derivatives_list().keys())             # <<<<<<<<<<<<<<
 *         else:
 *             derivatives = self.get_derivatives_list().keys()
 */
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_298); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5057; __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 = 5057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__keys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __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 = 5057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_v_derivatives = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":5059
 *             derivatives = list(self.get_derivatives_list().keys())
 *         else:
 *             derivatives = self.get_derivatives_list().keys()             # <<<<<<<<<<<<<<
 *         states_list = self.get_states_list()
 *         inputs_list = self.get_input_list()
 */
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_298); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5059; __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 = 5059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__keys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_derivatives = __pyx_t_1;
    __pyx_t_1 = 0;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":5060
 *         else:
 *             derivatives = self.get_derivatives_list().keys()
 *         states_list = self.get_states_list()             # <<<<<<<<<<<<<<
 *         inputs_list = self.get_input_list()
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_states_list); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5060; __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 = 5060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_states_list = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":5061
 *             derivatives = self.get_derivatives_list().keys()
 *         states_list = self.get_states_list()
 *         inputs_list = self.get_input_list()             # <<<<<<<<<<<<<<
 * 
 *         states = OrderedDict()
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_input_list); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5061; __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 = 5061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_inputs_list = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5063
 *         inputs_list = self.get_input_list()
 * 
 *         states = OrderedDict()             # <<<<<<<<<<<<<<
 *         inputs = OrderedDict()
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__OrderedDict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5063; __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 = 5063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_states = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":5064
 * 
 *         states = OrderedDict()
 *         inputs = OrderedDict()             # <<<<<<<<<<<<<<
 * 
 *         if len(derivatives) != 0:
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__OrderedDict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5064; __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 = 5064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_inputs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5066
 *         inputs = OrderedDict()
 * 
 *         if len(derivatives) != 0:             # <<<<<<<<<<<<<<
 *             FMIL.fmi2_import_get_derivatives_dependencies(self._fmu, &start_indexp, &dependencyp, &factor_kindp)
 * 
 */
  __pyx_t_6 = PyObject_Length(__pyx_v_derivatives); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = (__pyx_t_6 != 0);
  if (__pyx_t_5) {

    /* "pyfmi\fmi.pyx":5067
 * 
 *         if len(derivatives) != 0:
 *             FMIL.fmi2_import_get_derivatives_dependencies(self._fmu, &start_indexp, &dependencyp, &factor_kindp)             # <<<<<<<<<<<<<<
 * 
 *             if start_indexp == NULL:
 */
    fmi2_import_get_derivatives_dependencies(__pyx_v_self->_fmu, (&__pyx_v_start_indexp), (&__pyx_v_dependencyp), (&__pyx_v_factor_kindp));

    /* "pyfmi\fmi.pyx":5069
 *             FMIL.fmi2_import_get_derivatives_dependencies(self._fmu, &start_indexp, &dependencyp, &factor_kindp)
 * 
 *             if start_indexp == NULL:             # <<<<<<<<<<<<<<
 *                 logging.warning(
 *                     'No dependency information for the derivatives was found in the model description.' \
 */
    __pyx_t_5 = (__pyx_v_start_indexp == NULL);
    if (__pyx_t_5) {

      /* "pyfmi\fmi.pyx":5070
 * 
 *             if start_indexp == NULL:
 *                 logging.warning(             # <<<<<<<<<<<<<<
 *                     'No dependency information for the derivatives was found in the model description.' \
 *                     ' Assuming complete dependency.')
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logging); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__warning); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_300), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "pyfmi\fmi.pyx":5073
 *                     'No dependency information for the derivatives was found in the model description.' \
 *                     ' Assuming complete dependency.')
 *                 for i in range(0,len(derivatives)):             # <<<<<<<<<<<<<<
 *                     states[derivatives[i]]  = states_list.keys()
 *                     inputs[derivatives[i]]  = inputs_list.keys()
 */
      __pyx_t_6 = PyObject_Length(__pyx_v_derivatives); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5073; __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 = 5073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
        __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
        __pyx_t_7 = NULL;
      } else {
        __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      for (;;) {
        if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_2)) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_2)) {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        } else {
          __pyx_t_1 = __pyx_t_7(__pyx_t_2);
          if (unlikely(!__pyx_t_1)) {
            if (PyErr_Occurred()) {
              if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_XDECREF(__pyx_v_i);
        __pyx_v_i = __pyx_t_1;
        __pyx_t_1 = 0;

        /* "pyfmi\fmi.pyx":5074
 *                     ' Assuming complete dependency.')
 *                 for i in range(0,len(derivatives)):
 *                     states[derivatives[i]]  = states_list.keys()             # <<<<<<<<<<<<<<
 *                     inputs[derivatives[i]]  = inputs_list.keys()
 *             else:
 */
        __pyx_t_1 = PyObject_GetAttr(__pyx_v_states_list, __pyx_n_s__keys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyObject_GetItem(__pyx_v_derivatives, __pyx_v_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        if (PyObject_SetItem(__pyx_v_states, __pyx_t_1, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "pyfmi\fmi.pyx":5075
 *                 for i in range(0,len(derivatives)):
 *                     states[derivatives[i]]  = states_list.keys()
 *                     inputs[derivatives[i]]  = inputs_list.keys()             # <<<<<<<<<<<<<<
 *             else:
 *                 for i in range(0,len(derivatives)):
 */
        __pyx_t_8 = PyObject_GetAttr(__pyx_v_inputs_list, __pyx_n_s__keys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyObject_GetItem(__pyx_v_derivatives, __pyx_v_i); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        if (PyObject_SetItem(__pyx_v_inputs, __pyx_t_8, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L6;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":5077
 *                     inputs[derivatives[i]]  = inputs_list.keys()
 *             else:
 *                 for i in range(0,len(derivatives)):             # <<<<<<<<<<<<<<
 *                     states[derivatives[i]]  = []
 *                     inputs[derivatives[i]] = []
 */
      __pyx_t_6 = PyObject_Length(__pyx_v_derivatives); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
        __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
        __pyx_t_7 = NULL;
      } else {
        __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      for (;;) {
        if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_1)) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_1)) {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        } else {
          __pyx_t_2 = __pyx_t_7(__pyx_t_1);
          if (unlikely(!__pyx_t_2)) {
            if (PyErr_Occurred()) {
              if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_XDECREF(__pyx_v_i);
        __pyx_v_i = __pyx_t_2;
        __pyx_t_2 = 0;

        /* "pyfmi\fmi.pyx":5078
 *             else:
 *                 for i in range(0,len(derivatives)):
 *                     states[derivatives[i]]  = []             # <<<<<<<<<<<<<<
 *                     inputs[derivatives[i]] = []
 * 
 */
        __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_8 = PyObject_GetItem(__pyx_v_derivatives, __pyx_v_i); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        if (PyObject_SetItem(__pyx_v_states, __pyx_t_8, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

        /* "pyfmi\fmi.pyx":5079
 *                 for i in range(0,len(derivatives)):
 *                     states[derivatives[i]]  = []
 *                     inputs[derivatives[i]] = []             # <<<<<<<<<<<<<<
 * 
 *                     for j in range(0, start_indexp[i+1]-start_indexp[i]):
 */
        __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_8 = PyObject_GetItem(__pyx_v_derivatives, __pyx_v_i); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        if (PyObject_SetItem(__pyx_v_inputs, __pyx_t_8, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

        /* "pyfmi\fmi.pyx":5081
 *                     inputs[derivatives[i]] = []
 * 
 *                     for j in range(0, start_indexp[i+1]-start_indexp[i]):             # <<<<<<<<<<<<<<
 *                         if dependencyp[start_indexp[i]+j] != 0:
 *                             variable = FMIL.fmi2_import_get_variable(variable_list, dependencyp[start_indexp[i]+j]-1)
 */
        __pyx_t_2 = PyNumber_Add(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_2 = __Pyx_PyInt_FromSize_t(((__pyx_v_start_indexp[__pyx_t_9]) - (__pyx_v_start_indexp[__pyx_t_10]))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_2 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
        if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
          __pyx_t_8 = __pyx_t_2; __Pyx_INCREF(__pyx_t_8); __pyx_t_10 = 0;
          __pyx_t_11 = NULL;
        } else {
          __pyx_t_10 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_11 = Py_TYPE(__pyx_t_8)->tp_iternext;
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        for (;;) {
          if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_8)) {
            if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_8)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_2 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #else
            __pyx_t_2 = PySequence_ITEM(__pyx_t_8, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #endif
          } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_8)) {
            if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #else
            __pyx_t_2 = PySequence_ITEM(__pyx_t_8, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #endif
          } else {
            __pyx_t_2 = __pyx_t_11(__pyx_t_8);
            if (unlikely(!__pyx_t_2)) {
              if (PyErr_Occurred()) {
                if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
                else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_2);
          }
          __Pyx_XDECREF(__pyx_v_j);
          __pyx_v_j = __pyx_t_2;
          __pyx_t_2 = 0;

          /* "pyfmi\fmi.pyx":5082
 * 
 *                     for j in range(0, start_indexp[i+1]-start_indexp[i]):
 *                         if dependencyp[start_indexp[i]+j] != 0:             # <<<<<<<<<<<<<<
 *                             variable = FMIL.fmi2_import_get_variable(variable_list, dependencyp[start_indexp[i]+j]-1)
 *                             name             = decode(FMIL.fmi2_import_get_variable_name(variable))
 */
          __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_t_2 = __Pyx_PyInt_FromSize_t((__pyx_v_start_indexp[__pyx_t_9])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_12 = PyNumber_Add(__pyx_t_2, __pyx_v_j); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_12); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_5 = ((__pyx_v_dependencyp[__pyx_t_9]) != 0);
          if (__pyx_t_5) {

            /* "pyfmi\fmi.pyx":5083
 *                     for j in range(0, start_indexp[i+1]-start_indexp[i]):
 *                         if dependencyp[start_indexp[i]+j] != 0:
 *                             variable = FMIL.fmi2_import_get_variable(variable_list, dependencyp[start_indexp[i]+j]-1)             # <<<<<<<<<<<<<<
 *                             name             = decode(FMIL.fmi2_import_get_variable_name(variable))
 * 
 */
            __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __pyx_t_12 = __Pyx_PyInt_FromSize_t((__pyx_v_start_indexp[__pyx_t_9])); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_12);
            __pyx_t_2 = PyNumber_Add(__pyx_t_12, __pyx_v_j); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_v_variable = fmi2_import_get_variable(__pyx_v_variable_list, ((__pyx_v_dependencyp[__pyx_t_9]) - 1));

            /* "pyfmi\fmi.pyx":5084
 *                         if dependencyp[start_indexp[i]+j] != 0:
 *                             variable = FMIL.fmi2_import_get_variable(variable_list, dependencyp[start_indexp[i]+j]-1)
 *                             name             = decode(FMIL.fmi2_import_get_variable_name(variable))             # <<<<<<<<<<<<<<
 * 
 *                             if name in states_list:
 */
            __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_12 = PyBytes_FromString(fmi2_import_get_variable_name(__pyx_v_variable)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(((PyObject *)__pyx_t_12));
            __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_13);
            PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)__pyx_t_12));
            __Pyx_GIVEREF(((PyObject *)__pyx_t_12));
            __pyx_t_12 = 0;
            __pyx_t_12 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
            __Pyx_XDECREF(__pyx_v_name);
            __pyx_v_name = __pyx_t_12;
            __pyx_t_12 = 0;

            /* "pyfmi\fmi.pyx":5086
 *                             name             = decode(FMIL.fmi2_import_get_variable_name(variable))
 * 
 *                             if name in states_list:             # <<<<<<<<<<<<<<
 *                                 states[derivatives[i]].append(name)
 *                             elif name in inputs_list:
 */
            __pyx_t_5 = (__Pyx_PySequence_Contains(__pyx_v_name, __pyx_v_states_list, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            if (__pyx_t_5) {

              /* "pyfmi\fmi.pyx":5087
 * 
 *                             if name in states_list:
 *                                 states[derivatives[i]].append(name)             # <<<<<<<<<<<<<<
 *                             elif name in inputs_list:
 *                                 inputs[derivatives[i]].append(name)
 */
              __pyx_t_12 = PyObject_GetItem(__pyx_v_derivatives, __pyx_v_i); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_12);
              __pyx_t_13 = PyObject_GetItem(__pyx_v_states, __pyx_t_12); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
              __pyx_t_12 = __Pyx_PyObject_Append(__pyx_t_13, __pyx_v_name); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
              goto __pyx_L14;
            }

            /* "pyfmi\fmi.pyx":5088
 *                             if name in states_list:
 *                                 states[derivatives[i]].append(name)
 *                             elif name in inputs_list:             # <<<<<<<<<<<<<<
 *                                 inputs[derivatives[i]].append(name)
 * 
 */
            __pyx_t_5 = (__Pyx_PySequence_Contains(__pyx_v_name, __pyx_v_inputs_list, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            if (__pyx_t_5) {

              /* "pyfmi\fmi.pyx":5089
 *                                 states[derivatives[i]].append(name)
 *                             elif name in inputs_list:
 *                                 inputs[derivatives[i]].append(name)             # <<<<<<<<<<<<<<
 * 
 *         #Caching
 */
              __pyx_t_12 = PyObject_GetItem(__pyx_v_derivatives, __pyx_v_i); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_12);
              __pyx_t_13 = PyObject_GetItem(__pyx_v_inputs, __pyx_t_12); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
              __pyx_t_12 = __Pyx_PyObject_Append(__pyx_t_13, __pyx_v_name); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
              goto __pyx_L14;
            }
            __pyx_L14:;
            goto __pyx_L13;
          }
          __pyx_L13:;
        }
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_L6:;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":5092
 * 
 *         #Caching
 *         self._derivatives_states_dependencies = states             # <<<<<<<<<<<<<<
 *         self._derivatives_inputs_dependencies = inputs
 * 
 */
  __Pyx_INCREF(__pyx_v_states);
  __Pyx_GIVEREF(__pyx_v_states);
  __Pyx_GOTREF(__pyx_v_self->_derivatives_states_dependencies);
  __Pyx_DECREF(__pyx_v_self->_derivatives_states_dependencies);
  __pyx_v_self->_derivatives_states_dependencies = __pyx_v_states;

  /* "pyfmi\fmi.pyx":5093
 *         #Caching
 *         self._derivatives_states_dependencies = states
 *         self._derivatives_inputs_dependencies = inputs             # <<<<<<<<<<<<<<
 * 
 *         return states, inputs
 */
  __Pyx_INCREF(__pyx_v_inputs);
  __Pyx_GIVEREF(__pyx_v_inputs);
  __Pyx_GOTREF(__pyx_v_self->_derivatives_inputs_dependencies);
  __Pyx_DECREF(__pyx_v_self->_derivatives_inputs_dependencies);
  __pyx_v_self->_derivatives_inputs_dependencies = __pyx_v_inputs;

  /* "pyfmi\fmi.pyx":5095
 *         self._derivatives_inputs_dependencies = inputs
 * 
 *         return states, inputs             # <<<<<<<<<<<<<<
 * 
 *     def _get_directional_proxy(self, var_ref, func_ref, group, add_diag=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_states);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_states);
  __Pyx_GIVEREF(__pyx_v_states);
  __Pyx_INCREF(__pyx_v_inputs);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_inputs);
  __Pyx_GIVEREF(__pyx_v_inputs);
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_derivatives_dependencies", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_derivatives);
  __Pyx_XDECREF(__pyx_v_states_list);
  __Pyx_XDECREF(__pyx_v_inputs_list);
  __Pyx_XDECREF(__pyx_v_states);
  __Pyx_XDECREF(__pyx_v_inputs);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_j);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_105get_derivatives_dependencies(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_104get_derivatives_dependencies[] = "\n        Retrieve the list of variables that the derivatives are \n        dependent on. Returns two dictionaries, one with the states \n        and one with the inputs.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_105get_derivatives_dependencies(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_derivatives_dependencies (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_104get_derivatives_dependencies(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5040
 *         return states, inputs
 * 
 *     cpdef get_derivatives_dependencies(self):             # <<<<<<<<<<<<<<
 *         """
 *         Retrieve the list of variables that the derivatives are
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_104get_derivatives_dependencies(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__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("get_derivatives_dependencies", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_derivatives_dependencies(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_derivatives_dependencies", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_107_get_directional_proxy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_107_get_directional_proxy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_var_ref = 0;
  PyObject *__pyx_v_func_ref = 0;
  PyObject *__pyx_v_group = 0;
  PyObject *__pyx_v_add_diag = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_directional_proxy (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__var_ref,&__pyx_n_s__func_ref,&__pyx_n_s__group,&__pyx_n_s__add_diag,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k_301;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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__var_ref)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__func_ref)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_get_directional_proxy", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5097; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__group)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_get_directional_proxy", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5097; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__add_diag);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_get_directional_proxy") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5097; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_var_ref = values[0];
    __pyx_v_func_ref = values[1];
    __pyx_v_group = values[2];
    __pyx_v_add_diag = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_get_directional_proxy", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5097; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2._get_directional_proxy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_106_get_directional_proxy(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_v_var_ref, __pyx_v_func_ref, __pyx_v_group, __pyx_v_add_diag);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5097
 *         return states, inputs
 * 
 *     def _get_directional_proxy(self, var_ref, func_ref, group, add_diag=False):             # <<<<<<<<<<<<<<
 *         cdef list data = []
 *         cdef list row = []
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_106_get_directional_proxy(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_var_ref, PyObject *__pyx_v_func_ref, PyObject *__pyx_v_group, PyObject *__pyx_v_add_diag) {
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_v_row = 0;
  PyObject *__pyx_v_col = 0;
  PyObject *__pyx_v_dim = NULL;
  PyObject *__pyx_v_v = NULL;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_directional_proxy", 0);

  /* "pyfmi\fmi.pyx":5098
 * 
 *     def _get_directional_proxy(self, var_ref, func_ref, group, add_diag=False):
 *         cdef list data = []             # <<<<<<<<<<<<<<
 *         cdef list row = []
 *         cdef list col = []
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_data = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5099
 *     def _get_directional_proxy(self, var_ref, func_ref, group, add_diag=False):
 *         cdef list data = []
 *         cdef list row = []             # <<<<<<<<<<<<<<
 *         cdef list col = []
 * 
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_row = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5100
 *         cdef list data = []
 *         cdef list row = []
 *         cdef list col = []             # <<<<<<<<<<<<<<
 * 
 *         if add_diag:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_col = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5102
 *         cdef list col = []
 * 
 *         if add_diag:             # <<<<<<<<<<<<<<
 *             dim = min(len(var_ref),len(func_ref))
 *             data.extend([0.0]*dim)
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_add_diag); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":5103
 * 
 *         if add_diag:
 *             dim = min(len(var_ref),len(func_ref))             # <<<<<<<<<<<<<<
 *             data.extend([0.0]*dim)
 *             row.extend(range(dim))
 */
    __pyx_t_3 = PyObject_Length(__pyx_v_func_ref); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = PyObject_Length(__pyx_v_var_ref); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if ((__pyx_t_3 < __pyx_t_4)) {
      __pyx_t_5 = __pyx_t_3;
    } else {
      __pyx_t_5 = __pyx_t_4;
    }
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_dim = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pyfmi\fmi.pyx":5104
 *         if add_diag:
 *             dim = min(len(var_ref),len(func_ref))
 *             data.extend([0.0]*dim)             # <<<<<<<<<<<<<<
 *             row.extend(range(dim))
 *             col.extend(range(dim))
 */
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_data), __pyx_n_s__extend); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_7, __pyx_v_dim); if (unlikely(!__pyx_temp)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_temp);
      __Pyx_DECREF(__pyx_t_7);
      __pyx_t_7 = __pyx_temp;
    }
    __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_7));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
    __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "pyfmi\fmi.pyx":5105
 *             dim = min(len(var_ref),len(func_ref))
 *             data.extend([0.0]*dim)
 *             row.extend(range(dim))             # <<<<<<<<<<<<<<
 *             col.extend(range(dim))
 * 
 */
    __pyx_t_7 = PyObject_GetAttr(((PyObject *)__pyx_v_row), __pyx_n_s__extend); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_dim);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_dim);
    __Pyx_GIVEREF(__pyx_v_dim);
    __pyx_t_1 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyfmi\fmi.pyx":5106
 *             data.extend([0.0]*dim)
 *             row.extend(range(dim))
 *             col.extend(range(dim))             # <<<<<<<<<<<<<<
 * 
 *         v = N.zeros(len(var_ref))
 */
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_col), __pyx_n_s__extend); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_dim);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_dim);
    __Pyx_GIVEREF(__pyx_v_dim);
    __pyx_t_7 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5108
 *             col.extend(range(dim))
 * 
 *         v = N.zeros(len(var_ref))             # <<<<<<<<<<<<<<
 *         for key in group.keys():
 *             v[group[key][0]] = 1.0
 */
  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__zeros); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_5 = PyObject_Length(__pyx_v_var_ref); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  __pyx_t_7 = 0;
  __pyx_t_7 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_v_v = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "pyfmi\fmi.pyx":5109
 * 
 *         v = N.zeros(len(var_ref))
 *         for key in group.keys():             # <<<<<<<<<<<<<<
 *             v[group[key][0]] = 1.0
 * 
 */
  __pyx_t_7 = PyObject_GetAttr(__pyx_v_group, __pyx_n_s__keys); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_1 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_7 = __pyx_t_1; __Pyx_INCREF(__pyx_t_7); __pyx_t_5 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_7)) {
      if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_7)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_7)) {
      if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_8(__pyx_t_7);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF(__pyx_v_key);
    __pyx_v_key = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pyfmi\fmi.pyx":5110
 *         v = N.zeros(len(var_ref))
 *         for key in group.keys():
 *             v[group[key][0]] = 1.0             # <<<<<<<<<<<<<<
 * 
 *             data.extend(self.get_directional_derivative(var_ref, func_ref, v)[group[key][2]])
 */
    __pyx_t_1 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyObject_GetItem(__pyx_v_group, __pyx_v_key); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (PyObject_SetItem(__pyx_v_v, __pyx_t_9, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyfmi\fmi.pyx":5112
 *             v[group[key][0]] = 1.0
 * 
 *             data.extend(self.get_directional_derivative(var_ref, func_ref, v)[group[key][2]])             # <<<<<<<<<<<<<<
 *             row.extend(group[key][2])
 *             col.extend(group[key][3])
 */
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_data), __pyx_n_s__extend); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_302); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_var_ref);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_var_ref);
    __Pyx_GIVEREF(__pyx_v_var_ref);
    __Pyx_INCREF(__pyx_v_func_ref);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_func_ref);
    __Pyx_GIVEREF(__pyx_v_func_ref);
    __Pyx_INCREF(__pyx_v_v);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_v);
    __Pyx_GIVEREF(__pyx_v_v);
    __pyx_t_10 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_GetItem(__pyx_v_group, __pyx_v_key); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_6, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_GetItem(__pyx_t_10, __pyx_t_9); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyfmi\fmi.pyx":5113
 * 
 *             data.extend(self.get_directional_derivative(var_ref, func_ref, v)[group[key][2]])
 *             row.extend(group[key][2])             # <<<<<<<<<<<<<<
 *             col.extend(group[key][3])
 * 
 */
    __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_row), __pyx_n_s__extend); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_9 = PyObject_GetItem(__pyx_v_group, __pyx_v_key); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_9, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyfmi\fmi.pyx":5114
 *             data.extend(self.get_directional_derivative(var_ref, func_ref, v)[group[key][2]])
 *             row.extend(group[key][2])
 *             col.extend(group[key][3])             # <<<<<<<<<<<<<<
 * 
 *             v[group[key][0]] = 0.0
 */
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_col), __pyx_n_s__extend); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = PyObject_GetItem(__pyx_v_group, __pyx_v_key); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_9, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyfmi\fmi.pyx":5116
 *             col.extend(group[key][3])
 * 
 *             v[group[key][0]] = 0.0             # <<<<<<<<<<<<<<
 * 
 *         if len(data) == 0:
 */
    __pyx_t_6 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_9 = PyObject_GetItem(__pyx_v_group, __pyx_v_key); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_9, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (PyObject_SetItem(__pyx_v_v, __pyx_t_1, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "pyfmi\fmi.pyx":5118
 *             v[group[key][0]] = 0.0
 * 
 *         if len(data) == 0:             # <<<<<<<<<<<<<<
 *             return sp.csc_matrix((len(func_ref),len(var_ref)))
 *         else:
 */
  __pyx_t_5 = PyList_GET_SIZE(((PyObject *)__pyx_v_data)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (__pyx_t_5 == 0);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":5119
 * 
 *         if len(data) == 0:
 *             return sp.csc_matrix((len(func_ref),len(var_ref)))             # <<<<<<<<<<<<<<
 *         else:
 *             return sp.csc_matrix((data, (row, col)), (len(func_ref),len(var_ref)))
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__sp); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__csc_matrix); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_5 = PyObject_Length(__pyx_v_func_ref); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = PyObject_Length(__pyx_v_var_ref); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_7 = 0;
    __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_9));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
    __pyx_t_9 = 0;
    __pyx_t_9 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_9;
    __pyx_t_9 = 0;
    goto __pyx_L0;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":5121
 *             return sp.csc_matrix((len(func_ref),len(var_ref)))
 *         else:
 *             return sp.csc_matrix((data, (row, col)), (len(func_ref),len(var_ref)))             # <<<<<<<<<<<<<<
 * 
 *     def _get_A(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__sp); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__csc_matrix); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_INCREF(((PyObject *)__pyx_v_row));
    PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_row));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_row));
    __Pyx_INCREF(((PyObject *)__pyx_v_col));
    PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_v_col));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_col));
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(((PyObject *)__pyx_v_data));
    PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_data));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_data));
    PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_t_9));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
    __pyx_t_9 = 0;
    __pyx_t_5 = PyObject_Length(__pyx_v_func_ref); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_5 = PyObject_Length(__pyx_v_var_ref); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_9 = 0;
    __pyx_t_7 = 0;
    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_t_6));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
    PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_t_10));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_10));
    __pyx_t_6 = 0;
    __pyx_t_10 = 0;
    __pyx_t_10 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __pyx_r = __pyx_t_10;
    __pyx_t_10 = 0;
    goto __pyx_L0;
  }
  __pyx_L6:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2._get_directional_proxy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XDECREF(__pyx_v_col);
  __Pyx_XDECREF(__pyx_v_dim);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_109_get_A(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_109_get_A(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_A (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_108_get_A(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5123
 *             return sp.csc_matrix((data, (row, col)), (len(func_ref),len(var_ref)))
 * 
 *     def _get_A(self):             # <<<<<<<<<<<<<<
 *         if self._A is None:
 *             [derv_state_dep, derv_input_dep] = self.get_derivatives_dependencies()
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_108_get_A(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  PyObject *__pyx_v_derv_state_dep = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_derv_input_dep = NULL;
  PyObject *__pyx_v_states = NULL;
  PyObject *__pyx_v_derivatives = NULL;
  PyObject *__pyx_v_A = NULL;
  PyObject *__pyx_v_s = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_A", 0);

  /* "pyfmi\fmi.pyx":5124
 * 
 *     def _get_A(self):
 *         if self._A is None:             # <<<<<<<<<<<<<<
 *             [derv_state_dep, derv_input_dep] = self.get_derivatives_dependencies()
 *             if python3_flag:
 */
  __pyx_t_1 = (__pyx_v_self->_A == Py_None);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5125
 *     def _get_A(self):
 *         if self._A is None:
 *             [derv_state_dep, derv_input_dep] = self.get_derivatives_dependencies()             # <<<<<<<<<<<<<<
 *             if python3_flag:
 *                 self._group_A = cpr_seed(derv_state_dep, list(self.get_states_list().keys()))
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_derivatives_dependencies(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      #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[0]; __pyx_lineno = 5125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    {
      Py_ssize_t index = -1;
      __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __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_L4_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_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = NULL;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L5_unpacking_done;
      __pyx_L4_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[0]; __pyx_lineno = 5125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L5_unpacking_done:;
    }
    __pyx_v_derv_state_dep = __pyx_t_3;
    __pyx_t_3 = 0;
    __pyx_v_derv_input_dep = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "pyfmi\fmi.pyx":5126
 *         if self._A is None:
 *             [derv_state_dep, derv_input_dep] = self.get_derivatives_dependencies()
 *             if python3_flag:             # <<<<<<<<<<<<<<
 *                 self._group_A = cpr_seed(derv_state_dep, list(self.get_states_list().keys()))
 *             else:
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__python3_flag); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "pyfmi\fmi.pyx":5127
 *             [derv_state_dep, derv_input_dep] = self.get_derivatives_dependencies()
 *             if python3_flag:
 *                 self._group_A = cpr_seed(derv_state_dep, list(self.get_states_list().keys()))             # <<<<<<<<<<<<<<
 *             else:
 *                 self._group_A = cpr_seed(derv_state_dep, self.get_states_list().keys())
 */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__cpr_seed); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_states_list); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__keys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_derv_state_dep);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_derv_state_dep);
      __Pyx_GIVEREF(__pyx_v_derv_state_dep);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5127; __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_4)); __pyx_t_4 = 0;
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->_group_A);
      __Pyx_DECREF(__pyx_v_self->_group_A);
      __pyx_v_self->_group_A = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L6;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":5129
 *                 self._group_A = cpr_seed(derv_state_dep, list(self.get_states_list().keys()))
 *             else:
 *                 self._group_A = cpr_seed(derv_state_dep, self.get_states_list().keys())             # <<<<<<<<<<<<<<
 *         if self._states_references is None:
 *             states                       = self.get_states_list()
 */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__cpr_seed); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_states_list); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__keys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_derv_state_dep);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_derv_state_dep);
      __Pyx_GIVEREF(__pyx_v_derv_state_dep);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_v_self->_group_A);
      __Pyx_DECREF(__pyx_v_self->_group_A);
      __pyx_v_self->_group_A = __pyx_t_2;
      __pyx_t_2 = 0;
    }
    __pyx_L6:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5130
 *             else:
 *                 self._group_A = cpr_seed(derv_state_dep, self.get_states_list().keys())
 *         if self._states_references is None:             # <<<<<<<<<<<<<<
 *             states                       = self.get_states_list()
 *             self._states_references      = [s.value_reference for s in states.values()]
 */
  __pyx_t_1 = (__pyx_v_self->_states_references == Py_None);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5131
 *                 self._group_A = cpr_seed(derv_state_dep, self.get_states_list().keys())
 *         if self._states_references is None:
 *             states                       = self.get_states_list()             # <<<<<<<<<<<<<<
 *             self._states_references      = [s.value_reference for s in states.values()]
 *         if self._derivatives_references is None:
 */
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_states_list); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_states = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "pyfmi\fmi.pyx":5132
 *         if self._states_references is None:
 *             states                       = self.get_states_list()
 *             self._states_references      = [s.value_reference for s in states.values()]             # <<<<<<<<<<<<<<
 *         if self._derivatives_references is None:
 *             derivatives                  = self.get_derivatives_list()
 */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_states, __pyx_n_s__values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = Py_TYPE(__pyx_t_2)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_2)) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_2)) {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_3 = __pyx_t_8(__pyx_t_2);
        if (unlikely(!__pyx_t_3)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF(__pyx_v_s);
      __pyx_v_s = __pyx_t_3;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_GetAttr(__pyx_v_s, __pyx_n_s__value_reference); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(__Pyx_PyList_Append(__pyx_t_4, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = ((PyObject *)__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->_states_references);
    __Pyx_DECREF(__pyx_v_self->_states_references);
    __pyx_v_self->_states_references = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "pyfmi\fmi.pyx":5133
 *             states                       = self.get_states_list()
 *             self._states_references      = [s.value_reference for s in states.values()]
 *         if self._derivatives_references is None:             # <<<<<<<<<<<<<<
 *             derivatives                  = self.get_derivatives_list()
 *             self._derivatives_references = [s.value_reference for s in derivatives.values()]
 */
  __pyx_t_1 = (__pyx_v_self->_derivatives_references == Py_None);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5134
 *             self._states_references      = [s.value_reference for s in states.values()]
 *         if self._derivatives_references is None:
 *             derivatives                  = self.get_derivatives_list()             # <<<<<<<<<<<<<<
 *             self._derivatives_references = [s.value_reference for s in derivatives.values()]
 * 
 */
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_298); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_derivatives = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "pyfmi\fmi.pyx":5135
 *         if self._derivatives_references is None:
 *             derivatives                  = self.get_derivatives_list()
 *             self._derivatives_references = [s.value_reference for s in derivatives.values()]             # <<<<<<<<<<<<<<
 * 
 *         A = self._get_directional_proxy(self._states_references, self._derivatives_references, self._group_A, add_diag=True)
 */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_derivatives, __pyx_n_s__values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = Py_TYPE(__pyx_t_2)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_2)) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_2)) {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_3 = __pyx_t_8(__pyx_t_2);
        if (unlikely(!__pyx_t_3)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF(__pyx_v_s);
      __pyx_v_s = __pyx_t_3;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_GetAttr(__pyx_v_s, __pyx_n_s__value_reference); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(__Pyx_PyList_Append(__pyx_t_4, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = ((PyObject *)__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->_derivatives_references);
    __Pyx_DECREF(__pyx_v_self->_derivatives_references);
    __pyx_v_self->_derivatives_references = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L10;
  }
  __pyx_L10:;

  /* "pyfmi\fmi.pyx":5137
 *             self._derivatives_references = [s.value_reference for s in derivatives.values()]
 * 
 *         A = self._get_directional_proxy(self._states_references, self._derivatives_references, self._group_A, add_diag=True)             # <<<<<<<<<<<<<<
 * 
 *         if self._A is None:
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_303); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_self->_states_references);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->_states_references);
  __Pyx_GIVEREF(__pyx_v_self->_states_references);
  __Pyx_INCREF(__pyx_v_self->_derivatives_references);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_self->_derivatives_references);
  __Pyx_GIVEREF(__pyx_v_self->_derivatives_references);
  __Pyx_INCREF(__pyx_v_self->_group_A);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_self->_group_A);
  __Pyx_GIVEREF(__pyx_v_self->_group_A);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_5 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__add_diag), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_v_A = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":5139
 *         A = self._get_directional_proxy(self._states_references, self._derivatives_references, self._group_A, add_diag=True)
 * 
 *         if self._A is None:             # <<<<<<<<<<<<<<
 *             self._A = A
 * 
 */
  __pyx_t_1 = (__pyx_v_self->_A == Py_None);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5140
 * 
 *         if self._A is None:
 *             self._A = A             # <<<<<<<<<<<<<<
 * 
 *         return A
 */
    __Pyx_INCREF(__pyx_v_A);
    __Pyx_GIVEREF(__pyx_v_A);
    __Pyx_GOTREF(__pyx_v_self->_A);
    __Pyx_DECREF(__pyx_v_self->_A);
    __pyx_v_self->_A = __pyx_v_A;
    goto __pyx_L13;
  }
  __pyx_L13:;

  /* "pyfmi\fmi.pyx":5142
 *             self._A = A
 * 
 *         return A             # <<<<<<<<<<<<<<
 * 
 *     def _get_B(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_A);
  __pyx_r = __pyx_v_A;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2._get_A", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_derv_state_dep);
  __Pyx_XDECREF(__pyx_v_derv_input_dep);
  __Pyx_XDECREF(__pyx_v_states);
  __Pyx_XDECREF(__pyx_v_derivatives);
  __Pyx_XDECREF(__pyx_v_A);
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_111_get_B(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_111_get_B(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_B (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_110_get_B(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5144
 *         return A
 * 
 *     def _get_B(self):             # <<<<<<<<<<<<<<
 *         if self._B is None:
 *             [derv_state_dep, derv_input_dep] = self.get_derivatives_dependencies()
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_110_get_B(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  CYTHON_UNUSED PyObject *__pyx_v_derv_state_dep = NULL;
  PyObject *__pyx_v_derv_input_dep = NULL;
  PyObject *__pyx_v_inputs = NULL;
  PyObject *__pyx_v_derivatives = NULL;
  PyObject *__pyx_v_B = NULL;
  PyObject *__pyx_v_s = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_B", 0);

  /* "pyfmi\fmi.pyx":5145
 * 
 *     def _get_B(self):
 *         if self._B is None:             # <<<<<<<<<<<<<<
 *             [derv_state_dep, derv_input_dep] = self.get_derivatives_dependencies()
 *             if python3_flag:
 */
  __pyx_t_1 = (__pyx_v_self->_B == Py_None);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5146
 *     def _get_B(self):
 *         if self._B is None:
 *             [derv_state_dep, derv_input_dep] = self.get_derivatives_dependencies()             # <<<<<<<<<<<<<<
 *             if python3_flag:
 *                 self._group_B = cpr_seed(derv_input_dep, list(self.get_input_list().keys()))
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_derivatives_dependencies(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      #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[0]; __pyx_lineno = 5146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    {
      Py_ssize_t index = -1;
      __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __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_L4_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_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = NULL;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L5_unpacking_done;
      __pyx_L4_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[0]; __pyx_lineno = 5146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L5_unpacking_done:;
    }
    __pyx_v_derv_state_dep = __pyx_t_3;
    __pyx_t_3 = 0;
    __pyx_v_derv_input_dep = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "pyfmi\fmi.pyx":5147
 *         if self._B is None:
 *             [derv_state_dep, derv_input_dep] = self.get_derivatives_dependencies()
 *             if python3_flag:             # <<<<<<<<<<<<<<
 *                 self._group_B = cpr_seed(derv_input_dep, list(self.get_input_list().keys()))
 *             else:
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__python3_flag); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "pyfmi\fmi.pyx":5148
 *             [derv_state_dep, derv_input_dep] = self.get_derivatives_dependencies()
 *             if python3_flag:
 *                 self._group_B = cpr_seed(derv_input_dep, list(self.get_input_list().keys()))             # <<<<<<<<<<<<<<
 *             else:
 *                 self._group_B = cpr_seed(derv_input_dep, self.get_input_list().keys())
 */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__cpr_seed); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_input_list); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__keys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_derv_input_dep);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_derv_input_dep);
      __Pyx_GIVEREF(__pyx_v_derv_input_dep);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5148; __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_4)); __pyx_t_4 = 0;
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->_group_B);
      __Pyx_DECREF(__pyx_v_self->_group_B);
      __pyx_v_self->_group_B = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L6;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":5150
 *                 self._group_B = cpr_seed(derv_input_dep, list(self.get_input_list().keys()))
 *             else:
 *                 self._group_B = cpr_seed(derv_input_dep, self.get_input_list().keys())             # <<<<<<<<<<<<<<
 *         if self._inputs_references is None:
 *             inputs                       = self.get_input_list()
 */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__cpr_seed); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_input_list); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__keys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_derv_input_dep);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_derv_input_dep);
      __Pyx_GIVEREF(__pyx_v_derv_input_dep);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_v_self->_group_B);
      __Pyx_DECREF(__pyx_v_self->_group_B);
      __pyx_v_self->_group_B = __pyx_t_2;
      __pyx_t_2 = 0;
    }
    __pyx_L6:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5151
 *             else:
 *                 self._group_B = cpr_seed(derv_input_dep, self.get_input_list().keys())
 *         if self._inputs_references is None:             # <<<<<<<<<<<<<<
 *             inputs                       = self.get_input_list()
 *             self._inputs_references      = [s.value_reference for s in inputs.values()]
 */
  __pyx_t_1 = (__pyx_v_self->_inputs_references == Py_None);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5152
 *                 self._group_B = cpr_seed(derv_input_dep, self.get_input_list().keys())
 *         if self._inputs_references is None:
 *             inputs                       = self.get_input_list()             # <<<<<<<<<<<<<<
 *             self._inputs_references      = [s.value_reference for s in inputs.values()]
 *         if self._derivatives_references is None:
 */
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_input_list); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_inputs = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "pyfmi\fmi.pyx":5153
 *         if self._inputs_references is None:
 *             inputs                       = self.get_input_list()
 *             self._inputs_references      = [s.value_reference for s in inputs.values()]             # <<<<<<<<<<<<<<
 *         if self._derivatives_references is None:
 *             derivatives                  = self.get_derivatives_list()
 */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_inputs, __pyx_n_s__values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = Py_TYPE(__pyx_t_2)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_2)) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_2)) {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_3 = __pyx_t_8(__pyx_t_2);
        if (unlikely(!__pyx_t_3)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF(__pyx_v_s);
      __pyx_v_s = __pyx_t_3;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_GetAttr(__pyx_v_s, __pyx_n_s__value_reference); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(__Pyx_PyList_Append(__pyx_t_4, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = ((PyObject *)__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->_inputs_references);
    __Pyx_DECREF(__pyx_v_self->_inputs_references);
    __pyx_v_self->_inputs_references = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "pyfmi\fmi.pyx":5154
 *             inputs                       = self.get_input_list()
 *             self._inputs_references      = [s.value_reference for s in inputs.values()]
 *         if self._derivatives_references is None:             # <<<<<<<<<<<<<<
 *             derivatives                  = self.get_derivatives_list()
 *             self._derivatives_references = [s.value_reference for s in derivatives.values()]
 */
  __pyx_t_1 = (__pyx_v_self->_derivatives_references == Py_None);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5155
 *             self._inputs_references      = [s.value_reference for s in inputs.values()]
 *         if self._derivatives_references is None:
 *             derivatives                  = self.get_derivatives_list()             # <<<<<<<<<<<<<<
 *             self._derivatives_references = [s.value_reference for s in derivatives.values()]
 * 
 */
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_298); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_derivatives = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "pyfmi\fmi.pyx":5156
 *         if self._derivatives_references is None:
 *             derivatives                  = self.get_derivatives_list()
 *             self._derivatives_references = [s.value_reference for s in derivatives.values()]             # <<<<<<<<<<<<<<
 * 
 *         B = self._get_directional_proxy(self._inputs_references, self._derivatives_references, self._group_B)
 */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_derivatives, __pyx_n_s__values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = Py_TYPE(__pyx_t_2)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_2)) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_2)) {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_3 = __pyx_t_8(__pyx_t_2);
        if (unlikely(!__pyx_t_3)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF(__pyx_v_s);
      __pyx_v_s = __pyx_t_3;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_GetAttr(__pyx_v_s, __pyx_n_s__value_reference); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(__Pyx_PyList_Append(__pyx_t_4, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = ((PyObject *)__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->_derivatives_references);
    __Pyx_DECREF(__pyx_v_self->_derivatives_references);
    __pyx_v_self->_derivatives_references = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L10;
  }
  __pyx_L10:;

  /* "pyfmi\fmi.pyx":5158
 *             self._derivatives_references = [s.value_reference for s in derivatives.values()]
 * 
 *         B = self._get_directional_proxy(self._inputs_references, self._derivatives_references, self._group_B)             # <<<<<<<<<<<<<<
 * 
 *         if self._B is None:
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_303); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_self->_inputs_references);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->_inputs_references);
  __Pyx_GIVEREF(__pyx_v_self->_inputs_references);
  __Pyx_INCREF(__pyx_v_self->_derivatives_references);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_self->_derivatives_references);
  __Pyx_GIVEREF(__pyx_v_self->_derivatives_references);
  __Pyx_INCREF(__pyx_v_self->_group_B);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_self->_group_B);
  __Pyx_GIVEREF(__pyx_v_self->_group_B);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5158; __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_4)); __pyx_t_4 = 0;
  __pyx_v_B = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":5160
 *         B = self._get_directional_proxy(self._inputs_references, self._derivatives_references, self._group_B)
 * 
 *         if self._B is None:             # <<<<<<<<<<<<<<
 *             self._B = B
 * 
 */
  __pyx_t_1 = (__pyx_v_self->_B == Py_None);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5161
 * 
 *         if self._B is None:
 *             self._B = B             # <<<<<<<<<<<<<<
 * 
 *         return B
 */
    __Pyx_INCREF(__pyx_v_B);
    __Pyx_GIVEREF(__pyx_v_B);
    __Pyx_GOTREF(__pyx_v_self->_B);
    __Pyx_DECREF(__pyx_v_self->_B);
    __pyx_v_self->_B = __pyx_v_B;
    goto __pyx_L13;
  }
  __pyx_L13:;

  /* "pyfmi\fmi.pyx":5163
 *             self._B = B
 * 
 *         return B             # <<<<<<<<<<<<<<
 * 
 *     def _get_C(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_B);
  __pyx_r = __pyx_v_B;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2._get_B", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_derv_state_dep);
  __Pyx_XDECREF(__pyx_v_derv_input_dep);
  __Pyx_XDECREF(__pyx_v_inputs);
  __Pyx_XDECREF(__pyx_v_derivatives);
  __Pyx_XDECREF(__pyx_v_B);
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_113_get_C(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_113_get_C(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_C (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_112_get_C(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5165
 *         return B
 * 
 *     def _get_C(self):             # <<<<<<<<<<<<<<
 *         if self._C is None:
 *             [out_state_dep, out_input_dep] = self.get_output_dependencies()
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_112_get_C(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  PyObject *__pyx_v_out_state_dep = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_out_input_dep = NULL;
  PyObject *__pyx_v_states = NULL;
  PyObject *__pyx_v_outputs = NULL;
  PyObject *__pyx_v_C = NULL;
  PyObject *__pyx_v_s = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_C", 0);

  /* "pyfmi\fmi.pyx":5166
 * 
 *     def _get_C(self):
 *         if self._C is None:             # <<<<<<<<<<<<<<
 *             [out_state_dep, out_input_dep] = self.get_output_dependencies()
 *             if python3_flag:
 */
  __pyx_t_1 = (__pyx_v_self->_C == Py_None);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5167
 *     def _get_C(self):
 *         if self._C is None:
 *             [out_state_dep, out_input_dep] = self.get_output_dependencies()             # <<<<<<<<<<<<<<
 *             if python3_flag:
 *                 self._group_C = cpr_seed(out_state_dep, list(self.get_states_list().keys()))
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_output_dependencies(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      #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[0]; __pyx_lineno = 5167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    {
      Py_ssize_t index = -1;
      __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __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_L4_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_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = NULL;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L5_unpacking_done;
      __pyx_L4_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[0]; __pyx_lineno = 5167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L5_unpacking_done:;
    }
    __pyx_v_out_state_dep = __pyx_t_3;
    __pyx_t_3 = 0;
    __pyx_v_out_input_dep = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "pyfmi\fmi.pyx":5168
 *         if self._C is None:
 *             [out_state_dep, out_input_dep] = self.get_output_dependencies()
 *             if python3_flag:             # <<<<<<<<<<<<<<
 *                 self._group_C = cpr_seed(out_state_dep, list(self.get_states_list().keys()))
 *             else:
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__python3_flag); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "pyfmi\fmi.pyx":5169
 *             [out_state_dep, out_input_dep] = self.get_output_dependencies()
 *             if python3_flag:
 *                 self._group_C = cpr_seed(out_state_dep, list(self.get_states_list().keys()))             # <<<<<<<<<<<<<<
 *             else:
 *                 self._group_C = cpr_seed(out_state_dep, self.get_states_list().keys())
 */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__cpr_seed); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_states_list); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__keys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_out_state_dep);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_out_state_dep);
      __Pyx_GIVEREF(__pyx_v_out_state_dep);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5169; __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_4)); __pyx_t_4 = 0;
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->_group_C);
      __Pyx_DECREF(__pyx_v_self->_group_C);
      __pyx_v_self->_group_C = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L6;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":5171
 *                 self._group_C = cpr_seed(out_state_dep, list(self.get_states_list().keys()))
 *             else:
 *                 self._group_C = cpr_seed(out_state_dep, self.get_states_list().keys())             # <<<<<<<<<<<<<<
 *         if self._states_references is None:
 *             states                       = self.get_states_list()
 */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__cpr_seed); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_states_list); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__keys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_out_state_dep);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_out_state_dep);
      __Pyx_GIVEREF(__pyx_v_out_state_dep);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_v_self->_group_C);
      __Pyx_DECREF(__pyx_v_self->_group_C);
      __pyx_v_self->_group_C = __pyx_t_2;
      __pyx_t_2 = 0;
    }
    __pyx_L6:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5172
 *             else:
 *                 self._group_C = cpr_seed(out_state_dep, self.get_states_list().keys())
 *         if self._states_references is None:             # <<<<<<<<<<<<<<
 *             states                       = self.get_states_list()
 *             self._states_references      = [s.value_reference for s in states.values()]
 */
  __pyx_t_1 = (__pyx_v_self->_states_references == Py_None);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5173
 *                 self._group_C = cpr_seed(out_state_dep, self.get_states_list().keys())
 *         if self._states_references is None:
 *             states                       = self.get_states_list()             # <<<<<<<<<<<<<<
 *             self._states_references      = [s.value_reference for s in states.values()]
 *         if self._outputs_references is None:
 */
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_states_list); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_states = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "pyfmi\fmi.pyx":5174
 *         if self._states_references is None:
 *             states                       = self.get_states_list()
 *             self._states_references      = [s.value_reference for s in states.values()]             # <<<<<<<<<<<<<<
 *         if self._outputs_references is None:
 *             outputs                      = self.get_output_list()
 */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_states, __pyx_n_s__values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = Py_TYPE(__pyx_t_2)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_2)) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_2)) {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_3 = __pyx_t_8(__pyx_t_2);
        if (unlikely(!__pyx_t_3)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF(__pyx_v_s);
      __pyx_v_s = __pyx_t_3;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_GetAttr(__pyx_v_s, __pyx_n_s__value_reference); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(__Pyx_PyList_Append(__pyx_t_4, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = ((PyObject *)__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->_states_references);
    __Pyx_DECREF(__pyx_v_self->_states_references);
    __pyx_v_self->_states_references = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "pyfmi\fmi.pyx":5175
 *             states                       = self.get_states_list()
 *             self._states_references      = [s.value_reference for s in states.values()]
 *         if self._outputs_references is None:             # <<<<<<<<<<<<<<
 *             outputs                      = self.get_output_list()
 *             self._outputs_references     = [s.value_reference for s in outputs.values()]
 */
  __pyx_t_1 = (__pyx_v_self->_outputs_references == Py_None);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5176
 *             self._states_references      = [s.value_reference for s in states.values()]
 *         if self._outputs_references is None:
 *             outputs                      = self.get_output_list()             # <<<<<<<<<<<<<<
 *             self._outputs_references     = [s.value_reference for s in outputs.values()]
 * 
 */
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_output_list); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_outputs = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "pyfmi\fmi.pyx":5177
 *         if self._outputs_references is None:
 *             outputs                      = self.get_output_list()
 *             self._outputs_references     = [s.value_reference for s in outputs.values()]             # <<<<<<<<<<<<<<
 * 
 *         C = self._get_directional_proxy(self._states_references, self._outputs_references, self._group_C)
 */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_outputs, __pyx_n_s__values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = Py_TYPE(__pyx_t_2)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_2)) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_2)) {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_3 = __pyx_t_8(__pyx_t_2);
        if (unlikely(!__pyx_t_3)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF(__pyx_v_s);
      __pyx_v_s = __pyx_t_3;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_GetAttr(__pyx_v_s, __pyx_n_s__value_reference); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(__Pyx_PyList_Append(__pyx_t_4, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = ((PyObject *)__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->_outputs_references);
    __Pyx_DECREF(__pyx_v_self->_outputs_references);
    __pyx_v_self->_outputs_references = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L10;
  }
  __pyx_L10:;

  /* "pyfmi\fmi.pyx":5179
 *             self._outputs_references     = [s.value_reference for s in outputs.values()]
 * 
 *         C = self._get_directional_proxy(self._states_references, self._outputs_references, self._group_C)             # <<<<<<<<<<<<<<
 * 
 *         if self._C is None:
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_303); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_self->_states_references);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->_states_references);
  __Pyx_GIVEREF(__pyx_v_self->_states_references);
  __Pyx_INCREF(__pyx_v_self->_outputs_references);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_self->_outputs_references);
  __Pyx_GIVEREF(__pyx_v_self->_outputs_references);
  __Pyx_INCREF(__pyx_v_self->_group_C);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_self->_group_C);
  __Pyx_GIVEREF(__pyx_v_self->_group_C);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5179; __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_4)); __pyx_t_4 = 0;
  __pyx_v_C = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":5181
 *         C = self._get_directional_proxy(self._states_references, self._outputs_references, self._group_C)
 * 
 *         if self._C is None:             # <<<<<<<<<<<<<<
 *             self._C = C
 * 
 */
  __pyx_t_1 = (__pyx_v_self->_C == Py_None);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5182
 * 
 *         if self._C is None:
 *             self._C = C             # <<<<<<<<<<<<<<
 * 
 *         return C
 */
    __Pyx_INCREF(__pyx_v_C);
    __Pyx_GIVEREF(__pyx_v_C);
    __Pyx_GOTREF(__pyx_v_self->_C);
    __Pyx_DECREF(__pyx_v_self->_C);
    __pyx_v_self->_C = __pyx_v_C;
    goto __pyx_L13;
  }
  __pyx_L13:;

  /* "pyfmi\fmi.pyx":5184
 *             self._C = C
 * 
 *         return C             # <<<<<<<<<<<<<<
 * 
 *     def _get_D(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_C);
  __pyx_r = __pyx_v_C;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2._get_C", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out_state_dep);
  __Pyx_XDECREF(__pyx_v_out_input_dep);
  __Pyx_XDECREF(__pyx_v_states);
  __Pyx_XDECREF(__pyx_v_outputs);
  __Pyx_XDECREF(__pyx_v_C);
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_115_get_D(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_115_get_D(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_D (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_114_get_D(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5186
 *         return C
 * 
 *     def _get_D(self):             # <<<<<<<<<<<<<<
 *         if self._D is None:
 *             [out_state_dep, out_input_dep] = self.get_output_dependencies()
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_114_get_D(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  CYTHON_UNUSED PyObject *__pyx_v_out_state_dep = NULL;
  PyObject *__pyx_v_out_input_dep = NULL;
  PyObject *__pyx_v_inputs = NULL;
  PyObject *__pyx_v_outputs = NULL;
  PyObject *__pyx_v_D = NULL;
  PyObject *__pyx_v_s = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_D", 0);

  /* "pyfmi\fmi.pyx":5187
 * 
 *     def _get_D(self):
 *         if self._D is None:             # <<<<<<<<<<<<<<
 *             [out_state_dep, out_input_dep] = self.get_output_dependencies()
 *             if python3_flag:
 */
  __pyx_t_1 = (__pyx_v_self->_D == Py_None);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5188
 *     def _get_D(self):
 *         if self._D is None:
 *             [out_state_dep, out_input_dep] = self.get_output_dependencies()             # <<<<<<<<<<<<<<
 *             if python3_flag:
 *                 self._group_D = cpr_seed(out_input_dep, list(self.get_input_list().keys()))
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_output_dependencies(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      #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[0]; __pyx_lineno = 5188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    {
      Py_ssize_t index = -1;
      __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __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_L4_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_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = NULL;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L5_unpacking_done;
      __pyx_L4_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[0]; __pyx_lineno = 5188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L5_unpacking_done:;
    }
    __pyx_v_out_state_dep = __pyx_t_3;
    __pyx_t_3 = 0;
    __pyx_v_out_input_dep = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "pyfmi\fmi.pyx":5189
 *         if self._D is None:
 *             [out_state_dep, out_input_dep] = self.get_output_dependencies()
 *             if python3_flag:             # <<<<<<<<<<<<<<
 *                 self._group_D = cpr_seed(out_input_dep, list(self.get_input_list().keys()))
 *             else:
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__python3_flag); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "pyfmi\fmi.pyx":5190
 *             [out_state_dep, out_input_dep] = self.get_output_dependencies()
 *             if python3_flag:
 *                 self._group_D = cpr_seed(out_input_dep, list(self.get_input_list().keys()))             # <<<<<<<<<<<<<<
 *             else:
 *                 self._group_D = cpr_seed(out_input_dep, self.get_input_list().keys())
 */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__cpr_seed); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_input_list); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__keys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_out_input_dep);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_out_input_dep);
      __Pyx_GIVEREF(__pyx_v_out_input_dep);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5190; __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_4)); __pyx_t_4 = 0;
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->_group_D);
      __Pyx_DECREF(__pyx_v_self->_group_D);
      __pyx_v_self->_group_D = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L6;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":5192
 *                 self._group_D = cpr_seed(out_input_dep, list(self.get_input_list().keys()))
 *             else:
 *                 self._group_D = cpr_seed(out_input_dep, self.get_input_list().keys())             # <<<<<<<<<<<<<<
 *         if self._inputs_references is None:
 *             inputs                       = self.get_input_list()
 */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__cpr_seed); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_input_list); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__keys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_out_input_dep);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_out_input_dep);
      __Pyx_GIVEREF(__pyx_v_out_input_dep);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_v_self->_group_D);
      __Pyx_DECREF(__pyx_v_self->_group_D);
      __pyx_v_self->_group_D = __pyx_t_2;
      __pyx_t_2 = 0;
    }
    __pyx_L6:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5193
 *             else:
 *                 self._group_D = cpr_seed(out_input_dep, self.get_input_list().keys())
 *         if self._inputs_references is None:             # <<<<<<<<<<<<<<
 *             inputs                       = self.get_input_list()
 *             self._inputs_references      = [s.value_reference for s in inputs.values()]
 */
  __pyx_t_1 = (__pyx_v_self->_inputs_references == Py_None);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5194
 *                 self._group_D = cpr_seed(out_input_dep, self.get_input_list().keys())
 *         if self._inputs_references is None:
 *             inputs                       = self.get_input_list()             # <<<<<<<<<<<<<<
 *             self._inputs_references      = [s.value_reference for s in inputs.values()]
 *         if self._outputs_references is None:
 */
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_input_list); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_inputs = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "pyfmi\fmi.pyx":5195
 *         if self._inputs_references is None:
 *             inputs                       = self.get_input_list()
 *             self._inputs_references      = [s.value_reference for s in inputs.values()]             # <<<<<<<<<<<<<<
 *         if self._outputs_references is None:
 *             outputs                      = self.get_output_list()
 */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_inputs, __pyx_n_s__values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = Py_TYPE(__pyx_t_2)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_2)) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_2)) {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_3 = __pyx_t_8(__pyx_t_2);
        if (unlikely(!__pyx_t_3)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF(__pyx_v_s);
      __pyx_v_s = __pyx_t_3;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_GetAttr(__pyx_v_s, __pyx_n_s__value_reference); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(__Pyx_PyList_Append(__pyx_t_4, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = ((PyObject *)__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->_inputs_references);
    __Pyx_DECREF(__pyx_v_self->_inputs_references);
    __pyx_v_self->_inputs_references = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "pyfmi\fmi.pyx":5196
 *             inputs                       = self.get_input_list()
 *             self._inputs_references      = [s.value_reference for s in inputs.values()]
 *         if self._outputs_references is None:             # <<<<<<<<<<<<<<
 *             outputs                      = self.get_output_list()
 *             self._outputs_references     = [s.value_reference for s in outputs.values()]
 */
  __pyx_t_1 = (__pyx_v_self->_outputs_references == Py_None);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5197
 *             self._inputs_references      = [s.value_reference for s in inputs.values()]
 *         if self._outputs_references is None:
 *             outputs                      = self.get_output_list()             # <<<<<<<<<<<<<<
 *             self._outputs_references     = [s.value_reference for s in outputs.values()]
 * 
 */
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_output_list); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_outputs = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "pyfmi\fmi.pyx":5198
 *         if self._outputs_references is None:
 *             outputs                      = self.get_output_list()
 *             self._outputs_references     = [s.value_reference for s in outputs.values()]             # <<<<<<<<<<<<<<
 * 
 *         D = self._get_directional_proxy(self._inputs_references, self._outputs_references, self._group_D)
 */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_outputs, __pyx_n_s__values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = Py_TYPE(__pyx_t_2)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_2)) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_2)) {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_3 = __pyx_t_8(__pyx_t_2);
        if (unlikely(!__pyx_t_3)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF(__pyx_v_s);
      __pyx_v_s = __pyx_t_3;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_GetAttr(__pyx_v_s, __pyx_n_s__value_reference); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(__Pyx_PyList_Append(__pyx_t_4, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = ((PyObject *)__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->_outputs_references);
    __Pyx_DECREF(__pyx_v_self->_outputs_references);
    __pyx_v_self->_outputs_references = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L10;
  }
  __pyx_L10:;

  /* "pyfmi\fmi.pyx":5200
 *             self._outputs_references     = [s.value_reference for s in outputs.values()]
 * 
 *         D = self._get_directional_proxy(self._inputs_references, self._outputs_references, self._group_D)             # <<<<<<<<<<<<<<
 * 
 *         if self._D is None:
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_303); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_self->_inputs_references);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->_inputs_references);
  __Pyx_GIVEREF(__pyx_v_self->_inputs_references);
  __Pyx_INCREF(__pyx_v_self->_outputs_references);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_self->_outputs_references);
  __Pyx_GIVEREF(__pyx_v_self->_outputs_references);
  __Pyx_INCREF(__pyx_v_self->_group_D);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_self->_group_D);
  __Pyx_GIVEREF(__pyx_v_self->_group_D);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5200; __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_4)); __pyx_t_4 = 0;
  __pyx_v_D = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":5202
 *         D = self._get_directional_proxy(self._inputs_references, self._outputs_references, self._group_D)
 * 
 *         if self._D is None:             # <<<<<<<<<<<<<<
 *             self._D = D
 * 
 */
  __pyx_t_1 = (__pyx_v_self->_D == Py_None);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5203
 * 
 *         if self._D is None:
 *             self._D = D             # <<<<<<<<<<<<<<
 * 
 *         return D
 */
    __Pyx_INCREF(__pyx_v_D);
    __Pyx_GIVEREF(__pyx_v_D);
    __Pyx_GOTREF(__pyx_v_self->_D);
    __Pyx_DECREF(__pyx_v_self->_D);
    __pyx_v_self->_D = __pyx_v_D;
    goto __pyx_L13;
  }
  __pyx_L13:;

  /* "pyfmi\fmi.pyx":5205
 *             self._D = D
 * 
 *         return D             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_D);
  __pyx_r = __pyx_v_D;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2._get_D", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out_state_dep);
  __Pyx_XDECREF(__pyx_v_out_input_dep);
  __Pyx_XDECREF(__pyx_v_inputs);
  __Pyx_XDECREF(__pyx_v_outputs);
  __Pyx_XDECREF(__pyx_v_D);
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_117get_state_space_representation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_116get_state_space_representation[] = "\n        Returns a state space representation of the model. I.e::\n        \n            der(x) = Ax + Bu\n                y  = Cx + Du\n                \n        Which of the matrices to be returned can be choosen by the arguments.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_117get_state_space_representation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_A = 0;
  PyObject *__pyx_v_B = 0;
  PyObject *__pyx_v_C = 0;
  PyObject *__pyx_v_D = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_state_space_representation (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__A,&__pyx_n_s__B,&__pyx_n_s__C,&__pyx_n_s__D,0};
    PyObject* values[4] = {0,0,0,0};
    values[0] = __pyx_k_304;
    values[1] = __pyx_k_305;
    values[2] = __pyx_k_306;
    values[3] = __pyx_k_307;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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 (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__A);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__B);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__C);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__D);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_state_space_representation") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5208; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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;
      }
    }
    __pyx_v_A = values[0];
    __pyx_v_B = values[1];
    __pyx_v_C = values[2];
    __pyx_v_D = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_state_space_representation", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5208; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_state_space_representation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_116get_state_space_representation(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_v_A, __pyx_v_B, __pyx_v_C, __pyx_v_D);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5208
 * 
 * 
 *     def get_state_space_representation(self, A=True, B=True, C=True, D=True):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a state space representation of the model. I.e::
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_116get_state_space_representation(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_C, PyObject *__pyx_v_D) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  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("get_state_space_representation", 0);
  __Pyx_INCREF(__pyx_v_A);
  __Pyx_INCREF(__pyx_v_B);
  __Pyx_INCREF(__pyx_v_C);
  __Pyx_INCREF(__pyx_v_D);

  /* "pyfmi\fmi.pyx":5217
 *         Which of the matrices to be returned can be choosen by the arguments.
 *         """
 *         if A:             # <<<<<<<<<<<<<<
 *             A = self._get_A()
 *         if B:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_A); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5218
 *         """
 *         if A:
 *             A = self._get_A()             # <<<<<<<<<<<<<<
 *         if B:
 *             B = self._get_B()
 */
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___get_A); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_v_A);
    __pyx_v_A = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5219
 *         if A:
 *             A = self._get_A()
 *         if B:             # <<<<<<<<<<<<<<
 *             B = self._get_B()
 *         if C:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_B); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5220
 *             A = self._get_A()
 *         if B:
 *             B = self._get_B()             # <<<<<<<<<<<<<<
 *         if C:
 *             C = self._get_C()
 */
    __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___get_B); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_v_B);
    __pyx_v_B = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":5221
 *         if B:
 *             B = self._get_B()
 *         if C:             # <<<<<<<<<<<<<<
 *             C = self._get_C()
 *         if D:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_C); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5222
 *             B = self._get_B()
 *         if C:
 *             C = self._get_C()             # <<<<<<<<<<<<<<
 *         if D:
 *             D = self._get_D()
 */
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___get_C); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_v_C);
    __pyx_v_C = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":5223
 *         if C:
 *             C = self._get_C()
 *         if D:             # <<<<<<<<<<<<<<
 *             D = self._get_D()
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_D); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5224
 *             C = self._get_C()
 *         if D:
 *             D = self._get_D()             # <<<<<<<<<<<<<<
 * 
 *         return A,B,C,D
 */
    __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___get_D); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_v_D);
    __pyx_v_D = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pyfmi\fmi.pyx":5226
 *             D = self._get_D()
 * 
 *         return A,B,C,D             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_A);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_A);
  __Pyx_GIVEREF(__pyx_v_A);
  __Pyx_INCREF(__pyx_v_B);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_B);
  __Pyx_GIVEREF(__pyx_v_B);
  __Pyx_INCREF(__pyx_v_C);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_C);
  __Pyx_GIVEREF(__pyx_v_C);
  __Pyx_INCREF(__pyx_v_D);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_D);
  __Pyx_GIVEREF(__pyx_v_D);
  __pyx_r = ((PyObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_state_space_representation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_A);
  __Pyx_XDECREF(__pyx_v_B);
  __Pyx_XDECREF(__pyx_v_C);
  __Pyx_XDECREF(__pyx_v_D);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_119get_states_list(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_118get_states_list[] = "\n        Returns a dictionary with the states.\n\n        Returns::\n\n            An ordered dictionary with the state variables.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_119get_states_list(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_states_list (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_118get_states_list(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5229
 * 
 * 
 *     def get_states_list(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a dictionary with the states.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_118get_states_list(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  fmi2_import_variable_list_t *__pyx_v_variable_list;
  size_t __pyx_v_variable_list_size;
  PyObject *__pyx_v_variable_dict = NULL;
  size_t __pyx_v_i;
  fmi2_import_variable_t *__pyx_v_der_variable;
  fmi2_import_real_variable_t *__pyx_v_variable;
  PyObject *__pyx_v_scalar_variable = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  size_t __pyx_t_4;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_states_list", 0);

  /* "pyfmi\fmi.pyx":5239
 *         cdef FMIL.fmi2_import_variable_list_t*   variable_list
 *         cdef FMIL.size_t             variable_list_size
 *         variable_dict = OrderedDict()             # <<<<<<<<<<<<<<
 * 
 *         variable_list = FMIL.fmi2_import_get_derivatives_list(self._fmu)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__OrderedDict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5239; __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 = 5239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_variable_dict = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":5241
 *         variable_dict = OrderedDict()
 * 
 *         variable_list = FMIL.fmi2_import_get_derivatives_list(self._fmu)             # <<<<<<<<<<<<<<
 *         variable_list_size = FMIL.fmi2_import_get_variable_list_size(variable_list)
 * 
 */
  __pyx_v_variable_list = fmi2_import_get_derivatives_list(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":5242
 * 
 *         variable_list = FMIL.fmi2_import_get_derivatives_list(self._fmu)
 *         variable_list_size = FMIL.fmi2_import_get_variable_list_size(variable_list)             # <<<<<<<<<<<<<<
 * 
 *         if variable_list == NULL:
 */
  __pyx_v_variable_list_size = fmi2_import_get_variable_list_size(__pyx_v_variable_list);

  /* "pyfmi\fmi.pyx":5244
 *         variable_list_size = FMIL.fmi2_import_get_variable_list_size(variable_list)
 * 
 *         if variable_list == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The returned derivatives states list is NULL.")
 * 
 */
  __pyx_t_3 = (__pyx_v_variable_list == NULL);
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":5245
 * 
 *         if variable_list == NULL:
 *             raise FMUException("The returned derivatives states list is NULL.")             # <<<<<<<<<<<<<<
 * 
 *         for i in range(variable_list_size):
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_309), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5247
 *             raise FMUException("The returned derivatives states list is NULL.")
 * 
 *         for i in range(variable_list_size):             # <<<<<<<<<<<<<<
 *             der_variable = FMIL.fmi2_import_get_variable(variable_list, i)
 *             variable     = FMIL.fmi2_import_get_real_variable_derivative_of(<FMIL.fmi2_import_real_variable_t*>der_variable)
 */
  __pyx_t_4 = __pyx_v_variable_list_size;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "pyfmi\fmi.pyx":5248
 * 
 *         for i in range(variable_list_size):
 *             der_variable = FMIL.fmi2_import_get_variable(variable_list, i)             # <<<<<<<<<<<<<<
 *             variable     = FMIL.fmi2_import_get_real_variable_derivative_of(<FMIL.fmi2_import_real_variable_t*>der_variable)
 * 
 */
    __pyx_v_der_variable = fmi2_import_get_variable(__pyx_v_variable_list, __pyx_v_i);

    /* "pyfmi\fmi.pyx":5249
 *         for i in range(variable_list_size):
 *             der_variable = FMIL.fmi2_import_get_variable(variable_list, i)
 *             variable     = FMIL.fmi2_import_get_real_variable_derivative_of(<FMIL.fmi2_import_real_variable_t*>der_variable)             # <<<<<<<<<<<<<<
 * 
 *             scalar_variable = self._add_scalar_variable(<FMIL.fmi2_import_variable_t*>variable)
 */
    __pyx_v_variable = fmi2_import_get_real_variable_derivative_of(((fmi2_import_real_variable_t *)__pyx_v_der_variable));

    /* "pyfmi\fmi.pyx":5251
 *             variable     = FMIL.fmi2_import_get_real_variable_derivative_of(<FMIL.fmi2_import_real_variable_t*>der_variable)
 * 
 *             scalar_variable = self._add_scalar_variable(<FMIL.fmi2_import_variable_t*>variable)             # <<<<<<<<<<<<<<
 *             variable_dict[scalar_variable.name] = scalar_variable
 * 
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self->__pyx_base.__pyx_vtab)->_add_scalar_variable(__pyx_v_self, ((fmi2_import_variable_t *)__pyx_v_variable)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_v_scalar_variable);
    __pyx_v_scalar_variable = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pyfmi\fmi.pyx":5252
 * 
 *             scalar_variable = self._add_scalar_variable(<FMIL.fmi2_import_variable_t*>variable)
 *             variable_dict[scalar_variable.name] = scalar_variable             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_scalar_variable, __pyx_n_s__name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyObject_SetItem(__pyx_v_variable_dict, __pyx_t_1, __pyx_v_scalar_variable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":5258
 * 
 *         #Free the variable list
 *         FMIL.fmi2_import_free_variable_list(variable_list)             # <<<<<<<<<<<<<<
 * 
 *         return variable_dict
 */
  fmi2_import_free_variable_list(__pyx_v_variable_list);

  /* "pyfmi\fmi.pyx":5260
 *         FMIL.fmi2_import_free_variable_list(variable_list)
 * 
 *         return variable_dict             # <<<<<<<<<<<<<<
 * 
 *     def get_input_list(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_variable_dict);
  __pyx_r = __pyx_v_variable_dict;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_states_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_dict);
  __Pyx_XDECREF(__pyx_v_scalar_variable);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_121get_input_list(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_120get_input_list[] = "\n        Returns a dictionary with input variables\n\n        Returns::\n\n            An ordered dictionary with the (real) (continuous) input variables.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_121get_input_list(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_input_list (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_120get_input_list(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5262
 *         return variable_dict
 * 
 *     def get_input_list(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a dictionary with input variables
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_120get_input_list(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  PyObject *__pyx_v_variable_dict = NULL;
  PyObject *__pyx_r = NULL;
  __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("get_input_list", 0);

  /* "pyfmi\fmi.pyx":5270
 *             An ordered dictionary with the (real) (continuous) input variables.
 *         """
 *         variable_dict = self.get_model_variables(type=FMI2_REAL, include_alias = False,             # <<<<<<<<<<<<<<
 *                              causality = FMI2_INPUT,   variability = FMI2_CONTINUOUS)
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_model_variables); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI2_REAL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__type), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__include_alias), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":5271
 *         """
 *         variable_dict = self.get_model_variables(type=FMI2_REAL, include_alias = False,
 *                              causality = FMI2_INPUT,   variability = FMI2_CONTINUOUS)             # <<<<<<<<<<<<<<
 * 
 *         return variable_dict
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI2_INPUT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__causality), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI2_CONTINUOUS); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__variability), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_variable_dict = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":5273
 *                              causality = FMI2_INPUT,   variability = FMI2_CONTINUOUS)
 * 
 *         return variable_dict             # <<<<<<<<<<<<<<
 * 
 *     def get_output_list(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_variable_dict);
  __pyx_r = __pyx_v_variable_dict;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_input_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_123get_output_list(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_122get_output_list[] = "\n        Returns a dictionary with output variables\n\n        Returns::\n\n            An ordered dictionary with the (real) (continuous) output variables.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_123get_output_list(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_output_list (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_122get_output_list(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5275
 *         return variable_dict
 * 
 *     def get_output_list(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a dictionary with output variables
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_122get_output_list(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  fmi2_import_variable_list_t *__pyx_v_variable_list;
  size_t __pyx_v_variable_list_size;
  fmi2_import_variable_t *__pyx_v_variable;
  PyObject *__pyx_v_variable_dict = NULL;
  size_t __pyx_v_i;
  PyObject *__pyx_v_scalar_variable = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  size_t __pyx_t_4;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_output_list", 0);

  /* "pyfmi\fmi.pyx":5289
 *         cdef FMIL.size_t                         variable_list_size
 *         cdef FMIL.fmi2_import_variable_t*        variable
 *         variable_dict = OrderedDict()             # <<<<<<<<<<<<<<
 * 
 *         variable_list = FMIL.fmi2_import_get_outputs_list(self._fmu)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__OrderedDict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5289; __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 = 5289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_variable_dict = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":5291
 *         variable_dict = OrderedDict()
 * 
 *         variable_list = FMIL.fmi2_import_get_outputs_list(self._fmu)             # <<<<<<<<<<<<<<
 *         variable_list_size = FMIL.fmi2_import_get_variable_list_size(variable_list)
 * 
 */
  __pyx_v_variable_list = fmi2_import_get_outputs_list(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":5292
 * 
 *         variable_list = FMIL.fmi2_import_get_outputs_list(self._fmu)
 *         variable_list_size = FMIL.fmi2_import_get_variable_list_size(variable_list)             # <<<<<<<<<<<<<<
 * 
 *         if variable_list == NULL:
 */
  __pyx_v_variable_list_size = fmi2_import_get_variable_list_size(__pyx_v_variable_list);

  /* "pyfmi\fmi.pyx":5294
 *         variable_list_size = FMIL.fmi2_import_get_variable_list_size(variable_list)
 * 
 *         if variable_list == NULL:             # <<<<<<<<<<<<<<
 *             raise FMUException("The returned outputs list is NULL.")
 * 
 */
  __pyx_t_3 = (__pyx_v_variable_list == NULL);
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":5295
 * 
 *         if variable_list == NULL:
 *             raise FMUException("The returned outputs list is NULL.")             # <<<<<<<<<<<<<<
 * 
 *         for i in range(variable_list_size):
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_311), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5297
 *             raise FMUException("The returned outputs list is NULL.")
 * 
 *         for i in range(variable_list_size):             # <<<<<<<<<<<<<<
 *             variable = FMIL.fmi2_import_get_variable(variable_list, i)
 * 
 */
  __pyx_t_4 = __pyx_v_variable_list_size;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "pyfmi\fmi.pyx":5298
 * 
 *         for i in range(variable_list_size):
 *             variable = FMIL.fmi2_import_get_variable(variable_list, i)             # <<<<<<<<<<<<<<
 * 
 *             scalar_variable = self._add_scalar_variable(variable)
 */
    __pyx_v_variable = fmi2_import_get_variable(__pyx_v_variable_list, __pyx_v_i);

    /* "pyfmi\fmi.pyx":5300
 *             variable = FMIL.fmi2_import_get_variable(variable_list, i)
 * 
 *             scalar_variable = self._add_scalar_variable(variable)             # <<<<<<<<<<<<<<
 *             variable_dict[scalar_variable.name] = scalar_variable
 * 
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self->__pyx_base.__pyx_vtab)->_add_scalar_variable(__pyx_v_self, __pyx_v_variable); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_v_scalar_variable);
    __pyx_v_scalar_variable = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pyfmi\fmi.pyx":5301
 * 
 *             scalar_variable = self._add_scalar_variable(variable)
 *             variable_dict[scalar_variable.name] = scalar_variable             # <<<<<<<<<<<<<<
 * 
 *         #Free the variable list
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_scalar_variable, __pyx_n_s__name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyObject_SetItem(__pyx_v_variable_dict, __pyx_t_1, __pyx_v_scalar_variable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":5304
 * 
 *         #Free the variable list
 *         FMIL.fmi2_import_free_variable_list(variable_list)             # <<<<<<<<<<<<<<
 * 
 *         return variable_dict
 */
  fmi2_import_free_variable_list(__pyx_v_variable_list);

  /* "pyfmi\fmi.pyx":5306
 *         FMIL.fmi2_import_free_variable_list(variable_list)
 * 
 *         return variable_dict             # <<<<<<<<<<<<<<
 * 
 *     def get_directional_derivative(self, var_ref, func_ref, v):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_variable_dict);
  __pyx_r = __pyx_v_variable_dict;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_output_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_variable_dict);
  __Pyx_XDECREF(__pyx_v_scalar_variable);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_125get_directional_derivative(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_124get_directional_derivative[] = "\n        Returns the directional derivatives of the functions with respect\n        to the given variables and in the given direction.\n        In other words, it returns linear combinations of the partial derivatives\n        of the given functions with respect to the selected variables.\n        The point of evaluation is the current time-point.\n\n        Parameters::\n\n            var_ref --\n                A list of variable references that the partial derivatives\n                will be calculated with respect to.\n\n            func_ref --\n                A list of function references for which the partial derivatives will be calculated.\n\n            v --\n                A seed vector specifying the linear combination of the partial derivatives.\n\n        Returns::\n\n            value --\n                A vector with the directional derivatives (linear combination of\n                partial derivatives) evaluated in the current time point.\n\n\n        Example::\n\n            states = model.get_states_list()\n            states_references = [s.value_reference for s in states.values()]\n            derivatives = model.get_derivatives_list()\n            derivatives_references = [d.value_reference for d in derivatives.values()]\n            model.get_directional_derivative(states_references, derivatives_references, v)\n\n            This returns Jv, where J is the Jacobian and v the seed vector.\n\n            Also, only a subset of the derivatives and and states can be selected:\n\n            model.get_directional_derivative(var_ref = [0,1], func_ref = [2,3], v = [1,2])\n\n            This returns a vector with two values where:\n\n            values[0] = (df2/dv0) * 1 + (df2/dv1) * 2\n            values[1] = (df3/dv0) * 1 + (df3/dv1) * 2\n\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_125get_directional_derivative(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_var_ref = 0;
  PyObject *__pyx_v_func_ref = 0;
  PyObject *__pyx_v_v = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_directional_derivative (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__var_ref,&__pyx_n_s__func_ref,&__pyx_n_s__v,0};
    PyObject* values[3] = {0,0,0};
    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__var_ref)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__func_ref)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_directional_derivative", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5308; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__v)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_directional_derivative", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5308; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_directional_derivative") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5308; __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_var_ref = values[0];
    __pyx_v_func_ref = values[1];
    __pyx_v_v = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_directional_derivative", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5308; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_directional_derivative", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_124get_directional_derivative(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_v_var_ref, __pyx_v_func_ref, __pyx_v_v);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5308
 *         return variable_dict
 * 
 *     def get_directional_derivative(self, var_ref, func_ref, v):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the directional derivatives of the functions with respect
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_124get_directional_derivative(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_var_ref, PyObject *__pyx_v_func_ref, PyObject *__pyx_v_v) {
  int __pyx_v_status;
  CYTHON_UNUSED size_t __pyx_v_nv;
  CYTHON_UNUSED size_t __pyx_v_nz;
  PyArrayObject *__pyx_v_v_ref = 0;
  PyArrayObject *__pyx_v_z_ref = 0;
  PyArrayObject *__pyx_v_dv = 0;
  PyArrayObject *__pyx_v_dz = 0;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_j = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_dv;
  __Pyx_Buffer __pyx_pybuffer_dv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_dz;
  __Pyx_Buffer __pyx_pybuffer_dz;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_v_ref;
  __Pyx_Buffer __pyx_pybuffer_v_ref;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_z_ref;
  __Pyx_Buffer __pyx_pybuffer_z_ref;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  PyArrayObject *__pyx_t_8 = NULL;
  PyArrayObject *__pyx_t_9 = NULL;
  PyArrayObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  int __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_directional_derivative", 0);
  __pyx_pybuffer_v_ref.pybuffer.buf = NULL;
  __pyx_pybuffer_v_ref.refcount = 0;
  __pyx_pybuffernd_v_ref.data = NULL;
  __pyx_pybuffernd_v_ref.rcbuffer = &__pyx_pybuffer_v_ref;
  __pyx_pybuffer_z_ref.pybuffer.buf = NULL;
  __pyx_pybuffer_z_ref.refcount = 0;
  __pyx_pybuffernd_z_ref.data = NULL;
  __pyx_pybuffernd_z_ref.rcbuffer = &__pyx_pybuffer_z_ref;
  __pyx_pybuffer_dv.pybuffer.buf = NULL;
  __pyx_pybuffer_dv.refcount = 0;
  __pyx_pybuffernd_dv.data = NULL;
  __pyx_pybuffernd_dv.rcbuffer = &__pyx_pybuffer_dv;
  __pyx_pybuffer_dz.pybuffer.buf = NULL;
  __pyx_pybuffer_dz.refcount = 0;
  __pyx_pybuffernd_dz.data = NULL;
  __pyx_pybuffernd_dz.rcbuffer = &__pyx_pybuffer_dz;

  /* "pyfmi\fmi.pyx":5360
 * 
 *         #input arrays
 *         cdef N.ndarray[FMIL.fmi2_value_reference_t, ndim=1, mode='c'] v_ref = N.zeros(len(var_ref),  dtype = N.uint32)             # <<<<<<<<<<<<<<
 *         cdef N.ndarray[FMIL.fmi2_value_reference_t, ndim=1, mode='c'] z_ref = N.zeros(len(func_ref), dtype = N.uint32)
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] dv    = N.zeros(len(v),        dtype = N.double)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = PyObject_Length(__pyx_v_var_ref); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__uint32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v_ref.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn_fmi2_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_v_ref = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_v_ref.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_v_ref.diminfo[0].strides = __pyx_pybuffernd_v_ref.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v_ref.diminfo[0].shape = __pyx_pybuffernd_v_ref.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_7 = 0;
  __pyx_v_v_ref = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pyfmi\fmi.pyx":5361
 *         #input arrays
 *         cdef N.ndarray[FMIL.fmi2_value_reference_t, ndim=1, mode='c'] v_ref = N.zeros(len(var_ref),  dtype = N.uint32)
 *         cdef N.ndarray[FMIL.fmi2_value_reference_t, ndim=1, mode='c'] z_ref = N.zeros(len(func_ref), dtype = N.uint32)             # <<<<<<<<<<<<<<
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] dv    = N.zeros(len(v),        dtype = N.double)
 *         #output array
 */
  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_3 = PyObject_Length(__pyx_v_func_ref); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__uint32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_z_ref.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn_fmi2_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_z_ref = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_z_ref.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_z_ref.diminfo[0].strides = __pyx_pybuffernd_z_ref.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_z_ref.diminfo[0].shape = __pyx_pybuffernd_z_ref.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_8 = 0;
  __pyx_v_z_ref = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":5362
 *         cdef N.ndarray[FMIL.fmi2_value_reference_t, ndim=1, mode='c'] v_ref = N.zeros(len(var_ref),  dtype = N.uint32)
 *         cdef N.ndarray[FMIL.fmi2_value_reference_t, ndim=1, mode='c'] z_ref = N.zeros(len(func_ref), dtype = N.uint32)
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] dv    = N.zeros(len(v),        dtype = N.double)             # <<<<<<<<<<<<<<
 *         #output array
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] dz    = N.zeros(len(func_ref), dtype = N.double)
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__zeros); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = PyObject_Length(__pyx_v_v); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__double); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dv.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn_fmi2_real_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_dv = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_dv.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_dv.diminfo[0].strides = __pyx_pybuffernd_dv.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dv.diminfo[0].shape = __pyx_pybuffernd_dv.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_9 = 0;
  __pyx_v_dv = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":5364
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] dv    = N.zeros(len(v),        dtype = N.double)
 *         #output array
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] dz    = N.zeros(len(func_ref), dtype = N.double)             # <<<<<<<<<<<<<<
 * 
 *         if not self._provides_directional_derivatives():
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = PyObject_Length(__pyx_v_func_ref); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__double); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_10 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dz.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn_fmi2_real_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_dz = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_dz.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_dz.diminfo[0].strides = __pyx_pybuffernd_dz.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dz.diminfo[0].shape = __pyx_pybuffernd_dz.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_10 = 0;
  __pyx_v_dz = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5366
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] dz    = N.zeros(len(func_ref), dtype = N.double)
 * 
 *         if not self._provides_directional_derivatives():             # <<<<<<<<<<<<<<
 *             raise FMUException('This FMU does not provide directional derivatives')
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_312); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5366; __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 = 5366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_12 = (!__pyx_t_11);
  if (__pyx_t_12) {

    /* "pyfmi\fmi.pyx":5367
 * 
 *         if not self._provides_directional_derivatives():
 *             raise FMUException('This FMU does not provide directional derivatives')             # <<<<<<<<<<<<<<
 * 
 *         if len(var_ref) != len(v):
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_314), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5369
 *             raise FMUException('This FMU does not provide directional derivatives')
 * 
 *         if len(var_ref) != len(v):             # <<<<<<<<<<<<<<
 *             raise FMUException('The length of the list with variables (var_ref) and the seed vector (V) are not equal')
 * 
 */
  __pyx_t_3 = PyObject_Length(__pyx_v_var_ref); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = PyObject_Length(__pyx_v_v); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = (__pyx_t_3 != __pyx_t_13);
  if (__pyx_t_12) {

    /* "pyfmi\fmi.pyx":5370
 * 
 *         if len(var_ref) != len(v):
 *             raise FMUException('The length of the list with variables (var_ref) and the seed vector (V) are not equal')             # <<<<<<<<<<<<<<
 * 
 *         for i in range(len(var_ref)):
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_316), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":5372
 *             raise FMUException('The length of the list with variables (var_ref) and the seed vector (V) are not equal')
 * 
 *         for i in range(len(var_ref)):             # <<<<<<<<<<<<<<
 *             v_ref[i] = var_ref[i]
 *             dv[i] = v[i]
 */
  __pyx_t_13 = PyObject_Length(__pyx_v_var_ref); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_13 = 0;
    __pyx_t_14 = NULL;
  } else {
    __pyx_t_13 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_14 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (!__pyx_t_14 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_14 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_2 = __pyx_t_14(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF(__pyx_v_i);
    __pyx_v_i = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyfmi\fmi.pyx":5373
 * 
 *         for i in range(len(var_ref)):
 *             v_ref[i] = var_ref[i]             # <<<<<<<<<<<<<<
 *             dv[i] = v[i]
 *         for j in range(len(func_ref)):
 */
    __pyx_t_2 = PyObject_GetItem(__pyx_v_var_ref, __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (PyObject_SetItem(((PyObject *)__pyx_v_v_ref), __pyx_v_i, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pyfmi\fmi.pyx":5374
 *         for i in range(len(var_ref)):
 *             v_ref[i] = var_ref[i]
 *             dv[i] = v[i]             # <<<<<<<<<<<<<<
 *         for j in range(len(func_ref)):
 *             z_ref[j] = func_ref[j]
 */
    __pyx_t_2 = PyObject_GetItem(__pyx_v_v, __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (PyObject_SetItem(((PyObject *)__pyx_v_dv), __pyx_v_i, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5375
 *             v_ref[i] = var_ref[i]
 *             dv[i] = v[i]
 *         for j in range(len(func_ref)):             # <<<<<<<<<<<<<<
 *             z_ref[j] = func_ref[j]
 * 
 */
  __pyx_t_13 = PyObject_Length(__pyx_v_func_ref); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5375; __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 = 5375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_13 = 0;
    __pyx_t_14 = NULL;
  } else {
    __pyx_t_13 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_14 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (!__pyx_t_14 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_14 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_14(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF(__pyx_v_j);
    __pyx_v_j = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pyfmi\fmi.pyx":5376
 *             dv[i] = v[i]
 *         for j in range(len(func_ref)):
 *             z_ref[j] = func_ref[j]             # <<<<<<<<<<<<<<
 * 
 *         nv = len(v_ref)
 */
    __pyx_t_1 = PyObject_GetItem(__pyx_v_func_ref, __pyx_v_j); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyObject_SetItem(((PyObject *)__pyx_v_z_ref), __pyx_v_j, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":5378
 *             z_ref[j] = func_ref[j]
 * 
 *         nv = len(v_ref)             # <<<<<<<<<<<<<<
 *         nz = len(z_ref)
 * 
 */
  __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_v_ref)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nv = __pyx_t_13;

  /* "pyfmi\fmi.pyx":5379
 * 
 *         nv = len(v_ref)
 *         nz = len(z_ref)             # <<<<<<<<<<<<<<
 * 
 *         #status = FMIL.fmi2_import_get_directional_derivative(self._fmu, <FMIL.fmi2_value_reference_t*> v_ref.data, nv, <FMIL.fmi2_value_reference_t*> z_ref.data, nz, <FMIL.fmi2_real_t*> dv.data, <FMIL.fmi2_real_t*> dz.data)
 */
  __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_z_ref)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nz = __pyx_t_13;

  /* "pyfmi\fmi.pyx":5382
 * 
 *         #status = FMIL.fmi2_import_get_directional_derivative(self._fmu, <FMIL.fmi2_value_reference_t*> v_ref.data, nv, <FMIL.fmi2_value_reference_t*> z_ref.data, nz, <FMIL.fmi2_real_t*> dv.data, <FMIL.fmi2_real_t*> dz.data)
 *         status = self._get_directional_derivative(v_ref, z_ref, dv, dz)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_t_15 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self->__pyx_base.__pyx_vtab)->_get_directional_derivative(__pyx_v_self, ((PyArrayObject *)__pyx_v_v_ref), ((PyArrayObject *)__pyx_v_z_ref), ((PyArrayObject *)__pyx_v_dv), ((PyArrayObject *)__pyx_v_dz)); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_status = __pyx_t_15;

  /* "pyfmi\fmi.pyx":5384
 *         status = self._get_directional_derivative(v_ref, z_ref, dv, dz)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('An error occured while getting the directional derivative, see the log for possible more information')
 * 
 */
  __pyx_t_12 = (__pyx_v_status != 0);
  if (__pyx_t_12) {

    /* "pyfmi\fmi.pyx":5385
 * 
 *         if status != 0:
 *             raise FMUException('An error occured while getting the directional derivative, see the log for possible more information')             # <<<<<<<<<<<<<<
 * 
 *         return dz
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_318), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "pyfmi\fmi.pyx":5387
 *             raise FMUException('An error occured while getting the directional derivative, see the log for possible more information')
 * 
 *         return dz             # <<<<<<<<<<<<<<
 * 
 *     cdef int _get_directional_derivative(self, N.ndarray[FMIL.fmi2_value_reference_t, ndim=1, mode="c"] v_ref,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_dz));
  __pyx_r = ((PyObject *)__pyx_v_dz);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dv.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dz.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v_ref.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_z_ref.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_directional_derivative", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dv.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dz.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v_ref.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_z_ref.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_v_ref);
  __Pyx_XDECREF((PyObject *)__pyx_v_z_ref);
  __Pyx_XDECREF((PyObject *)__pyx_v_dv);
  __Pyx_XDECREF((PyObject *)__pyx_v_dz);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_j);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5389
 *         return dz
 * 
 *     cdef int _get_directional_derivative(self, N.ndarray[FMIL.fmi2_value_reference_t, ndim=1, mode="c"] v_ref,             # <<<<<<<<<<<<<<
 *                                                N.ndarray[FMIL.fmi2_value_reference_t, ndim=1, mode="c"] z_ref,
 *                                                N.ndarray[FMIL.fmi2_real_t, ndim=1, mode="c"] dv,
 */

static int __pyx_f_5pyfmi_3fmi_13FMUModelBase2__get_directional_derivative(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyArrayObject *__pyx_v_v_ref, PyArrayObject *__pyx_v_z_ref, PyArrayObject *__pyx_v_dv, PyArrayObject *__pyx_v_dz) {
  int __pyx_v_status;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_dv;
  __Pyx_Buffer __pyx_pybuffer_dv;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_dz;
  __Pyx_Buffer __pyx_pybuffer_dz;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_v_ref;
  __Pyx_Buffer __pyx_pybuffer_v_ref;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_z_ref;
  __Pyx_Buffer __pyx_pybuffer_z_ref;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  size_t __pyx_t_7;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_directional_derivative", 0);
  __pyx_pybuffer_v_ref.pybuffer.buf = NULL;
  __pyx_pybuffer_v_ref.refcount = 0;
  __pyx_pybuffernd_v_ref.data = NULL;
  __pyx_pybuffernd_v_ref.rcbuffer = &__pyx_pybuffer_v_ref;
  __pyx_pybuffer_z_ref.pybuffer.buf = NULL;
  __pyx_pybuffer_z_ref.refcount = 0;
  __pyx_pybuffernd_z_ref.data = NULL;
  __pyx_pybuffernd_z_ref.rcbuffer = &__pyx_pybuffer_z_ref;
  __pyx_pybuffer_dv.pybuffer.buf = NULL;
  __pyx_pybuffer_dv.refcount = 0;
  __pyx_pybuffernd_dv.data = NULL;
  __pyx_pybuffernd_dv.rcbuffer = &__pyx_pybuffer_dv;
  __pyx_pybuffer_dz.pybuffer.buf = NULL;
  __pyx_pybuffer_dz.refcount = 0;
  __pyx_pybuffernd_dz.data = NULL;
  __pyx_pybuffernd_dz.rcbuffer = &__pyx_pybuffer_dz;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v_ref.rcbuffer->pybuffer, (PyObject*)__pyx_v_v_ref, &__Pyx_TypeInfo_nn_fmi2_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_v_ref.diminfo[0].strides = __pyx_pybuffernd_v_ref.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v_ref.diminfo[0].shape = __pyx_pybuffernd_v_ref.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_z_ref.rcbuffer->pybuffer, (PyObject*)__pyx_v_z_ref, &__Pyx_TypeInfo_nn_fmi2_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_z_ref.diminfo[0].strides = __pyx_pybuffernd_z_ref.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_z_ref.diminfo[0].shape = __pyx_pybuffernd_z_ref.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dv.rcbuffer->pybuffer, (PyObject*)__pyx_v_dv, &__Pyx_TypeInfo_nn_fmi2_real_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_dv.diminfo[0].strides = __pyx_pybuffernd_dv.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dv.diminfo[0].shape = __pyx_pybuffernd_dv.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dz.rcbuffer->pybuffer, (PyObject*)__pyx_v_dz, &__Pyx_TypeInfo_nn_fmi2_real_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_dz.diminfo[0].strides = __pyx_pybuffernd_dz.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dz.diminfo[0].shape = __pyx_pybuffernd_dz.rcbuffer->pybuffer.shape[0];

  /* "pyfmi\fmi.pyx":5395
 *         cdef int status
 * 
 *         assert dv.size >= v_ref.size and dz.size >= z_ref.size             # <<<<<<<<<<<<<<
 * 
 *         if not self._provides_directional_derivatives():
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_dv), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_v_ref), __pyx_n_s__size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {
    __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_dz), __pyx_n_s__size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_z_ref), __pyx_n_s__size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = __pyx_t_5;
  } else {
    __pyx_t_6 = __pyx_t_4;
  }
  if (unlikely(!__pyx_t_6)) {
    PyErr_SetNone(PyExc_AssertionError);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "pyfmi\fmi.pyx":5397
 *         assert dv.size >= v_ref.size and dz.size >= z_ref.size
 * 
 *         if not self._provides_directional_derivatives():             # <<<<<<<<<<<<<<
 *             raise FMUException('This FMU does not provide directional derivatives')
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_312); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5397; __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 = 5397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (!__pyx_t_6);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":5398
 * 
 *         if not self._provides_directional_derivatives():
 *             raise FMUException('This FMU does not provide directional derivatives')             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_get_directional_derivative(self._fmu,
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_319), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5401
 * 
 *         status = FMIL.fmi2_import_get_directional_derivative(self._fmu,
 *                   <FMIL.fmi2_value_reference_t*> v_ref.data, v_ref.size,             # <<<<<<<<<<<<<<
 *                   <FMIL.fmi2_value_reference_t*> z_ref.data, z_ref.size,
 *                   <FMIL.fmi2_real_t*> dv.data,
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_v_ref), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyInt_AsSize_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5402
 *         status = FMIL.fmi2_import_get_directional_derivative(self._fmu,
 *                   <FMIL.fmi2_value_reference_t*> v_ref.data, v_ref.size,
 *                   <FMIL.fmi2_value_reference_t*> z_ref.data, z_ref.size,             # <<<<<<<<<<<<<<
 *                   <FMIL.fmi2_real_t*> dv.data,
 *                   <FMIL.fmi2_real_t*> dz.data)
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_z_ref), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_PyInt_AsSize_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5404
 *                   <FMIL.fmi2_value_reference_t*> z_ref.data, z_ref.size,
 *                   <FMIL.fmi2_real_t*> dv.data,
 *                   <FMIL.fmi2_real_t*> dz.data)             # <<<<<<<<<<<<<<
 * 
 *         return status
 */
  __pyx_v_status = fmi2_import_get_directional_derivative(__pyx_v_self->_fmu, ((fmi2_value_reference_t *)__pyx_v_v_ref->data), __pyx_t_7, ((fmi2_value_reference_t *)__pyx_v_z_ref->data), __pyx_t_8, ((fmi2_real_t *)__pyx_v_dv->data), ((fmi2_real_t *)__pyx_v_dz->data));

  /* "pyfmi\fmi.pyx":5406
 *                   <FMIL.fmi2_real_t*> dz.data)
 * 
 *         return status             # <<<<<<<<<<<<<<
 * 
 *     def get_version(self):
 */
  __pyx_r = __pyx_v_status;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dv.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dz.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v_ref.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_z_ref.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2._get_directional_derivative", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dv.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dz.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v_ref.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_z_ref.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_127get_version(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_126get_version[] = "\n        Returns the FMI version of the Model which it was generated according.\n\n        Returns::\n\n            version --\n                The version.\n\n        Example::\n\n            model.get_version()\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_127get_version(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_version (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_126get_version(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5408
 *         return status
 * 
 *     def get_version(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the FMI version of the Model which it was generated according.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_126get_version(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  char *__pyx_v_version;
  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("get_version", 0);

  /* "pyfmi\fmi.pyx":5421
 *             model.get_version()
 *         """
 *         cdef char* version = FMIL.fmi2_import_get_version(self._fmu)             # <<<<<<<<<<<<<<
 *         return version
 * 
 */
  __pyx_v_version = fmi2_import_get_version(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":5422
 *         """
 *         cdef char* version = FMIL.fmi2_import_get_version(self._fmu)
 *         return version             # <<<<<<<<<<<<<<
 * 
 *     def get_model_version(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromString(__pyx_v_version); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_version", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_129get_model_version(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_128get_model_version[] = "\n        Returns the version fo the FMU.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_129get_model_version(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_model_version (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_128get_model_version(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5424
 *         return version
 * 
 *     def get_model_version(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the version fo the FMU.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_128get_model_version(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  char *__pyx_v_version;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_model_version", 0);

  /* "pyfmi\fmi.pyx":5429
 *         """
 *         cdef char* version
 *         version = FMIL.fmi2_import_get_model_version(self._fmu)             # <<<<<<<<<<<<<<
 *         return version if version != NULL else ""
 * 
 */
  __pyx_v_version = fmi2_import_get_model_version(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":5430
 *         cdef char* version
 *         version = FMIL.fmi2_import_get_model_version(self._fmu)
 *         return version if version != NULL else ""             # <<<<<<<<<<<<<<
 * 
 *     def get_name(self):
 */
  __Pyx_XDECREF(__pyx_r);
  if ((__pyx_v_version != NULL)) {
    __pyx_t_2 = PyBytes_FromString(__pyx_v_version); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_1 = ((PyObject *)__pyx_t_2);
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_12));
    __pyx_t_1 = ((PyObject *)__pyx_kp_s_12);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_model_version", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_131get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_130get_name[] = "\n        Return the model name as used in the modeling environment.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_131get_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_name (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_130get_name(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5432
 *         return version if version != NULL else ""
 * 
 *     def get_name(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the model name as used in the modeling environment.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_130get_name(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_name", 0);

  /* "pyfmi\fmi.pyx":5436
 *         Return the model name as used in the modeling environment.
 *         """
 *         return self._modelName             # <<<<<<<<<<<<<<
 * 
 *     def get_author(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_modelName);
  __pyx_r = __pyx_v_self->_modelName;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_133get_author(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_132get_author[] = "\n        Return the name and organization of the model author.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_133get_author(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_author (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_132get_author(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5438
 *         return self._modelName
 * 
 *     def get_author(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the name and organization of the model author.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_132get_author(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  char *__pyx_v_author;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_author", 0);

  /* "pyfmi\fmi.pyx":5443
 *         """
 *         cdef char* author
 *         author = FMIL.fmi2_import_get_author(self._fmu)             # <<<<<<<<<<<<<<
 *         return author if author != NULL else ""
 * 
 */
  __pyx_v_author = fmi2_import_get_author(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":5444
 *         cdef char* author
 *         author = FMIL.fmi2_import_get_author(self._fmu)
 *         return author if author != NULL else ""             # <<<<<<<<<<<<<<
 * 
 *     def get_description(self):
 */
  __Pyx_XDECREF(__pyx_r);
  if ((__pyx_v_author != NULL)) {
    __pyx_t_2 = PyBytes_FromString(__pyx_v_author); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_1 = ((PyObject *)__pyx_t_2);
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_12));
    __pyx_t_1 = ((PyObject *)__pyx_kp_s_12);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_author", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_135get_description(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_134get_description[] = "\n        Return the model description.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_135get_description(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_description (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_134get_description(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5446
 *         return author if author != NULL else ""
 * 
 *     def get_description(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the model description.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_134get_description(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  char *__pyx_v_desc;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_description", 0);

  /* "pyfmi\fmi.pyx":5451
 *         """
 *         cdef char* desc
 *         desc = FMIL.fmi2_import_get_description(self._fmu)             # <<<<<<<<<<<<<<
 *         return desc if desc != NULL else ""
 * 
 */
  __pyx_v_desc = fmi2_import_get_description(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":5452
 *         cdef char* desc
 *         desc = FMIL.fmi2_import_get_description(self._fmu)
 *         return desc if desc != NULL else ""             # <<<<<<<<<<<<<<
 * 
 *     def get_copyright(self):
 */
  __Pyx_XDECREF(__pyx_r);
  if ((__pyx_v_desc != NULL)) {
    __pyx_t_2 = PyBytes_FromString(__pyx_v_desc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_1 = ((PyObject *)__pyx_t_2);
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_12));
    __pyx_t_1 = ((PyObject *)__pyx_kp_s_12);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_description", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_137get_copyright(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_136get_copyright[] = "\n        Return the model copyright.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_137get_copyright(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_copyright (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_136get_copyright(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5454
 *         return desc if desc != NULL else ""
 * 
 *     def get_copyright(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the model copyright.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_136get_copyright(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  char *__pyx_v_copyright;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_copyright", 0);

  /* "pyfmi\fmi.pyx":5459
 *         """
 *         cdef char* copyright
 *         copyright = FMIL.fmi2_import_get_copyright(self._fmu)             # <<<<<<<<<<<<<<
 *         return copyright if copyright != NULL else ""
 * 
 */
  __pyx_v_copyright = fmi2_import_get_copyright(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":5460
 *         cdef char* copyright
 *         copyright = FMIL.fmi2_import_get_copyright(self._fmu)
 *         return copyright if copyright != NULL else ""             # <<<<<<<<<<<<<<
 * 
 *     def get_license(self):
 */
  __Pyx_XDECREF(__pyx_r);
  if ((__pyx_v_copyright != NULL)) {
    __pyx_t_2 = PyBytes_FromString(__pyx_v_copyright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_1 = ((PyObject *)__pyx_t_2);
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_12));
    __pyx_t_1 = ((PyObject *)__pyx_kp_s_12);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_copyright", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_139get_license(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_138get_license[] = "\n        Return the model license.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_139get_license(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_license (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_138get_license(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5462
 *         return copyright if copyright != NULL else ""
 * 
 *     def get_license(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the model license.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_138get_license(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  char *__pyx_v_license;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_license", 0);

  /* "pyfmi\fmi.pyx":5467
 *         """
 *         cdef char* license
 *         license = FMIL.fmi2_import_get_license(self._fmu)             # <<<<<<<<<<<<<<
 *         return license if license != NULL else ""
 * 
 */
  __pyx_v_license = fmi2_import_get_license(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":5468
 *         cdef char* license
 *         license = FMIL.fmi2_import_get_license(self._fmu)
 *         return license if license != NULL else ""             # <<<<<<<<<<<<<<
 * 
 *     def get_generation_tool(self):
 */
  __Pyx_XDECREF(__pyx_r);
  if ((__pyx_v_license != NULL)) {
    __pyx_t_2 = PyBytes_FromString(__pyx_v_license); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_1 = ((PyObject *)__pyx_t_2);
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_12));
    __pyx_t_1 = ((PyObject *)__pyx_kp_s_12);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_license", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_141get_generation_tool(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_140get_generation_tool[] = "\n        Return the model generation tool.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_141get_generation_tool(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_generation_tool (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_140get_generation_tool(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5470
 *         return license if license != NULL else ""
 * 
 *     def get_generation_tool(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the model generation tool.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_140get_generation_tool(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  char *__pyx_v_gen;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_generation_tool", 0);

  /* "pyfmi\fmi.pyx":5475
 *         """
 *         cdef char* gen
 *         gen = FMIL.fmi2_import_get_generation_tool(self._fmu)             # <<<<<<<<<<<<<<
 *         return gen if gen != NULL else ""
 * 
 */
  __pyx_v_gen = fmi2_import_get_generation_tool(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":5476
 *         cdef char* gen
 *         gen = FMIL.fmi2_import_get_generation_tool(self._fmu)
 *         return gen if gen != NULL else ""             # <<<<<<<<<<<<<<
 * 
 *     def get_generation_date_and_time(self):
 */
  __Pyx_XDECREF(__pyx_r);
  if ((__pyx_v_gen != NULL)) {
    __pyx_t_2 = PyBytes_FromString(__pyx_v_gen); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_1 = ((PyObject *)__pyx_t_2);
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_12));
    __pyx_t_1 = ((PyObject *)__pyx_kp_s_12);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_generation_tool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_143get_generation_date_and_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_142get_generation_date_and_time[] = "\n        Return the model generation date and time.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_143get_generation_date_and_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_generation_date_and_time (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_142get_generation_date_and_time(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5478
 *         return gen if gen != NULL else ""
 * 
 *     def get_generation_date_and_time(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the model generation date and time.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_142get_generation_date_and_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  char *__pyx_v_gen;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_generation_date_and_time", 0);

  /* "pyfmi\fmi.pyx":5483
 *         """
 *         cdef char* gen
 *         gen = FMIL.fmi2_import_get_generation_date_and_time(self._fmu)             # <<<<<<<<<<<<<<
 *         return gen if gen != NULL else ""
 * 
 */
  __pyx_v_gen = fmi2_import_get_generation_date_and_time(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":5484
 *         cdef char* gen
 *         gen = FMIL.fmi2_import_get_generation_date_and_time(self._fmu)
 *         return gen if gen != NULL else ""             # <<<<<<<<<<<<<<
 * 
 *     def get_guid(self):
 */
  __Pyx_XDECREF(__pyx_r);
  if ((__pyx_v_gen != NULL)) {
    __pyx_t_2 = PyBytes_FromString(__pyx_v_gen); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_1 = ((PyObject *)__pyx_t_2);
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_12));
    __pyx_t_1 = ((PyObject *)__pyx_kp_s_12);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_generation_date_and_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_145get_guid(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_144get_guid[] = "\n        Return the model GUID.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_145get_guid(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_guid (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_144get_guid(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5486
 *         return gen if gen != NULL else ""
 * 
 *     def get_guid(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the model GUID.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_144get_guid(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  PyObject *__pyx_v_guid = NULL;
  PyObject *__pyx_r = NULL;
  __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("get_guid", 0);

  /* "pyfmi\fmi.pyx":5490
 *         Return the model GUID.
 *         """
 *         guid = decode(FMIL.fmi2_import_get_GUID(self._fmu))             # <<<<<<<<<<<<<<
 *         return guid
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyBytes_FromString(fmi2_import_get_GUID(__pyx_v_self->_fmu)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_v_guid = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":5491
 *         """
 *         guid = decode(FMIL.fmi2_import_get_GUID(self._fmu))
 *         return guid             # <<<<<<<<<<<<<<
 * 
 *     def get_variable_naming_convention(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_guid);
  __pyx_r = __pyx_v_guid;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_guid", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_guid);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_147get_variable_naming_convention(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_146get_variable_naming_convention[] = "\n        Return the variable naming convention.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_147get_variable_naming_convention(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_variable_naming_convention (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_146get_variable_naming_convention(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5493
 *         return guid
 * 
 *     def get_variable_naming_convention(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the variable naming convention.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_146get_variable_naming_convention(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  fmi2_variable_naming_convension_enu_t __pyx_v_conv;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("get_variable_naming_convention", 0);

  /* "pyfmi\fmi.pyx":5498
 *         """
 *         cdef FMIL.fmi2_variable_naming_convension_enu_t conv
 *         conv = FMIL.fmi2_import_get_naming_convention(self._fmu)             # <<<<<<<<<<<<<<
 *         if conv == FMIL.fmi2_naming_enu_flat:
 *             return "flat"
 */
  __pyx_v_conv = fmi2_import_get_naming_convention(__pyx_v_self->_fmu);

  /* "pyfmi\fmi.pyx":5499
 *         cdef FMIL.fmi2_variable_naming_convension_enu_t conv
 *         conv = FMIL.fmi2_import_get_naming_convention(self._fmu)
 *         if conv == FMIL.fmi2_naming_enu_flat:             # <<<<<<<<<<<<<<
 *             return "flat"
 *         elif conv == FMIL.fmi2_naming_enu_structured:
 */
  __pyx_t_1 = (__pyx_v_conv == fmi2_naming_enu_flat);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5500
 *         conv = FMIL.fmi2_import_get_naming_convention(self._fmu)
 *         if conv == FMIL.fmi2_naming_enu_flat:
 *             return "flat"             # <<<<<<<<<<<<<<
 *         elif conv == FMIL.fmi2_naming_enu_structured:
 *             return "structured"
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_n_s__flat));
    __pyx_r = ((PyObject *)__pyx_n_s__flat);
    goto __pyx_L0;
    goto __pyx_L3;
  }

  /* "pyfmi\fmi.pyx":5501
 *         if conv == FMIL.fmi2_naming_enu_flat:
 *             return "flat"
 *         elif conv == FMIL.fmi2_naming_enu_structured:             # <<<<<<<<<<<<<<
 *             return "structured"
 *         else:
 */
  __pyx_t_1 = (__pyx_v_conv == fmi2_naming_enu_structured);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5502
 *             return "flat"
 *         elif conv == FMIL.fmi2_naming_enu_structured:
 *             return "structured"             # <<<<<<<<<<<<<<
 *         else:
 *             return "unknown"
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_n_s__structured));
    __pyx_r = ((PyObject *)__pyx_n_s__structured);
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":5504
 *             return "structured"
 *         else:
 *             return "unknown"             # <<<<<<<<<<<<<<
 * 
 *     def get_identifier(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_n_s__unknown));
    __pyx_r = ((PyObject *)__pyx_n_s__unknown);
    goto __pyx_L0;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_149get_identifier(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_148get_identifier[] = "\n        Return the model identifier, name of binary model file and prefix in\n        the C-function names of the model.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_149get_identifier(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_identifier (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_148get_identifier(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5506
 *             return "unknown"
 * 
 *     def get_identifier(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the model identifier, name of binary model file and prefix in
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_148get_identifier(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_identifier", 0);

  /* "pyfmi\fmi.pyx":5511
 *         the C-function names of the model.
 *         """
 *         return self._modelId             # <<<<<<<<<<<<<<
 * 
 *     def get_model_types_platform(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_modelId);
  __pyx_r = __pyx_v_self->_modelId;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_151get_model_types_platform(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_13FMUModelBase2_150get_model_types_platform[] = "\n        Returns the set of valid compatible platforms for the Model, extracted\n        from the XML.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_151get_model_types_platform(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_model_types_platform (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_150get_model_types_platform(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5513
 *         return self._modelId
 * 
 *     def get_model_types_platform(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the set of valid compatible platforms for the Model, extracted
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_150get_model_types_platform(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__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("get_model_types_platform", 0);

  /* "pyfmi\fmi.pyx":5518
 *         from the XML.
 *         """
 *         return FMIL.fmi2_import_get_types_platform(self._fmu)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromString(fmi2_import_get_types_platform(__pyx_v_self->_fmu)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2.get_model_types_platform", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_15_enable_logging_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_15_enable_logging_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_15_enable_logging___get__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pxd":150
 *     #Internal values
 *     cdef object         _fmu_full_path
 *     cdef public object  _enable_logging             # <<<<<<<<<<<<<<
 *     cdef int _allocated_dll, _allocated_context, _allocated_xml, _allocated_fmu
 *     cdef object         _modelId
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_15_enable_logging___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_enable_logging);
  __pyx_r = __pyx_v_self->_enable_logging;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_15_enable_logging_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_15_enable_logging_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_15_enable_logging_2__set__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_15_enable_logging_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->_enable_logging);
  __Pyx_DECREF(__pyx_v_self->_enable_logging);
  __pyx_v_self->_enable_logging = __pyx_v_value;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_15_enable_logging_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_15_enable_logging_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_15_enable_logging_4__del__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_15_enable_logging_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_enable_logging);
  __Pyx_DECREF(__pyx_v_self->_enable_logging);
  __pyx_v_self->_enable_logging = Py_None;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_24_save_real_variables_val_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_24_save_real_variables_val_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_24_save_real_variables_val___get__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pxd":155
 *     cdef object         _modelName
 *     cdef list           _categories
 *     cdef public list    _save_real_variables_val             # <<<<<<<<<<<<<<
 *     cdef public list    _save_int_variables_val
 *     cdef public list    _save_bool_variables_val
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_24_save_real_variables_val___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->_save_real_variables_val));
  __pyx_r = ((PyObject *)__pyx_v_self->_save_real_variables_val);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_24_save_real_variables_val_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_24_save_real_variables_val_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_24_save_real_variables_val_2__set__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_24_save_real_variables_val_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->_save_real_variables_val);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_save_real_variables_val));
  __pyx_v_self->_save_real_variables_val = ((PyObject*)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2._save_real_variables_val.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_24_save_real_variables_val_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_24_save_real_variables_val_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_24_save_real_variables_val_4__del__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_24_save_real_variables_val_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_save_real_variables_val);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_save_real_variables_val));
  __pyx_v_self->_save_real_variables_val = ((PyObject*)Py_None);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_23_save_int_variables_val_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_23_save_int_variables_val_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_23_save_int_variables_val___get__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pxd":156
 *     cdef list           _categories
 *     cdef public list    _save_real_variables_val
 *     cdef public list    _save_int_variables_val             # <<<<<<<<<<<<<<
 *     cdef public list    _save_bool_variables_val
 *     cdef object         __t
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_23_save_int_variables_val___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->_save_int_variables_val));
  __pyx_r = ((PyObject *)__pyx_v_self->_save_int_variables_val);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_23_save_int_variables_val_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_23_save_int_variables_val_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_23_save_int_variables_val_2__set__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_23_save_int_variables_val_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->_save_int_variables_val);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_save_int_variables_val));
  __pyx_v_self->_save_int_variables_val = ((PyObject*)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2._save_int_variables_val.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_23_save_int_variables_val_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_23_save_int_variables_val_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_23_save_int_variables_val_4__del__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_23_save_int_variables_val_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_save_int_variables_val);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_save_int_variables_val));
  __pyx_v_self->_save_int_variables_val = ((PyObject*)Py_None);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_24_save_bool_variables_val_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_24_save_bool_variables_val_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_24_save_bool_variables_val___get__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pxd":157
 *     cdef public list    _save_real_variables_val
 *     cdef public list    _save_int_variables_val
 *     cdef public list    _save_bool_variables_val             # <<<<<<<<<<<<<<
 *     cdef object         __t
 *     cdef public object  _pyEventInfo
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_24_save_bool_variables_val___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->_save_bool_variables_val));
  __pyx_r = ((PyObject *)__pyx_v_self->_save_bool_variables_val);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_24_save_bool_variables_val_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_24_save_bool_variables_val_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_24_save_bool_variables_val_2__set__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_24_save_bool_variables_val_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->_save_bool_variables_val);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_save_bool_variables_val));
  __pyx_v_self->_save_bool_variables_val = ((PyObject*)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelBase2._save_bool_variables_val.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_24_save_bool_variables_val_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_24_save_bool_variables_val_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_24_save_bool_variables_val_4__del__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_24_save_bool_variables_val_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_save_bool_variables_val);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_save_bool_variables_val));
  __pyx_v_self->_save_bool_variables_val = ((PyObject*)Py_None);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_12_pyEventInfo_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_12_pyEventInfo_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_12_pyEventInfo___get__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pxd":159
 *     cdef public list    _save_bool_variables_val
 *     cdef object         __t
 *     cdef public object  _pyEventInfo             # <<<<<<<<<<<<<<
 *     cdef char* _fmu_temp_dir
 *     cdef object         _states_references
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_12_pyEventInfo___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_pyEventInfo);
  __pyx_r = __pyx_v_self->_pyEventInfo;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_12_pyEventInfo_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_12_pyEventInfo_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_12_pyEventInfo_2__set__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_12_pyEventInfo_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->_pyEventInfo);
  __Pyx_DECREF(__pyx_v_self->_pyEventInfo);
  __pyx_v_self->_pyEventInfo = __pyx_v_value;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_12_pyEventInfo_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_12_pyEventInfo_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_12_pyEventInfo_4__del__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_12_pyEventInfo_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_pyEventInfo);
  __Pyx_DECREF(__pyx_v_self->_pyEventInfo);
  __pyx_v_self->_pyEventInfo = Py_None;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_8_group_A_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_8_group_A_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8_group_A___get__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pxd":170
 *     cdef object         _outputs_inputs_dependencies
 *     cdef object         _A, _B, _C, _D
 *     cdef public object         _group_A, _group_B, _group_C, _group_D             # <<<<<<<<<<<<<<
 *     cdef object         _mask_A
 *     cdef object         _A_row_ind, _A_col_ind
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8_group_A___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_group_A);
  __pyx_r = __pyx_v_self->_group_A;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_8_group_A_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_8_group_A_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8_group_A_2__set__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8_group_A_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->_group_A);
  __Pyx_DECREF(__pyx_v_self->_group_A);
  __pyx_v_self->_group_A = __pyx_v_value;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_8_group_A_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_8_group_A_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8_group_A_4__del__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8_group_A_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_group_A);
  __Pyx_DECREF(__pyx_v_self->_group_A);
  __pyx_v_self->_group_A = Py_None;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_8_group_B_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_8_group_B_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8_group_B___get__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8_group_B___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_group_B);
  __pyx_r = __pyx_v_self->_group_B;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_8_group_B_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_8_group_B_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8_group_B_2__set__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8_group_B_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->_group_B);
  __Pyx_DECREF(__pyx_v_self->_group_B);
  __pyx_v_self->_group_B = __pyx_v_value;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_8_group_B_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_8_group_B_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8_group_B_4__del__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8_group_B_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_group_B);
  __Pyx_DECREF(__pyx_v_self->_group_B);
  __pyx_v_self->_group_B = Py_None;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_8_group_C_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_8_group_C_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8_group_C___get__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8_group_C___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_group_C);
  __pyx_r = __pyx_v_self->_group_C;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_8_group_C_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_8_group_C_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8_group_C_2__set__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8_group_C_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->_group_C);
  __Pyx_DECREF(__pyx_v_self->_group_C);
  __pyx_v_self->_group_C = __pyx_v_value;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_8_group_C_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_8_group_C_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8_group_C_4__del__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8_group_C_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_group_C);
  __Pyx_DECREF(__pyx_v_self->_group_C);
  __pyx_v_self->_group_C = Py_None;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_8_group_D_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_8_group_D_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8_group_D___get__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8_group_D___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_group_D);
  __pyx_r = __pyx_v_self->_group_D;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_8_group_D_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_8_group_D_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8_group_D_2__set__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8_group_D_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->_group_D);
  __Pyx_DECREF(__pyx_v_self->_group_D);
  __pyx_v_self->_group_D = __pyx_v_value;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_8_group_D_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_8_group_D_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8_group_D_4__del__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_8_group_D_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_group_D);
  __Pyx_DECREF(__pyx_v_self->_group_D);
  __pyx_v_self->_group_D = Py_None;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_11FMUModelCS2_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2___init__[] = "\n        Constructor of the model.\n\n        Parameters::\n\n            fmu --\n                Name of the fmu as a string.\n\n            path --\n                Path to the fmu-directory.\n                Default: '.' (working directory)\n\n            enable_logging --\n                Boolean for acesss to logging-messages.\n                Default: True\n\n            log_file_name --\n                Filename for file used to save log messages.\n                Default: \"\" (Generates automatically)\n\n        Returns::\n\n            A model as an object from the class FMUModelCS2\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_5pyfmi_3fmi_11FMUModelCS2___init__;
#endif
static int __pyx_pw_5pyfmi_3fmi_11FMUModelCS2_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fmu = 0;
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_enable_logging = 0;
  PyObject *__pyx_v_log_file_name = 0;
  PyObject *__pyx_v_log_level = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fmu,&__pyx_n_s__path,&__pyx_n_s__enable_logging,&__pyx_n_s__log_file_name,&__pyx_n_s__log_level,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_kp_s_30);
    values[2] = __pyx_k_320;
    values[3] = ((PyObject *)__pyx_kp_s_12);
    values[4] = __pyx_k_321;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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__fmu)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__enable_logging);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__log_file_name);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__log_level);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      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 = 5525; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_fmu = values[0];
    __pyx_v_path = values[1];
    __pyx_v_enable_logging = values[2];
    __pyx_v_log_file_name = values[3];
    __pyx_v_log_level = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5525; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS2___init__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self), __pyx_v_fmu, __pyx_v_path, __pyx_v_enable_logging, __pyx_v_log_file_name, __pyx_v_log_level);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5525
 *     Co-simulation model loaded from a dll
 *     """
 *     def __init__(self, fmu, path = '.', enable_logging = True, log_file_name = "", log_level=FMI_DEFAULT_LOG_LEVEL):             # <<<<<<<<<<<<<<
 *         """
 *         Constructor of the model.
 */

static int __pyx_pf_5pyfmi_3fmi_11FMUModelCS2___init__(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_fmu, PyObject *__pyx_v_path, PyObject *__pyx_v_enable_logging, PyObject *__pyx_v_log_file_name, PyObject *__pyx_v_log_level) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyfmi\fmi.pyx":5552
 * 
 *         #Call super
 *         FMUModelBase2.__init__(self, fmu, path, enable_logging, log_file_name, log_level)             # <<<<<<<<<<<<<<
 * 
 *         if self._fmu_kind != FMIL.fmi2_fmu_kind_cs:
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelBase2)), __pyx_n_s____init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __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_fmu);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_fmu);
  __Pyx_GIVEREF(__pyx_v_fmu);
  __Pyx_INCREF(__pyx_v_path);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  __Pyx_INCREF(__pyx_v_enable_logging);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_enable_logging);
  __Pyx_GIVEREF(__pyx_v_enable_logging);
  __Pyx_INCREF(__pyx_v_log_file_name);
  PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_log_file_name);
  __Pyx_GIVEREF(__pyx_v_log_file_name);
  __Pyx_INCREF(__pyx_v_log_level);
  PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_v_log_level);
  __Pyx_GIVEREF(__pyx_v_log_level);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":5554
 *         FMUModelBase2.__init__(self, fmu, path, enable_logging, log_file_name, log_level)
 * 
 *         if self._fmu_kind != FMIL.fmi2_fmu_kind_cs:             # <<<<<<<<<<<<<<
 *             if self._fmu_kind != FMIL.fmi2_fmu_kind_me_and_cs:
 *                 raise FMUException("This class only supports FMI 2.0 for Co-simulation.")
 */
  __pyx_t_4 = (__pyx_v_self->__pyx_base._fmu_kind != fmi2_fmu_kind_cs);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":5555
 * 
 *         if self._fmu_kind != FMIL.fmi2_fmu_kind_cs:
 *             if self._fmu_kind != FMIL.fmi2_fmu_kind_me_and_cs:             # <<<<<<<<<<<<<<
 *                 raise FMUException("This class only supports FMI 2.0 for Co-simulation.")
 * 
 */
    __pyx_t_4 = (__pyx_v_self->__pyx_base._fmu_kind != fmi2_fmu_kind_me_and_cs);
    if (__pyx_t_4) {

      /* "pyfmi\fmi.pyx":5556
 *         if self._fmu_kind != FMIL.fmi2_fmu_kind_cs:
 *             if self._fmu_kind != FMIL.fmi2_fmu_kind_me_and_cs:
 *                 raise FMUException("This class only supports FMI 2.0 for Co-simulation.")             # <<<<<<<<<<<<<<
 * 
 *         if self.get_capability_flags()['needsExecutionTool'] == True:
 */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_323), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L4;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5558
 *                 raise FMUException("This class only supports FMI 2.0 for Co-simulation.")
 * 
 *         if self.get_capability_flags()['needsExecutionTool'] == True:             # <<<<<<<<<<<<<<
 *             raise FMUException('Models that need an execution tool are not supported')
 * 
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_324); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__needsExecutionTool)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":5559
 * 
 *         if self.get_capability_flags()['needsExecutionTool'] == True:
 *             raise FMUException('Models that need an execution tool are not supported')             # <<<<<<<<<<<<<<
 * 
 *         self._modelId = decode(FMIL.fmi2_import_get_model_identifier_CS(self._fmu))
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_326), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":5561
 *             raise FMUException('Models that need an execution tool are not supported')
 * 
 *         self._modelId = decode(FMIL.fmi2_import_get_model_identifier_CS(self._fmu))             # <<<<<<<<<<<<<<
 *         self.instantiate()
 * 
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyBytes_FromString(fmi2_import_get_model_identifier_CS(__pyx_v_self->__pyx_base._fmu)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base._modelId);
  __Pyx_DECREF(__pyx_v_self->__pyx_base._modelId);
  __pyx_v_self->__pyx_base._modelId = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5562
 * 
 *         self._modelId = decode(FMIL.fmi2_import_get_model_identifier_CS(self._fmu))
 *         self.instantiate()             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__instantiate); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5562; __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 = 5562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static void __pyx_pw_5pyfmi_3fmi_11FMUModelCS2_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_5pyfmi_3fmi_11FMUModelCS2_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_2__dealloc__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
}

/* "pyfmi\fmi.pyx":5564
 *         self.instantiate()
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Deallocate memory allocated
 */

static void __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_2__dealloc__(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pyfmi\fmi.pyx":5568
 *         Deallocate memory allocated
 *         """
 *         if self._allocated_fmu == 1:             # <<<<<<<<<<<<<<
 *             FMIL.fmi2_import_terminate(self._fmu)
 *             FMIL.fmi2_import_free_instance(self._fmu)
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base._allocated_fmu == 1);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5569
 *         """
 *         if self._allocated_fmu == 1:
 *             FMIL.fmi2_import_terminate(self._fmu)             # <<<<<<<<<<<<<<
 *             FMIL.fmi2_import_free_instance(self._fmu)
 * 
 */
    fmi2_import_terminate(__pyx_v_self->__pyx_base._fmu);

    /* "pyfmi\fmi.pyx":5570
 *         if self._allocated_fmu == 1:
 *             FMIL.fmi2_import_terminate(self._fmu)
 *             FMIL.fmi2_import_free_instance(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if self._allocated_dll == 1:
 */
    fmi2_import_free_instance(__pyx_v_self->__pyx_base._fmu);
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5572
 *             FMIL.fmi2_import_free_instance(self._fmu)
 * 
 *         if self._allocated_dll == 1:             # <<<<<<<<<<<<<<
 *             FMIL.fmi2_import_destroy_dllfmu(self._fmu)
 * 
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base._allocated_dll == 1);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5573
 * 
 *         if self._allocated_dll == 1:
 *             FMIL.fmi2_import_destroy_dllfmu(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if self._allocated_xml == 1:
 */
    fmi2_import_destroy_dllfmu(__pyx_v_self->__pyx_base._fmu);
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":5575
 *             FMIL.fmi2_import_destroy_dllfmu(self._fmu)
 * 
 *         if self._allocated_xml == 1:             # <<<<<<<<<<<<<<
 *             FMIL.fmi2_import_free(self._fmu)
 * 
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base._allocated_xml == 1);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5576
 * 
 *         if self._allocated_xml == 1:
 *             FMIL.fmi2_import_free(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if self._fmu_temp_dir != NULL:
 */
    fmi2_import_free(__pyx_v_self->__pyx_base._fmu);
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":5578
 *             FMIL.fmi2_import_free(self._fmu)
 * 
 *         if self._fmu_temp_dir != NULL:             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_rmdir(&self.callbacks, self._fmu_temp_dir)
 *             FMIL.free(self._fmu_temp_dir)
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base._fmu_temp_dir != NULL);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5579
 * 
 *         if self._fmu_temp_dir != NULL:
 *             FMIL.fmi_import_rmdir(&self.callbacks, self._fmu_temp_dir)             # <<<<<<<<<<<<<<
 *             FMIL.free(self._fmu_temp_dir)
 *             self._fmu_temp_dir = NULL
 */
    fmi_import_rmdir((&__pyx_v_self->__pyx_base.__pyx_base.callbacks), __pyx_v_self->__pyx_base._fmu_temp_dir);

    /* "pyfmi\fmi.pyx":5580
 *         if self._fmu_temp_dir != NULL:
 *             FMIL.fmi_import_rmdir(&self.callbacks, self._fmu_temp_dir)
 *             FMIL.free(self._fmu_temp_dir)             # <<<<<<<<<<<<<<
 *             self._fmu_temp_dir = NULL
 * 
 */
    free(__pyx_v_self->__pyx_base._fmu_temp_dir);

    /* "pyfmi\fmi.pyx":5581
 *             FMIL.fmi_import_rmdir(&self.callbacks, self._fmu_temp_dir)
 *             FMIL.free(self._fmu_temp_dir)
 *             self._fmu_temp_dir = NULL             # <<<<<<<<<<<<<<
 * 
 *         if self._allocated_context == 1:
 */
    __pyx_v_self->__pyx_base._fmu_temp_dir = NULL;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pyfmi\fmi.pyx":5583
 *             self._fmu_temp_dir = NULL
 * 
 *         if self._allocated_context == 1:             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_free_context(self._context)
 * 
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base._allocated_context == 1);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5584
 * 
 *         if self._allocated_context == 1:
 *             FMIL.fmi_import_free_context(self._context)             # <<<<<<<<<<<<<<
 * 
 *         if self._fmu_log_name != NULL:
 */
    fmi_import_free_context(__pyx_v_self->__pyx_base._context);
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "pyfmi\fmi.pyx":5586
 *             FMIL.fmi_import_free_context(self._context)
 * 
 *         if self._fmu_log_name != NULL:             # <<<<<<<<<<<<<<
 *             FMIL.free(self._fmu_log_name)
 *             self._fmu_log_name = NULL
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base.__pyx_base._fmu_log_name != NULL);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5587
 * 
 *         if self._fmu_log_name != NULL:
 *             FMIL.free(self._fmu_log_name)             # <<<<<<<<<<<<<<
 *             self._fmu_log_name = NULL
 * 
 */
    free(__pyx_v_self->__pyx_base.__pyx_base._fmu_log_name);

    /* "pyfmi\fmi.pyx":5588
 *         if self._fmu_log_name != NULL:
 *             FMIL.free(self._fmu_log_name)
 *             self._fmu_log_name = NULL             # <<<<<<<<<<<<<<
 * 
 *     cpdef _get_time(self):
 */
    __pyx_v_self->__pyx_base.__pyx_base._fmu_log_name = NULL;
    goto __pyx_L8;
  }
  __pyx_L8:;

  __Pyx_RefNannyFinishContext();
}

/* "pyfmi\fmi.pyx":5590
 *             self._fmu_log_name = NULL
 * 
 *     cpdef _get_time(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the current time of the simulation.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_5_get_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_11FMUModelCS2__get_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_time", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___get_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_5_get_time)) {
      __Pyx_XDECREF(__pyx_r);
      __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 = 5590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":5597
 *             The time.
 *         """
 *         return self.__t             # <<<<<<<<<<<<<<
 * 
 *     cpdef _set_time(self, FMIL.fmi2_real_t t):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx___t);
  __pyx_r = __pyx_v_self->__pyx_base.__pyx___t;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2._get_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_5_get_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_4_get_time[] = "\n        Returns the current time of the simulation.\n\n        Returns::\n            The time.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_5_get_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_time (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_4_get_time(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5590
 *             self._fmu_log_name = NULL
 * 
 *     cpdef _get_time(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the current time of the simulation.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_4_get_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__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("_get_time", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_get_time(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2._get_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5599
 *         return self.__t
 * 
 *     cpdef _set_time(self, FMIL.fmi2_real_t t):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the current time of the simulation.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_7_set_time(PyObject *__pyx_v_self, PyObject *__pyx_arg_t); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_11FMUModelCS2__set_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, fmi2_real_t __pyx_v_t, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __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("_set_time", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___set_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_7_set_time)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":5607
 *                 The time to set.
 *         """
 *         self.__t = t             # <<<<<<<<<<<<<<
 * 
 *     time = property(_get_time,_set_time, doc =
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.__pyx___t);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.__pyx___t);
  __pyx_v_self->__pyx_base.__pyx___t = __pyx_t_1;
  __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2._set_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_7_set_time(PyObject *__pyx_v_self, PyObject *__pyx_arg_t); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_6_set_time[] = "\n        Sets the current time of the simulation. \n\n        Parameters:: \n            t-- \n                The time to set.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_7_set_time(PyObject *__pyx_v_self, PyObject *__pyx_arg_t) {
  fmi2_real_t __pyx_v_t;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set_time (wrapper)", 0);
  assert(__pyx_arg_t); {
    __pyx_v_t = __pyx_PyFloat_AsDouble(__pyx_arg_t); if (unlikely((__pyx_v_t == (fmi2_real_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5599; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2._set_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_6_set_time(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self), ((fmi2_real_t)__pyx_v_t));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5599
 *         return self.__t
 * 
 *     cpdef _set_time(self, FMIL.fmi2_real_t t):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the current time of the simulation.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_6_set_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, fmi2_real_t __pyx_v_t) {
  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("_set_time", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_set_time(__pyx_v_self, __pyx_v_t, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2._set_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5615
 *     """)
 * 
 *     cpdef int do_step(self, FMIL.fmi2_real_t current_t, FMIL.fmi2_real_t step_size, new_step=True):             # <<<<<<<<<<<<<<
 *         """
 *         Performs an integrator step.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_9do_step(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_5pyfmi_3fmi_11FMUModelCS2_do_step(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, fmi2_real_t __pyx_v_current_t, fmi2_real_t __pyx_v_step_size, int __pyx_skip_dispatch, struct __pyx_opt_args_5pyfmi_3fmi_11FMUModelCS2_do_step *__pyx_optional_args) {
  PyObject *__pyx_v_new_step = __pyx_k_327;
  int __pyx_v_status;
  fmi2_boolean_t __pyx_v_new_s;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("do_step", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_new_step = __pyx_optional_args->new_step;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__do_step); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_9do_step)) {
      __pyx_t_2 = PyFloat_FromDouble(__pyx_v_current_t); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyFloat_FromDouble(__pyx_v_step_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_new_step);
      PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_new_step);
      __Pyx_GIVEREF(__pyx_v_new_step);
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_5;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":5644
 *         cdef FMIL.fmi2_boolean_t new_s
 * 
 *         if new_step:             # <<<<<<<<<<<<<<
 *             new_s = 1
 *         else:
 */
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_new_step); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":5645
 * 
 *         if new_step:
 *             new_s = 1             # <<<<<<<<<<<<<<
 *         else:
 *             new_s = 0
 */
    __pyx_v_new_s = 1;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":5647
 *             new_s = 1
 *         else:
 *             new_s = 0             # <<<<<<<<<<<<<<
 * 
 *         self.time = current_t + step_size
 */
    __pyx_v_new_s = 0;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5649
 *             new_s = 0
 * 
 *         self.time = current_t + step_size             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_do_step(self._fmu, current_t, step_size, new_s)
 */
  __pyx_t_1 = PyFloat_FromDouble((__pyx_v_current_t + __pyx_v_step_size)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__time, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5651
 *         self.time = current_t + step_size
 * 
 *         status = FMIL.fmi2_import_do_step(self._fmu, current_t, step_size, new_s)             # <<<<<<<<<<<<<<
 * 
 *         return status
 */
  __pyx_v_status = fmi2_import_do_step(__pyx_v_self->__pyx_base._fmu, __pyx_v_current_t, __pyx_v_step_size, __pyx_v_new_s);

  /* "pyfmi\fmi.pyx":5653
 *         status = FMIL.fmi2_import_do_step(self._fmu, current_t, step_size, new_s)
 * 
 *         return status             # <<<<<<<<<<<<<<
 * 
 *     def cancel_step(self):
 */
  __pyx_r = __pyx_v_status;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("pyfmi.fmi.FMUModelCS2.do_step", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_9do_step(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_8do_step[] = "\n        Performs an integrator step.\n\n        Parameters::\n\n            current_t --\n                The current communication point (current time) of\n                the master.\n\n            step_size --\n                The length of the step to be taken.\n\n            new_step --\n                True the last step was accepted by the master and\n                False if not.\n\n        Returns::\n\n            status --\n                    The status of function which can be checked against\n                    FMI_OK, FMI_WARNING. FMI_DISCARD, FMI_ERROR,\n                    FMI_FATAL,FMI_PENDING...\n\n        Calls the underlying low-level function fmi2DoStep.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_9do_step(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  fmi2_real_t __pyx_v_current_t;
  fmi2_real_t __pyx_v_step_size;
  PyObject *__pyx_v_new_step = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("do_step (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__current_t,&__pyx_n_s__step_size,&__pyx_n_s__new_step,0};
    PyObject* values[3] = {0,0,0};
    values[2] = __pyx_k_327;
    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__current_t)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__step_size)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("do_step", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5615; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__new_step);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "do_step") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5615; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_current_t = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_current_t == (fmi2_real_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5615; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_step_size = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_step_size == (fmi2_real_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5615; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_new_step = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("do_step", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5615; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2.do_step", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_8do_step(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self), __pyx_v_current_t, __pyx_v_step_size, __pyx_v_new_step);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5615
 *     """)
 * 
 *     cpdef int do_step(self, FMIL.fmi2_real_t current_t, FMIL.fmi2_real_t step_size, new_step=True):             # <<<<<<<<<<<<<<
 *         """
 *         Performs an integrator step.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_8do_step(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, fmi2_real_t __pyx_v_current_t, fmi2_real_t __pyx_v_step_size, PyObject *__pyx_v_new_step) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  struct __pyx_opt_args_5pyfmi_3fmi_11FMUModelCS2_do_step __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("do_step", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.new_step = __pyx_v_new_step;
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->do_step(__pyx_v_self, __pyx_v_current_t, __pyx_v_step_size, 1, &__pyx_t_2); 
  __pyx_t_3 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2.do_step", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_11cancel_step(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_10cancel_step[] = "\n        Cancel a current integrator step. Can only be called if the\n        status from do_step returns FMI_PENDING.\n        After this function has been called, only calls to the low-level\n        functions:\n            -fmi2Terminate\n            -fmi2Reset\n            -fmi2FreeInstance\n        are allowed\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_11cancel_step(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cancel_step (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_10cancel_step(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5655
 *         return status
 * 
 *     def cancel_step(self):             # <<<<<<<<<<<<<<
 *         """
 *         Cancel a current integrator step. Can only be called if the
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_10cancel_step(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self) {
  int __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  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("cancel_step", 0);

  /* "pyfmi\fmi.pyx":5669
 *         cdef int status
 * 
 *         status = FMIL.fmi2_import_cancel_step(self._fmu)             # <<<<<<<<<<<<<<
 *         if status != 0:
 *             raise FMUException('An error occured while canceling the step')
 */
  __pyx_v_status = fmi2_import_cancel_step(__pyx_v_self->__pyx_base._fmu);

  /* "pyfmi\fmi.pyx":5670
 * 
 *         status = FMIL.fmi2_import_cancel_step(self._fmu)
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('An error occured while canceling the step')
 * 
 */
  __pyx_t_1 = (__pyx_v_status != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":5671
 *         status = FMIL.fmi2_import_cancel_step(self._fmu)
 *         if status != 0:
 *             raise FMUException('An error occured while canceling the step')             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_329), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2.cancel_step", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_13set_input_derivatives(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_12set_input_derivatives[] = "\n        Sets the input derivative order for the specified variables.\n\n        Parameters::\n\n                variables --\n                        The variables as a string or list of strings for\n                        which the input derivative(s) should be set.\n\n                values --\n                        The actual values.\n\n                order --\n                        The derivative order to set.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_13set_input_derivatives(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_variables = 0;
  PyObject *__pyx_v_values = 0;
  fmi2_integer_t __pyx_v_order;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_input_derivatives (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__variables,&__pyx_n_s__values,&__pyx_n_s__order,0};
    PyObject* values[3] = {0,0,0};
    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__variables)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_input_derivatives", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5674; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__order)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_input_derivatives", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5674; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_input_derivatives") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5674; __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_variables = values[0];
    __pyx_v_values = values[1];
    __pyx_v_order = __Pyx_PyInt_from_py_fmi2_integer_t(values[2]); if (unlikely((__pyx_v_order == (fmi2_integer_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5674; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_input_derivatives", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5674; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2.set_input_derivatives", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_12set_input_derivatives(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self), __pyx_v_variables, __pyx_v_values, __pyx_v_order);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5674
 * 
 * 
 *     def set_input_derivatives(self, variables, values, FMIL.fmi2_integer_t order):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the input derivative order for the specified variables.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_12set_input_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_values, fmi2_integer_t __pyx_v_order) {
  int __pyx_v_status;
  unsigned int __pyx_v_can_interpolate_inputs;
  size_t __pyx_v_nref;
  PyArrayObject *__pyx_v_orders = 0;
  PyArrayObject *__pyx_v_value_refs = 0;
  PyArrayObject *__pyx_v_val = 0;
  size_t __pyx_v_i;
  PyObject *__pyx_v_v = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_orders;
  __Pyx_Buffer __pyx_pybuffer_orders;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_val;
  __Pyx_Buffer __pyx_pybuffer_val;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_value_refs;
  __Pyx_Buffer __pyx_pybuffer_value_refs;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  PyArrayObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  PyArrayObject *__pyx_t_14 = NULL;
  fmi2_value_reference_t __pyx_t_15;
  long __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  PyObject *(*__pyx_t_18)(PyObject *);
  int __pyx_t_19;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_t_21;
  size_t __pyx_t_22;
  size_t __pyx_t_23;
  size_t __pyx_t_24;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_input_derivatives", 0);
  __pyx_pybuffer_orders.pybuffer.buf = NULL;
  __pyx_pybuffer_orders.refcount = 0;
  __pyx_pybuffernd_orders.data = NULL;
  __pyx_pybuffernd_orders.rcbuffer = &__pyx_pybuffer_orders;
  __pyx_pybuffer_value_refs.pybuffer.buf = NULL;
  __pyx_pybuffer_value_refs.refcount = 0;
  __pyx_pybuffernd_value_refs.data = NULL;
  __pyx_pybuffernd_value_refs.rcbuffer = &__pyx_pybuffer_value_refs;
  __pyx_pybuffer_val.pybuffer.buf = NULL;
  __pyx_pybuffer_val.refcount = 0;
  __pyx_pybuffernd_val.data = NULL;
  __pyx_pybuffernd_val.rcbuffer = &__pyx_pybuffer_val;

  /* "pyfmi\fmi.pyx":5695
 *         cdef N.ndarray[FMIL.fmi2_integer_t, ndim=1, mode='c']         orders
 *         cdef N.ndarray[FMIL.fmi2_value_reference_t, ndim=1, mode='c'] value_refs
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c']            val = N.array(values, dtype=N.float, ndmin=1).ravel()             # <<<<<<<<<<<<<<
 * 
 *         nref = val.size
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__float); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_val.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_fmi2_real_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_val = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_val.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_val.diminfo[0].strides = __pyx_pybuffernd_val.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_val.diminfo[0].shape = __pyx_pybuffernd_val.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_val = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":5697
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c']            val = N.array(values, dtype=N.float, ndmin=1).ravel()
 * 
 *         nref = val.size             # <<<<<<<<<<<<<<
 *         orders = N.array([0]*nref, dtype=N.int32)
 * 
 */
  __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_val), __pyx_n_s__size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_PyInt_from_py_size_t(__pyx_t_5); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_nref = __pyx_t_7;

  /* "pyfmi\fmi.pyx":5698
 * 
 *         nref = val.size
 *         orders = N.array([0]*nref, dtype=N.int32)             # <<<<<<<<<<<<<<
 * 
 *         can_interpolate_inputs = FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canInterpolateInputs)
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyList_New(1 * ((__pyx_v_nref<0) ? 0:__pyx_v_nref)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  { Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < __pyx_v_nref; __pyx_temp++) {
      __Pyx_INCREF(__pyx_int_0);
      PyList_SET_ITEM(__pyx_t_5, __pyx_temp, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
    }
  }
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
  __pyx_t_5 = 0;
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__int32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_orders.rcbuffer->pybuffer);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_orders.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn_fmi2_integer_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_9 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_orders.rcbuffer->pybuffer, (PyObject*)__pyx_v_orders, &__Pyx_TypeInfo_nn_fmi2_integer_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      }
    }
    __pyx_pybuffernd_orders.diminfo[0].strides = __pyx_pybuffernd_orders.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_orders.diminfo[0].shape = __pyx_pybuffernd_orders.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_orders = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":5700
 *         orders = N.array([0]*nref, dtype=N.int32)
 * 
 *         can_interpolate_inputs = FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canInterpolateInputs)             # <<<<<<<<<<<<<<
 *         #NOTE IS THIS THE HIGHEST ORDER OF INTERPOLATION OR SIMPLY IF IT CAN OR NOT?
 * 
 */
  __pyx_v_can_interpolate_inputs = fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_cs_canInterpolateInputs);

  /* "pyfmi\fmi.pyx":5703
 *         #NOTE IS THIS THE HIGHEST ORDER OF INTERPOLATION OR SIMPLY IF IT CAN OR NOT?
 * 
 *         if order < 1:             # <<<<<<<<<<<<<<
 *             raise FMUException("The order must be greater than zero.")
 *         if not can_interpolate_inputs:
 */
  __pyx_t_13 = (__pyx_v_order < 1);
  if (__pyx_t_13) {

    /* "pyfmi\fmi.pyx":5704
 * 
 *         if order < 1:
 *             raise FMUException("The order must be greater than zero.")             # <<<<<<<<<<<<<<
 *         if not can_interpolate_inputs:
 *             raise FMUException("The FMU does not support input derivatives.")
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_330), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5705
 *         if order < 1:
 *             raise FMUException("The order must be greater than zero.")
 *         if not can_interpolate_inputs:             # <<<<<<<<<<<<<<
 *             raise FMUException("The FMU does not support input derivatives.")
 * 
 */
  __pyx_t_13 = (!__pyx_v_can_interpolate_inputs);
  if (__pyx_t_13) {

    /* "pyfmi\fmi.pyx":5706
 *             raise FMUException("The order must be greater than zero.")
 *         if not can_interpolate_inputs:
 *             raise FMUException("The FMU does not support input derivatives.")             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(variables,str):
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_331), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":5708
 *             raise FMUException("The FMU does not support input derivatives.")
 * 
 *         if isinstance(variables,str):             # <<<<<<<<<<<<<<
 *             value_refs = N.array([0], dtype=N.uint32, ndmin=1).ravel()
 *             value_refs[0] = self.get_variable_valueref(variables)
 */
  __pyx_t_13 = PyString_Check(__pyx_v_variables); 
  if (__pyx_t_13) {

    /* "pyfmi\fmi.pyx":5709
 * 
 *         if isinstance(variables,str):
 *             value_refs = N.array([0], dtype=N.uint32, ndmin=1).ravel()             # <<<<<<<<<<<<<<
 *             value_refs[0] = self.get_variable_valueref(variables)
 *         elif isinstance(variables,list) and N.prod([int(isinstance(v,str)) for v in variables]): #prod equals 0 or 1
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_int_0);
    PyList_SET_ITEM(__pyx_t_4, 0, __pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_4));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
    __pyx_t_4 = 0;
    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__uint32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ravel); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = ((PyArrayObject *)__pyx_t_2);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer);
      __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn_fmi2_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_9 < 0)) {
        PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer, (PyObject*)__pyx_v_value_refs, &__Pyx_TypeInfo_nn_fmi2_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
        }
      }
      __pyx_pybuffernd_value_refs.diminfo[0].strides = __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_value_refs.diminfo[0].shape = __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_14 = 0;
    __pyx_v_value_refs = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyfmi\fmi.pyx":5710
 *         if isinstance(variables,str):
 *             value_refs = N.array([0], dtype=N.uint32, ndmin=1).ravel()
 *             value_refs[0] = self.get_variable_valueref(variables)             # <<<<<<<<<<<<<<
 *         elif isinstance(variables,list) and N.prod([int(isinstance(v,str)) for v in variables]): #prod equals 0 or 1
 *             value_refs = N.array([0]*nref, dtype=N.uint32,ndmin=1).ravel()
 */
    __pyx_t_15 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.get_variable_valueref(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_v_variables, 0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_16 = 0;
    __pyx_t_9 = -1;
    if (__pyx_t_16 < 0) {
      __pyx_t_16 += __pyx_pybuffernd_value_refs.diminfo[0].shape;
      if (unlikely(__pyx_t_16 < 0)) __pyx_t_9 = 0;
    } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_value_refs.diminfo[0].shape)) __pyx_t_9 = 0;
    if (unlikely(__pyx_t_9 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_9);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrCContig1d(fmi2_value_reference_t *, __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_value_refs.diminfo[0].strides) = __pyx_t_15;
    goto __pyx_L5;
  }

  /* "pyfmi\fmi.pyx":5711
 *             value_refs = N.array([0], dtype=N.uint32, ndmin=1).ravel()
 *             value_refs[0] = self.get_variable_valueref(variables)
 *         elif isinstance(variables,list) and N.prod([int(isinstance(v,str)) for v in variables]): #prod equals 0 or 1             # <<<<<<<<<<<<<<
 *             value_refs = N.array([0]*nref, dtype=N.uint32,ndmin=1).ravel()
 *             for i in range(nref):
 */
  __pyx_t_13 = PyList_Check(__pyx_v_variables); 
  if (__pyx_t_13) {
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__prod); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (PyList_CheckExact(__pyx_v_variables) || PyTuple_CheckExact(__pyx_v_variables)) {
      __pyx_t_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); __pyx_t_17 = 0;
      __pyx_t_18 = NULL;
    } else {
      __pyx_t_17 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_18 = Py_TYPE(__pyx_t_1)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_18 && PyList_CheckExact(__pyx_t_1)) {
        if (__pyx_t_17 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_17); __Pyx_INCREF(__pyx_t_5); __pyx_t_17++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_17); __pyx_t_17++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_18 && PyTuple_CheckExact(__pyx_t_1)) {
        if (__pyx_t_17 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_17); __Pyx_INCREF(__pyx_t_5); __pyx_t_17++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_17); __pyx_t_17++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_5 = __pyx_t_18(__pyx_t_1);
        if (unlikely(!__pyx_t_5)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XDECREF(__pyx_v_v);
      __pyx_v_v = __pyx_t_5;
      __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__int); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_19 = PyString_Check(__pyx_v_v); 
      __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_19); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_20);
      PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_20), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0;
      if (unlikely(__Pyx_PyList_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)__pyx_t_2));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_21 = __pyx_t_19;
  } else {
    __pyx_t_21 = __pyx_t_13;
  }
  if (__pyx_t_21) {

    /* "pyfmi\fmi.pyx":5712
 *             value_refs[0] = self.get_variable_valueref(variables)
 *         elif isinstance(variables,list) and N.prod([int(isinstance(v,str)) for v in variables]): #prod equals 0 or 1
 *             value_refs = N.array([0]*nref, dtype=N.uint32,ndmin=1).ravel()             # <<<<<<<<<<<<<<
 *             for i in range(nref):
 *                 value_refs[i] = self.get_variable_valueref(variables[i])
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyList_New(1 * ((__pyx_v_nref<0) ? 0:__pyx_v_nref)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    { Py_ssize_t __pyx_temp;
      for (__pyx_temp=0; __pyx_temp < __pyx_v_nref; __pyx_temp++) {
        __Pyx_INCREF(__pyx_int_0);
        PyList_SET_ITEM(__pyx_t_2, __pyx_temp, __pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
      }
    }
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __pyx_t_2 = 0;
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_20 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__uint32); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_20);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_20) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_20 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_20);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_20, __pyx_n_s__ravel); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    __pyx_t_20 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_20);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_20) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_20, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = ((PyArrayObject *)__pyx_t_20);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer);
      __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn_fmi2_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_9 < 0)) {
        PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer, (PyObject*)__pyx_v_value_refs, &__Pyx_TypeInfo_nn_fmi2_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
        }
      }
      __pyx_pybuffernd_value_refs.diminfo[0].strides = __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_value_refs.diminfo[0].shape = __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_14 = 0;
    __pyx_v_value_refs = ((PyArrayObject *)__pyx_t_20);
    __pyx_t_20 = 0;

    /* "pyfmi\fmi.pyx":5713
 *         elif isinstance(variables,list) and N.prod([int(isinstance(v,str)) for v in variables]): #prod equals 0 or 1
 *             value_refs = N.array([0]*nref, dtype=N.uint32,ndmin=1).ravel()
 *             for i in range(nref):             # <<<<<<<<<<<<<<
 *                 value_refs[i] = self.get_variable_valueref(variables[i])
 *                 orders[i] = order
 */
    __pyx_t_7 = __pyx_v_nref;
    for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_7; __pyx_t_22+=1) {
      __pyx_v_i = __pyx_t_22;

      /* "pyfmi\fmi.pyx":5714
 *             value_refs = N.array([0]*nref, dtype=N.uint32,ndmin=1).ravel()
 *             for i in range(nref):
 *                 value_refs[i] = self.get_variable_valueref(variables[i])             # <<<<<<<<<<<<<<
 *                 orders[i] = order
 *         else:
 */
      __pyx_t_20 = __Pyx_GetItemInt(__pyx_v_variables, __pyx_v_i, sizeof(size_t)+1, __Pyx_PyInt_to_py_size_t); if (!__pyx_t_20) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_20);
      __pyx_t_15 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.get_variable_valueref(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_t_20, 0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __pyx_t_23 = __pyx_v_i;
      __pyx_t_9 = -1;
      if (unlikely(__pyx_t_23 >= (size_t)__pyx_pybuffernd_value_refs.diminfo[0].shape)) __pyx_t_9 = 0;
      if (unlikely(__pyx_t_9 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_9);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrCContig1d(fmi2_value_reference_t *, __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_value_refs.diminfo[0].strides) = __pyx_t_15;

      /* "pyfmi\fmi.pyx":5715
 *             for i in range(nref):
 *                 value_refs[i] = self.get_variable_valueref(variables[i])
 *                 orders[i] = order             # <<<<<<<<<<<<<<
 *         else:
 *             raise FMUException("The variables must either be a string or a list of strings")
 */
      __pyx_t_24 = __pyx_v_i;
      __pyx_t_9 = -1;
      if (unlikely(__pyx_t_24 >= (size_t)__pyx_pybuffernd_orders.diminfo[0].shape)) __pyx_t_9 = 0;
      if (unlikely(__pyx_t_9 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_9);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrCContig1d(fmi2_integer_t *, __pyx_pybuffernd_orders.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_orders.diminfo[0].strides) = __pyx_v_order;
    }
    goto __pyx_L5;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":5717
 *                 orders[i] = order
 *         else:
 *             raise FMUException("The variables must either be a string or a list of strings")             # <<<<<<<<<<<<<<
 * 
 *         status = self._set_input_derivatives(value_refs, val, orders)
 */
    __pyx_t_20 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_20);
    __pyx_t_2 = PyObject_Call(__pyx_t_20, ((PyObject *)__pyx_k_tuple_332), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":5719
 *             raise FMUException("The variables must either be a string or a list of strings")
 * 
 *         status = self._set_input_derivatives(value_refs, val, orders)             # <<<<<<<<<<<<<<
 *         #status = FMIL.fmi2_import_set_real_input_derivatives(self._fmu, <FMIL.fmi2_value_reference_t*> value_refs.data, nref,
 *         #                                                        <FMIL.fmi2_integer_t*> orders.data, <FMIL.fmi2_real_t*> val.data)
 */
  __pyx_v_status = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_set_input_derivatives(__pyx_v_self, ((PyArrayObject *)__pyx_v_value_refs), ((PyArrayObject *)__pyx_v_val), ((PyArrayObject *)__pyx_v_orders));

  /* "pyfmi\fmi.pyx":5723
 *         #                                                        <FMIL.fmi2_integer_t*> orders.data, <FMIL.fmi2_real_t*> val.data)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to set the Real input derivatives.')
 * 
 */
  __pyx_t_21 = (__pyx_v_status != 0);
  if (__pyx_t_21) {

    /* "pyfmi\fmi.pyx":5724
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Real input derivatives.')             # <<<<<<<<<<<<<<
 * 
 *     cdef int _set_input_derivatives(self, N.ndarray[FMIL.fmi2_value_reference_t, ndim=1, mode="c"] value_refs,
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_20 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_333), NULL); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_20);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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 = 5724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L10;
  }
  __pyx_L10:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_20);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_orders.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_val.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2.set_input_derivatives", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_orders.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_val.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_orders);
  __Pyx_XDECREF((PyObject *)__pyx_v_value_refs);
  __Pyx_XDECREF((PyObject *)__pyx_v_val);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5726
 *             raise FMUException('Failed to set the Real input derivatives.')
 * 
 *     cdef int _set_input_derivatives(self, N.ndarray[FMIL.fmi2_value_reference_t, ndim=1, mode="c"] value_refs,             # <<<<<<<<<<<<<<
 *                                           N.ndarray[FMIL.fmi2_real_t, ndim=1, mode="c"] values,
 *                                           N.ndarray[FMIL.fmi2_integer_t, ndim=1, mode="c"] orders):
 */

static int __pyx_f_5pyfmi_3fmi_11FMUModelCS2__set_input_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyArrayObject *__pyx_v_value_refs, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_orders) {
  int __pyx_v_status;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_orders;
  __Pyx_Buffer __pyx_pybuffer_orders;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_value_refs;
  __Pyx_Buffer __pyx_pybuffer_value_refs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_input_derivatives", 0);
  __pyx_pybuffer_value_refs.pybuffer.buf = NULL;
  __pyx_pybuffer_value_refs.refcount = 0;
  __pyx_pybuffernd_value_refs.data = NULL;
  __pyx_pybuffernd_value_refs.rcbuffer = &__pyx_pybuffer_value_refs;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_orders.pybuffer.buf = NULL;
  __pyx_pybuffer_orders.refcount = 0;
  __pyx_pybuffernd_orders.data = NULL;
  __pyx_pybuffernd_orders.rcbuffer = &__pyx_pybuffer_orders;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer, (PyObject*)__pyx_v_value_refs, &__Pyx_TypeInfo_nn_fmi2_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_value_refs.diminfo[0].strides = __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_value_refs.diminfo[0].shape = __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn_fmi2_real_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_orders.rcbuffer->pybuffer, (PyObject*)__pyx_v_orders, &__Pyx_TypeInfo_nn_fmi2_integer_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_orders.diminfo[0].strides = __pyx_pybuffernd_orders.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_orders.diminfo[0].shape = __pyx_pybuffernd_orders.rcbuffer->pybuffer.shape[0];

  /* "pyfmi\fmi.pyx":5731
 *         cdef int status
 * 
 *         assert values.size >= value_refs.size and orders.size >= value_refs.size             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_set_real_input_derivatives(self._fmu,
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_value_refs), __pyx_n_s__size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {
    __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_orders), __pyx_n_s__size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_value_refs), __pyx_n_s__size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = __pyx_t_5;
  } else {
    __pyx_t_6 = __pyx_t_4;
  }
  if (unlikely(!__pyx_t_6)) {
    PyErr_SetNone(PyExc_AssertionError);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "pyfmi\fmi.pyx":5735
 *         status = FMIL.fmi2_import_set_real_input_derivatives(self._fmu,
 *                         <FMIL.fmi2_value_reference_t*> value_refs.data,
 *                         value_refs.size, <FMIL.fmi2_integer_t*> orders.data,             # <<<<<<<<<<<<<<
 *                         <FMIL.fmi2_real_t*> values.data)
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_value_refs), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyInt_AsSize_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5736
 *                         <FMIL.fmi2_value_reference_t*> value_refs.data,
 *                         value_refs.size, <FMIL.fmi2_integer_t*> orders.data,
 *                         <FMIL.fmi2_real_t*> values.data)             # <<<<<<<<<<<<<<
 * 
 *         return status
 */
  __pyx_v_status = fmi2_import_set_real_input_derivatives(__pyx_v_self->__pyx_base._fmu, ((fmi2_value_reference_t *)__pyx_v_value_refs->data), __pyx_t_7, ((fmi2_integer_t *)__pyx_v_orders->data), ((fmi2_real_t *)__pyx_v_values->data));

  /* "pyfmi\fmi.pyx":5738
 *                         <FMIL.fmi2_real_t*> values.data)
 * 
 *         return status             # <<<<<<<<<<<<<<
 * 
 *     def get_output_derivatives(self, variables, FMIL.fmi2_integer_t order):
 */
  __pyx_r = __pyx_v_status;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_orders.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_WriteUnraisable("pyfmi.fmi.FMUModelCS2._set_input_derivatives", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_orders.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_15get_output_derivatives(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_14get_output_derivatives[] = "\n        Returns the output derivatives for the specified variables. The\n        order specifies the nth-derivative.\n\n        Parameters::\n\n            variables --\n                The variables for which the output derivatives\n                should be returned.\n\n            order --\n                The derivative order.\n\n        Returns::\n\n            The derivatives of the specified order.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_15get_output_derivatives(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_variables = 0;
  fmi2_integer_t __pyx_v_order;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_output_derivatives (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__variables,&__pyx_n_s__order,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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__variables)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__order)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_output_derivatives", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5740; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_output_derivatives") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5740; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_variables = values[0];
    __pyx_v_order = __Pyx_PyInt_from_py_fmi2_integer_t(values[1]); if (unlikely((__pyx_v_order == (fmi2_integer_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5740; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_output_derivatives", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5740; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2.get_output_derivatives", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_14get_output_derivatives(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self), __pyx_v_variables, __pyx_v_order);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5740
 *         return status
 * 
 *     def get_output_derivatives(self, variables, FMIL.fmi2_integer_t order):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the output derivatives for the specified variables. The
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_14get_output_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_variables, fmi2_integer_t __pyx_v_order) {
  int __pyx_v_status;
  unsigned int __pyx_v_max_output_derivative;
  size_t __pyx_v_nref;
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_value_refs = 0;
  PyArrayObject *__pyx_v_orders = 0;
  size_t __pyx_v_i;
  PyObject *__pyx_v_v = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_orders;
  __Pyx_Buffer __pyx_pybuffer_orders;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_value_refs;
  __Pyx_Buffer __pyx_pybuffer_value_refs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyArrayObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyArrayObject *__pyx_t_14 = NULL;
  fmi2_value_reference_t __pyx_t_15;
  long __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  PyObject *(*__pyx_t_18)(PyObject *);
  PyObject *__pyx_t_19 = NULL;
  size_t __pyx_t_20;
  size_t __pyx_t_21;
  size_t __pyx_t_22;
  size_t __pyx_t_23;
  PyArrayObject *__pyx_t_24 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_output_derivatives", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_value_refs.pybuffer.buf = NULL;
  __pyx_pybuffer_value_refs.refcount = 0;
  __pyx_pybuffernd_value_refs.data = NULL;
  __pyx_pybuffernd_value_refs.rcbuffer = &__pyx_pybuffer_value_refs;
  __pyx_pybuffer_orders.pybuffer.buf = NULL;
  __pyx_pybuffer_orders.refcount = 0;
  __pyx_pybuffernd_orders.data = NULL;
  __pyx_pybuffernd_orders.rcbuffer = &__pyx_pybuffer_orders;

  /* "pyfmi\fmi.pyx":5766
 * 
 * 
 *         max_output_derivative = FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_maxOutputDerivativeOrder)             # <<<<<<<<<<<<<<
 * 
 *         if order < 1 or order > max_output_derivative:
 */
  __pyx_v_max_output_derivative = fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_cs_maxOutputDerivativeOrder);

  /* "pyfmi\fmi.pyx":5768
 *         max_output_derivative = FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_maxOutputDerivativeOrder)
 * 
 *         if order < 1 or order > max_output_derivative:             # <<<<<<<<<<<<<<
 *             raise FMUException("The order must be greater than zero and below the maximum output derivative support of the FMU (%d)."%max_output_derivative)
 * 
 */
  __pyx_t_1 = (__pyx_v_order < 1);
  if (!__pyx_t_1) {
    __pyx_t_2 = (__pyx_v_order > __pyx_v_max_output_derivative);
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":5769
 * 
 *         if order < 1 or order > max_output_derivative:
 *             raise FMUException("The order must be greater than zero and below the maximum output derivative support of the FMU (%d)."%max_output_derivative)             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(variables,str):
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyLong_FromUnsignedLong(__pyx_v_max_output_derivative); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_110), __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_6));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
    __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5771
 *             raise FMUException("The order must be greater than zero and below the maximum output derivative support of the FMU (%d)."%max_output_derivative)
 * 
 *         if isinstance(variables,str):             # <<<<<<<<<<<<<<
 *             nref = 1
 *             value_refs = N.array([0], dtype=N.uint32, ndmin=1).ravel()
 */
  __pyx_t_3 = PyString_Check(__pyx_v_variables); 
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":5772
 * 
 *         if isinstance(variables,str):
 *             nref = 1             # <<<<<<<<<<<<<<
 *             value_refs = N.array([0], dtype=N.uint32, ndmin=1).ravel()
 *             orders = N.array([order], dtype=N.int32)
 */
    __pyx_v_nref = 1;

    /* "pyfmi\fmi.pyx":5773
 *         if isinstance(variables,str):
 *             nref = 1
 *             value_refs = N.array([0], dtype=N.uint32, ndmin=1).ravel()             # <<<<<<<<<<<<<<
 *             orders = N.array([order], dtype=N.int32)
 *             value_refs[0] = self.get_variable_valueref(variables)
 */
    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_int_0);
    PyList_SET_ITEM(__pyx_t_6, 0, __pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_6));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
    __pyx_t_6 = 0;
    __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
    __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__uint32); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_8 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__ravel); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = ((PyArrayObject *)__pyx_t_8);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer);
      __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn_fmi2_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_10 < 0)) {
        PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer, (PyObject*)__pyx_v_value_refs, &__Pyx_TypeInfo_nn_fmi2_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
        }
      }
      __pyx_pybuffernd_value_refs.diminfo[0].strides = __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_value_refs.diminfo[0].shape = __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_9 = 0;
    __pyx_v_value_refs = ((PyArrayObject *)__pyx_t_8);
    __pyx_t_8 = 0;

    /* "pyfmi\fmi.pyx":5774
 *             nref = 1
 *             value_refs = N.array([0], dtype=N.uint32, ndmin=1).ravel()
 *             orders = N.array([order], dtype=N.int32)             # <<<<<<<<<<<<<<
 *             value_refs[0] = self.get_variable_valueref(variables)
 *         elif isinstance(variables,list) and N.prod([int(isinstance(v,str)) for v in variables]): #prod equals 0 or 1
 */
    __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_6 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyInt_to_py_fmi2_integer_t(__pyx_v_order); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_4));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
    __pyx_t_4 = 0;
    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int32); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_8), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = ((PyArrayObject *)__pyx_t_7);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_orders.rcbuffer->pybuffer);
      __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_orders.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn_fmi2_integer_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_10 < 0)) {
        PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_orders.rcbuffer->pybuffer, (PyObject*)__pyx_v_orders, &__Pyx_TypeInfo_nn_fmi2_integer_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11);
        }
      }
      __pyx_pybuffernd_orders.diminfo[0].strides = __pyx_pybuffernd_orders.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_orders.diminfo[0].shape = __pyx_pybuffernd_orders.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_14 = 0;
    __pyx_v_orders = ((PyArrayObject *)__pyx_t_7);
    __pyx_t_7 = 0;

    /* "pyfmi\fmi.pyx":5775
 *             value_refs = N.array([0], dtype=N.uint32, ndmin=1).ravel()
 *             orders = N.array([order], dtype=N.int32)
 *             value_refs[0] = self.get_variable_valueref(variables)             # <<<<<<<<<<<<<<
 *         elif isinstance(variables,list) and N.prod([int(isinstance(v,str)) for v in variables]): #prod equals 0 or 1
 *             nref = len(variables)
 */
    __pyx_t_15 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.get_variable_valueref(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_v_variables, 0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_16 = 0;
    __pyx_t_10 = -1;
    if (__pyx_t_16 < 0) {
      __pyx_t_16 += __pyx_pybuffernd_value_refs.diminfo[0].shape;
      if (unlikely(__pyx_t_16 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_value_refs.diminfo[0].shape)) __pyx_t_10 = 0;
    if (unlikely(__pyx_t_10 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_10);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrCContig1d(fmi2_value_reference_t *, __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_value_refs.diminfo[0].strides) = __pyx_t_15;
    goto __pyx_L4;
  }

  /* "pyfmi\fmi.pyx":5776
 *             orders = N.array([order], dtype=N.int32)
 *             value_refs[0] = self.get_variable_valueref(variables)
 *         elif isinstance(variables,list) and N.prod([int(isinstance(v,str)) for v in variables]): #prod equals 0 or 1             # <<<<<<<<<<<<<<
 *             nref = len(variables)
 *             value_refs = N.array([0]*nref, dtype=N.uint32, ndmin=1).ravel()
 */
  __pyx_t_3 = PyList_Check(__pyx_v_variables); 
  if (__pyx_t_3) {
    __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__prod); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    if (PyList_CheckExact(__pyx_v_variables) || PyTuple_CheckExact(__pyx_v_variables)) {
      __pyx_t_8 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_8); __pyx_t_17 = 0;
      __pyx_t_18 = NULL;
    } else {
      __pyx_t_17 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_18 = Py_TYPE(__pyx_t_8)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_18 && PyList_CheckExact(__pyx_t_8)) {
        if (__pyx_t_17 >= PyList_GET_SIZE(__pyx_t_8)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_6 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_17); __Pyx_INCREF(__pyx_t_6); __pyx_t_17++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_6 = PySequence_ITEM(__pyx_t_8, __pyx_t_17); __pyx_t_17++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_18 && PyTuple_CheckExact(__pyx_t_8)) {
        if (__pyx_t_17 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_17); __Pyx_INCREF(__pyx_t_6); __pyx_t_17++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_6 = PySequence_ITEM(__pyx_t_8, __pyx_t_17); __pyx_t_17++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_6 = __pyx_t_18(__pyx_t_8);
        if (unlikely(!__pyx_t_6)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_XDECREF(__pyx_v_v);
      __pyx_v_v = __pyx_t_6;
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__int); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_1 = PyString_Check(__pyx_v_v); 
      __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_19), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
      if (unlikely(__Pyx_PyList_Append(__pyx_t_7, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_INCREF(((PyObject *)__pyx_t_7));
    PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_7));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_2 = __pyx_t_1;
  } else {
    __pyx_t_2 = __pyx_t_3;
  }
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":5777
 *             value_refs[0] = self.get_variable_valueref(variables)
 *         elif isinstance(variables,list) and N.prod([int(isinstance(v,str)) for v in variables]): #prod equals 0 or 1
 *             nref = len(variables)             # <<<<<<<<<<<<<<
 *             value_refs = N.array([0]*nref, dtype=N.uint32, ndmin=1).ravel()
 *             orders = N.array([0]*nref, dtype=N.int32)
 */
    __pyx_t_17 = PyObject_Length(__pyx_v_variables); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_nref = __pyx_t_17;

    /* "pyfmi\fmi.pyx":5778
 *         elif isinstance(variables,list) and N.prod([int(isinstance(v,str)) for v in variables]): #prod equals 0 or 1
 *             nref = len(variables)
 *             value_refs = N.array([0]*nref, dtype=N.uint32, ndmin=1).ravel()             # <<<<<<<<<<<<<<
 *             orders = N.array([0]*nref, dtype=N.int32)
 *             for i in range(nref):
 */
    __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__array); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyList_New(1 * ((__pyx_v_nref<0) ? 0:__pyx_v_nref)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    { Py_ssize_t __pyx_temp;
      for (__pyx_temp=0; __pyx_temp < __pyx_v_nref; __pyx_temp++) {
        __Pyx_INCREF(__pyx_int_0);
        PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
      }
    }
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_7));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
    __pyx_t_7 = 0;
    __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_7));
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_19 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__uint32); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_19);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__dtype), __pyx_t_19) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
    if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_19 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_19);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_GetAttr(__pyx_t_19, __pyx_n_s__ravel); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
    __pyx_t_19 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_19);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (!(likely(((__pyx_t_19) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_19, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = ((PyArrayObject *)__pyx_t_19);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer);
      __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn_fmi2_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_10 < 0)) {
        PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer, (PyObject*)__pyx_v_value_refs, &__Pyx_TypeInfo_nn_fmi2_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
        }
      }
      __pyx_pybuffernd_value_refs.diminfo[0].strides = __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_value_refs.diminfo[0].shape = __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_9 = 0;
    __pyx_v_value_refs = ((PyArrayObject *)__pyx_t_19);
    __pyx_t_19 = 0;

    /* "pyfmi\fmi.pyx":5779
 *             nref = len(variables)
 *             value_refs = N.array([0]*nref, dtype=N.uint32, ndmin=1).ravel()
 *             orders = N.array([0]*nref, dtype=N.int32)             # <<<<<<<<<<<<<<
 *             for i in range(nref):
 *                 value_refs[i] = self.get_variable_valueref(variables[i])
 */
    __pyx_t_19 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_19);
    __pyx_t_7 = PyObject_GetAttr(__pyx_t_19, __pyx_n_s__array); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
    __pyx_t_19 = PyList_New(1 * ((__pyx_v_nref<0) ? 0:__pyx_v_nref)); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_19);
    { Py_ssize_t __pyx_temp;
      for (__pyx_temp=0; __pyx_temp < __pyx_v_nref; __pyx_temp++) {
        __Pyx_INCREF(__pyx_int_0);
        PyList_SET_ITEM(__pyx_t_19, __pyx_temp, __pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
      }
    }
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_19));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_19));
    __pyx_t_19 = 0;
    __pyx_t_19 = PyDict_New(); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_19));
    __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (PyDict_SetItem(__pyx_t_19, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_19)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = ((PyArrayObject *)__pyx_t_5);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_orders.rcbuffer->pybuffer);
      __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_orders.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn_fmi2_integer_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_10 < 0)) {
        PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_orders.rcbuffer->pybuffer, (PyObject*)__pyx_v_orders, &__Pyx_TypeInfo_nn_fmi2_integer_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11);
        }
      }
      __pyx_pybuffernd_orders.diminfo[0].strides = __pyx_pybuffernd_orders.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_orders.diminfo[0].shape = __pyx_pybuffernd_orders.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_14 = 0;
    __pyx_v_orders = ((PyArrayObject *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "pyfmi\fmi.pyx":5780
 *             value_refs = N.array([0]*nref, dtype=N.uint32, ndmin=1).ravel()
 *             orders = N.array([0]*nref, dtype=N.int32)
 *             for i in range(nref):             # <<<<<<<<<<<<<<
 *                 value_refs[i] = self.get_variable_valueref(variables[i])
 *                 orders[i] = order
 */
    __pyx_t_20 = __pyx_v_nref;
    for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
      __pyx_v_i = __pyx_t_21;

      /* "pyfmi\fmi.pyx":5781
 *             orders = N.array([0]*nref, dtype=N.int32)
 *             for i in range(nref):
 *                 value_refs[i] = self.get_variable_valueref(variables[i])             # <<<<<<<<<<<<<<
 *                 orders[i] = order
 *         else:
 */
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_variables, __pyx_v_i, sizeof(size_t)+1, __Pyx_PyInt_to_py_size_t); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_15 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.get_variable_valueref(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_t_5, 0); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_22 = __pyx_v_i;
      __pyx_t_10 = -1;
      if (unlikely(__pyx_t_22 >= (size_t)__pyx_pybuffernd_value_refs.diminfo[0].shape)) __pyx_t_10 = 0;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrCContig1d(fmi2_value_reference_t *, __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_value_refs.diminfo[0].strides) = __pyx_t_15;

      /* "pyfmi\fmi.pyx":5782
 *             for i in range(nref):
 *                 value_refs[i] = self.get_variable_valueref(variables[i])
 *                 orders[i] = order             # <<<<<<<<<<<<<<
 *         else:
 *             raise FMUException("The variables must either be a string or a list of strings")
 */
      __pyx_t_23 = __pyx_v_i;
      __pyx_t_10 = -1;
      if (unlikely(__pyx_t_23 >= (size_t)__pyx_pybuffernd_orders.diminfo[0].shape)) __pyx_t_10 = 0;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrCContig1d(fmi2_integer_t *, __pyx_pybuffernd_orders.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_orders.diminfo[0].strides) = __pyx_v_order;
    }
    goto __pyx_L4;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":5784
 *                 orders[i] = order
 *         else:
 *             raise FMUException("The variables must either be a string or a list of strings")             # <<<<<<<<<<<<<<
 * 
 *         values = N.array([0.0]*nref, dtype=N.float, ndmin=1)
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_19 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_334), NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_19);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_19, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":5786
 *             raise FMUException("The variables must either be a string or a list of strings")
 * 
 *         values = N.array([0.0]*nref, dtype=N.float, ndmin=1)             # <<<<<<<<<<<<<<
 * 
 *         #status = FMIL.fmi2_import_get_real_output_derivatives(self._fmu, <FMIL.fmi2_value_reference_t*> value_refs.data, nref,
 */
  __pyx_t_19 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_19, __pyx_n_s__array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_4 = PyList_New(1 * ((__pyx_v_nref<0) ? 0:__pyx_v_nref)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  { Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < __pyx_v_nref; __pyx_temp++) {
      __Pyx_INCREF(__pyx_t_19);
      PyList_SET_ITEM(__pyx_t_4, __pyx_temp, __pyx_t_19);
      __Pyx_GIVEREF(__pyx_t_19);
    }
  }
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_19);
  PyTuple_SET_ITEM(__pyx_t_19, 0, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
  __pyx_t_4 = 0;
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__float); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_19), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_24 = ((PyArrayObject *)__pyx_t_8);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
    __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_24, &__Pyx_TypeInfo_nn_fmi2_real_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_10 < 0)) {
      PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn_fmi2_real_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
      }
    }
    __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_24 = 0;
  __pyx_v_values = ((PyArrayObject *)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "pyfmi\fmi.pyx":5790
 *         #status = FMIL.fmi2_import_get_real_output_derivatives(self._fmu, <FMIL.fmi2_value_reference_t*> value_refs.data, nref,
 *         #                                                    <FMIL.fmi2_integer_t*> orders.data, <FMIL.fmi2_real_t*> values.data)
 *         status = self._get_output_derivatives(value_refs, values, orders)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_get_output_derivatives(__pyx_v_self, ((PyArrayObject *)__pyx_v_value_refs), ((PyArrayObject *)__pyx_v_values), ((PyArrayObject *)__pyx_v_orders));

  /* "pyfmi\fmi.pyx":5792
 *         status = self._get_output_derivatives(value_refs, values, orders)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to get the Real output derivatives.')
 * 
 */
  __pyx_t_2 = (__pyx_v_status != 0);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":5793
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Real output derivatives.')             # <<<<<<<<<<<<<<
 * 
 *         return values
 */
    __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_k_tuple_335), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "pyfmi\fmi.pyx":5795
 *             raise FMUException('Failed to get the Real output derivatives.')
 * 
 *         return values             # <<<<<<<<<<<<<<
 * 
 *     cdef int _get_output_derivatives(self, N.ndarray[FMIL.fmi2_value_reference_t, ndim=1, mode="c"] value_refs,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_values));
  __pyx_r = ((PyObject *)__pyx_v_values);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_19);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_orders.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2.get_output_derivatives", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_orders.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_values);
  __Pyx_XDECREF((PyObject *)__pyx_v_value_refs);
  __Pyx_XDECREF((PyObject *)__pyx_v_orders);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5797
 *         return values
 * 
 *     cdef int _get_output_derivatives(self, N.ndarray[FMIL.fmi2_value_reference_t, ndim=1, mode="c"] value_refs,             # <<<<<<<<<<<<<<
 *                                            N.ndarray[FMIL.fmi2_real_t, ndim=1, mode="c"] values,
 *                                            N.ndarray[FMIL.fmi2_integer_t, ndim=1, mode="c"] orders):
 */

static int __pyx_f_5pyfmi_3fmi_11FMUModelCS2__get_output_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyArrayObject *__pyx_v_value_refs, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_orders) {
  int __pyx_v_status;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_orders;
  __Pyx_Buffer __pyx_pybuffer_orders;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_value_refs;
  __Pyx_Buffer __pyx_pybuffer_value_refs;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_output_derivatives", 0);
  __pyx_pybuffer_value_refs.pybuffer.buf = NULL;
  __pyx_pybuffer_value_refs.refcount = 0;
  __pyx_pybuffernd_value_refs.data = NULL;
  __pyx_pybuffernd_value_refs.rcbuffer = &__pyx_pybuffer_value_refs;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  __pyx_pybuffer_orders.pybuffer.buf = NULL;
  __pyx_pybuffer_orders.refcount = 0;
  __pyx_pybuffernd_orders.data = NULL;
  __pyx_pybuffernd_orders.rcbuffer = &__pyx_pybuffer_orders;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer, (PyObject*)__pyx_v_value_refs, &__Pyx_TypeInfo_nn_fmi2_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_value_refs.diminfo[0].strides = __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_value_refs.diminfo[0].shape = __pyx_pybuffernd_value_refs.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn_fmi2_real_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_orders.rcbuffer->pybuffer, (PyObject*)__pyx_v_orders, &__Pyx_TypeInfo_nn_fmi2_integer_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_orders.diminfo[0].strides = __pyx_pybuffernd_orders.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_orders.diminfo[0].shape = __pyx_pybuffernd_orders.rcbuffer->pybuffer.shape[0];

  /* "pyfmi\fmi.pyx":5802
 *         cdef int status
 * 
 *         assert values.size >= value_refs.size and orders.size >= value_refs.size             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_get_real_output_derivatives(self._fmu,
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_value_refs), __pyx_n_s__size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {
    __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_orders), __pyx_n_s__size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_value_refs), __pyx_n_s__size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = __pyx_t_5;
  } else {
    __pyx_t_6 = __pyx_t_4;
  }
  if (unlikely(!__pyx_t_6)) {
    PyErr_SetNone(PyExc_AssertionError);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "pyfmi\fmi.pyx":5805
 * 
 *         status = FMIL.fmi2_import_get_real_output_derivatives(self._fmu,
 *                     <FMIL.fmi2_value_reference_t*> value_refs.data, value_refs.size,             # <<<<<<<<<<<<<<
 *                     <FMIL.fmi2_integer_t*> orders.data, <FMIL.fmi2_real_t*> values.data)
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_value_refs), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyInt_AsSize_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":5806
 *         status = FMIL.fmi2_import_get_real_output_derivatives(self._fmu,
 *                     <FMIL.fmi2_value_reference_t*> value_refs.data, value_refs.size,
 *                     <FMIL.fmi2_integer_t*> orders.data, <FMIL.fmi2_real_t*> values.data)             # <<<<<<<<<<<<<<
 * 
 *         return status
 */
  __pyx_v_status = fmi2_import_get_real_output_derivatives(__pyx_v_self->__pyx_base._fmu, ((fmi2_value_reference_t *)__pyx_v_value_refs->data), __pyx_t_7, ((fmi2_integer_t *)__pyx_v_orders->data), ((fmi2_real_t *)__pyx_v_values->data));

  /* "pyfmi\fmi.pyx":5808
 *                     <FMIL.fmi2_integer_t*> orders.data, <FMIL.fmi2_real_t*> values.data)
 * 
 *         return status             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_status;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_orders.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_WriteUnraisable("pyfmi.fmi.FMUModelCS2._get_output_derivatives", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_orders.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_value_refs.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_17get_status(PyObject *__pyx_v_self, PyObject *__pyx_v_status_kind); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_16get_status[] = "\n        Retrieves the fmi-status for the the specified fmi-staus-kind.\n\n        Parameters::\n\n            status_kind --\n                An integer corresponding to one of the following:\n                fmi2DoStepStatus       = 0\n                fmi2PendingStatus      = 1\n                fmi2LastSuccessfulTime = 2\n                fmi2Terminated         = 3\n\n        Returns::\n\n            status_ok      = 0\n            status_warning = 1\n            status_discard = 2\n            status_error   = 3\n            status_fatal   = 4\n            status_pending = 5\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_17get_status(PyObject *__pyx_v_self, PyObject *__pyx_v_status_kind) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_status (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_16get_status(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self), ((PyObject *)__pyx_v_status_kind));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5811
 * 
 * 
 *     def get_status(self, status_kind):             # <<<<<<<<<<<<<<
 *         """
 *         Retrieves the fmi-status for the the specified fmi-staus-kind.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_16get_status(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_status_kind) {
  int __pyx_v_status;
  int __pyx_v_fmi_status_kind;
  int __pyx_v_status_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_status", 0);

  /* "pyfmi\fmi.pyx":5838
 *         cdef int status_value
 * 
 *         if status_kind >= 0 and status_kind <= 3:             # <<<<<<<<<<<<<<
 *             fmi_status_kind = status_kind
 *         else:
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_status_kind, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_status_kind, __pyx_int_3, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_3;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":5839
 * 
 *         if status_kind >= 0 and status_kind <= 3:
 *             fmi_status_kind = status_kind             # <<<<<<<<<<<<<<
 *         else:
 *             raise FMUException('Status kind has to be between 0 and 3')
 */
    __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_v_status_kind); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_fmi_status_kind = __pyx_t_5;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":5841
 *             fmi_status_kind = status_kind
 *         else:
 *             raise FMUException('Status kind has to be between 0 and 3')             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_get_status(self._fmu, fmi_status_kind, &status_value)
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_337), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5843
 *             raise FMUException('Status kind has to be between 0 and 3')
 * 
 *         status = FMIL.fmi2_import_get_status(self._fmu, fmi_status_kind, &status_value)             # <<<<<<<<<<<<<<
 *         if status != 0:
 *             raise FMUException('An error occured while retriving the status')
 */
  __pyx_v_status = fmi2_import_get_status(__pyx_v_self->__pyx_base._fmu, __pyx_v_fmi_status_kind, (&__pyx_v_status_value));

  /* "pyfmi\fmi.pyx":5844
 * 
 *         status = FMIL.fmi2_import_get_status(self._fmu, fmi_status_kind, &status_value)
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('An error occured while retriving the status')
 * 
 */
  __pyx_t_4 = (__pyx_v_status != 0);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":5845
 *         status = FMIL.fmi2_import_get_status(self._fmu, fmi_status_kind, &status_value)
 *         if status != 0:
 *             raise FMUException('An error occured while retriving the status')             # <<<<<<<<<<<<<<
 * 
 *         return status_value
 */
    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_339), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":5847
 *             raise FMUException('An error occured while retriving the status')
 * 
 *         return status_value             # <<<<<<<<<<<<<<
 * 
 *     def get_real_status(self, status_kind):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(__pyx_v_status_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2.get_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_19get_real_status(PyObject *__pyx_v_self, PyObject *__pyx_v_status_kind); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_18get_real_status[] = "\n        Retrieves the status, represented as a real-value,\n        for the specified fmi-status-kind.\n        See docstring for function get_status() for more\n        information about fmi-status-kind.\n\n        Parameters::\n\n            status_kind--\n                integer indicating the status kind\n\n        Returns::\n\n            The status.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_19get_real_status(PyObject *__pyx_v_self, PyObject *__pyx_v_status_kind) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_real_status (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_18get_real_status(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self), ((PyObject *)__pyx_v_status_kind));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5849
 *         return status_value
 * 
 *     def get_real_status(self, status_kind):             # <<<<<<<<<<<<<<
 *         """
 *         Retrieves the status, represented as a real-value,
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_18get_real_status(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_status_kind) {
  int __pyx_v_status;
  int __pyx_v_fmi_status_kind;
  fmi2_real_t __pyx_v_output;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_real_status", 0);

  /* "pyfmi\fmi.pyx":5870
 *         cdef FMIL.fmi2_real_t output
 * 
 *         if status_kind >= 0 and status_kind <= 3:             # <<<<<<<<<<<<<<
 *             fmi_status_kind = status_kind
 *         else:
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_status_kind, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_status_kind, __pyx_int_3, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_3;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":5871
 * 
 *         if status_kind >= 0 and status_kind <= 3:
 *             fmi_status_kind = status_kind             # <<<<<<<<<<<<<<
 *         else:
 *             raise FMUException('Status kind has to be between 0 and 3')
 */
    __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_v_status_kind); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_fmi_status_kind = __pyx_t_5;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":5873
 *             fmi_status_kind = status_kind
 *         else:
 *             raise FMUException('Status kind has to be between 0 and 3')             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_340), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5876
 * 
 * 
 *         status = FMIL.fmi2_import_get_real_status(self._fmu, fmi_status_kind, &output)             # <<<<<<<<<<<<<<
 *         if status != 0:
 *             raise FMUException('An error occured while retriving the status')
 */
  __pyx_v_status = fmi2_import_get_real_status(__pyx_v_self->__pyx_base._fmu, __pyx_v_fmi_status_kind, (&__pyx_v_output));

  /* "pyfmi\fmi.pyx":5877
 * 
 *         status = FMIL.fmi2_import_get_real_status(self._fmu, fmi_status_kind, &output)
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('An error occured while retriving the status')
 * 
 */
  __pyx_t_4 = (__pyx_v_status != 0);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":5878
 *         status = FMIL.fmi2_import_get_real_status(self._fmu, fmi_status_kind, &output)
 *         if status != 0:
 *             raise FMUException('An error occured while retriving the status')             # <<<<<<<<<<<<<<
 * 
 *         return output
 */
    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_341), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":5880
 *             raise FMUException('An error occured while retriving the status')
 * 
 *         return output             # <<<<<<<<<<<<<<
 * 
 *     def get_integer_status(self, status_kind):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_output); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2.get_real_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_21get_integer_status(PyObject *__pyx_v_self, PyObject *__pyx_v_status_kind); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_20get_integer_status[] = "\n        Retrieves the status, represented as a integer-value,\n        for the specified fmi-status-kind.\n        See docstring for function get_status() for more\n        information about fmi-status-kind.\n\n        Parameters::\n\n            status_kind--\n                integer indicating the status kind\n\n        Returns::\n\n            The status.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_21get_integer_status(PyObject *__pyx_v_self, PyObject *__pyx_v_status_kind) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_integer_status (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_20get_integer_status(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self), ((PyObject *)__pyx_v_status_kind));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5882
 *         return output
 * 
 *     def get_integer_status(self, status_kind):             # <<<<<<<<<<<<<<
 *         """
 *         Retrieves the status, represented as a integer-value,
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_20get_integer_status(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_status_kind) {
  int __pyx_v_status;
  int __pyx_v_fmi_status_kind;
  fmi2_integer_t __pyx_v_output;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_integer_status", 0);

  /* "pyfmi\fmi.pyx":5903
 *         cdef FMIL.fmi2_integer_t output
 * 
 *         if status_kind >= 0 and status_kind <= 3:             # <<<<<<<<<<<<<<
 *             fmi_status_kind = status_kind
 *         else:
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_status_kind, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_status_kind, __pyx_int_3, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_3;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":5904
 * 
 *         if status_kind >= 0 and status_kind <= 3:
 *             fmi_status_kind = status_kind             # <<<<<<<<<<<<<<
 *         else:
 *             raise FMUException('Status kind has to be between 0 and 3')
 */
    __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_v_status_kind); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_fmi_status_kind = __pyx_t_5;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":5906
 *             fmi_status_kind = status_kind
 *         else:
 *             raise FMUException('Status kind has to be between 0 and 3')             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_342), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5909
 * 
 * 
 *         status = FMIL.fmi2_import_get_integer_status(self._fmu, fmi_status_kind, &output)             # <<<<<<<<<<<<<<
 *         if status != 0:
 *             raise FMUException('An error occured while retriving the status')
 */
  __pyx_v_status = fmi2_import_get_integer_status(__pyx_v_self->__pyx_base._fmu, __pyx_v_fmi_status_kind, (&__pyx_v_output));

  /* "pyfmi\fmi.pyx":5910
 * 
 *         status = FMIL.fmi2_import_get_integer_status(self._fmu, fmi_status_kind, &output)
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('An error occured while retriving the status')
 * 
 */
  __pyx_t_4 = (__pyx_v_status != 0);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":5911
 *         status = FMIL.fmi2_import_get_integer_status(self._fmu, fmi_status_kind, &output)
 *         if status != 0:
 *             raise FMUException('An error occured while retriving the status')             # <<<<<<<<<<<<<<
 * 
 *         return output
 */
    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_343), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":5913
 *             raise FMUException('An error occured while retriving the status')
 * 
 *         return output             # <<<<<<<<<<<<<<
 * 
 *     def get_boolean_status(self, status_kind):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_fmi2_integer_t(__pyx_v_output); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2.get_integer_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_23get_boolean_status(PyObject *__pyx_v_self, PyObject *__pyx_v_status_kind); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_22get_boolean_status[] = "\n        Retrieves the status, represented as a boolean-value,\n        for the specified fmi-status-kind.\n        See docstring for function get_status() for more\n        information about fmi-status-kind.\n\n        Parameters::\n\n            status_kind--\n                integer indicating the status kind\n\n        Returns::\n\n            The status.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_23get_boolean_status(PyObject *__pyx_v_self, PyObject *__pyx_v_status_kind) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_boolean_status (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_22get_boolean_status(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self), ((PyObject *)__pyx_v_status_kind));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5915
 *         return output
 * 
 *     def get_boolean_status(self, status_kind):             # <<<<<<<<<<<<<<
 *         """
 *         Retrieves the status, represented as a boolean-value,
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_22get_boolean_status(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_status_kind) {
  int __pyx_v_status;
  int __pyx_v_fmi_status_kind;
  fmi2_boolean_t __pyx_v_output;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_boolean_status", 0);

  /* "pyfmi\fmi.pyx":5936
 *         cdef FMIL.fmi2_boolean_t output
 * 
 *         if status_kind >= 0 and status_kind <= 3:             # <<<<<<<<<<<<<<
 *             fmi_status_kind = status_kind
 *         else:
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_status_kind, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_status_kind, __pyx_int_3, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_3;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":5937
 * 
 *         if status_kind >= 0 and status_kind <= 3:
 *             fmi_status_kind = status_kind             # <<<<<<<<<<<<<<
 *         else:
 *             raise FMUException('Status kind has to be between 0 and 3')
 */
    __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_v_status_kind); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_fmi_status_kind = __pyx_t_5;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":5939
 *             fmi_status_kind = status_kind
 *         else:
 *             raise FMUException('Status kind has to be between 0 and 3')             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_344), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5942
 * 
 * 
 *         status = FMIL.fmi2_import_get_boolean_status(self._fmu, fmi_status_kind, &output)             # <<<<<<<<<<<<<<
 *         if status != 0:
 *             raise FMUException('An error occured while retriving the status')
 */
  __pyx_v_status = fmi2_import_get_boolean_status(__pyx_v_self->__pyx_base._fmu, __pyx_v_fmi_status_kind, (&__pyx_v_output));

  /* "pyfmi\fmi.pyx":5943
 * 
 *         status = FMIL.fmi2_import_get_boolean_status(self._fmu, fmi_status_kind, &output)
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('An error occured while retriving the status')
 * 
 */
  __pyx_t_4 = (__pyx_v_status != 0);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":5944
 *         status = FMIL.fmi2_import_get_boolean_status(self._fmu, fmi_status_kind, &output)
 *         if status != 0:
 *             raise FMUException('An error occured while retriving the status')             # <<<<<<<<<<<<<<
 * 
 *         return output
 */
    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_345), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":5946
 *             raise FMUException('An error occured while retriving the status')
 * 
 *         return output             # <<<<<<<<<<<<<<
 * 
 *     def get_string_status(self, status_kind):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_fmi2_boolean_t(__pyx_v_output); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2.get_boolean_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_25get_string_status(PyObject *__pyx_v_self, PyObject *__pyx_v_status_kind); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_24get_string_status[] = "\n        Retrieves the status, represented as a string-value,\n        for the specified fmi-status-kind.\n        See docstring for function get_status() for more\n        information about fmi-status-kind.\n\n        Parameters::\n\n            status_kind--\n                integer indicating the status kind\n\n        Returns::\n\n            The status.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_25get_string_status(PyObject *__pyx_v_self, PyObject *__pyx_v_status_kind) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_string_status (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_24get_string_status(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self), ((PyObject *)__pyx_v_status_kind));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5948
 *         return output
 * 
 *     def get_string_status(self, status_kind):             # <<<<<<<<<<<<<<
 *         """
 *         Retrieves the status, represented as a string-value,
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_24get_string_status(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_status_kind) {
  int __pyx_v_status;
  int __pyx_v_fmi_status_kind;
  fmi2_string_t __pyx_v_output;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_string_status", 0);

  /* "pyfmi\fmi.pyx":5969
 *         cdef FMIL.fmi2_string_t output
 * 
 *         if status_kind >= 0 and status_kind <= 3:             # <<<<<<<<<<<<<<
 *             fmi_status_kind = status_kind
 *         else:
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_status_kind, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_status_kind, __pyx_int_3, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_3;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":5970
 * 
 *         if status_kind >= 0 and status_kind <= 3:
 *             fmi_status_kind = status_kind             # <<<<<<<<<<<<<<
 *         else:
 *             raise FMUException('Status kind has to be between 0 and 3')
 */
    __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_v_status_kind); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_fmi_status_kind = __pyx_t_5;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":5972
 *             fmi_status_kind = status_kind
 *         else:
 *             raise FMUException('Status kind has to be between 0 and 3')             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_346), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":5975
 * 
 * 
 *         status = FMIL.fmi2_import_get_string_status(self._fmu, fmi_status_kind, &output)             # <<<<<<<<<<<<<<
 *         if status != 0:
 *             raise FMUException('An error occured while retriving the status')
 */
  __pyx_v_status = fmi2_import_get_string_status(__pyx_v_self->__pyx_base._fmu, __pyx_v_fmi_status_kind, (&__pyx_v_output));

  /* "pyfmi\fmi.pyx":5976
 * 
 *         status = FMIL.fmi2_import_get_string_status(self._fmu, fmi_status_kind, &output)
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('An error occured while retriving the status')
 * 
 */
  __pyx_t_4 = (__pyx_v_status != 0);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":5977
 *         status = FMIL.fmi2_import_get_string_status(self._fmu, fmi_status_kind, &output)
 *         if status != 0:
 *             raise FMUException('An error occured while retriving the status')             # <<<<<<<<<<<<<<
 * 
 *         return output
 */
    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_347), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":5979
 *             raise FMUException('An error occured while retriving the status')
 * 
 *         return output             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromString(__pyx_v_output); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2.get_string_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_27simulate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_26simulate[] = "\n        Compact function for model simulation.\n\n        The simulation method depends on which algorithm is used, this can be\n        set with the function argument 'algorithm'. Options for the algorithm\n        are passed as option classes or as pure dicts. See\n        FMUModel.simulate_options for more details.\n\n        The default algorithm for this function is FMICSAlg.\n\n        Parameters::\n\n            start_time --\n                Start time for the simulation.\n                Default: Start time defined in the default experiment from\n                        the ModelDescription file.\n\n            final_time --\n                Final time for the simulation.\n                Default: Stop time defined in the default experiment from\n                        the ModelDescription file.\n\n            input --\n                Input signal for the simulation. The input should be a 2-tuple\n                consisting of first the names of the input variable(s) and then\n                the data matrix.\n                Default: Empty tuple.\n\n            algorithm --\n                The algorithm which will be used for the simulation is specified\n                by passing the algorithm class as string or class object in this\n                argument. 'algorithm' can be any class which implements the\n                abstract class AlgorithmBase (found in algorithm_drivers.py). In\n                this way it is possible to write own algorithms and use them\n                with this function.\n                Default: 'FMICSAlg'\n\n            options --\n                The options that should be used in the algorithm. For details on\n                the options do:\n\n                    >> myModel = FMUModel(...)\n                    >> opts = myModel.simulate_options()\n                    >> opts?\n\n                Valid values are:\n                    - A dict which gives AssimuloFMIAlgOptions with\n                      default valu""es on all options except the ones\n                      listed in the dict. Empty dict will thus give all\n                      options with default values.\n                    - An options object.\n                Default: Empty dict\n\n        Returns::\n\n            Result object, subclass of common.algorithm_drivers.ResultBase.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_27simulate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start_time = 0;
  PyObject *__pyx_v_final_time = 0;
  PyObject *__pyx_v_input = 0;
  PyObject *__pyx_v_algorithm = 0;
  PyObject *__pyx_v_options = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("simulate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start_time,&__pyx_n_s__final_time,&__pyx_n_s__input,&__pyx_n_s__algorithm,&__pyx_n_s__options,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[0] = ((PyObject *)__pyx_n_s__Default);
    values[1] = ((PyObject *)__pyx_n_s__Default);

    /* "pyfmi\fmi.pyx":5985
 *                  start_time="Default",
 *                  final_time="Default",
 *                  input=(),             # <<<<<<<<<<<<<<
 *                  algorithm='FMICSAlg',
 *                  options={}):
 */
    values[2] = ((PyObject *)__pyx_empty_tuple);
    values[3] = ((PyObject *)__pyx_n_s__FMICSAlg);
    values[4] = __pyx_k_348;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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 (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start_time);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__final_time);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__input);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__algorithm);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__options);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "simulate") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5982; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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;
      }
    }
    __pyx_v_start_time = values[0];
    __pyx_v_final_time = values[1];
    __pyx_v_input = values[2];
    __pyx_v_algorithm = values[3];
    __pyx_v_options = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("simulate", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5982; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2.simulate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_26simulate(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self), __pyx_v_start_time, __pyx_v_final_time, __pyx_v_input, __pyx_v_algorithm, __pyx_v_options);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":5982
 * 
 * 
 *     def simulate(self,             # <<<<<<<<<<<<<<
 *                  start_time="Default",
 *                  final_time="Default",
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_26simulate(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_start_time, PyObject *__pyx_v_final_time, PyObject *__pyx_v_input, PyObject *__pyx_v_algorithm, PyObject *__pyx_v_options) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("simulate", 0);
  __Pyx_INCREF(__pyx_v_start_time);
  __Pyx_INCREF(__pyx_v_final_time);

  /* "pyfmi\fmi.pyx":6045
 *             Result object, subclass of common.algorithm_drivers.ResultBase.
 *         """
 *         if start_time == "Default":             # <<<<<<<<<<<<<<
 *             start_time = self.get_default_experiment_start_time()
 *         if final_time == "Default":
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_start_time, ((PyObject *)__pyx_n_s__Default), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":6046
 *         """
 *         if start_time == "Default":
 *             start_time = self.get_default_experiment_start_time()             # <<<<<<<<<<<<<<
 *         if final_time == "Default":
 *             final_time = self.get_default_experiment_stop_time()
 */
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_129); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_v_start_time);
    __pyx_v_start_time = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":6047
 *         if start_time == "Default":
 *             start_time = self.get_default_experiment_start_time()
 *         if final_time == "Default":             # <<<<<<<<<<<<<<
 *             final_time = self.get_default_experiment_stop_time()
 * 
 */
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_final_time, ((PyObject *)__pyx_n_s__Default), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":6048
 *             start_time = self.get_default_experiment_start_time()
 *         if final_time == "Default":
 *             final_time = self.get_default_experiment_stop_time()             # <<<<<<<<<<<<<<
 * 
 *         return self._exec_simulate_algorithm(start_time,
 */
    __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_130); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6048; __pyx_clineno = __LINE__; goto __pyx_L1_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 = 6048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_v_final_time);
    __pyx_v_final_time = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":6050
 *             final_time = self.get_default_experiment_stop_time()
 * 
 *         return self._exec_simulate_algorithm(start_time,             # <<<<<<<<<<<<<<
 *                                              final_time,
 *                                              input,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_131); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyfmi\fmi.pyx":6055
 *                                              'pyfmi.fmi_algorithm_drivers',
 *                                              algorithm,
 *                                              options)             # <<<<<<<<<<<<<<
 * 
 *     def simulate_options(self, algorithm='FMICSAlg'):
 */
  __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_start_time);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_start_time);
  __Pyx_GIVEREF(__pyx_v_start_time);
  __Pyx_INCREF(__pyx_v_final_time);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_final_time);
  __Pyx_GIVEREF(__pyx_v_final_time);
  __Pyx_INCREF(__pyx_v_input);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_input);
  __Pyx_GIVEREF(__pyx_v_input);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_9));
  PyTuple_SET_ITEM(__pyx_t_3, 3, ((PyObject *)__pyx_kp_s_9));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9));
  __Pyx_INCREF(__pyx_v_algorithm);
  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_algorithm);
  __Pyx_GIVEREF(__pyx_v_algorithm);
  __Pyx_INCREF(__pyx_v_options);
  PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_v_options);
  __Pyx_GIVEREF(__pyx_v_options);
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2.simulate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_start_time);
  __Pyx_XDECREF(__pyx_v_final_time);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_29simulate_options(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_28simulate_options[] = "\n        Get an instance of the simulate options class, filled with default\n        values. If called without argument then the options class for the\n        default simulation algorithm will be returned.\n\n        Parameters::\n\n            algorithm --\n                The algorithm for which the options class should be fetched.\n                Possible values are: 'FMICSAlg'.\n                Default: 'FMICSAlg'\n\n        Returns::\n\n            Options class for the algorithm specified with default values.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_29simulate_options(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_algorithm = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("simulate_options (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__algorithm,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_n_s__FMICSAlg);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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 (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__algorithm);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "simulate_options") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6057; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_algorithm = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("simulate_options", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6057; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2.simulate_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_28simulate_options(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self), __pyx_v_algorithm);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":6057
 *                                              options)
 * 
 *     def simulate_options(self, algorithm='FMICSAlg'):             # <<<<<<<<<<<<<<
 *         """
 *         Get an instance of the simulate options class, filled with default
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_28simulate_options(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self, PyObject *__pyx_v_algorithm) {
  PyObject *__pyx_r = NULL;
  __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("simulate_options", 0);

  /* "pyfmi\fmi.pyx":6074
 *             Options class for the algorithm specified with default values.
 *         """
 *         return self._default_options('pyfmi.fmi_algorithm_drivers', algorithm)             # <<<<<<<<<<<<<<
 * 
 *     def get_capability_flags(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___default_options); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6074; __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 = 6074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_9));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_9));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9));
  __Pyx_INCREF(__pyx_v_algorithm);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_algorithm);
  __Pyx_GIVEREF(__pyx_v_algorithm);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2.simulate_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_31get_capability_flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_30get_capability_flags[] = "\n        Returns a dictionary with the capability flags of the FMU.\n\n        Returns::\n            Dictionary with keys:\n            needsExecutionTool\n            canHandleVariableCommunicationStepSize\n            canInterpolateInputs\n            maxOutputDerivativeOrder\n            canRunAsynchronuously\n            canBeInstantiatedOnlyOncePerProcess\n            canNotUseMemoryManagementFunctions\n            canGetAndSetFMUstate\n            providesDirectionalDerivatives\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_31get_capability_flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_capability_flags (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_30get_capability_flags(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":6076
 *         return self._default_options('pyfmi.fmi_algorithm_drivers', algorithm)
 * 
 *     def get_capability_flags(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a dictionary with the capability flags of the FMU.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_30get_capability_flags(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__pyx_v_self) {
  PyObject *__pyx_v_capabilities = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_capability_flags", 0);

  /* "pyfmi\fmi.pyx":6092
 *             providesDirectionalDerivatives
 *         """
 *         cdef dict capabilities = {}             # <<<<<<<<<<<<<<
 *         capabilities['needsExecutionTool']                     = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_needsExecutionTool))
 *         capabilities['canHandleVariableCommunicationStepSize'] = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canHandleVariableCommunicationStepSize))
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_capabilities = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6093
 *         """
 *         cdef dict capabilities = {}
 *         capabilities['needsExecutionTool']                     = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_needsExecutionTool))             # <<<<<<<<<<<<<<
 *         capabilities['canHandleVariableCommunicationStepSize'] = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canHandleVariableCommunicationStepSize))
 *         capabilities['canInterpolateInputs']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canInterpolateInputs))
 */
  __pyx_t_1 = PyLong_FromUnsignedLong(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_cs_needsExecutionTool)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s__needsExecutionTool), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6094
 *         cdef dict capabilities = {}
 *         capabilities['needsExecutionTool']                     = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_needsExecutionTool))
 *         capabilities['canHandleVariableCommunicationStepSize'] = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canHandleVariableCommunicationStepSize))             # <<<<<<<<<<<<<<
 *         capabilities['canInterpolateInputs']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canInterpolateInputs))
 *         capabilities['maxOutputDerivativeOrder']               = FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_maxOutputDerivativeOrder)
 */
  __pyx_t_1 = PyLong_FromUnsignedLong(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_cs_canHandleVariableCommunicationStepSize)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_145), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6095
 *         capabilities['needsExecutionTool']                     = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_needsExecutionTool))
 *         capabilities['canHandleVariableCommunicationStepSize'] = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canHandleVariableCommunicationStepSize))
 *         capabilities['canInterpolateInputs']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canInterpolateInputs))             # <<<<<<<<<<<<<<
 *         capabilities['maxOutputDerivativeOrder']               = FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_maxOutputDerivativeOrder)
 *         capabilities['canRunAsynchronuously']                  = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canRunAsynchronuously))
 */
  __pyx_t_1 = PyLong_FromUnsignedLong(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_cs_canInterpolateInputs)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_146), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6096
 *         capabilities['canHandleVariableCommunicationStepSize'] = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canHandleVariableCommunicationStepSize))
 *         capabilities['canInterpolateInputs']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canInterpolateInputs))
 *         capabilities['maxOutputDerivativeOrder']               = FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_maxOutputDerivativeOrder)             # <<<<<<<<<<<<<<
 *         capabilities['canRunAsynchronuously']                  = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canRunAsynchronuously))
 *         capabilities['canBeInstantiatedOnlyOncePerProcess']    = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canBeInstantiatedOnlyOncePerProcess))
 */
  __pyx_t_1 = PyLong_FromUnsignedLong(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_cs_maxOutputDerivativeOrder)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_147), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6097
 *         capabilities['canInterpolateInputs']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canInterpolateInputs))
 *         capabilities['maxOutputDerivativeOrder']               = FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_maxOutputDerivativeOrder)
 *         capabilities['canRunAsynchronuously']                  = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canRunAsynchronuously))             # <<<<<<<<<<<<<<
 *         capabilities['canBeInstantiatedOnlyOncePerProcess']    = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canBeInstantiatedOnlyOncePerProcess))
 *         capabilities['canNotUseMemoryManagementFunctions']     = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canNotUseMemoryManagementFunctions))
 */
  __pyx_t_1 = PyLong_FromUnsignedLong(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_cs_canRunAsynchronuously)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_148), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6098
 *         capabilities['maxOutputDerivativeOrder']               = FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_maxOutputDerivativeOrder)
 *         capabilities['canRunAsynchronuously']                  = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canRunAsynchronuously))
 *         capabilities['canBeInstantiatedOnlyOncePerProcess']    = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canBeInstantiatedOnlyOncePerProcess))             # <<<<<<<<<<<<<<
 *         capabilities['canNotUseMemoryManagementFunctions']     = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canNotUseMemoryManagementFunctions))
 *         capabilities['canGetAndSetFMUstate']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canGetAndSetFMUstate))
 */
  __pyx_t_1 = PyLong_FromUnsignedLong(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_cs_canBeInstantiatedOnlyOncePerProcess)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_149), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6099
 *         capabilities['canRunAsynchronuously']                  = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canRunAsynchronuously))
 *         capabilities['canBeInstantiatedOnlyOncePerProcess']    = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canBeInstantiatedOnlyOncePerProcess))
 *         capabilities['canNotUseMemoryManagementFunctions']     = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canNotUseMemoryManagementFunctions))             # <<<<<<<<<<<<<<
 *         capabilities['canGetAndSetFMUstate']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canGetAndSetFMUstate))
 *         capabilities['canSerializeFMUstate']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canSerializeFMUstate))
 */
  __pyx_t_1 = PyLong_FromUnsignedLong(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_cs_canNotUseMemoryManagementFunctions)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_150), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6100
 *         capabilities['canBeInstantiatedOnlyOncePerProcess']    = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canBeInstantiatedOnlyOncePerProcess))
 *         capabilities['canNotUseMemoryManagementFunctions']     = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canNotUseMemoryManagementFunctions))
 *         capabilities['canGetAndSetFMUstate']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canGetAndSetFMUstate))             # <<<<<<<<<<<<<<
 *         capabilities['canSerializeFMUstate']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canSerializeFMUstate))
 *         capabilities['providesDirectionalDerivatives']         = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_providesDirectionalDerivatives))
 */
  __pyx_t_1 = PyLong_FromUnsignedLong(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_cs_canGetAndSetFMUstate)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_349), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6101
 *         capabilities['canNotUseMemoryManagementFunctions']     = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canNotUseMemoryManagementFunctions))
 *         capabilities['canGetAndSetFMUstate']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canGetAndSetFMUstate))
 *         capabilities['canSerializeFMUstate']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canSerializeFMUstate))             # <<<<<<<<<<<<<<
 *         capabilities['providesDirectionalDerivatives']         = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_providesDirectionalDerivatives))
 * 
 */
  __pyx_t_1 = PyLong_FromUnsignedLong(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_cs_canSerializeFMUstate)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_350), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6102
 *         capabilities['canGetAndSetFMUstate']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canGetAndSetFMUstate))
 *         capabilities['canSerializeFMUstate']                   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canSerializeFMUstate))
 *         capabilities['providesDirectionalDerivatives']         = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_providesDirectionalDerivatives))             # <<<<<<<<<<<<<<
 * 
 *         return capabilities
 */
  __pyx_t_1 = PyLong_FromUnsignedLong(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_cs_providesDirectionalDerivatives)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_351), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6104
 *         capabilities['providesDirectionalDerivatives']         = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_providesDirectionalDerivatives))
 * 
 *         return capabilities             # <<<<<<<<<<<<<<
 * 
 *     def _provides_directional_derivatives(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_capabilities));
  __pyx_r = ((PyObject *)__pyx_v_capabilities);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2.get_capability_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_capabilities);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_33_provides_directional_derivatives(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_32_provides_directional_derivatives[] = "\n        Check capability to provide directional derivatives.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_33_provides_directional_derivatives(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_provides_directional_derivatives (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_32_provides_directional_derivatives(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":6106
 *         return capabilities
 * 
 *     def _provides_directional_derivatives(self):             # <<<<<<<<<<<<<<
 *         """
 *         Check capability to provide directional derivatives.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_32_provides_directional_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__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("_provides_directional_derivatives", 0);

  /* "pyfmi\fmi.pyx":6110
 *         Check capability to provide directional derivatives.
 *         """
 *         return FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_providesDirectionalDerivatives)             # <<<<<<<<<<<<<<
 * 
 *     def _supports_get_set_FMU_state(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyLong_FromUnsignedLong(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_cs_providesDirectionalDerivatives)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2._provides_directional_derivatives", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_35_supports_get_set_FMU_state(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelCS2_34_supports_get_set_FMU_state[] = "\n        Check support for getting and setting the FMU state.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_35_supports_get_set_FMU_state(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_supports_get_set_FMU_state (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelCS2_34_supports_get_set_FMU_state(((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":6112
 *         return FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_providesDirectionalDerivatives)
 * 
 *     def _supports_get_set_FMU_state(self):             # <<<<<<<<<<<<<<
 *         """
 *         Check support for getting and setting the FMU state.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelCS2_34_supports_get_set_FMU_state(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *__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("_supports_get_set_FMU_state", 0);

  /* "pyfmi\fmi.pyx":6116
 *         Check support for getting and setting the FMU state.
 *         """
 *         return FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_cs_canGetAndSetFMUstate)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyLong_FromUnsignedLong(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_cs_canGetAndSetFMUstate)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelCS2._supports_get_set_FMU_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_11FMUModelME2_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2___init__[] = "\n        Constructor of the model.\n\n        Parameters::\n\n            fmu --\n                Name of the fmu as a string.\n\n            path --\n                Path to the fmu-directory.\n                Default: '.' (working directory)\n\n            enable_logging --\n                Boolean for acesss to logging-messages.\n                Default: True\n\n            log_file_name --\n                Filename for file used to save logmessages.\n                Default: \"\" (Generates automatically)\n\n        Returns::\n\n            A model as an object from the class FMUModelME2\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_5pyfmi_3fmi_11FMUModelME2___init__;
#endif
static int __pyx_pw_5pyfmi_3fmi_11FMUModelME2_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fmu = 0;
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_enable_logging = 0;
  PyObject *__pyx_v_log_file_name = 0;
  PyObject *__pyx_v_log_level = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fmu,&__pyx_n_s__path,&__pyx_n_s__enable_logging,&__pyx_n_s__log_file_name,&__pyx_n_s__log_level,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_kp_s_30);
    values[2] = __pyx_k_352;
    values[3] = ((PyObject *)__pyx_kp_s_12);
    values[4] = __pyx_k_353;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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__fmu)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__enable_logging);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__log_file_name);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__log_level);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      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 = 6124; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_fmu = values[0];
    __pyx_v_path = values[1];
    __pyx_v_enable_logging = values[2];
    __pyx_v_log_file_name = values[3];
    __pyx_v_log_level = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6124; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2___init__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self), __pyx_v_fmu, __pyx_v_path, __pyx_v_enable_logging, __pyx_v_log_file_name, __pyx_v_log_level);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":6124
 *     """
 * 
 *     def __init__(self, fmu, path = '.', enable_logging = True, log_file_name = "", log_level=FMI_DEFAULT_LOG_LEVEL):             # <<<<<<<<<<<<<<
 *         """
 *         Constructor of the model.
 */

static int __pyx_pf_5pyfmi_3fmi_11FMUModelME2___init__(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, PyObject *__pyx_v_fmu, PyObject *__pyx_v_path, PyObject *__pyx_v_enable_logging, PyObject *__pyx_v_log_file_name, PyObject *__pyx_v_log_level) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  fmi2_boolean_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyfmi\fmi.pyx":6150
 *         """
 *         #Call super
 *         FMUModelBase2.__init__(self, fmu, path, enable_logging, log_file_name, log_level)             # <<<<<<<<<<<<<<
 * 
 *         if self._fmu_kind != FMIL.fmi2_fmu_kind_me:
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelBase2)), __pyx_n_s____init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __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_fmu);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_fmu);
  __Pyx_GIVEREF(__pyx_v_fmu);
  __Pyx_INCREF(__pyx_v_path);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  __Pyx_INCREF(__pyx_v_enable_logging);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_enable_logging);
  __Pyx_GIVEREF(__pyx_v_enable_logging);
  __Pyx_INCREF(__pyx_v_log_file_name);
  PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_log_file_name);
  __Pyx_GIVEREF(__pyx_v_log_file_name);
  __Pyx_INCREF(__pyx_v_log_level);
  PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_v_log_level);
  __Pyx_GIVEREF(__pyx_v_log_level);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":6152
 *         FMUModelBase2.__init__(self, fmu, path, enable_logging, log_file_name, log_level)
 * 
 *         if self._fmu_kind != FMIL.fmi2_fmu_kind_me:             # <<<<<<<<<<<<<<
 *             if self._fmu_kind != FMIL.fmi2_fmu_kind_me_and_cs:
 *                 raise FMUException('This class only supports FMI 2.0 for Model Exchange.')
 */
  __pyx_t_4 = (__pyx_v_self->__pyx_base._fmu_kind != fmi2_fmu_kind_me);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":6153
 * 
 *         if self._fmu_kind != FMIL.fmi2_fmu_kind_me:
 *             if self._fmu_kind != FMIL.fmi2_fmu_kind_me_and_cs:             # <<<<<<<<<<<<<<
 *                 raise FMUException('This class only supports FMI 2.0 for Model Exchange.')
 * 
 */
    __pyx_t_4 = (__pyx_v_self->__pyx_base._fmu_kind != fmi2_fmu_kind_me_and_cs);
    if (__pyx_t_4) {

      /* "pyfmi\fmi.pyx":6154
 *         if self._fmu_kind != FMIL.fmi2_fmu_kind_me:
 *             if self._fmu_kind != FMIL.fmi2_fmu_kind_me_and_cs:
 *                 raise FMUException('This class only supports FMI 2.0 for Model Exchange.')             # <<<<<<<<<<<<<<
 * 
 *         if self.get_capability_flags()['needsExecutionTool'] == True:
 */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_355), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L4;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":6156
 *                 raise FMUException('This class only supports FMI 2.0 for Model Exchange.')
 * 
 *         if self.get_capability_flags()['needsExecutionTool'] == True:             # <<<<<<<<<<<<<<
 *             raise FMUException('Models that need an execution tool are not supported')
 * 
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_324); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__needsExecutionTool)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":6157
 * 
 *         if self.get_capability_flags()['needsExecutionTool'] == True:
 *             raise FMUException('Models that need an execution tool are not supported')             # <<<<<<<<<<<<<<
 * 
 *         self._eventInfo.newDiscreteStatesNeeded           = FMI2_FALSE
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_356), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":6159
 *             raise FMUException('Models that need an execution tool are not supported')
 * 
 *         self._eventInfo.newDiscreteStatesNeeded           = FMI2_FALSE             # <<<<<<<<<<<<<<
 *         self._eventInfo.terminateSimulation               = FMI2_FALSE
 *         self._eventInfo.nominalsOfContinuousStatesChanged = FMI2_FALSE
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI2_FALSE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyInt_from_py_fmi2_boolean_t(__pyx_t_3); if (unlikely((__pyx_t_5 == (fmi2_boolean_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->__pyx_base._eventInfo.newDiscreteStatesNeeded = __pyx_t_5;

  /* "pyfmi\fmi.pyx":6160
 * 
 *         self._eventInfo.newDiscreteStatesNeeded           = FMI2_FALSE
 *         self._eventInfo.terminateSimulation               = FMI2_FALSE             # <<<<<<<<<<<<<<
 *         self._eventInfo.nominalsOfContinuousStatesChanged = FMI2_FALSE
 *         self._eventInfo.valuesOfContinuousStatesChanged   = FMI2_TRUE
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI2_FALSE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyInt_from_py_fmi2_boolean_t(__pyx_t_3); if (unlikely((__pyx_t_5 == (fmi2_boolean_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->__pyx_base._eventInfo.terminateSimulation = __pyx_t_5;

  /* "pyfmi\fmi.pyx":6161
 *         self._eventInfo.newDiscreteStatesNeeded           = FMI2_FALSE
 *         self._eventInfo.terminateSimulation               = FMI2_FALSE
 *         self._eventInfo.nominalsOfContinuousStatesChanged = FMI2_FALSE             # <<<<<<<<<<<<<<
 *         self._eventInfo.valuesOfContinuousStatesChanged   = FMI2_TRUE
 *         self._eventInfo.nextEventTimeDefined              = FMI2_FALSE
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI2_FALSE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyInt_from_py_fmi2_boolean_t(__pyx_t_3); if (unlikely((__pyx_t_5 == (fmi2_boolean_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->__pyx_base._eventInfo.nominalsOfContinuousStatesChanged = __pyx_t_5;

  /* "pyfmi\fmi.pyx":6162
 *         self._eventInfo.terminateSimulation               = FMI2_FALSE
 *         self._eventInfo.nominalsOfContinuousStatesChanged = FMI2_FALSE
 *         self._eventInfo.valuesOfContinuousStatesChanged   = FMI2_TRUE             # <<<<<<<<<<<<<<
 *         self._eventInfo.nextEventTimeDefined              = FMI2_FALSE
 *         self._eventInfo.nextEventTime                     = 0.0
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI2_TRUE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyInt_from_py_fmi2_boolean_t(__pyx_t_3); if (unlikely((__pyx_t_5 == (fmi2_boolean_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->__pyx_base._eventInfo.valuesOfContinuousStatesChanged = __pyx_t_5;

  /* "pyfmi\fmi.pyx":6163
 *         self._eventInfo.nominalsOfContinuousStatesChanged = FMI2_FALSE
 *         self._eventInfo.valuesOfContinuousStatesChanged   = FMI2_TRUE
 *         self._eventInfo.nextEventTimeDefined              = FMI2_FALSE             # <<<<<<<<<<<<<<
 *         self._eventInfo.nextEventTime                     = 0.0
 * 
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI2_FALSE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyInt_from_py_fmi2_boolean_t(__pyx_t_3); if (unlikely((__pyx_t_5 == (fmi2_boolean_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->__pyx_base._eventInfo.nextEventTimeDefined = __pyx_t_5;

  /* "pyfmi\fmi.pyx":6164
 *         self._eventInfo.valuesOfContinuousStatesChanged   = FMI2_TRUE
 *         self._eventInfo.nextEventTimeDefined              = FMI2_FALSE
 *         self._eventInfo.nextEventTime                     = 0.0             # <<<<<<<<<<<<<<
 * 
 *         self.force_finite_differences = False
 */
  __pyx_v_self->__pyx_base._eventInfo.nextEventTime = 0.0;

  /* "pyfmi\fmi.pyx":6166
 *         self._eventInfo.nextEventTime                     = 0.0
 * 
 *         self.force_finite_differences = False             # <<<<<<<<<<<<<<
 * 
 *         self._modelId = decode(FMIL.fmi2_import_get_model_identifier_ME(self._fmu))
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->force_finite_differences);
  __Pyx_DECREF(__pyx_v_self->force_finite_differences);
  __pyx_v_self->force_finite_differences = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":6168
 *         self.force_finite_differences = False
 * 
 *         self._modelId = decode(FMIL.fmi2_import_get_model_identifier_ME(self._fmu))             # <<<<<<<<<<<<<<
 *         self.instantiate()
 * 
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyBytes_FromString(fmi2_import_get_model_identifier_ME(__pyx_v_self->__pyx_base._fmu)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base._modelId);
  __Pyx_DECREF(__pyx_v_self->__pyx_base._modelId);
  __pyx_v_self->__pyx_base._modelId = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6169
 * 
 *         self._modelId = decode(FMIL.fmi2_import_get_model_identifier_ME(self._fmu))
 *         self.instantiate()             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__instantiate); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6169; __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 = 6169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static void __pyx_pw_5pyfmi_3fmi_11FMUModelME2_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_5pyfmi_3fmi_11FMUModelME2_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_5pyfmi_3fmi_11FMUModelME2_2__dealloc__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
}

/* "pyfmi\fmi.pyx":6171
 *         self.instantiate()
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         """
 *         Deallocate memory allocated
 */

static void __pyx_pf_5pyfmi_3fmi_11FMUModelME2_2__dealloc__(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pyfmi\fmi.pyx":6176
 *         """
 * 
 *         if self._allocated_fmu == 1:             # <<<<<<<<<<<<<<
 *             FMIL.fmi2_import_terminate(self._fmu)
 *             FMIL.fmi2_import_free_instance(self._fmu)
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base._allocated_fmu == 1);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":6177
 * 
 *         if self._allocated_fmu == 1:
 *             FMIL.fmi2_import_terminate(self._fmu)             # <<<<<<<<<<<<<<
 *             FMIL.fmi2_import_free_instance(self._fmu)
 * 
 */
    fmi2_import_terminate(__pyx_v_self->__pyx_base._fmu);

    /* "pyfmi\fmi.pyx":6178
 *         if self._allocated_fmu == 1:
 *             FMIL.fmi2_import_terminate(self._fmu)
 *             FMIL.fmi2_import_free_instance(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if self._allocated_dll == 1:
 */
    fmi2_import_free_instance(__pyx_v_self->__pyx_base._fmu);
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":6180
 *             FMIL.fmi2_import_free_instance(self._fmu)
 * 
 *         if self._allocated_dll == 1:             # <<<<<<<<<<<<<<
 *             FMIL.fmi2_import_destroy_dllfmu(self._fmu)
 * 
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base._allocated_dll == 1);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":6181
 * 
 *         if self._allocated_dll == 1:
 *             FMIL.fmi2_import_destroy_dllfmu(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if self._allocated_xml == 1:
 */
    fmi2_import_destroy_dllfmu(__pyx_v_self->__pyx_base._fmu);
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":6183
 *             FMIL.fmi2_import_destroy_dllfmu(self._fmu)
 * 
 *         if self._allocated_xml == 1:             # <<<<<<<<<<<<<<
 *             FMIL.fmi2_import_free(self._fmu)
 * 
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base._allocated_xml == 1);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":6184
 * 
 *         if self._allocated_xml == 1:
 *             FMIL.fmi2_import_free(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if self._fmu_temp_dir != NULL:
 */
    fmi2_import_free(__pyx_v_self->__pyx_base._fmu);
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":6186
 *             FMIL.fmi2_import_free(self._fmu)
 * 
 *         if self._fmu_temp_dir != NULL:             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_rmdir(&self.callbacks, self._fmu_temp_dir)
 *             FMIL.free(self._fmu_temp_dir)
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base._fmu_temp_dir != NULL);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":6187
 * 
 *         if self._fmu_temp_dir != NULL:
 *             FMIL.fmi_import_rmdir(&self.callbacks, self._fmu_temp_dir)             # <<<<<<<<<<<<<<
 *             FMIL.free(self._fmu_temp_dir)
 *             self._fmu_temp_dir = NULL
 */
    fmi_import_rmdir((&__pyx_v_self->__pyx_base.__pyx_base.callbacks), __pyx_v_self->__pyx_base._fmu_temp_dir);

    /* "pyfmi\fmi.pyx":6188
 *         if self._fmu_temp_dir != NULL:
 *             FMIL.fmi_import_rmdir(&self.callbacks, self._fmu_temp_dir)
 *             FMIL.free(self._fmu_temp_dir)             # <<<<<<<<<<<<<<
 *             self._fmu_temp_dir = NULL
 * 
 */
    free(__pyx_v_self->__pyx_base._fmu_temp_dir);

    /* "pyfmi\fmi.pyx":6189
 *             FMIL.fmi_import_rmdir(&self.callbacks, self._fmu_temp_dir)
 *             FMIL.free(self._fmu_temp_dir)
 *             self._fmu_temp_dir = NULL             # <<<<<<<<<<<<<<
 * 
 *         if self._allocated_context == 1:
 */
    __pyx_v_self->__pyx_base._fmu_temp_dir = NULL;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pyfmi\fmi.pyx":6191
 *             self._fmu_temp_dir = NULL
 * 
 *         if self._allocated_context == 1:             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_free_context(self._context)
 * 
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base._allocated_context == 1);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":6192
 * 
 *         if self._allocated_context == 1:
 *             FMIL.fmi_import_free_context(self._context)             # <<<<<<<<<<<<<<
 * 
 *         if self._fmu_log_name != NULL:
 */
    fmi_import_free_context(__pyx_v_self->__pyx_base._context);
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "pyfmi\fmi.pyx":6194
 *             FMIL.fmi_import_free_context(self._context)
 * 
 *         if self._fmu_log_name != NULL:             # <<<<<<<<<<<<<<
 *             FMIL.free(self._fmu_log_name)
 *             self._fmu_log_name = NULL
 */
  __pyx_t_1 = (__pyx_v_self->__pyx_base.__pyx_base._fmu_log_name != NULL);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":6195
 * 
 *         if self._fmu_log_name != NULL:
 *             FMIL.free(self._fmu_log_name)             # <<<<<<<<<<<<<<
 *             self._fmu_log_name = NULL
 * 
 */
    free(__pyx_v_self->__pyx_base.__pyx_base._fmu_log_name);

    /* "pyfmi\fmi.pyx":6196
 *         if self._fmu_log_name != NULL:
 *             FMIL.free(self._fmu_log_name)
 *             self._fmu_log_name = NULL             # <<<<<<<<<<<<<<
 * 
 *     cpdef _get_time(self):
 */
    __pyx_v_self->__pyx_base.__pyx_base._fmu_log_name = NULL;
    goto __pyx_L8;
  }
  __pyx_L8:;

  __Pyx_RefNannyFinishContext();
}

/* "pyfmi\fmi.pyx":6198
 *             self._fmu_log_name = NULL
 * 
 *     cpdef _get_time(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the current time of the simulation.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_5_get_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_11FMUModelME2__get_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_time", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___get_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_5_get_time)) {
      __Pyx_XDECREF(__pyx_r);
      __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 = 6198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":6205
 *             The time.
 *         """
 *         return self.__t             # <<<<<<<<<<<<<<
 * 
 *     cpdef _set_time(self, FMIL.fmi2_real_t t):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx___t);
  __pyx_r = __pyx_v_self->__pyx_base.__pyx___t;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2._get_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_5_get_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_4_get_time[] = "\n        Returns the current time of the simulation.\n\n        Returns::\n            The time.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_5_get_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_time (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_4_get_time(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":6198
 *             self._fmu_log_name = NULL
 * 
 *     cpdef _get_time(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the current time of the simulation.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_4_get_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__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("_get_time", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_get_time(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2._get_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":6207
 *         return self.__t
 * 
 *     cpdef _set_time(self, FMIL.fmi2_real_t t):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the current time of the simulation.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_7_set_time(PyObject *__pyx_v_self, PyObject *__pyx_arg_t); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_11FMUModelME2__set_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, fmi2_real_t __pyx_v_t, int __pyx_skip_dispatch) {
  int __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_time", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___set_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_7_set_time)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":6217
 * 
 *         cdef int status
 *         status = FMIL.fmi2_import_set_time(self._fmu, t)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi2_import_set_time(__pyx_v_self->__pyx_base._fmu, __pyx_v_t);

  /* "pyfmi\fmi.pyx":6219
 *         status = FMIL.fmi2_import_set_time(self._fmu, t)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to set the time.')
 *         self.__t = t
 */
  __pyx_t_4 = (__pyx_v_status != 0);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":6220
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the time.')             # <<<<<<<<<<<<<<
 *         self.__t = t
 * 
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_357), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":6221
 *         if status != 0:
 *             raise FMUException('Failed to set the time.')
 *         self.__t = t             # <<<<<<<<<<<<<<
 * 
 *     time = property(_get_time,_set_time, doc =
 */
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.__pyx___t);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.__pyx___t);
  __pyx_v_self->__pyx_base.__pyx___t = __pyx_t_2;
  __pyx_t_2 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2._set_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_7_set_time(PyObject *__pyx_v_self, PyObject *__pyx_arg_t); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_6_set_time[] = "\n        Sets the current time of the simulation.\n\n        Parameters::\n            t--\n                The time to set.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_7_set_time(PyObject *__pyx_v_self, PyObject *__pyx_arg_t) {
  fmi2_real_t __pyx_v_t;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set_time (wrapper)", 0);
  assert(__pyx_arg_t); {
    __pyx_v_t = __pyx_PyFloat_AsDouble(__pyx_arg_t); if (unlikely((__pyx_v_t == (fmi2_real_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6207; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2._set_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_6_set_time(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self), ((fmi2_real_t)__pyx_v_t));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":6207
 *         return self.__t
 * 
 *     cpdef _set_time(self, FMIL.fmi2_real_t t):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the current time of the simulation.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_6_set_time(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, fmi2_real_t __pyx_v_t) {
  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("_set_time", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_set_time(__pyx_v_self, __pyx_v_t, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2._set_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_9get_event_info(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_8get_event_info[] = "\n        Returns the event information from the FMU.\n\n        Returns::\n\n            The event information, a struct which contains:\n\n            newDiscreteStatesNeeded --\n                Event iteration did not converge (if True).\n\n            terminateSimulation --\n                Error, terminate simulation (if True).\n\n            nominalsOfContinuousStatesChanged --\n                Values of states x have changed (if True).\n\n            valuesOfContinuousStatesChanged --\n                ValueReferences of states x changed (if True).\n\n            nextEventTimeDefined -\n                If True, nextEventTime is the next time event.\n\n            nextEventTime --\n                The next time event.\n\n        Example::\n\n            event_info    = model.event_info\n            nextEventTime = model.event_info.nextEventTime\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_9get_event_info(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_event_info (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_8get_event_info(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":6229
 *     """)
 * 
 *     def get_event_info(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the event information from the FMU.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_8get_event_info(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__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("get_event_info", 0);

  /* "pyfmi\fmi.pyx":6260
 *             nextEventTime = model.event_info.nextEventTime
 *         """
 *         self._pyEventInfo.newDiscreteStatesNeeded           = self._eventInfo.newDiscreteStatesNeeded == 1             # <<<<<<<<<<<<<<
 *         self._pyEventInfo.terminateSimulation               = self._eventInfo.terminateSimulation == 1
 *         self._pyEventInfo.nominalsOfContinuousStatesChanged = self._eventInfo.nominalsOfContinuousStatesChanged == 1
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->__pyx_base._eventInfo.newDiscreteStatesNeeded == 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_v_self->__pyx_base._pyEventInfo, __pyx_n_s_358, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6261
 *         """
 *         self._pyEventInfo.newDiscreteStatesNeeded           = self._eventInfo.newDiscreteStatesNeeded == 1
 *         self._pyEventInfo.terminateSimulation               = self._eventInfo.terminateSimulation == 1             # <<<<<<<<<<<<<<
 *         self._pyEventInfo.nominalsOfContinuousStatesChanged = self._eventInfo.nominalsOfContinuousStatesChanged == 1
 *         self._pyEventInfo.valuesOfContinuousStatesChanged   = self._eventInfo.valuesOfContinuousStatesChanged == 1
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->__pyx_base._eventInfo.terminateSimulation == 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_v_self->__pyx_base._pyEventInfo, __pyx_n_s__terminateSimulation, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6262
 *         self._pyEventInfo.newDiscreteStatesNeeded           = self._eventInfo.newDiscreteStatesNeeded == 1
 *         self._pyEventInfo.terminateSimulation               = self._eventInfo.terminateSimulation == 1
 *         self._pyEventInfo.nominalsOfContinuousStatesChanged = self._eventInfo.nominalsOfContinuousStatesChanged == 1             # <<<<<<<<<<<<<<
 *         self._pyEventInfo.valuesOfContinuousStatesChanged   = self._eventInfo.valuesOfContinuousStatesChanged == 1
 *         self._pyEventInfo.nextEventTimeDefined              = self._eventInfo.nextEventTimeDefined == 1
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->__pyx_base._eventInfo.nominalsOfContinuousStatesChanged == 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_v_self->__pyx_base._pyEventInfo, __pyx_n_s_359, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6263
 *         self._pyEventInfo.terminateSimulation               = self._eventInfo.terminateSimulation == 1
 *         self._pyEventInfo.nominalsOfContinuousStatesChanged = self._eventInfo.nominalsOfContinuousStatesChanged == 1
 *         self._pyEventInfo.valuesOfContinuousStatesChanged   = self._eventInfo.valuesOfContinuousStatesChanged == 1             # <<<<<<<<<<<<<<
 *         self._pyEventInfo.nextEventTimeDefined              = self._eventInfo.nextEventTimeDefined == 1
 *         self._pyEventInfo.nextEventTime                     = self._eventInfo.nextEventTime
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->__pyx_base._eventInfo.valuesOfContinuousStatesChanged == 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_v_self->__pyx_base._pyEventInfo, __pyx_n_s_360, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6264
 *         self._pyEventInfo.nominalsOfContinuousStatesChanged = self._eventInfo.nominalsOfContinuousStatesChanged == 1
 *         self._pyEventInfo.valuesOfContinuousStatesChanged   = self._eventInfo.valuesOfContinuousStatesChanged == 1
 *         self._pyEventInfo.nextEventTimeDefined              = self._eventInfo.nextEventTimeDefined == 1             # <<<<<<<<<<<<<<
 *         self._pyEventInfo.nextEventTime                     = self._eventInfo.nextEventTime
 * 
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->__pyx_base._eventInfo.nextEventTimeDefined == 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_v_self->__pyx_base._pyEventInfo, __pyx_n_s_361, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6265
 *         self._pyEventInfo.valuesOfContinuousStatesChanged   = self._eventInfo.valuesOfContinuousStatesChanged == 1
 *         self._pyEventInfo.nextEventTimeDefined              = self._eventInfo.nextEventTimeDefined == 1
 *         self._pyEventInfo.nextEventTime                     = self._eventInfo.nextEventTime             # <<<<<<<<<<<<<<
 * 
 *         return self._pyEventInfo
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->__pyx_base._eventInfo.nextEventTime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_v_self->__pyx_base._pyEventInfo, __pyx_n_s__nextEventTime, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6267
 *         self._pyEventInfo.nextEventTime                     = self._eventInfo.nextEventTime
 * 
 *         return self._pyEventInfo             # <<<<<<<<<<<<<<
 * 
 *     def enter_event_mode(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->__pyx_base._pyEventInfo);
  __pyx_r = __pyx_v_self->__pyx_base._pyEventInfo;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2.get_event_info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_11enter_event_mode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_10enter_event_mode[] = "\n        Sets the FMU to be in event mode by calling the\n        underlying FMU method.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_11enter_event_mode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("enter_event_mode (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_10enter_event_mode(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":6269
 *         return self._pyEventInfo
 * 
 *     def enter_event_mode(self):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the FMU to be in event mode by calling the
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_10enter_event_mode(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self) {
  int __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  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("enter_event_mode", 0);

  /* "pyfmi\fmi.pyx":6275
 *         """
 *         cdef int status
 *         status = FMIL.fmi2_import_enter_event_mode(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi2_import_enter_event_mode(__pyx_v_self->__pyx_base._fmu);

  /* "pyfmi\fmi.pyx":6277
 *         status = FMIL.fmi2_import_enter_event_mode(self._fmu)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to enter event mode.')
 * 
 */
  __pyx_t_1 = (__pyx_v_status != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":6278
 * 
 *         if status != 0:
 *             raise FMUException('Failed to enter event mode.')             # <<<<<<<<<<<<<<
 * 
 *     def enter_continuous_time_mode(self):
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_363), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2.enter_event_mode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_13enter_continuous_time_mode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_12enter_continuous_time_mode[] = "\n        Sets the FMU to be in continuous time mode by calling the\n        underlying FMU method.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_13enter_continuous_time_mode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("enter_continuous_time_mode (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_12enter_continuous_time_mode(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":6280
 *             raise FMUException('Failed to enter event mode.')
 * 
 *     def enter_continuous_time_mode(self):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the FMU to be in continuous time mode by calling the
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_12enter_continuous_time_mode(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self) {
  int __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  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("enter_continuous_time_mode", 0);

  /* "pyfmi\fmi.pyx":6286
 *         """
 *         cdef int status
 *         status = FMIL.fmi2_import_enter_continuous_time_mode(self._fmu)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi2_import_enter_continuous_time_mode(__pyx_v_self->__pyx_base._fmu);

  /* "pyfmi\fmi.pyx":6288
 *         status = FMIL.fmi2_import_enter_continuous_time_mode(self._fmu)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to enter continuous time mode.')
 * 
 */
  __pyx_t_1 = (__pyx_v_status != 0);
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":6289
 * 
 *         if status != 0:
 *             raise FMUException('Failed to enter continuous time mode.')             # <<<<<<<<<<<<<<
 * 
 *     def get_event_indicators(self):
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_365), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2.enter_continuous_time_mode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_15get_event_indicators(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_14get_event_indicators[] = "\n        Returns the event indicators at the current time-point.\n\n        Returns::\n\n            evInd --\n                The event indicators as an array.\n\n        Example::\n\n            evInd = model.get_event_indicators()\n\n        Calls the low-level FMI function: fmiGetEventIndicators\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_15get_event_indicators(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_event_indicators (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_14get_event_indicators(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":6291
 *             raise FMUException('Failed to enter continuous time mode.')
 * 
 *     def get_event_indicators(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the event indicators at the current time-point.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_14get_event_indicators(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self) {
  int __pyx_v_status;
  PyArrayObject *__pyx_v_values = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_event_indicators", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;

  /* "pyfmi\fmi.pyx":6307
 *         """
 *         cdef int status
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] values = N.empty(self._nEventIndicators, dtype=N.double)             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_get_event_indicators(self._fmu, <FMIL.fmi2_real_t*> values.data, self._nEventIndicators)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_to_py_size_t(__pyx_v_self->__pyx_base._nEventIndicators); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_fmi2_real_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_values = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_values.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_values = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":6309
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] values = N.empty(self._nEventIndicators, dtype=N.double)
 * 
 *         status = FMIL.fmi2_import_get_event_indicators(self._fmu, <FMIL.fmi2_real_t*> values.data, self._nEventIndicators)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi2_import_get_event_indicators(__pyx_v_self->__pyx_base._fmu, ((fmi2_real_t *)__pyx_v_values->data), __pyx_v_self->__pyx_base._nEventIndicators);

  /* "pyfmi\fmi.pyx":6311
 *         status = FMIL.fmi2_import_get_event_indicators(self._fmu, <FMIL.fmi2_real_t*> values.data, self._nEventIndicators)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to get the event indicators.')
 * 
 */
  __pyx_t_7 = (__pyx_v_status != 0);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":6312
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the event indicators.')             # <<<<<<<<<<<<<<
 * 
 *         return values
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_366), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":6314
 *             raise FMUException('Failed to get the event indicators.')
 * 
 *         return values             # <<<<<<<<<<<<<<
 * 
 *     def event_update(self, intermediateResult=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_values));
  __pyx_r = ((PyObject *)__pyx_v_values);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2.get_event_indicators", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_values);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_17event_update(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_16event_update[] = "\n        Updates the event information at the current time-point. If\n        intermediateResult is set to True the update_event will stop at each\n        event iteration which would require to loop until\n        event_info.newDiscreteStatesNeeded == fmiFalse.\n\n        Parameters::\n\n            intermediateResult --\n                If set to True, the update_event will stop at each event\n                iteration.\n                Default: False.\n\n        Example::\n\n            model.event_update()\n\n        Calls the low-level FMI function: fmi2NewDiscreteStates\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_17event_update(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_intermediateResult = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("event_update (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__intermediateResult,0};
    PyObject* values[1] = {0};
    values[0] = __pyx_k_367;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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 (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__intermediateResult);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "event_update") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6316; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_intermediateResult = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("event_update", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6316; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2.event_update", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_16event_update(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self), __pyx_v_intermediateResult);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":6316
 *         return values
 * 
 *     def event_update(self, intermediateResult=False):             # <<<<<<<<<<<<<<
 *         """
 *         Updates the event information at the current time-point. If
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_16event_update(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, PyObject *__pyx_v_intermediateResult) {
  int __pyx_v_status;
  int __pyx_v_tmpValuesOfContinuousStatesChanged;
  int __pyx_v_tmpNominalsOfContinuousStatesChanged;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  fmi2_boolean_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("event_update", 0);

  /* "pyfmi\fmi.pyx":6338
 *         cdef int status
 * 
 *         if intermediateResult:             # <<<<<<<<<<<<<<
 *             status = FMIL.fmi2_import_new_discrete_states(self._fmu, &self._eventInfo)
 *             if status != 0:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_intermediateResult); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "pyfmi\fmi.pyx":6339
 * 
 *         if intermediateResult:
 *             status = FMIL.fmi2_import_new_discrete_states(self._fmu, &self._eventInfo)             # <<<<<<<<<<<<<<
 *             if status != 0:
 *                 raise FMUException('Failed to update the events at time: %E.'%self.time)
 */
    __pyx_v_status = fmi2_import_new_discrete_states(__pyx_v_self->__pyx_base._fmu, (&__pyx_v_self->__pyx_base._eventInfo));

    /* "pyfmi\fmi.pyx":6340
 *         if intermediateResult:
 *             status = FMIL.fmi2_import_new_discrete_states(self._fmu, &self._eventInfo)
 *             if status != 0:             # <<<<<<<<<<<<<<
 *                 raise FMUException('Failed to update the events at time: %E.'%self.time)
 *         else:
 */
    __pyx_t_1 = (__pyx_v_status != 0);
    if (__pyx_t_1) {

      /* "pyfmi\fmi.pyx":6341
 *             status = FMIL.fmi2_import_new_discrete_states(self._fmu, &self._eventInfo)
 *             if status != 0:
 *                 raise FMUException('Failed to update the events at time: %E.'%self.time)             # <<<<<<<<<<<<<<
 *         else:
 *             tmpValuesOfContinuousStatesChanged = False
 */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_172), __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
      __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L4;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":6343
 *                 raise FMUException('Failed to update the events at time: %E.'%self.time)
 *         else:
 *             tmpValuesOfContinuousStatesChanged = False             # <<<<<<<<<<<<<<
 *             tmpNominalsOfContinuousStatesChanged = False
 * 
 */
    __pyx_v_tmpValuesOfContinuousStatesChanged = 0;

    /* "pyfmi\fmi.pyx":6344
 *         else:
 *             tmpValuesOfContinuousStatesChanged = False
 *             tmpNominalsOfContinuousStatesChanged = False             # <<<<<<<<<<<<<<
 * 
 *             self._eventInfo.newDiscreteStatesNeeded = FMI2_TRUE
 */
    __pyx_v_tmpNominalsOfContinuousStatesChanged = 0;

    /* "pyfmi\fmi.pyx":6346
 *             tmpNominalsOfContinuousStatesChanged = False
 * 
 *             self._eventInfo.newDiscreteStatesNeeded = FMI2_TRUE             # <<<<<<<<<<<<<<
 *             while self._eventInfo.newDiscreteStatesNeeded:
 *                 status = FMIL.fmi2_import_new_discrete_states(self._fmu, &self._eventInfo)
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI2_TRUE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_from_py_fmi2_boolean_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (fmi2_boolean_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_self->__pyx_base._eventInfo.newDiscreteStatesNeeded = __pyx_t_5;

    /* "pyfmi\fmi.pyx":6347
 * 
 *             self._eventInfo.newDiscreteStatesNeeded = FMI2_TRUE
 *             while self._eventInfo.newDiscreteStatesNeeded:             # <<<<<<<<<<<<<<
 *                 status = FMIL.fmi2_import_new_discrete_states(self._fmu, &self._eventInfo)
 * 
 */
    while (1) {
      if (!__pyx_v_self->__pyx_base._eventInfo.newDiscreteStatesNeeded) break;

      /* "pyfmi\fmi.pyx":6348
 *             self._eventInfo.newDiscreteStatesNeeded = FMI2_TRUE
 *             while self._eventInfo.newDiscreteStatesNeeded:
 *                 status = FMIL.fmi2_import_new_discrete_states(self._fmu, &self._eventInfo)             # <<<<<<<<<<<<<<
 * 
 *                 if self._eventInfo.nominalsOfContinuousStatesChanged:
 */
      __pyx_v_status = fmi2_import_new_discrete_states(__pyx_v_self->__pyx_base._fmu, (&__pyx_v_self->__pyx_base._eventInfo));

      /* "pyfmi\fmi.pyx":6350
 *                 status = FMIL.fmi2_import_new_discrete_states(self._fmu, &self._eventInfo)
 * 
 *                 if self._eventInfo.nominalsOfContinuousStatesChanged:             # <<<<<<<<<<<<<<
 *                     tmpNominalsOfContinuousStatesChanged = True
 *                 if self._eventInfo.valuesOfContinuousStatesChanged:
 */
      if (__pyx_v_self->__pyx_base._eventInfo.nominalsOfContinuousStatesChanged) {

        /* "pyfmi\fmi.pyx":6351
 * 
 *                 if self._eventInfo.nominalsOfContinuousStatesChanged:
 *                     tmpNominalsOfContinuousStatesChanged = True             # <<<<<<<<<<<<<<
 *                 if self._eventInfo.valuesOfContinuousStatesChanged:
 *                     tmpValuesOfContinuousStatesChanged = True
 */
        __pyx_v_tmpNominalsOfContinuousStatesChanged = 1;
        goto __pyx_L7;
      }
      __pyx_L7:;

      /* "pyfmi\fmi.pyx":6352
 *                 if self._eventInfo.nominalsOfContinuousStatesChanged:
 *                     tmpNominalsOfContinuousStatesChanged = True
 *                 if self._eventInfo.valuesOfContinuousStatesChanged:             # <<<<<<<<<<<<<<
 *                     tmpValuesOfContinuousStatesChanged = True
 *                 if status != 0:
 */
      if (__pyx_v_self->__pyx_base._eventInfo.valuesOfContinuousStatesChanged) {

        /* "pyfmi\fmi.pyx":6353
 *                     tmpNominalsOfContinuousStatesChanged = True
 *                 if self._eventInfo.valuesOfContinuousStatesChanged:
 *                     tmpValuesOfContinuousStatesChanged = True             # <<<<<<<<<<<<<<
 *                 if status != 0:
 *                     raise FMUException('Failed to update the events at time: %E.'%self.time)
 */
        __pyx_v_tmpValuesOfContinuousStatesChanged = 1;
        goto __pyx_L8;
      }
      __pyx_L8:;

      /* "pyfmi\fmi.pyx":6354
 *                 if self._eventInfo.valuesOfContinuousStatesChanged:
 *                     tmpValuesOfContinuousStatesChanged = True
 *                 if status != 0:             # <<<<<<<<<<<<<<
 *                     raise FMUException('Failed to update the events at time: %E.'%self.time)
 * 
 */
      __pyx_t_1 = (__pyx_v_status != 0);
      if (__pyx_t_1) {

        /* "pyfmi\fmi.pyx":6355
 *                     tmpValuesOfContinuousStatesChanged = True
 *                 if status != 0:
 *                     raise FMUException('Failed to update the events at time: %E.'%self.time)             # <<<<<<<<<<<<<<
 * 
 *             # If the values in the event struct have been overwritten.
 */
        __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_172), __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_2));
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
        __pyx_t_2 = 0;
        __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L9;
      }
      __pyx_L9:;
    }

    /* "pyfmi\fmi.pyx":6358
 * 
 *             # If the values in the event struct have been overwritten.
 *             if tmpNominalsOfContinuousStatesChanged:             # <<<<<<<<<<<<<<
 *                 self._eventInfo.nominalsOfContinuousStatesChanged = True
 *             if tmpValuesOfContinuousStatesChanged:
 */
    if (__pyx_v_tmpNominalsOfContinuousStatesChanged) {

      /* "pyfmi\fmi.pyx":6359
 *             # If the values in the event struct have been overwritten.
 *             if tmpNominalsOfContinuousStatesChanged:
 *                 self._eventInfo.nominalsOfContinuousStatesChanged = True             # <<<<<<<<<<<<<<
 *             if tmpValuesOfContinuousStatesChanged:
 *                 self._eventInfo.valuesOfContinuousStatesChanged = True
 */
      __pyx_v_self->__pyx_base._eventInfo.nominalsOfContinuousStatesChanged = 1;
      goto __pyx_L10;
    }
    __pyx_L10:;

    /* "pyfmi\fmi.pyx":6360
 *             if tmpNominalsOfContinuousStatesChanged:
 *                 self._eventInfo.nominalsOfContinuousStatesChanged = True
 *             if tmpValuesOfContinuousStatesChanged:             # <<<<<<<<<<<<<<
 *                 self._eventInfo.valuesOfContinuousStatesChanged = True
 * 
 */
    if (__pyx_v_tmpValuesOfContinuousStatesChanged) {

      /* "pyfmi\fmi.pyx":6361
 *                 self._eventInfo.nominalsOfContinuousStatesChanged = True
 *             if tmpValuesOfContinuousStatesChanged:
 *                 self._eventInfo.valuesOfContinuousStatesChanged = True             # <<<<<<<<<<<<<<
 * 
 *     def get_tolerances(self):
 */
      __pyx_v_self->__pyx_base._eventInfo.valuesOfContinuousStatesChanged = 1;
      goto __pyx_L11;
    }
    __pyx_L11:;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2.event_update", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_19get_tolerances(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_18get_tolerances[] = "\n        Returns the relative and absolute tolerances. If the relative tolerance\n        is defined in the XML-file it is used, otherwise a default of 1.e-4 is\n        used. The absolute tolerance is calculated and returned according to\n        the FMI specification, atol = 0.01*rtol*(nominal values of the\n        continuous states).\n\n        Returns::\n\n            rtol --\n                The relative tolerance.\n\n            atol --\n                The absolute tolerance.\n\n        Example::\n\n            [rtol, atol] = model.get_tolerances()\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_19get_tolerances(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_tolerances (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_18get_tolerances(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":6363
 *                 self._eventInfo.valuesOfContinuousStatesChanged = True
 * 
 *     def get_tolerances(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the relative and absolute tolerances. If the relative tolerance
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_18get_tolerances(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self) {
  PyObject *__pyx_v_rtol = NULL;
  PyObject *__pyx_v_atol = NULL;
  PyObject *__pyx_r = NULL;
  __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("get_tolerances", 0);

  /* "pyfmi\fmi.pyx":6384
 *         """
 * 
 *         rtol = self.get_default_experiment_tolerance()             # <<<<<<<<<<<<<<
 *         atol = 0.01*rtol*self.nominal_continuous_states
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_169); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6384; __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 = 6384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_rtol = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":6385
 * 
 *         rtol = self.get_default_experiment_tolerance()
 *         atol = 0.01*rtol*self.nominal_continuous_states             # <<<<<<<<<<<<<<
 * 
 *         return [rtol, atol]
 */
  __pyx_t_2 = PyFloat_FromDouble(0.01); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_v_rtol); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_170); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_atol = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":6387
 *         atol = 0.01*rtol*self.nominal_continuous_states
 * 
 *         return [rtol, atol]             # <<<<<<<<<<<<<<
 * 
 *     def completed_integrator_step(self, no_set_FMU_state_prior_to_current_point = True):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_rtol);
  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_rtol);
  __Pyx_GIVEREF(__pyx_v_rtol);
  __Pyx_INCREF(__pyx_v_atol);
  PyList_SET_ITEM(__pyx_t_3, 1, __pyx_v_atol);
  __Pyx_GIVEREF(__pyx_v_atol);
  __pyx_r = ((PyObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2.get_tolerances", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_rtol);
  __Pyx_XDECREF(__pyx_v_atol);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_21completed_integrator_step(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_20completed_integrator_step[] = "\n        This method must be called by the environment after every completed step\n        of the integrator. If the return is True, then the environment must call\n        event_update() otherwise, no action is needed.\n\n        Returns::\n\n            True -> Call event_update().\n            False -> Do nothing.\n\n        Calls the low-level FMI function: fmi2CompletedIntegratorStep.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_21completed_integrator_step(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_no_set_FMU_state_prior_to_current_point = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("completed_integrator_step (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_368,0};
    PyObject* values[1] = {0};
    values[0] = __pyx_k_369;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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 (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_368);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "completed_integrator_step") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6389; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_no_set_FMU_state_prior_to_current_point = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("completed_integrator_step", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6389; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2.completed_integrator_step", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_20completed_integrator_step(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self), __pyx_v_no_set_FMU_state_prior_to_current_point);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":6389
 *         return [rtol, atol]
 * 
 *     def completed_integrator_step(self, no_set_FMU_state_prior_to_current_point = True):             # <<<<<<<<<<<<<<
 *         """
 *         This method must be called by the environment after every completed step
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_20completed_integrator_step(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, PyObject *__pyx_v_no_set_FMU_state_prior_to_current_point) {
  int __pyx_v_status;
  fmi2_boolean_t __pyx_v_noSetFMUStatePriorToCurrentPoint;
  fmi2_boolean_t __pyx_v_enterEventMode;
  fmi2_boolean_t __pyx_v_terminateSimulation;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  fmi2_boolean_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("completed_integrator_step", 0);

  /* "pyfmi\fmi.pyx":6403
 *         """
 *         cdef int status
 *         cdef FMIL.fmi2_boolean_t noSetFMUStatePriorToCurrentPoint = FMI2_TRUE if no_set_FMU_state_prior_to_current_point else FMI2_FALSE             # <<<<<<<<<<<<<<
 *         cdef FMIL.fmi2_boolean_t enterEventMode
 *         cdef FMIL.fmi2_boolean_t terminateSimulation
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_no_set_FMU_state_prior_to_current_point); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI2_TRUE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI2_FALSE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_t_4 = __Pyx_PyInt_from_py_fmi2_boolean_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (fmi2_boolean_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_noSetFMUStatePriorToCurrentPoint = __pyx_t_4;

  /* "pyfmi\fmi.pyx":6407
 *         cdef FMIL.fmi2_boolean_t terminateSimulation
 * 
 *         status = FMIL.fmi2_import_completed_integrator_step(self._fmu, noSetFMUStatePriorToCurrentPoint, &enterEventMode, &terminateSimulation)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi2_import_completed_integrator_step(__pyx_v_self->__pyx_base._fmu, __pyx_v_noSetFMUStatePriorToCurrentPoint, (&__pyx_v_enterEventMode), (&__pyx_v_terminateSimulation));

  /* "pyfmi\fmi.pyx":6409
 *         status = FMIL.fmi2_import_completed_integrator_step(self._fmu, noSetFMUStatePriorToCurrentPoint, &enterEventMode, &terminateSimulation)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to call FMI Completed Step.')
 * 
 */
  __pyx_t_2 = (__pyx_v_status != 0);
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":6410
 * 
 *         if status != 0:
 *             raise FMUException('Failed to call FMI Completed Step.')             # <<<<<<<<<<<<<<
 * 
 *         return enterEventMode==FMI2_TRUE, terminateSimulation==FMI2_TRUE
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_370), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":6412
 *             raise FMUException('Failed to call FMI Completed Step.')
 * 
 *         return enterEventMode==FMI2_TRUE, terminateSimulation==FMI2_TRUE             # <<<<<<<<<<<<<<
 * 
 *     def _get_continuous_states(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyInt_to_py_fmi2_boolean_t(__pyx_v_enterEventMode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI2_TRUE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_to_py_fmi2_boolean_t(__pyx_v_terminateSimulation); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI2_TRUE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_r = ((PyObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2.completed_integrator_step", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_23_get_continuous_states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_22_get_continuous_states[] = "\n        Returns a vector with the values of the continuous states.\n\n        Returns::\n\n            The continuous states.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_23_get_continuous_states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_continuous_states (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_22_get_continuous_states(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":6414
 *         return enterEventMode==FMI2_TRUE, terminateSimulation==FMI2_TRUE
 * 
 *     def _get_continuous_states(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a vector with the values of the continuous states.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_22_get_continuous_states(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self) {
  int __pyx_v_status;
  PyArrayObject *__pyx_v_ndx = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_ndx;
  __Pyx_Buffer __pyx_pybuffer_ndx;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_continuous_states", 0);
  __pyx_pybuffer_ndx.pybuffer.buf = NULL;
  __pyx_pybuffer_ndx.refcount = 0;
  __pyx_pybuffernd_ndx.data = NULL;
  __pyx_pybuffernd_ndx.rcbuffer = &__pyx_pybuffer_ndx;

  /* "pyfmi\fmi.pyx":6423
 *         """
 *         cdef int status
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] ndx = N.zeros(self._nContinuousStates, dtype=N.double)             # <<<<<<<<<<<<<<
 *         status = FMIL.fmi2_import_get_continuous_states(self._fmu, <FMIL.fmi2_real_t*> ndx.data ,self._nContinuousStates)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_to_py_size_t(__pyx_v_self->__pyx_base._nContinuousStates); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ndx.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_fmi2_real_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_ndx = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_ndx.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_ndx.diminfo[0].strides = __pyx_pybuffernd_ndx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ndx.diminfo[0].shape = __pyx_pybuffernd_ndx.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_ndx = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":6424
 *         cdef int status
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] ndx = N.zeros(self._nContinuousStates, dtype=N.double)
 *         status = FMIL.fmi2_import_get_continuous_states(self._fmu, <FMIL.fmi2_real_t*> ndx.data ,self._nContinuousStates)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi2_import_get_continuous_states(__pyx_v_self->__pyx_base._fmu, ((fmi2_real_t *)__pyx_v_ndx->data), __pyx_v_self->__pyx_base._nContinuousStates);

  /* "pyfmi\fmi.pyx":6426
 *         status = FMIL.fmi2_import_get_continuous_states(self._fmu, <FMIL.fmi2_real_t*> ndx.data ,self._nContinuousStates)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to retrieve the continuous states.')
 * 
 */
  __pyx_t_7 = (__pyx_v_status != 0);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":6427
 * 
 *         if status != 0:
 *             raise FMUException('Failed to retrieve the continuous states.')             # <<<<<<<<<<<<<<
 * 
 *         return ndx
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_371), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":6429
 *             raise FMUException('Failed to retrieve the continuous states.')
 * 
 *         return ndx             # <<<<<<<<<<<<<<
 * 
 *     def _set_continuous_states(self, N.ndarray[FMIL.fmi2_real_t, ndim=1, mode="c"] values):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ndx));
  __pyx_r = ((PyObject *)__pyx_v_ndx);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ndx.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2._get_continuous_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ndx.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_ndx);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_25_set_continuous_states(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_24_set_continuous_states[] = "\n        Set the values of the continuous states.\n\n        Parameters::\n\n            values--\n                The new values of the continuous states.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_25_set_continuous_states(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set_continuous_states (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_24_set_continuous_states(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values));
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":6431
 *         return ndx
 * 
 *     def _set_continuous_states(self, N.ndarray[FMIL.fmi2_real_t, ndim=1, mode="c"] values):             # <<<<<<<<<<<<<<
 *         """
 *         Set the values of the continuous states.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_24_set_continuous_states(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, PyArrayObject *__pyx_v_values) {
  int __pyx_v_status;
  PyArrayObject *__pyx_v_ndx = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_ndx;
  __Pyx_Buffer __pyx_pybuffer_ndx;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_continuous_states", 0);
  __pyx_pybuffer_ndx.pybuffer.buf = NULL;
  __pyx_pybuffer_ndx.refcount = 0;
  __pyx_pybuffernd_ndx.data = NULL;
  __pyx_pybuffernd_ndx.rcbuffer = &__pyx_pybuffer_ndx;
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn_fmi2_real_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];

  /* "pyfmi\fmi.pyx":6441
 *         """
 *         cdef int status
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1,mode='c'] ndx = values             # <<<<<<<<<<<<<<
 * 
 *         if ndx.size != self._nContinuousStates:
 */
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ndx.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_values), &__Pyx_TypeInfo_nn_fmi2_real_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_ndx = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_ndx.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_ndx.diminfo[0].strides = __pyx_pybuffernd_ndx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ndx.diminfo[0].shape = __pyx_pybuffernd_ndx.rcbuffer->pybuffer.shape[0];
    }
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_values));
  __pyx_v_ndx = ((PyArrayObject *)__pyx_v_values);

  /* "pyfmi\fmi.pyx":6443
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1,mode='c'] ndx = values
 * 
 *         if ndx.size != self._nContinuousStates:             # <<<<<<<<<<<<<<
 *             raise FMUException(
 *                 'Failed to set the new continuous states. ' \
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_ndx), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_to_py_size_t(__pyx_v_self->__pyx_base._nContinuousStates); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":6444
 * 
 *         if ndx.size != self._nContinuousStates:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'Failed to set the new continuous states. ' \
 *                 'The number of values are not consistent with the number of '\
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_372), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":6449
 *                 'continuous states.')
 * 
 *         status = FMIL.fmi2_import_set_continuous_states(self._fmu, <FMIL.fmi2_real_t*> ndx.data , self._nContinuousStates)             # <<<<<<<<<<<<<<
 * 
 *         if status >= 3:
 */
  __pyx_v_status = fmi2_import_set_continuous_states(__pyx_v_self->__pyx_base._fmu, ((fmi2_real_t *)__pyx_v_ndx->data), __pyx_v_self->__pyx_base._nContinuousStates);

  /* "pyfmi\fmi.pyx":6451
 *         status = FMIL.fmi2_import_set_continuous_states(self._fmu, <FMIL.fmi2_real_t*> ndx.data , self._nContinuousStates)
 * 
 *         if status >= 3:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to set the new continuous states.')
 * 
 */
  __pyx_t_4 = (__pyx_v_status >= 3);
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":6452
 * 
 *         if status >= 3:
 *             raise FMUException('Failed to set the new continuous states.')             # <<<<<<<<<<<<<<
 * 
 *     continuous_states = property(_get_continuous_states, _set_continuous_states,
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_373), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ndx.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2._set_continuous_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ndx.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_ndx);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_27_get_nominal_continuous_states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_26_get_nominal_continuous_states[] = "\n        Returns the nominal values of the continuous states.\n\n        Returns::\n            The nominal values.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_27_get_nominal_continuous_states(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_nominal_continuous_states (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_26_get_nominal_continuous_states(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":6461
 *     """)
 * 
 *     def _get_nominal_continuous_states(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the nominal values of the continuous states.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_26_get_nominal_continuous_states(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self) {
  int __pyx_v_status;
  PyArrayObject *__pyx_v_ndx = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_ndx;
  __Pyx_Buffer __pyx_pybuffer_ndx;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_nominal_continuous_states", 0);
  __pyx_pybuffer_ndx.pybuffer.buf = NULL;
  __pyx_pybuffer_ndx.refcount = 0;
  __pyx_pybuffernd_ndx.data = NULL;
  __pyx_pybuffernd_ndx.rcbuffer = &__pyx_pybuffer_ndx;

  /* "pyfmi\fmi.pyx":6469
 *         """
 *         cdef int status
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] ndx = N.zeros(self._nContinuousStates, dtype=N.double)             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_get_nominals_of_continuous_states(
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_to_py_size_t(__pyx_v_self->__pyx_base._nContinuousStates); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ndx.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_fmi2_real_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_ndx = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_ndx.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_ndx.diminfo[0].strides = __pyx_pybuffernd_ndx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ndx.diminfo[0].shape = __pyx_pybuffernd_ndx.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_ndx = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":6472
 * 
 *         status = FMIL.fmi2_import_get_nominals_of_continuous_states(
 *                 self._fmu, <FMIL.fmi2_real_t*> ndx.data, self._nContinuousStates)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi2_import_get_nominals_of_continuous_states(__pyx_v_self->__pyx_base._fmu, ((fmi2_real_t *)__pyx_v_ndx->data), __pyx_v_self->__pyx_base._nContinuousStates);

  /* "pyfmi\fmi.pyx":6474
 *                 self._fmu, <FMIL.fmi2_real_t*> ndx.data, self._nContinuousStates)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to get the nominal values.')
 * 
 */
  __pyx_t_7 = (__pyx_v_status != 0);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":6475
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the nominal values.')             # <<<<<<<<<<<<<<
 * 
 *         return ndx
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_374), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":6477
 *             raise FMUException('Failed to get the nominal values.')
 * 
 *         return ndx             # <<<<<<<<<<<<<<
 * 
 *     nominal_continuous_states = property(_get_nominal_continuous_states, doc =
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ndx));
  __pyx_r = ((PyObject *)__pyx_v_ndx);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ndx.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2._get_nominal_continuous_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ndx.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_ndx);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":6485
 *     """)
 * 
 *     cpdef get_derivatives(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the derivative of the continuous states.
 */

static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_29get_derivatives(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_5pyfmi_3fmi_11FMUModelME2_get_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, int __pyx_skip_dispatch) {
  int __pyx_v_status;
  PyArrayObject *__pyx_v_values = 0;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_values;
  __Pyx_Buffer __pyx_pybuffer_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_derivatives", 0);
  __pyx_pybuffer_values.pybuffer.buf = NULL;
  __pyx_pybuffer_values.refcount = 0;
  __pyx_pybuffernd_values.data = NULL;
  __pyx_pybuffernd_values.rcbuffer = &__pyx_pybuffer_values;
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_derivatives); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_29get_derivatives)) {
      __Pyx_XDECREF(__pyx_r);
      __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 = 6485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyfmi\fmi.pyx":6501
 *         """
 *         cdef int status
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] values = N.empty(self._nContinuousStates, dtype = N.double)             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_get_derivatives(self._fmu, <FMIL.fmi2_real_t*> values.data, self._nContinuousStates)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_to_py_size_t(__pyx_v_self->__pyx_base._nContinuousStates); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_fmi2_real_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_values = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_values.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_values = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":6503
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] values = N.empty(self._nContinuousStates, dtype = N.double)
 * 
 *         status = FMIL.fmi2_import_get_derivatives(self._fmu, <FMIL.fmi2_real_t*> values.data, self._nContinuousStates)             # <<<<<<<<<<<<<<
 * 
 *         if status != 0:
 */
  __pyx_v_status = fmi2_import_get_derivatives(__pyx_v_self->__pyx_base._fmu, ((fmi2_real_t *)__pyx_v_values->data), __pyx_v_self->__pyx_base._nContinuousStates);

  /* "pyfmi\fmi.pyx":6505
 *         status = FMIL.fmi2_import_get_derivatives(self._fmu, <FMIL.fmi2_real_t*> values.data, self._nContinuousStates)
 * 
 *         if status != 0:             # <<<<<<<<<<<<<<
 *             raise FMUException('Failed to get the derivative values at time: %E.'%self.time)
 * 
 */
  __pyx_t_7 = (__pyx_v_status != 0);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":6506
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the derivative values at time: %E.'%self.time)             # <<<<<<<<<<<<<<
 * 
 *         return values
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_166), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":6508
 *             raise FMUException('Failed to get the derivative values at time: %E.'%self.time)
 * 
 *         return values             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_values));
  __pyx_r = ((PyObject *)__pyx_v_values);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2.get_derivatives", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_values.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_values);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_29get_derivatives(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_28get_derivatives[] = "\n        Returns the derivative of the continuous states.\n\n        Returns::\n\n            dx --\n                The derivatives as an array.\n\n        Example::\n\n            dx = model.get_derivatives()\n\n        Calls the low-level FMI function: fmi2GetDerivatives\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_29get_derivatives(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_derivatives (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_28get_derivatives(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":6485
 *     """)
 * 
 *     cpdef get_derivatives(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the derivative of the continuous states.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_28get_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__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("get_derivatives", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->get_derivatives(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2.get_derivatives", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_31simulate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_30simulate[] = "\n        Compact function for model simulation.\n\n        The simulation method depends on which algorithm is used, this can be\n        set with the function argument 'algorithm'. Options for the algorithm\n        are passed as option classes or as pure dicts. See\n        FMUModel.simulate_options for more details.\n\n        The default algorithm for this function is AssimuloFMIAlg.\n\n        Parameters::\n\n            start_time --\n                Start time for the simulation.\n                Default: Start time defined in the default experiment from\n                        the ModelDescription file.\n\n            final_time --\n                Final time for the simulation.\n                Default: Stop time defined in the default experiment from\n                        the ModelDescription file.\n\n            input --\n                Input signal for the simulation. The input should be a 2-tuple\n                consisting of first the names of the input variable(s) and then\n                the data matrix or a function. If a data matrix, the first\n                column should be a time vector and then the variable vectors as\n                columns. If instead a function, the argument should correspond\n                to time and the output the variable data. See the users-guide\n                for examples.\n                Default: Empty tuple.\n\n            algorithm --\n                The algorithm which will be used for the simulation is specified\n                by passing the algorithm class as string or class object in this\n                argument. 'algorithm' can be any class which implements the\n                abstract class AlgorithmBase (found in algorithm_drivers.py). In\n                this way it is possible to write own algorithms and use them\n                with this function.\n                Default: 'AssimuloFMIAlg'\n\n            options --\n                The options that should be used in the algorithm. Fo""r details on\n                the options do:\n\n                    >> myModel = FMUModel(...)\n                    >> opts = myModel.simulate_options()\n                    >> opts?\n\n                Valid values are:\n                    - A dict which gives AssimuloFMIAlgOptions with\n                      default values on all options except the ones\n                      listed in the dict. Empty dict will thus give all\n                      options with default values.\n                    - An options object.\n                Default: Empty dict\n\n        Returns::\n\n            Result object, subclass of common.algorithm_drivers.ResultBase.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_31simulate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start_time = 0;
  PyObject *__pyx_v_final_time = 0;
  PyObject *__pyx_v_input = 0;
  PyObject *__pyx_v_algorithm = 0;
  PyObject *__pyx_v_options = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("simulate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__start_time,&__pyx_n_s__final_time,&__pyx_n_s__input,&__pyx_n_s__algorithm,&__pyx_n_s__options,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[0] = ((PyObject *)__pyx_n_s__Default);
    values[1] = ((PyObject *)__pyx_n_s__Default);

    /* "pyfmi\fmi.pyx":6514
 *                  start_time="Default",
 *                  final_time="Default",
 *                  input=(),             # <<<<<<<<<<<<<<
 *                  algorithm='AssimuloFMIAlg',
 *                  options={}):
 */
    values[2] = ((PyObject *)__pyx_empty_tuple);
    values[3] = ((PyObject *)__pyx_n_s__AssimuloFMIAlg);
    values[4] = __pyx_k_375;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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 (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start_time);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__final_time);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__input);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__algorithm);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__options);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "simulate") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6511; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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;
      }
    }
    __pyx_v_start_time = values[0];
    __pyx_v_final_time = values[1];
    __pyx_v_input = values[2];
    __pyx_v_algorithm = values[3];
    __pyx_v_options = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("simulate", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6511; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2.simulate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_30simulate(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self), __pyx_v_start_time, __pyx_v_final_time, __pyx_v_input, __pyx_v_algorithm, __pyx_v_options);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":6511
 * 
 * 
 *     def simulate(self,             # <<<<<<<<<<<<<<
 *                  start_time="Default",
 *                  final_time="Default",
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_30simulate(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, PyObject *__pyx_v_start_time, PyObject *__pyx_v_final_time, PyObject *__pyx_v_input, PyObject *__pyx_v_algorithm, PyObject *__pyx_v_options) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("simulate", 0);
  __Pyx_INCREF(__pyx_v_start_time);
  __Pyx_INCREF(__pyx_v_final_time);

  /* "pyfmi\fmi.pyx":6578
 *             Result object, subclass of common.algorithm_drivers.ResultBase.
 *         """
 *         if start_time == "Default":             # <<<<<<<<<<<<<<
 *             start_time = self.get_default_experiment_start_time()
 *         if final_time == "Default":
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_start_time, ((PyObject *)__pyx_n_s__Default), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":6579
 *         """
 *         if start_time == "Default":
 *             start_time = self.get_default_experiment_start_time()             # <<<<<<<<<<<<<<
 *         if final_time == "Default":
 *             final_time = self.get_default_experiment_stop_time()
 */
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_129); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_v_start_time);
    __pyx_v_start_time = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":6580
 *         if start_time == "Default":
 *             start_time = self.get_default_experiment_start_time()
 *         if final_time == "Default":             # <<<<<<<<<<<<<<
 *             final_time = self.get_default_experiment_stop_time()
 * 
 */
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_final_time, ((PyObject *)__pyx_n_s__Default), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "pyfmi\fmi.pyx":6581
 *             start_time = self.get_default_experiment_start_time()
 *         if final_time == "Default":
 *             final_time = self.get_default_experiment_stop_time()             # <<<<<<<<<<<<<<
 * 
 *         return self._exec_simulate_algorithm(start_time,
 */
    __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_130); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6581; __pyx_clineno = __LINE__; goto __pyx_L1_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 = 6581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_v_final_time);
    __pyx_v_final_time = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":6583
 *             final_time = self.get_default_experiment_stop_time()
 * 
 *         return self._exec_simulate_algorithm(start_time,             # <<<<<<<<<<<<<<
 *                                              final_time,
 *                                              input,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_131); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyfmi\fmi.pyx":6588
 *                                              'pyfmi.fmi_algorithm_drivers',
 *                                              algorithm,
 *                                              options)             # <<<<<<<<<<<<<<
 * 
 *     def simulate_options(self, algorithm='AssimuloFMIAlg'):
 */
  __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_start_time);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_start_time);
  __Pyx_GIVEREF(__pyx_v_start_time);
  __Pyx_INCREF(__pyx_v_final_time);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_final_time);
  __Pyx_GIVEREF(__pyx_v_final_time);
  __Pyx_INCREF(__pyx_v_input);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_input);
  __Pyx_GIVEREF(__pyx_v_input);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_9));
  PyTuple_SET_ITEM(__pyx_t_3, 3, ((PyObject *)__pyx_kp_s_9));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9));
  __Pyx_INCREF(__pyx_v_algorithm);
  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_algorithm);
  __Pyx_GIVEREF(__pyx_v_algorithm);
  __Pyx_INCREF(__pyx_v_options);
  PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_v_options);
  __Pyx_GIVEREF(__pyx_v_options);
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2.simulate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_start_time);
  __Pyx_XDECREF(__pyx_v_final_time);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_33simulate_options(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_32simulate_options[] = "\n        Get an instance of the simulate options class, filled with default\n        values. If called without argument then the options class for the\n        default simulation algorithm will be returned.\n\n        Parameters::\n\n            algorithm --\n                The algorithm for which the options class should be fetched.\n                Possible values are: 'AssimuloFMIAlg'.\n                Default: 'AssimuloFMIAlg'\n\n        Returns::\n\n            Options class for the algorithm specified with default values.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_33simulate_options(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_algorithm = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("simulate_options (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__algorithm,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_n_s__AssimuloFMIAlg);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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 (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__algorithm);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "simulate_options") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6590; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_algorithm = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("simulate_options", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6590; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2.simulate_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_32simulate_options(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self), __pyx_v_algorithm);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":6590
 *                                              options)
 * 
 *     def simulate_options(self, algorithm='AssimuloFMIAlg'):             # <<<<<<<<<<<<<<
 *         """
 *         Get an instance of the simulate options class, filled with default
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_32simulate_options(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, PyObject *__pyx_v_algorithm) {
  PyObject *__pyx_r = NULL;
  __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("simulate_options", 0);

  /* "pyfmi\fmi.pyx":6607
 *             Options class for the algorithm specified with default values.
 *         """
 *         return self._default_options('pyfmi.fmi_algorithm_drivers', algorithm)             # <<<<<<<<<<<<<<
 * 
 *     def get_capability_flags(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___default_options); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6607; __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 = 6607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_9));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_9));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9));
  __Pyx_INCREF(__pyx_v_algorithm);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_algorithm);
  __Pyx_GIVEREF(__pyx_v_algorithm);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2.simulate_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_35get_capability_flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_34get_capability_flags[] = "\n        Returns a dictionary with the capability flags of the FMU.\n\n        Returns::\n            Dictionary with keys:\n            needsExecutionTool\n            completedIntegratorStepNotNeeded\n            canBeInstantiatedOnlyOncePerProcess\n            canNotUseMemoryManagementFunctions\n            canGetAndSetFMUstate\n            canSerializeFMUstate\n            providesDirectionalDerivatives\n            completedEventIterationIsProvided\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_35get_capability_flags(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_capability_flags (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_34get_capability_flags(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":6609
 *         return self._default_options('pyfmi.fmi_algorithm_drivers', algorithm)
 * 
 *     def get_capability_flags(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a dictionary with the capability flags of the FMU.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_34get_capability_flags(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self) {
  PyObject *__pyx_v_capabilities = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_capability_flags", 0);

  /* "pyfmi\fmi.pyx":6624
 *             completedEventIterationIsProvided
 *         """
 *         cdef dict capabilities = {}             # <<<<<<<<<<<<<<
 *         capabilities['needsExecutionTool']                  = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_needsExecutionTool))
 *         capabilities['completedIntegratorStepNotNeeded']    = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_completedIntegratorStepNotNeeded))
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_capabilities = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6625
 *         """
 *         cdef dict capabilities = {}
 *         capabilities['needsExecutionTool']                  = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_needsExecutionTool))             # <<<<<<<<<<<<<<
 *         capabilities['completedIntegratorStepNotNeeded']    = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_completedIntegratorStepNotNeeded))
 *         capabilities['canBeInstantiatedOnlyOncePerProcess'] = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canBeInstantiatedOnlyOncePerProcess))
 */
  __pyx_t_1 = PyLong_FromUnsignedLong(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_me_needsExecutionTool)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s__needsExecutionTool), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6626
 *         cdef dict capabilities = {}
 *         capabilities['needsExecutionTool']                  = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_needsExecutionTool))
 *         capabilities['completedIntegratorStepNotNeeded']    = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_completedIntegratorStepNotNeeded))             # <<<<<<<<<<<<<<
 *         capabilities['canBeInstantiatedOnlyOncePerProcess'] = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canBeInstantiatedOnlyOncePerProcess))
 *         capabilities['canNotUseMemoryManagementFunctions']  = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canNotUseMemoryManagementFunctions))
 */
  __pyx_t_1 = PyLong_FromUnsignedLong(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_me_completedIntegratorStepNotNeeded)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_376), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6627
 *         capabilities['needsExecutionTool']                  = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_needsExecutionTool))
 *         capabilities['completedIntegratorStepNotNeeded']    = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_completedIntegratorStepNotNeeded))
 *         capabilities['canBeInstantiatedOnlyOncePerProcess'] = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canBeInstantiatedOnlyOncePerProcess))             # <<<<<<<<<<<<<<
 *         capabilities['canNotUseMemoryManagementFunctions']  = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canNotUseMemoryManagementFunctions))
 *         capabilities['canGetAndSetFMUstate']                = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canGetAndSetFMUstate))
 */
  __pyx_t_1 = PyLong_FromUnsignedLong(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_me_canBeInstantiatedOnlyOncePerProcess)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_149), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6628
 *         capabilities['completedIntegratorStepNotNeeded']    = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_completedIntegratorStepNotNeeded))
 *         capabilities['canBeInstantiatedOnlyOncePerProcess'] = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canBeInstantiatedOnlyOncePerProcess))
 *         capabilities['canNotUseMemoryManagementFunctions']  = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canNotUseMemoryManagementFunctions))             # <<<<<<<<<<<<<<
 *         capabilities['canGetAndSetFMUstate']                = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canGetAndSetFMUstate))
 *         capabilities['canSerializeFMUstate']                = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canSerializeFMUstate))
 */
  __pyx_t_1 = PyLong_FromUnsignedLong(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_me_canNotUseMemoryManagementFunctions)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_150), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6629
 *         capabilities['canBeInstantiatedOnlyOncePerProcess'] = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canBeInstantiatedOnlyOncePerProcess))
 *         capabilities['canNotUseMemoryManagementFunctions']  = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canNotUseMemoryManagementFunctions))
 *         capabilities['canGetAndSetFMUstate']                = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canGetAndSetFMUstate))             # <<<<<<<<<<<<<<
 *         capabilities['canSerializeFMUstate']                = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canSerializeFMUstate))
 *         capabilities['providesDirectionalDerivatives']      = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_providesDirectionalDerivatives))
 */
  __pyx_t_1 = PyLong_FromUnsignedLong(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_me_canGetAndSetFMUstate)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_349), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6630
 *         capabilities['canNotUseMemoryManagementFunctions']  = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canNotUseMemoryManagementFunctions))
 *         capabilities['canGetAndSetFMUstate']                = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canGetAndSetFMUstate))
 *         capabilities['canSerializeFMUstate']                = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canSerializeFMUstate))             # <<<<<<<<<<<<<<
 *         capabilities['providesDirectionalDerivatives']      = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_providesDirectionalDerivatives))
 *         capabilities['completedEventIterationIsProvided']   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_completedEventIterationIsProvided))
 */
  __pyx_t_1 = PyLong_FromUnsignedLong(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_me_canSerializeFMUstate)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_350), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6631
 *         capabilities['canGetAndSetFMUstate']                = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canGetAndSetFMUstate))
 *         capabilities['canSerializeFMUstate']                = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canSerializeFMUstate))
 *         capabilities['providesDirectionalDerivatives']      = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_providesDirectionalDerivatives))             # <<<<<<<<<<<<<<
 *         capabilities['completedEventIterationIsProvided']   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_completedEventIterationIsProvided))
 * 
 */
  __pyx_t_1 = PyLong_FromUnsignedLong(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_me_providesDirectionalDerivatives)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_351), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6632
 *         capabilities['canSerializeFMUstate']                = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canSerializeFMUstate))
 *         capabilities['providesDirectionalDerivatives']      = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_providesDirectionalDerivatives))
 *         capabilities['completedEventIterationIsProvided']   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_completedEventIterationIsProvided))             # <<<<<<<<<<<<<<
 * 
 *         return capabilities
 */
  __pyx_t_1 = PyLong_FromUnsignedLong(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_me_completedEventIterationIsProvided)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(((PyObject *)__pyx_v_capabilities), ((PyObject *)__pyx_n_s_377), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6634
 *         capabilities['completedEventIterationIsProvided']   = bool(FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_completedEventIterationIsProvided))
 * 
 *         return capabilities             # <<<<<<<<<<<<<<
 * 
 *     def _provides_directional_derivatives(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_capabilities));
  __pyx_r = ((PyObject *)__pyx_v_capabilities);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2.get_capability_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_capabilities);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_37_provides_directional_derivatives(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_36_provides_directional_derivatives[] = "\n        Check capability to provide directional derivatives.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_37_provides_directional_derivatives(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_provides_directional_derivatives (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_36_provides_directional_derivatives(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":6636
 *         return capabilities
 * 
 *     def _provides_directional_derivatives(self):             # <<<<<<<<<<<<<<
 *         """
 *         Check capability to provide directional derivatives.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_36_provides_directional_derivatives(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__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("_provides_directional_derivatives", 0);

  /* "pyfmi\fmi.pyx":6640
 *         Check capability to provide directional derivatives.
 *         """
 *         return FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_providesDirectionalDerivatives)             # <<<<<<<<<<<<<<
 * 
 *     def _supports_get_set_FMU_state(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyLong_FromUnsignedLong(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_me_providesDirectionalDerivatives)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2._provides_directional_derivatives", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_39_supports_get_set_FMU_state(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_11FMUModelME2_38_supports_get_set_FMU_state[] = "\n        Check support for getting and setting the FMU state.\n        ";
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_39_supports_get_set_FMU_state(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_supports_get_set_FMU_state (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_38_supports_get_set_FMU_state(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":6642
 *         return FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_providesDirectionalDerivatives)
 * 
 *     def _supports_get_set_FMU_state(self):             # <<<<<<<<<<<<<<
 *         """
 *         Check support for getting and setting the FMU state.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_38_supports_get_set_FMU_state(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__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("_supports_get_set_FMU_state", 0);

  /* "pyfmi\fmi.pyx":6646
 *         Check support for getting and setting the FMU state.
 *         """
 *         return FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canGetAndSetFMUstate)             # <<<<<<<<<<<<<<
 * 
 *     def _get_directional_proxy(self, var_ref, func_ref, group, add_diag=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyLong_FromUnsignedLong(fmi2_import_get_capability(__pyx_v_self->__pyx_base._fmu, fmi2_me_canGetAndSetFMUstate)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2._supports_get_set_FMU_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_41_get_directional_proxy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_41_get_directional_proxy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_var_ref = 0;
  PyObject *__pyx_v_func_ref = 0;
  PyObject *__pyx_v_group = 0;
  PyObject *__pyx_v_add_diag = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_directional_proxy (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__var_ref,&__pyx_n_s__func_ref,&__pyx_n_s__group,&__pyx_n_s__add_diag,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k_378;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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__var_ref)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__func_ref)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_get_directional_proxy", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6648; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__group)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_get_directional_proxy", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6648; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__add_diag);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_get_directional_proxy") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6648; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_var_ref = values[0];
    __pyx_v_func_ref = values[1];
    __pyx_v_group = values[2];
    __pyx_v_add_diag = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_get_directional_proxy", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6648; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2._get_directional_proxy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_40_get_directional_proxy(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self), __pyx_v_var_ref, __pyx_v_func_ref, __pyx_v_group, __pyx_v_add_diag);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":6648
 *         return FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canGetAndSetFMUstate)
 * 
 *     def _get_directional_proxy(self, var_ref, func_ref, group, add_diag=False):             # <<<<<<<<<<<<<<
 *         if self._provides_directional_derivatives() and not self.force_finite_differences:
 *             return FMUModelBase2._get_directional_proxy(self, var_ref, func_ref, group, add_diag)
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_40_get_directional_proxy(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, PyObject *__pyx_v_var_ref, PyObject *__pyx_v_func_ref, PyObject *__pyx_v_group, PyObject *__pyx_v_add_diag) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_directional_proxy", 0);

  /* "pyfmi\fmi.pyx":6649
 * 
 *     def _get_directional_proxy(self, var_ref, func_ref, group, add_diag=False):
 *         if self._provides_directional_derivatives() and not self.force_finite_differences:             # <<<<<<<<<<<<<<
 *             return FMUModelBase2._get_directional_proxy(self, var_ref, func_ref, group, add_diag)
 *         else:
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_312); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6649; __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 = 6649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_self->force_finite_differences); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = (!__pyx_t_4);
    __pyx_t_4 = __pyx_t_5;
  } else {
    __pyx_t_4 = __pyx_t_3;
  }
  if (__pyx_t_4) {

    /* "pyfmi\fmi.pyx":6650
 *     def _get_directional_proxy(self, var_ref, func_ref, group, add_diag=False):
 *         if self._provides_directional_derivatives() and not self.force_finite_differences:
 *             return FMUModelBase2._get_directional_proxy(self, var_ref, func_ref, group, add_diag)             # <<<<<<<<<<<<<<
 *         else:
 *             return self._estimate_directional_derivative(var_ref, func_ref, group, add_diag)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelBase2)), __pyx_n_s_303); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __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_var_ref);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_var_ref);
    __Pyx_GIVEREF(__pyx_v_var_ref);
    __Pyx_INCREF(__pyx_v_func_ref);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_func_ref);
    __Pyx_GIVEREF(__pyx_v_func_ref);
    __Pyx_INCREF(__pyx_v_group);
    PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_group);
    __Pyx_GIVEREF(__pyx_v_group);
    __Pyx_INCREF(__pyx_v_add_diag);
    PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_add_diag);
    __Pyx_GIVEREF(__pyx_v_add_diag);
    __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":6652
 *             return FMUModelBase2._get_directional_proxy(self, var_ref, func_ref, group, add_diag)
 *         else:
 *             return self._estimate_directional_derivative(var_ref, func_ref, group, add_diag)             # <<<<<<<<<<<<<<
 * 
 *     def _estimate_directional_derivative(self, var_ref, func_ref, group, add_diag=False):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_379); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_var_ref);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_var_ref);
    __Pyx_GIVEREF(__pyx_v_var_ref);
    __Pyx_INCREF(__pyx_v_func_ref);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_func_ref);
    __Pyx_GIVEREF(__pyx_v_func_ref);
    __Pyx_INCREF(__pyx_v_group);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_group);
    __Pyx_GIVEREF(__pyx_v_group);
    __Pyx_INCREF(__pyx_v_add_diag);
    PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_add_diag);
    __Pyx_GIVEREF(__pyx_v_add_diag);
    __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2._get_directional_proxy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_43_estimate_directional_derivative(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_43_estimate_directional_derivative(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_var_ref = 0;
  PyObject *__pyx_v_func_ref = 0;
  PyObject *__pyx_v_group = 0;
  PyObject *__pyx_v_add_diag = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_estimate_directional_derivative (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__var_ref,&__pyx_n_s__func_ref,&__pyx_n_s__group,&__pyx_n_s__add_diag,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k_380;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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__var_ref)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__func_ref)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_estimate_directional_derivative", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6654; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__group)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_estimate_directional_derivative", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6654; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__add_diag);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_estimate_directional_derivative") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6654; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_var_ref = values[0];
    __pyx_v_func_ref = values[1];
    __pyx_v_group = values[2];
    __pyx_v_add_diag = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_estimate_directional_derivative", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6654; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2._estimate_directional_derivative", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_42_estimate_directional_derivative(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self), __pyx_v_var_ref, __pyx_v_func_ref, __pyx_v_group, __pyx_v_add_diag);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":6654
 *             return self._estimate_directional_derivative(var_ref, func_ref, group, add_diag)
 * 
 *     def _estimate_directional_derivative(self, var_ref, func_ref, group, add_diag=False):             # <<<<<<<<<<<<<<
 *         cdef list data = []
 *         cdef list row = []
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_42_estimate_directional_derivative(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, PyObject *__pyx_v_var_ref, PyObject *__pyx_v_func_ref, PyObject *__pyx_v_group, PyObject *__pyx_v_add_diag) {
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_v_row = 0;
  PyObject *__pyx_v_col = 0;
  int __pyx_v_dim;
  int __pyx_v_i;
  int __pyx_v_len_v;
  int __pyx_v_len_f;
  double __pyx_v_nominal;
  double __pyx_v_RUROUND;
  PyArrayObject *__pyx_v_v = 0;
  PyArrayObject *__pyx_v_eps = 0;
  PyArrayObject *__pyx_v_df = 0;
  CYTHON_UNUSED PyArrayObject *__pyx_v_dfpert = 0;
  PyArrayObject *__pyx_v_v_ref = 0;
  PyArrayObject *__pyx_v_z_ref = 0;
  PyObject *__pyx_v_key = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_df;
  __Pyx_Buffer __pyx_pybuffer_df;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_dfpert;
  __Pyx_Buffer __pyx_pybuffer_dfpert;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_eps;
  __Pyx_Buffer __pyx_pybuffer_eps;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
  __Pyx_Buffer __pyx_pybuffer_v;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_v_ref;
  __Pyx_Buffer __pyx_pybuffer_v_ref;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_z_ref;
  __Pyx_Buffer __pyx_pybuffer_z_ref;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  double __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyArrayObject *__pyx_t_8 = NULL;
  PyArrayObject *__pyx_t_9 = NULL;
  PyArrayObject *__pyx_t_10 = NULL;
  PyArrayObject *__pyx_t_11 = NULL;
  PyArrayObject *__pyx_t_12 = NULL;
  PyArrayObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  int __pyx_t_16;
  int __pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_t_21;
  double __pyx_t_22;
  double __pyx_t_23;
  int __pyx_t_24;
  PyObject *(*__pyx_t_25)(PyObject *);
  PyObject *__pyx_t_26 = NULL;
  PyObject *__pyx_t_27 = NULL;
  PyObject *__pyx_t_28 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_estimate_directional_derivative", 0);
  __pyx_pybuffer_v.pybuffer.buf = NULL;
  __pyx_pybuffer_v.refcount = 0;
  __pyx_pybuffernd_v.data = NULL;
  __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
  __pyx_pybuffer_eps.pybuffer.buf = NULL;
  __pyx_pybuffer_eps.refcount = 0;
  __pyx_pybuffernd_eps.data = NULL;
  __pyx_pybuffernd_eps.rcbuffer = &__pyx_pybuffer_eps;
  __pyx_pybuffer_df.pybuffer.buf = NULL;
  __pyx_pybuffer_df.refcount = 0;
  __pyx_pybuffernd_df.data = NULL;
  __pyx_pybuffernd_df.rcbuffer = &__pyx_pybuffer_df;
  __pyx_pybuffer_dfpert.pybuffer.buf = NULL;
  __pyx_pybuffer_dfpert.refcount = 0;
  __pyx_pybuffernd_dfpert.data = NULL;
  __pyx_pybuffernd_dfpert.rcbuffer = &__pyx_pybuffer_dfpert;
  __pyx_pybuffer_v_ref.pybuffer.buf = NULL;
  __pyx_pybuffer_v_ref.refcount = 0;
  __pyx_pybuffernd_v_ref.data = NULL;
  __pyx_pybuffernd_v_ref.rcbuffer = &__pyx_pybuffer_v_ref;
  __pyx_pybuffer_z_ref.pybuffer.buf = NULL;
  __pyx_pybuffer_z_ref.refcount = 0;
  __pyx_pybuffernd_z_ref.data = NULL;
  __pyx_pybuffernd_z_ref.rcbuffer = &__pyx_pybuffer_z_ref;

  /* "pyfmi\fmi.pyx":6655
 * 
 *     def _estimate_directional_derivative(self, var_ref, func_ref, group, add_diag=False):
 *         cdef list data = []             # <<<<<<<<<<<<<<
 *         cdef list row = []
 *         cdef list col = []
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_data = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6656
 *     def _estimate_directional_derivative(self, var_ref, func_ref, group, add_diag=False):
 *         cdef list data = []
 *         cdef list row = []             # <<<<<<<<<<<<<<
 *         cdef list col = []
 *         cdef int dim = 0, i, j
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_row = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6657
 *         cdef list data = []
 *         cdef list row = []
 *         cdef list col = []             # <<<<<<<<<<<<<<
 *         cdef int dim = 0, i, j
 *         cdef int len_v = len(var_ref)
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_col = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6658
 *         cdef list row = []
 *         cdef list col = []
 *         cdef int dim = 0, i, j             # <<<<<<<<<<<<<<
 *         cdef int len_v = len(var_ref)
 *         cdef int len_f = len(func_ref)
 */
  __pyx_v_dim = 0;

  /* "pyfmi\fmi.pyx":6659
 *         cdef list col = []
 *         cdef int dim = 0, i, j
 *         cdef int len_v = len(var_ref)             # <<<<<<<<<<<<<<
 *         cdef int len_f = len(func_ref)
 *         cdef double nominal
 */
  __pyx_t_2 = PyObject_Length(__pyx_v_var_ref); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_len_v = __pyx_t_2;

  /* "pyfmi\fmi.pyx":6660
 *         cdef int dim = 0, i, j
 *         cdef int len_v = len(var_ref)
 *         cdef int len_f = len(func_ref)             # <<<<<<<<<<<<<<
 *         cdef double nominal
 *         cdef double RUROUND = (N.finfo(float).eps)**0.5
 */
  __pyx_t_2 = PyObject_Length(__pyx_v_func_ref); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_len_f = __pyx_t_2;

  /* "pyfmi\fmi.pyx":6662
 *         cdef int len_f = len(func_ref)
 *         cdef double nominal
 *         cdef double RUROUND = (N.finfo(float).eps)**0.5             # <<<<<<<<<<<<<<
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] v       = N.zeros(len_v, dtype = N.double)
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] eps     = N.zeros(len_v, dtype = N.double)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__finfo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)((PyObject*)(&PyFloat_Type))));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)(&PyFloat_Type))));
  __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyFloat_Type))));
  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__eps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyFloat_FromDouble(0.5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyNumber_Power(__pyx_t_1, __pyx_t_4, Py_None); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_RUROUND = __pyx_t_5;

  /* "pyfmi\fmi.pyx":6663
 *         cdef double nominal
 *         cdef double RUROUND = (N.finfo(float).eps)**0.5
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] v       = N.zeros(len_v, dtype = N.double)             # <<<<<<<<<<<<<<
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] eps     = N.zeros(len_v, dtype = N.double)
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] df      = N.zeros(len_f, dtype = N.double)
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyInt_FromLong(__pyx_v_len_v); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__double); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_7);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn_fmi2_real_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_v = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_v.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_8 = 0;
  __pyx_v_v = ((PyArrayObject *)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "pyfmi\fmi.pyx":6664
 *         cdef double RUROUND = (N.finfo(float).eps)**0.5
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] v       = N.zeros(len_v, dtype = N.double)
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] eps     = N.zeros(len_v, dtype = N.double)             # <<<<<<<<<<<<<<
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] df      = N.zeros(len_f, dtype = N.double)
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] dfpert  = N.zeros(len_f, dtype = N.double)
 */
  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyInt_FromLong(__pyx_v_len_v); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  __pyx_t_7 = 0;
  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_eps.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn_fmi2_real_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_eps = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_eps.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_eps.diminfo[0].strides = __pyx_pybuffernd_eps.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_eps.diminfo[0].shape = __pyx_pybuffernd_eps.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_9 = 0;
  __pyx_v_eps = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pyfmi\fmi.pyx":6665
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] v       = N.zeros(len_v, dtype = N.double)
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] eps     = N.zeros(len_v, dtype = N.double)
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] df      = N.zeros(len_f, dtype = N.double)             # <<<<<<<<<<<<<<
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] dfpert  = N.zeros(len_f, dtype = N.double)
 *         cdef N.ndarray[FMIL.fmi2_value_reference_t, ndim=1, mode='c'] v_ref = N.array(var_ref, dtype = N.uint32)
 */
  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__zeros); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyInt_FromLong(__pyx_v_len_f); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__double); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_10 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_df.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn_fmi2_real_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_df = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_df.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_df.diminfo[0].strides = __pyx_pybuffernd_df.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_df.diminfo[0].shape = __pyx_pybuffernd_df.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_10 = 0;
  __pyx_v_df = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":6666
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] eps     = N.zeros(len_v, dtype = N.double)
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] df      = N.zeros(len_f, dtype = N.double)
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] dfpert  = N.zeros(len_f, dtype = N.double)             # <<<<<<<<<<<<<<
 *         cdef N.ndarray[FMIL.fmi2_value_reference_t, ndim=1, mode='c'] v_ref = N.array(var_ref, dtype = N.uint32)
 *         cdef N.ndarray[FMIL.fmi2_value_reference_t, ndim=1, mode='c'] z_ref = N.array(func_ref, dtype = N.uint32)
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__zeros); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyInt_FromLong(__pyx_v_len_f); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__double); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dfpert.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn_fmi2_real_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_dfpert = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_dfpert.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_dfpert.diminfo[0].strides = __pyx_pybuffernd_dfpert.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dfpert.diminfo[0].shape = __pyx_pybuffernd_dfpert.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_11 = 0;
  __pyx_v_dfpert = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":6667
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] df      = N.zeros(len_f, dtype = N.double)
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] dfpert  = N.zeros(len_f, dtype = N.double)
 *         cdef N.ndarray[FMIL.fmi2_value_reference_t, ndim=1, mode='c'] v_ref = N.array(var_ref, dtype = N.uint32)             # <<<<<<<<<<<<<<
 *         cdef N.ndarray[FMIL.fmi2_value_reference_t, ndim=1, mode='c'] z_ref = N.array(func_ref, dtype = N.uint32)
 * 
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_var_ref);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_var_ref);
  __Pyx_GIVEREF(__pyx_v_var_ref);
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__uint32); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = ((PyArrayObject *)__pyx_t_7);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v_ref.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn_fmi2_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_v_ref = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_v_ref.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_v_ref.diminfo[0].strides = __pyx_pybuffernd_v_ref.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v_ref.diminfo[0].shape = __pyx_pybuffernd_v_ref.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_12 = 0;
  __pyx_v_v_ref = ((PyArrayObject *)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "pyfmi\fmi.pyx":6668
 *         cdef N.ndarray[FMIL.fmi2_real_t, ndim=1, mode='c'] dfpert  = N.zeros(len_f, dtype = N.double)
 *         cdef N.ndarray[FMIL.fmi2_value_reference_t, ndim=1, mode='c'] v_ref = N.array(var_ref, dtype = N.uint32)
 *         cdef N.ndarray[FMIL.fmi2_value_reference_t, ndim=1, mode='c'] z_ref = N.array(func_ref, dtype = N.uint32)             # <<<<<<<<<<<<<<
 * 
 *         #structure
 */
  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_v_func_ref);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_func_ref);
  __Pyx_GIVEREF(__pyx_v_func_ref);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__uint32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_z_ref.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn_fmi2_value_reference_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_z_ref = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_z_ref.rcbuffer->pybuffer.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_pybuffernd_z_ref.diminfo[0].strides = __pyx_pybuffernd_z_ref.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_z_ref.diminfo[0].shape = __pyx_pybuffernd_z_ref.rcbuffer->pybuffer.shape[0];
    }
  }
  __pyx_t_13 = 0;
  __pyx_v_z_ref = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pyfmi\fmi.pyx":6676
 *         # - [3] - matrix columns
 * 
 *         if add_diag:             # <<<<<<<<<<<<<<
 *             dim = min(len_v,len_f)
 *             data.extend([0.0]*dim)
 */
  __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_add_diag); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_14) {

    /* "pyfmi\fmi.pyx":6677
 * 
 *         if add_diag:
 *             dim = min(len_v,len_f)             # <<<<<<<<<<<<<<
 *             data.extend([0.0]*dim)
 *             row.extend(range(dim))
 */
    __pyx_t_15 = __pyx_v_len_f;
    __pyx_t_16 = __pyx_v_len_v;
    if ((__pyx_t_15 < __pyx_t_16)) {
      __pyx_t_17 = __pyx_t_15;
    } else {
      __pyx_t_17 = __pyx_t_16;
    }
    __pyx_v_dim = __pyx_t_17;

    /* "pyfmi\fmi.pyx":6678
 *         if add_diag:
 *             dim = min(len_v,len_f)
 *             data.extend([0.0]*dim)             # <<<<<<<<<<<<<<
 *             row.extend(range(dim))
 *             col.extend(range(dim))
 */
    __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_data), __pyx_n_s__extend); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = PyList_New(1 * ((__pyx_v_dim<0) ? 0:__pyx_v_dim)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    { Py_ssize_t __pyx_temp;
      for (__pyx_temp=0; __pyx_temp < __pyx_v_dim; __pyx_temp++) {
        __Pyx_INCREF(__pyx_t_3);
        PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
      }
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_7));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
    __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "pyfmi\fmi.pyx":6679
 *             dim = min(len_v,len_f)
 *             data.extend([0.0]*dim)
 *             row.extend(range(dim))             # <<<<<<<<<<<<<<
 *             col.extend(range(dim))
 * 
 */
    __pyx_t_7 = PyObject_GetAttr(((PyObject *)__pyx_v_row), __pyx_n_s__extend); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = PyInt_FromLong(__pyx_v_dim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pyfmi\fmi.pyx":6680
 *             data.extend([0.0]*dim)
 *             row.extend(range(dim))
 *             col.extend(range(dim))             # <<<<<<<<<<<<<<
 * 
 *         df = self.get_real(func_ref)
 */
    __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_col), __pyx_n_s__extend); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = PyInt_FromLong(__pyx_v_dim); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":6682
 *             col.extend(range(dim))
 * 
 *         df = self.get_real(func_ref)             # <<<<<<<<<<<<<<
 *         v  = self.get_real(var_ref)
 *         for i in range(len_v):
 */
  __pyx_t_6 = ((PyObject *)((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.get_real(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_v_func_ref, 0)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_df.rcbuffer->pybuffer);
    __pyx_t_17 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_df.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_6), &__Pyx_TypeInfo_nn_fmi2_real_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_17 < 0)) {
      PyErr_Fetch(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_df.rcbuffer->pybuffer, (PyObject*)__pyx_v_df, &__Pyx_TypeInfo_nn_fmi2_real_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_20);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_18, __pyx_t_19, __pyx_t_20);
      }
    }
    __pyx_pybuffernd_df.diminfo[0].strides = __pyx_pybuffernd_df.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_df.diminfo[0].shape = __pyx_pybuffernd_df.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_17 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(((PyObject *)__pyx_v_df));
  __pyx_v_df = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pyfmi\fmi.pyx":6683
 * 
 *         df = self.get_real(func_ref)
 *         v  = self.get_real(var_ref)             # <<<<<<<<<<<<<<
 *         for i in range(len_v):
 *             nominal = self.get_variable_nominal(valueref = var_ref[i])
 */
  __pyx_t_6 = ((PyObject *)((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.get_real(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_v_var_ref, 0)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
    __pyx_t_17 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_6), &__Pyx_TypeInfo_nn_fmi2_real_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_17 < 0)) {
      PyErr_Fetch(&__pyx_t_20, &__pyx_t_19, &__pyx_t_18);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn_fmi2_real_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_18);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_20, __pyx_t_19, __pyx_t_18);
      }
    }
    __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_17 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(((PyObject *)__pyx_v_v));
  __pyx_v_v = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pyfmi\fmi.pyx":6684
 *         df = self.get_real(func_ref)
 *         v  = self.get_real(var_ref)
 *         for i in range(len_v):             # <<<<<<<<<<<<<<
 *             nominal = self.get_variable_nominal(valueref = var_ref[i])
 *             eps[i] = RUROUND*(max(abs(v[i]), nominal))
 */
  __pyx_t_17 = __pyx_v_len_v;
  for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_17; __pyx_t_15+=1) {
    __pyx_v_i = __pyx_t_15;

    /* "pyfmi\fmi.pyx":6685
 *         v  = self.get_real(var_ref)
 *         for i in range(len_v):
 *             nominal = self.get_variable_nominal(valueref = var_ref[i])             # <<<<<<<<<<<<<<
 *             eps[i] = RUROUND*(max(abs(v[i]), nominal))
 * 
 */
    __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_381); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_7));
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_var_ref, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__valueref), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_nominal = __pyx_t_5;

    /* "pyfmi\fmi.pyx":6686
 *         for i in range(len_v):
 *             nominal = self.get_variable_nominal(valueref = var_ref[i])
 *             eps[i] = RUROUND*(max(abs(v[i]), nominal))             # <<<<<<<<<<<<<<
 * 
 *         for key in group.keys():
 */
    __pyx_t_5 = __pyx_v_nominal;
    __pyx_t_16 = __pyx_v_i;
    __pyx_t_21 = -1;
    if (__pyx_t_16 < 0) {
      __pyx_t_16 += __pyx_pybuffernd_v.diminfo[0].shape;
      if (unlikely(__pyx_t_16 < 0)) __pyx_t_21 = 0;
    } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_21 = 0;
    if (unlikely(__pyx_t_21 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_21);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_22 = fabs((*__Pyx_BufPtrCContig1d(fmi2_real_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_v.diminfo[0].strides)));
    if ((__pyx_t_5 > __pyx_t_22)) {
      __pyx_t_23 = __pyx_t_5;
    } else {
      __pyx_t_23 = __pyx_t_22;
    }
    __pyx_t_21 = __pyx_v_i;
    __pyx_t_24 = -1;
    if (__pyx_t_21 < 0) {
      __pyx_t_21 += __pyx_pybuffernd_eps.diminfo[0].shape;
      if (unlikely(__pyx_t_21 < 0)) __pyx_t_24 = 0;
    } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_eps.diminfo[0].shape)) __pyx_t_24 = 0;
    if (unlikely(__pyx_t_24 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_24);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrCContig1d(fmi2_real_t *, __pyx_pybuffernd_eps.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_eps.diminfo[0].strides) = (__pyx_v_RUROUND * __pyx_t_23);
  }

  /* "pyfmi\fmi.pyx":6688
 *             eps[i] = RUROUND*(max(abs(v[i]), nominal))
 * 
 *         for key in group.keys():             # <<<<<<<<<<<<<<
 *             #for i in group[key][0]:
 *             #   self.set_real(var_ref[i], v[i]+eps[i])
 */
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_group, __pyx_n_s__keys); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyList_CheckExact(__pyx_t_7) || PyTuple_CheckExact(__pyx_t_7)) {
    __pyx_t_3 = __pyx_t_7; __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = 0;
    __pyx_t_25 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_25 = Py_TYPE(__pyx_t_3)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  for (;;) {
    if (!__pyx_t_25 && PyList_CheckExact(__pyx_t_3)) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_7 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_25 && PyTuple_CheckExact(__pyx_t_3)) {
      if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_7 = __pyx_t_25(__pyx_t_3);
      if (unlikely(!__pyx_t_7)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_XDECREF(__pyx_v_key);
    __pyx_v_key = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "pyfmi\fmi.pyx":6691
 *             #for i in group[key][0]:
 *             #   self.set_real(var_ref[i], v[i]+eps[i])
 *             self.set_real(v_ref[group[key][0]], v[group[key][0]]+eps[group[key][0]])             # <<<<<<<<<<<<<<
 * 
 *             #dfpert[:len(z_ref[group[key][2]])] = self.get_real(z_ref[group[key][2]])
 */
    __pyx_t_7 = PyObject_GetItem(__pyx_v_group, __pyx_v_key); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_7, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_v_ref), __pyx_t_6); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_GetItem(__pyx_v_group, __pyx_v_key); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_GetItem(__pyx_v_group, __pyx_v_key); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_eps), __pyx_t_4); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.set_real(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_t_7, __pyx_t_4, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyfmi\fmi.pyx":6700
 *             #    data.append((dfpert[i]-df[group[key][2]][i])/eps[j])
 *             #data.extend((dfpert[:len(z_ref[group[key][2]])]-df[group[key][2]])/eps[group[key][3]])
 *             try:             # <<<<<<<<<<<<<<
 *                 data.extend((self.get_real(z_ref[group[key][2]]) - df[group[key][2]])/eps[group[key][3]])
 *             except FMUException: #Try backward difference (for all variables)
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
      __Pyx_XGOTREF(__pyx_t_18);
      __Pyx_XGOTREF(__pyx_t_19);
      __Pyx_XGOTREF(__pyx_t_20);
      /*try:*/ {

        /* "pyfmi\fmi.pyx":6701
 *             #data.extend((dfpert[:len(z_ref[group[key][2]])]-df[group[key][2]])/eps[group[key][3]])
 *             try:
 *                 data.extend((self.get_real(z_ref[group[key][2]]) - df[group[key][2]])/eps[group[key][3]])             # <<<<<<<<<<<<<<
 *             except FMUException: #Try backward difference (for all variables)
 *                 self.set_real(v_ref[group[key][0]], v[group[key][0]]-eps[group[key][0]])
 */
        __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_data), __pyx_n_s__extend); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6701; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_4 = PyObject_GetItem(__pyx_v_group, __pyx_v_key); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6701; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_4, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6701; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_z_ref), __pyx_t_7); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6701; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = ((PyObject *)((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.get_real(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_t_4, 0)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6701; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyObject_GetItem(__pyx_v_group, __pyx_v_key); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6701; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_4, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6701; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_df), __pyx_t_6); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6701; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyNumber_Subtract(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6701; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyObject_GetItem(__pyx_v_group, __pyx_v_key); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6701; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_4, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6701; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_eps), __pyx_t_7); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6701; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6701; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6701; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
        __Pyx_GOTREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_7 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6701; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
      __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
      goto __pyx_L15_try_end;
      __pyx_L8_error:;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "pyfmi\fmi.pyx":6702
 *             try:
 *                 data.extend((self.get_real(z_ref[group[key][2]]) - df[group[key][2]])/eps[group[key][3]])
 *             except FMUException: #Try backward difference (for all variables)             # <<<<<<<<<<<<<<
 *                 self.set_real(v_ref[group[key][0]], v[group[key][0]]-eps[group[key][0]])
 *                 data.extend((df[group[key][2]] - self.get_real(z_ref[group[key][2]]))/eps[group[key][3]])
 */
      __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6702; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_17 = PyErr_ExceptionMatches(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_17) {
        __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2._estimate_directional_derivative", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_4, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6702; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_t_1);

        /* "pyfmi\fmi.pyx":6703
 *                 data.extend((self.get_real(z_ref[group[key][2]]) - df[group[key][2]])/eps[group[key][3]])
 *             except FMUException: #Try backward difference (for all variables)
 *                 self.set_real(v_ref[group[key][0]], v[group[key][0]]-eps[group[key][0]])             # <<<<<<<<<<<<<<
 *                 data.extend((df[group[key][2]] - self.get_real(z_ref[group[key][2]]))/eps[group[key][3]])
 * 
 */
        __pyx_t_6 = PyObject_GetItem(__pyx_v_group, __pyx_v_key); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6703; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_26 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_26) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6703; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_26);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyObject_GetItem(((PyObject *)__pyx_v_v_ref), __pyx_t_26); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6703; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
        __pyx_t_26 = PyObject_GetItem(__pyx_v_group, __pyx_v_key); if (!__pyx_t_26) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6703; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_26);
        __pyx_t_27 = __Pyx_GetItemInt(__pyx_t_26, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_27) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6703; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_27);
        __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
        __pyx_t_26 = PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_27); if (!__pyx_t_26) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6703; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_26);
        __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        __pyx_t_27 = PyObject_GetItem(__pyx_v_group, __pyx_v_key); if (!__pyx_t_27) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6703; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_27);
        __pyx_t_28 = __Pyx_GetItemInt(__pyx_t_27, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_28) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6703; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_28);
        __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        __pyx_t_27 = PyObject_GetItem(((PyObject *)__pyx_v_eps), __pyx_t_28); if (!__pyx_t_27) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6703; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_27);
        __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
        __pyx_t_28 = PyNumber_Subtract(__pyx_t_26, __pyx_t_27); if (unlikely(!__pyx_t_28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6703; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_28);
        __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
        __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        __pyx_t_27 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.set_real(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_t_6, __pyx_t_28, 0); if (unlikely(!__pyx_t_27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6703; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_27);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
        __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;

        /* "pyfmi\fmi.pyx":6704
 *             except FMUException: #Try backward difference (for all variables)
 *                 self.set_real(v_ref[group[key][0]], v[group[key][0]]-eps[group[key][0]])
 *                 data.extend((df[group[key][2]] - self.get_real(z_ref[group[key][2]]))/eps[group[key][3]])             # <<<<<<<<<<<<<<
 * 
 *             row.extend(group[key][2])
 */
        __pyx_t_27 = PyObject_GetAttr(((PyObject *)__pyx_v_data), __pyx_n_s__extend); if (unlikely(!__pyx_t_27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6704; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_27);
        __pyx_t_28 = PyObject_GetItem(__pyx_v_group, __pyx_v_key); if (!__pyx_t_28) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6704; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_28);
        __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_28, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6704; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
        __pyx_t_28 = PyObject_GetItem(((PyObject *)__pyx_v_df), __pyx_t_6); if (!__pyx_t_28) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6704; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_28);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyObject_GetItem(__pyx_v_group, __pyx_v_key); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6704; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_26 = __Pyx_GetItemInt(__pyx_t_6, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_26) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6704; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_26);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyObject_GetItem(((PyObject *)__pyx_v_z_ref), __pyx_t_26); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6704; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
        __pyx_t_26 = ((PyObject *)((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.get_real(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_t_6, 0)); if (unlikely(!__pyx_t_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6704; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_26);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyNumber_Subtract(__pyx_t_28, __pyx_t_26); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6704; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
        __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
        __pyx_t_26 = PyObject_GetItem(__pyx_v_group, __pyx_v_key); if (!__pyx_t_26) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6704; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_26);
        __pyx_t_28 = __Pyx_GetItemInt(__pyx_t_26, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_28) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6704; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_28);
        __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
        __pyx_t_26 = PyObject_GetItem(((PyObject *)__pyx_v_eps), __pyx_t_28); if (!__pyx_t_26) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6704; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_26);
        __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
        __pyx_t_28 = __Pyx_PyNumber_Divide(__pyx_t_6, __pyx_t_26); if (unlikely(!__pyx_t_28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6704; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_28);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
        __pyx_t_26 = PyTuple_New(1); if (unlikely(!__pyx_t_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6704; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_26);
        PyTuple_SET_ITEM(__pyx_t_26, 0, __pyx_t_28);
        __Pyx_GIVEREF(__pyx_t_28);
        __pyx_t_28 = 0;
        __pyx_t_28 = PyObject_Call(__pyx_t_27, ((PyObject *)__pyx_t_26), NULL); if (unlikely(!__pyx_t_28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6704; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_28);
        __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_26)); __pyx_t_26 = 0;
        __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L9_exception_handled;
      }
      __pyx_L10_except_error:;
      __Pyx_XGIVEREF(__pyx_t_18);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
      goto __pyx_L1_error;
      __pyx_L9_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_18);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
      __pyx_L15_try_end:;
    }

    /* "pyfmi\fmi.pyx":6706
 *                 data.extend((df[group[key][2]] - self.get_real(z_ref[group[key][2]]))/eps[group[key][3]])
 * 
 *             row.extend(group[key][2])             # <<<<<<<<<<<<<<
 *             col.extend(group[key][3])
 * 
 */
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_row), __pyx_n_s__extend); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_GetItem(__pyx_v_group, __pyx_v_key); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_4, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "pyfmi\fmi.pyx":6707
 * 
 *             row.extend(group[key][2])
 *             col.extend(group[key][3])             # <<<<<<<<<<<<<<
 * 
 *             #for i in group[key][0]:
 */
    __pyx_t_7 = PyObject_GetAttr(((PyObject *)__pyx_v_col), __pyx_n_s__extend); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = PyObject_GetItem(__pyx_v_group, __pyx_v_key); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyfmi\fmi.pyx":6711
 *             #for i in group[key][0]:
 *             #    self.set_real(var_ref[i], v[i])
 *             self.set_real(v_ref[group[key][0]], v[group[key][0]])             # <<<<<<<<<<<<<<
 * 
 *         if len(data) == 0:
 */
    __pyx_t_1 = PyObject_GetItem(__pyx_v_group, __pyx_v_key); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_v_ref), __pyx_t_4); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_GetItem(__pyx_v_group, __pyx_v_key); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_7); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = ((struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.set_real(((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)__pyx_v_self), __pyx_t_1, __pyx_t_4, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":6713
 *             self.set_real(v_ref[group[key][0]], v[group[key][0]])
 * 
 *         if len(data) == 0:             # <<<<<<<<<<<<<<
 *             return sp.csc_matrix((len_f,len_v))
 *         else:
 */
  __pyx_t_2 = PyList_GET_SIZE(((PyObject *)__pyx_v_data)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = (__pyx_t_2 == 0);
  if (__pyx_t_14) {

    /* "pyfmi\fmi.pyx":6714
 * 
 *         if len(data) == 0:
 *             return sp.csc_matrix((len_f,len_v))             # <<<<<<<<<<<<<<
 *         else:
 *             return sp.csc_matrix((data, (row, col)), (len_f,len_v))
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__sp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__csc_matrix); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyInt_FromLong(__pyx_v_len_f); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyInt_FromLong(__pyx_v_len_v); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_1));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L18;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":6716
 *             return sp.csc_matrix((len_f,len_v))
 *         else:
 *             return sp.csc_matrix((data, (row, col)), (len_f,len_v))             # <<<<<<<<<<<<<<
 * 
 * #Temporary should be removed! (after a period)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__sp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__csc_matrix); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __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 = 6716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)__pyx_v_row));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_row));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_row));
    __Pyx_INCREF(((PyObject *)__pyx_v_col));
    PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_col));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_col));
    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(((PyObject *)__pyx_v_data));
    PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_data));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_data));
    PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_t_1));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
    __pyx_t_1 = 0;
    __pyx_t_1 = PyInt_FromLong(__pyx_v_len_f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyInt_FromLong(__pyx_v_len_v); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_28 = PyTuple_New(2); if (unlikely(!__pyx_t_28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_28);
    PyTuple_SET_ITEM(__pyx_t_28, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_28, 1, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_1 = 0;
    __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_7));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
    PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_t_28));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_28));
    __pyx_t_7 = 0;
    __pyx_t_28 = 0;
    __pyx_t_28 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_28);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_28;
    __pyx_t_28 = 0;
    goto __pyx_L0;
  }
  __pyx_L18:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_26);
  __Pyx_XDECREF(__pyx_t_27);
  __Pyx_XDECREF(__pyx_t_28);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_df.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dfpert.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_eps.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v_ref.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_z_ref.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pyfmi.fmi.FMUModelME2._estimate_directional_derivative", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_df.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dfpert.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_eps.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v_ref.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_z_ref.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XDECREF(__pyx_v_col);
  __Pyx_XDECREF((PyObject *)__pyx_v_v);
  __Pyx_XDECREF((PyObject *)__pyx_v_eps);
  __Pyx_XDECREF((PyObject *)__pyx_v_df);
  __Pyx_XDECREF((PyObject *)__pyx_v_dfpert);
  __Pyx_XDECREF((PyObject *)__pyx_v_v_ref);
  __Pyx_XDECREF((PyObject *)__pyx_v_z_ref);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_24force_finite_differences_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5pyfmi_3fmi_11FMUModelME2_24force_finite_differences_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_24force_finite_differences___get__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pxd":207
 *     cpdef _set_time(self, FMIL.fmi2_real_t t)
 *     cpdef get_derivatives(self)
 *     cdef public object force_finite_differences             # <<<<<<<<<<<<<<
 * 
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_11FMUModelME2_24force_finite_differences___get__(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->force_finite_differences);
  __pyx_r = __pyx_v_self->force_finite_differences;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_11FMUModelME2_24force_finite_differences_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_11FMUModelME2_24force_finite_differences_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_24force_finite_differences_2__set__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_11FMUModelME2_24force_finite_differences_2__set__(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->force_finite_differences);
  __Pyx_DECREF(__pyx_v_self->force_finite_differences);
  __pyx_v_self->force_finite_differences = __pyx_v_value;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_11FMUModelME2_24force_finite_differences_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_11FMUModelME2_24force_finite_differences_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5pyfmi_3fmi_11FMUModelME2_24force_finite_differences_4__del__(((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5pyfmi_3fmi_11FMUModelME2_24force_finite_differences_4__del__(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->force_finite_differences);
  __Pyx_DECREF(__pyx_v_self->force_finite_differences);
  __pyx_v_self->force_finite_differences = Py_None;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5pyfmi_3fmi_8FMUModel_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5pyfmi_3fmi_8FMUModel_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fmu = 0;
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_enable_logging = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fmu,&__pyx_n_s__path,&__pyx_n_s__enable_logging,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_kp_s_30);
    values[2] = __pyx_k_382;
    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__fmu)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__enable_logging);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      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 = 6720; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_fmu = values[0];
    __pyx_v_path = values[1];
    __pyx_v_enable_logging = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6720; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.FMUModel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_8FMUModel___init__(((struct __pyx_obj_5pyfmi_3fmi_FMUModel *)__pyx_v_self), __pyx_v_fmu, __pyx_v_path, __pyx_v_enable_logging);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":6720
 * #Temporary should be removed! (after a period)
 * cdef class FMUModel(FMUModelME1):
 *     def __init__(self, fmu, path='.', enable_logging=True):             # <<<<<<<<<<<<<<
 *         print "WARNING: This class is deprecated and has been superseded with FMUModelME1. The recommended entry-point for loading an FMU is now the function load_fmu."
 *         FMUModelME1.__init__(self,fmu,path,enable_logging)
 */

static int __pyx_pf_5pyfmi_3fmi_8FMUModel___init__(struct __pyx_obj_5pyfmi_3fmi_FMUModel *__pyx_v_self, PyObject *__pyx_v_fmu, PyObject *__pyx_v_path, PyObject *__pyx_v_enable_logging) {
  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);

  /* "pyfmi\fmi.pyx":6721
 * cdef class FMUModel(FMUModelME1):
 *     def __init__(self, fmu, path='.', enable_logging=True):
 *         print "WARNING: This class is deprecated and has been superseded with FMUModelME1. The recommended entry-point for loading an FMU is now the function load_fmu."             # <<<<<<<<<<<<<<
 *         FMUModelME1.__init__(self,fmu,path,enable_logging)
 * 
 */
  if (__Pyx_PrintOne(0, ((PyObject *)__pyx_kp_s_383)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":6722
 *     def __init__(self, fmu, path='.', enable_logging=True):
 *         print "WARNING: This class is deprecated and has been superseded with FMUModelME1. The recommended entry-point for loading an FMU is now the function load_fmu."
 *         FMUModelME1.__init__(self,fmu,path,enable_logging)             # <<<<<<<<<<<<<<
 * 
 * def load_fmu_deprecated(fmu, path='.', enable_logging=True, log_file_name=""):
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelME1)), __pyx_n_s____init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6722; __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 = 6722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __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_fmu);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_fmu);
  __Pyx_GIVEREF(__pyx_v_fmu);
  __Pyx_INCREF(__pyx_v_path);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  __Pyx_INCREF(__pyx_v_enable_logging);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_enable_logging);
  __Pyx_GIVEREF(__pyx_v_enable_logging);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyfmi.fmi.FMUModel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_9load_fmu_deprecated(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_8load_fmu_deprecated[] = "\n    Helper function for loading FMUs of different kinds.\n    ";
static PyMethodDef __pyx_mdef_5pyfmi_3fmi_9load_fmu_deprecated = {__Pyx_NAMESTR("load_fmu_deprecated"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_9load_fmu_deprecated, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_8load_fmu_deprecated)};
static PyObject *__pyx_pw_5pyfmi_3fmi_9load_fmu_deprecated(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fmu = 0;
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_enable_logging = 0;
  PyObject *__pyx_v_log_file_name = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("load_fmu_deprecated (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fmu,&__pyx_n_s__path,&__pyx_n_s__enable_logging,&__pyx_n_s__log_file_name,0};
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)__pyx_kp_s_30);
    values[2] = __pyx_k_384;
    values[3] = ((PyObject *)__pyx_kp_s_12);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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__fmu)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__enable_logging);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__log_file_name);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "load_fmu_deprecated") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6724; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_fmu = values[0];
    __pyx_v_path = values[1];
    __pyx_v_enable_logging = values[2];
    __pyx_v_log_file_name = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("load_fmu_deprecated", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6724; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.load_fmu_deprecated", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_8load_fmu_deprecated(__pyx_self, __pyx_v_fmu, __pyx_v_path, __pyx_v_enable_logging, __pyx_v_log_file_name);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":6724
 *         FMUModelME1.__init__(self,fmu,path,enable_logging)
 * 
 * def load_fmu_deprecated(fmu, path='.', enable_logging=True, log_file_name=""):             # <<<<<<<<<<<<<<
 *     """
 *     Helper function for loading FMUs of different kinds.
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_8load_fmu_deprecated(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fmu, PyObject *__pyx_v_path, PyObject *__pyx_v_enable_logging, PyObject *__pyx_v_log_file_name) {
  fmi1_callback_functions_t __pyx_v_callBackFunctions;
  struct jm_callbacks __pyx_v_callbacks;
  fmi_import_context_t *__pyx_v_context;
  fmi1_import_t *__pyx_v__fmu;
  jm_string __pyx_v_last_error;
  int __pyx_v_allocated_context;
  int __pyx_v_allocated_xml;
  PyObject *__pyx_v_fmu_temp_dir = NULL;
  PyObject *__pyx_v_fmu_full_path = NULL;
  PyObject *__pyx_v_version = NULL;
  PyObject *__pyx_v_fmu_kind = NULL;
  struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *__pyx_v_model = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  jm_log_level_enu_t __pyx_t_7;
  char *__pyx_t_8;
  char *__pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("load_fmu_deprecated", 0);

  /* "pyfmi\fmi.pyx":6740
 * 
 *     #Used for deallocation
 *     allocated_context = False             # <<<<<<<<<<<<<<
 *     allocated_xml = False
 *     fmu_temp_dir = None
 */
  __pyx_v_allocated_context = 0;

  /* "pyfmi\fmi.pyx":6741
 *     #Used for deallocation
 *     allocated_context = False
 *     allocated_xml = False             # <<<<<<<<<<<<<<
 *     fmu_temp_dir = None
 * 
 */
  __pyx_v_allocated_xml = 0;

  /* "pyfmi\fmi.pyx":6742
 *     allocated_context = False
 *     allocated_xml = False
 *     fmu_temp_dir = None             # <<<<<<<<<<<<<<
 * 
 *     fmu_full_path = os.path.abspath(os.path.join(path,fmu))
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_fmu_temp_dir = Py_None;

  /* "pyfmi\fmi.pyx":6744
 *     fmu_temp_dir = None
 * 
 *     fmu_full_path = os.path.abspath(os.path.join(path,fmu))             # <<<<<<<<<<<<<<
 *     fmu_temp_dir  = create_temp_dir()
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__abspath); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__path); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__join); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_path);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  __Pyx_INCREF(__pyx_v_fmu);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_fmu);
  __Pyx_GIVEREF(__pyx_v_fmu);
  __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_v_fmu_full_path = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":6745
 * 
 *     fmu_full_path = os.path.abspath(os.path.join(path,fmu))
 *     fmu_temp_dir  = create_temp_dir()             # <<<<<<<<<<<<<<
 * 
 *     # Check that the file referenced by fmu has the correct file-ending
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__create_temp_dir); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_v_fmu_temp_dir);
  __pyx_v_fmu_temp_dir = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":6748
 * 
 *     # Check that the file referenced by fmu has the correct file-ending
 *     if not fmu_full_path.endswith(".fmu"):             # <<<<<<<<<<<<<<
 *         raise FMUException("FMUModel must be instantiated with an FMU (.fmu) file.")
 * 
 */
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_fmu_full_path, __pyx_n_s__endswith); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_385), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = (!__pyx_t_5);
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":6749
 *     # Check that the file referenced by fmu has the correct file-ending
 *     if not fmu_full_path.endswith(".fmu"):
 *         raise FMUException("FMUModel must be instantiated with an FMU (.fmu) file.")             # <<<<<<<<<<<<<<
 * 
 *     #Specify the general callback functions
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_386), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":6752
 * 
 *     #Specify the general callback functions
 *     callbacks.malloc    = FMIL.malloc             # <<<<<<<<<<<<<<
 *     callbacks.calloc    = FMIL.calloc
 *     callbacks.realloc   = FMIL.realloc
 */
  __pyx_v_callbacks.malloc = malloc;

  /* "pyfmi\fmi.pyx":6753
 *     #Specify the general callback functions
 *     callbacks.malloc    = FMIL.malloc
 *     callbacks.calloc    = FMIL.calloc             # <<<<<<<<<<<<<<
 *     callbacks.realloc   = FMIL.realloc
 *     callbacks.free      = FMIL.free
 */
  __pyx_v_callbacks.calloc = calloc;

  /* "pyfmi\fmi.pyx":6754
 *     callbacks.malloc    = FMIL.malloc
 *     callbacks.calloc    = FMIL.calloc
 *     callbacks.realloc   = FMIL.realloc             # <<<<<<<<<<<<<<
 *     callbacks.free      = FMIL.free
 *     callbacks.logger    = importlogger_load_fmu
 */
  __pyx_v_callbacks.realloc = realloc;

  /* "pyfmi\fmi.pyx":6755
 *     callbacks.calloc    = FMIL.calloc
 *     callbacks.realloc   = FMIL.realloc
 *     callbacks.free      = FMIL.free             # <<<<<<<<<<<<<<
 *     callbacks.logger    = importlogger_load_fmu
 *     callbacks.log_level = FMIL.jm_log_level_warning if enable_logging else FMIL.jm_log_level_nothing
 */
  __pyx_v_callbacks.free = free;

  /* "pyfmi\fmi.pyx":6756
 *     callbacks.realloc   = FMIL.realloc
 *     callbacks.free      = FMIL.free
 *     callbacks.logger    = importlogger_load_fmu             # <<<<<<<<<<<<<<
 *     callbacks.log_level = FMIL.jm_log_level_warning if enable_logging else FMIL.jm_log_level_nothing
 *     #callbacks.errMessageBuffer = NULL
 */
  __pyx_v_callbacks.logger = __pyx_f_5pyfmi_3fmi_importlogger_load_fmu;

  /* "pyfmi\fmi.pyx":6757
 *     callbacks.free      = FMIL.free
 *     callbacks.logger    = importlogger_load_fmu
 *     callbacks.log_level = FMIL.jm_log_level_warning if enable_logging else FMIL.jm_log_level_nothing             # <<<<<<<<<<<<<<
 *     #callbacks.errMessageBuffer = NULL
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_enable_logging); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_6) {
    __pyx_t_7 = jm_log_level_warning;
  } else {
    __pyx_t_7 = jm_log_level_nothing;
  }
  __pyx_v_callbacks.log_level = __pyx_t_7;

  /* "pyfmi\fmi.pyx":6761
 * 
 *     #Specify FMI related callbacks
 *     callBackFunctions.logger = FMIL.fmi1_log_forwarding;             # <<<<<<<<<<<<<<
 *     callBackFunctions.allocateMemory = FMIL.calloc;
 *     callBackFunctions.freeMemory = FMIL.free;
 */
  __pyx_v_callBackFunctions.logger = fmi1_log_forwarding;

  /* "pyfmi\fmi.pyx":6762
 *     #Specify FMI related callbacks
 *     callBackFunctions.logger = FMIL.fmi1_log_forwarding;
 *     callBackFunctions.allocateMemory = FMIL.calloc;             # <<<<<<<<<<<<<<
 *     callBackFunctions.freeMemory = FMIL.free;
 * 
 */
  __pyx_v_callBackFunctions.allocateMemory = calloc;

  /* "pyfmi\fmi.pyx":6763
 *     callBackFunctions.logger = FMIL.fmi1_log_forwarding;
 *     callBackFunctions.allocateMemory = FMIL.calloc;
 *     callBackFunctions.freeMemory = FMIL.free;             # <<<<<<<<<<<<<<
 * 
 *     context = FMIL.fmi_import_allocate_context(&callbacks)
 */
  __pyx_v_callBackFunctions.freeMemory = free;

  /* "pyfmi\fmi.pyx":6765
 *     callBackFunctions.freeMemory = FMIL.free;
 * 
 *     context = FMIL.fmi_import_allocate_context(&callbacks)             # <<<<<<<<<<<<<<
 *     allocated_context = True
 * 
 */
  __pyx_v_context = fmi_import_allocate_context((&__pyx_v_callbacks));

  /* "pyfmi\fmi.pyx":6766
 * 
 *     context = FMIL.fmi_import_allocate_context(&callbacks)
 *     allocated_context = True             # <<<<<<<<<<<<<<
 * 
 *     #Get the FMI version of the provided model
 */
  __pyx_v_allocated_context = 1;

  /* "pyfmi\fmi.pyx":6769
 * 
 *     #Get the FMI version of the provided model
 *     version = FMIL.fmi_import_get_fmi_version(context, fmu_full_path, fmu_temp_dir)             # <<<<<<<<<<<<<<
 * 
 *     if version == FMIL.fmi_version_unknown_enu:
 */
  __pyx_t_8 = PyBytes_AsString(__pyx_v_fmu_full_path); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = PyBytes_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = PyInt_FromLong(fmi_import_get_fmi_version(__pyx_v_context, __pyx_t_8, __pyx_t_9)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_version = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":6771
 *     version = FMIL.fmi_import_get_fmi_version(context, fmu_full_path, fmu_temp_dir)
 * 
 *     if version == FMIL.fmi_version_unknown_enu:             # <<<<<<<<<<<<<<
 *         last_error = FMIL.jm_get_last_error(&callbacks)
 * 
 */
  __pyx_t_3 = PyInt_FromLong(fmi_version_unknown_enu); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_version, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":6772
 * 
 *     if version == FMIL.fmi_version_unknown_enu:
 *         last_error = FMIL.jm_get_last_error(&callbacks)             # <<<<<<<<<<<<<<
 * 
 *         #Delete the context
 */
    __pyx_v_last_error = jm_get_last_error((&__pyx_v_callbacks));

    /* "pyfmi\fmi.pyx":6775
 * 
 *         #Delete the context
 *         if allocated_context:             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_free_context(context)
 * 
 */
    if (__pyx_v_allocated_context) {

      /* "pyfmi\fmi.pyx":6776
 *         #Delete the context
 *         if allocated_context:
 *             FMIL.fmi_import_free_context(context)             # <<<<<<<<<<<<<<
 * 
 *         if enable_logging:
 */
      fmi_import_free_context(__pyx_v_context);
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "pyfmi\fmi.pyx":6778
 *             FMIL.fmi_import_free_context(context)
 * 
 *         if enable_logging:             # <<<<<<<<<<<<<<
 *             raise FMUException("The FMU version could not be determined. "+decode(last_error))
 *         else:
 */
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_enable_logging); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_6) {

      /* "pyfmi\fmi.pyx":6779
 * 
 *         if enable_logging:
 *             raise FMUException("The FMU version could not be determined. "+decode(last_error))             # <<<<<<<<<<<<<<
 *         else:
 *             raise FMUException("The FMU version could not be determined. Enable logging for possibly more information.")
 */
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyBytes_FromString(__pyx_v_last_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
      __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_kp_s_39), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L6;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":6781
 *             raise FMUException("The FMU version could not be determined. "+decode(last_error))
 *         else:
 *             raise FMUException("The FMU version could not be determined. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 *     if version != 1:
 *         #Delete the context
 */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_387), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L6:;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":6782
 *         else:
 *             raise FMUException("The FMU version could not be determined. Enable logging for possibly more information.")
 *     if version != 1:             # <<<<<<<<<<<<<<
 *         #Delete the context
 *         if allocated_context:
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_version, __pyx_int_1, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":6784
 *     if version != 1:
 *         #Delete the context
 *         if allocated_context:             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_free_context(context)
 * 
 */
    if (__pyx_v_allocated_context) {

      /* "pyfmi\fmi.pyx":6785
 *         #Delete the context
 *         if allocated_context:
 *             FMIL.fmi_import_free_context(context)             # <<<<<<<<<<<<<<
 * 
 *         raise FMUException("PyFMI currently only supports FMI 1.0.")
 */
      fmi_import_free_context(__pyx_v_context);
      goto __pyx_L8;
    }
    __pyx_L8:;

    /* "pyfmi\fmi.pyx":6787
 *             FMIL.fmi_import_free_context(context)
 * 
 *         raise FMUException("PyFMI currently only supports FMI 1.0.")             # <<<<<<<<<<<<<<
 * 
 *     #Parse the XML
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_389), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "pyfmi\fmi.pyx":6790
 * 
 *     #Parse the XML
 *     _fmu = FMIL.fmi1_import_parse_xml(context, fmu_temp_dir)             # <<<<<<<<<<<<<<
 *     if _fmu == NULL:
 *         last_error = FMIL.jm_get_last_error(&callbacks)
 */
  __pyx_t_9 = PyBytes_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v__fmu = fmi1_import_parse_xml(__pyx_v_context, __pyx_t_9);

  /* "pyfmi\fmi.pyx":6791
 *     #Parse the XML
 *     _fmu = FMIL.fmi1_import_parse_xml(context, fmu_temp_dir)
 *     if _fmu == NULL:             # <<<<<<<<<<<<<<
 *         last_error = FMIL.jm_get_last_error(&callbacks)
 *         if enable_logging:
 */
  __pyx_t_6 = (__pyx_v__fmu == NULL);
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":6792
 *     _fmu = FMIL.fmi1_import_parse_xml(context, fmu_temp_dir)
 *     if _fmu == NULL:
 *         last_error = FMIL.jm_get_last_error(&callbacks)             # <<<<<<<<<<<<<<
 *         if enable_logging:
 *             raise FMUException("The XML file could not be parsed. "+decode(last_error))
 */
    __pyx_v_last_error = jm_get_last_error((&__pyx_v_callbacks));

    /* "pyfmi\fmi.pyx":6793
 *     if _fmu == NULL:
 *         last_error = FMIL.jm_get_last_error(&callbacks)
 *         if enable_logging:             # <<<<<<<<<<<<<<
 *             raise FMUException("The XML file could not be parsed. "+decode(last_error))
 *         else:
 */
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_enable_logging); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_6) {

      /* "pyfmi\fmi.pyx":6794
 *         last_error = FMIL.jm_get_last_error(&callbacks)
 *         if enable_logging:
 *             raise FMUException("The XML file could not be parsed. "+decode(last_error))             # <<<<<<<<<<<<<<
 *         else:
 *             raise FMUException("The XML file could not be parsed. Enable logging for possibly more information.")
 */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = PyBytes_FromString(__pyx_v_last_error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
      __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_kp_s_44), __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6794; __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_4)); __pyx_t_4 = 0;
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L10;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":6796
 *             raise FMUException("The XML file could not be parsed. "+decode(last_error))
 *         else:
 *             raise FMUException("The XML file could not be parsed. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 *     allocated_xml = True
 * 
 */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_390), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L10:;
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "pyfmi\fmi.pyx":6797
 *         else:
 *             raise FMUException("The XML file could not be parsed. Enable logging for possibly more information.")
 *     allocated_xml = True             # <<<<<<<<<<<<<<
 * 
 *     #Check the FMU kind
 */
  __pyx_v_allocated_xml = 1;

  /* "pyfmi\fmi.pyx":6800
 * 
 *     #Check the FMU kind
 *     fmu_kind = FMIL.fmi1_import_get_fmu_kind(_fmu)             # <<<<<<<<<<<<<<
 *     if fmu_kind == FMI_ME:
 *         model = FMUModelME1(fmu, path, enable_logging, log_file_name)
 */
  __pyx_t_4 = PyInt_FromLong(fmi1_import_get_fmu_kind(__pyx_v__fmu)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_fmu_kind = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":6801
 *     #Check the FMU kind
 *     fmu_kind = FMIL.fmi1_import_get_fmu_kind(_fmu)
 *     if fmu_kind == FMI_ME:             # <<<<<<<<<<<<<<
 *         model = FMUModelME1(fmu, path, enable_logging, log_file_name)
 *     elif fmu_kind == FMI_CS_STANDALONE:
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_ME); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_fmu_kind, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":6802
 *     fmu_kind = FMIL.fmi1_import_get_fmu_kind(_fmu)
 *     if fmu_kind == FMI_ME:
 *         model = FMUModelME1(fmu, path, enable_logging, log_file_name)             # <<<<<<<<<<<<<<
 *     elif fmu_kind == FMI_CS_STANDALONE:
 *         model = FMUModelCS1(fmu, path, enable_logging, log_file_name)
 */
    __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_fmu);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_fmu);
    __Pyx_GIVEREF(__pyx_v_fmu);
    __Pyx_INCREF(__pyx_v_path);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_path);
    __Pyx_GIVEREF(__pyx_v_path);
    __Pyx_INCREF(__pyx_v_enable_logging);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_enable_logging);
    __Pyx_GIVEREF(__pyx_v_enable_logging);
    __Pyx_INCREF(__pyx_v_log_file_name);
    PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_log_file_name);
    __Pyx_GIVEREF(__pyx_v_log_file_name);
    __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelME1)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_v_model = ((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L11;
  }

  /* "pyfmi\fmi.pyx":6803
 *     if fmu_kind == FMI_ME:
 *         model = FMUModelME1(fmu, path, enable_logging, log_file_name)
 *     elif fmu_kind == FMI_CS_STANDALONE:             # <<<<<<<<<<<<<<
 *         model = FMUModelCS1(fmu, path, enable_logging, log_file_name)
 *     else:
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_CS_STANDALONE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_fmu_kind, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":6804
 *         model = FMUModelME1(fmu, path, enable_logging, log_file_name)
 *     elif fmu_kind == FMI_CS_STANDALONE:
 *         model = FMUModelCS1(fmu, path, enable_logging, log_file_name)             # <<<<<<<<<<<<<<
 *     else:
 *         #Delete the XML
 */
    __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_fmu);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_fmu);
    __Pyx_GIVEREF(__pyx_v_fmu);
    __Pyx_INCREF(__pyx_v_path);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_path);
    __Pyx_GIVEREF(__pyx_v_path);
    __Pyx_INCREF(__pyx_v_enable_logging);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_enable_logging);
    __Pyx_GIVEREF(__pyx_v_enable_logging);
    __Pyx_INCREF(__pyx_v_log_file_name);
    PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_log_file_name);
    __Pyx_GIVEREF(__pyx_v_log_file_name);
    __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelCS1)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_v_model = ((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L11;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":6807
 *     else:
 *         #Delete the XML
 *         if allocated_xml:             # <<<<<<<<<<<<<<
 *             FMIL.fmi1_import_free(_fmu)
 * 
 */
    if (__pyx_v_allocated_xml) {

      /* "pyfmi\fmi.pyx":6808
 *         #Delete the XML
 *         if allocated_xml:
 *             FMIL.fmi1_import_free(_fmu)             # <<<<<<<<<<<<<<
 * 
 *         #Delete the context
 */
      fmi1_import_free(__pyx_v__fmu);
      goto __pyx_L12;
    }
    __pyx_L12:;

    /* "pyfmi\fmi.pyx":6811
 * 
 *         #Delete the context
 *         if allocated_context:             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_free_context(context)
 * 
 */
    if (__pyx_v_allocated_context) {

      /* "pyfmi\fmi.pyx":6812
 *         #Delete the context
 *         if allocated_context:
 *             FMIL.fmi_import_free_context(context)             # <<<<<<<<<<<<<<
 * 
 *         raise FMUException("PyFMI currently only supports FMI 1.0.")
 */
      fmi_import_free_context(__pyx_v_context);
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "pyfmi\fmi.pyx":6814
 *             FMIL.fmi_import_free_context(context)
 * 
 *         raise FMUException("PyFMI currently only supports FMI 1.0.")             # <<<<<<<<<<<<<<
 * 
 *     #Delete the XML
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_391), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L11:;

  /* "pyfmi\fmi.pyx":6817
 * 
 *     #Delete the XML
 *     if allocated_xml:             # <<<<<<<<<<<<<<
 *         FMIL.fmi1_import_free(_fmu)
 * 
 */
  if (__pyx_v_allocated_xml) {

    /* "pyfmi\fmi.pyx":6818
 *     #Delete the XML
 *     if allocated_xml:
 *         FMIL.fmi1_import_free(_fmu)             # <<<<<<<<<<<<<<
 * 
 *     #Delete the context
 */
    fmi1_import_free(__pyx_v__fmu);
    goto __pyx_L14;
  }
  __pyx_L14:;

  /* "pyfmi\fmi.pyx":6821
 * 
 *     #Delete the context
 *     if allocated_context:             # <<<<<<<<<<<<<<
 *         FMIL.fmi_import_free_context(context)
 * 
 */
  if (__pyx_v_allocated_context) {

    /* "pyfmi\fmi.pyx":6822
 *     #Delete the context
 *     if allocated_context:
 *         FMIL.fmi_import_free_context(context)             # <<<<<<<<<<<<<<
 * 
 *     #Delete the created directory
 */
    fmi_import_free_context(__pyx_v_context);
    goto __pyx_L15;
  }
  __pyx_L15:;

  /* "pyfmi\fmi.pyx":6825
 * 
 *     #Delete the created directory
 *     delete_temp_dir(fmu_temp_dir)             # <<<<<<<<<<<<<<
 * 
 *     return model
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__delete_temp_dir); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_fmu_temp_dir);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_fmu_temp_dir);
  __Pyx_GIVEREF(__pyx_v_fmu_temp_dir);
  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":6827
 *     delete_temp_dir(fmu_temp_dir)
 * 
 *     return model             # <<<<<<<<<<<<<<
 * 
 * def _handle_load_fmu_exception(fmu, log_file):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_model));
  __pyx_r = ((PyObject *)__pyx_v_model);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyfmi.fmi.load_fmu_deprecated", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fmu_temp_dir);
  __Pyx_XDECREF(__pyx_v_fmu_full_path);
  __Pyx_XDECREF(__pyx_v_version);
  __Pyx_XDECREF(__pyx_v_fmu_kind);
  __Pyx_XDECREF((PyObject *)__pyx_v_model);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_11_handle_load_fmu_exception(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5pyfmi_3fmi_11_handle_load_fmu_exception = {__Pyx_NAMESTR("_handle_load_fmu_exception"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11_handle_load_fmu_exception, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_5pyfmi_3fmi_11_handle_load_fmu_exception(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_fmu = 0;
  PyObject *__pyx_v_log_file = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_handle_load_fmu_exception (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fmu,&__pyx_n_s__log_file,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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__fmu)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__log_file)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_handle_load_fmu_exception", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6829; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_handle_load_fmu_exception") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6829; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_fmu = values[0];
    __pyx_v_log_file = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_handle_load_fmu_exception", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6829; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi._handle_load_fmu_exception", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_10_handle_load_fmu_exception(__pyx_self, __pyx_v_fmu, __pyx_v_log_file);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyfmi\fmi.pyx":6829
 *     return model
 * 
 * def _handle_load_fmu_exception(fmu, log_file):             # <<<<<<<<<<<<<<
 *     log = []
 *     with open(log_file,'r') as file:
 */

static PyObject *__pyx_pf_5pyfmi_3fmi_10_handle_load_fmu_exception(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_fmu, PyObject *__pyx_v_log_file) {
  PyObject *__pyx_v_log = NULL;
  PyObject *__pyx_v_file = NULL;
  PyObject *__pyx_v_line = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_handle_load_fmu_exception", 0);

  /* "pyfmi\fmi.pyx":6830
 * 
 * def _handle_load_fmu_exception(fmu, log_file):
 *     log = []             # <<<<<<<<<<<<<<
 *     with open(log_file,'r') as file:
 *         while True:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_log = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6831
 * def _handle_load_fmu_exception(fmu, log_file):
 *     log = []
 *     with open(log_file,'r') as file:             # <<<<<<<<<<<<<<
 *         while True:
 *             line = file.readline()
 */
  /*with:*/ {
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_log_file);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_log_file);
    __Pyx_GIVEREF(__pyx_v_log_file);
    __Pyx_INCREF(((PyObject *)__pyx_n_s__r));
    PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__r));
    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__r));
    __pyx_t_2 = PyObject_Call(__pyx_builtin_open, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s____exit__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s____enter__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6831; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6831; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /*try:*/ {
      {
        __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_5);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_7);
        /*try:*/ {
          __Pyx_INCREF(__pyx_t_4);
          __pyx_v_file = __pyx_t_4;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "pyfmi\fmi.pyx":6832
 *     log = []
 *     with open(log_file,'r') as file:
 *         while True:             # <<<<<<<<<<<<<<
 *             line = file.readline()
 *             if line == "":
 */
          while (1) {
            if (!1) break;

            /* "pyfmi\fmi.pyx":6833
 *     with open(log_file,'r') as file:
 *         while True:
 *             line = file.readline()             # <<<<<<<<<<<<<<
 *             if line == "":
 *                 break
 */
            __pyx_t_4 = PyObject_GetAttr(__pyx_v_file, __pyx_n_s__readline); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6833; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6833; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_XDECREF(__pyx_v_line);
            __pyx_v_line = __pyx_t_2;
            __pyx_t_2 = 0;

            /* "pyfmi\fmi.pyx":6834
 *         while True:
 *             line = file.readline()
 *             if line == "":             # <<<<<<<<<<<<<<
 *                 break
 *             log.append(line.strip("\n"))
 */
            __pyx_t_2 = PyObject_RichCompare(__pyx_v_line, ((PyObject *)__pyx_kp_s_12), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6834; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6834; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (__pyx_t_8) {

              /* "pyfmi\fmi.pyx":6835
 *             line = file.readline()
 *             if line == "":
 *                 break             # <<<<<<<<<<<<<<
 *             log.append(line.strip("\n"))
 * 
 */
              goto __pyx_L17_break;
              goto __pyx_L18;
            }
            __pyx_L18:;

            /* "pyfmi\fmi.pyx":6836
 *             if line == "":
 *                 break
 *             log.append(line.strip("\n"))             # <<<<<<<<<<<<<<
 * 
 *     for i in range(len(log)):
 */
            __pyx_t_2 = PyObject_GetAttr(__pyx_v_line, __pyx_n_s__strip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6836; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_392), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6836; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_t_9 = PyList_Append(__pyx_v_log, __pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6836; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          }
          __pyx_L17_break:;
        }
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L14_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "pyfmi\fmi.pyx":6831
 * def _handle_load_fmu_exception(fmu, log_file):
 *     log = []
 *     with open(log_file,'r') as file:             # <<<<<<<<<<<<<<
 *         while True:
 *             line = file.readline()
 */
        /*except:*/ {
          __Pyx_AddTraceback("pyfmi.fmi._handle_load_fmu_exception", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_2, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6831; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6831; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_1);
          __pyx_t_11 = PyObject_Call(__pyx_t_3, __pyx_t_10, NULL);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6831; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6831; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          __pyx_t_12 = (!__pyx_t_8);
          if (__pyx_t_12) {
            __Pyx_GIVEREF(__pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_ErrRestore(__pyx_t_4, __pyx_t_2, __pyx_t_1);
            __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; 
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6831; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
            goto __pyx_L21;
          }
          __pyx_L21:;
          __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
        __pyx_L14_try_end:;
      }
    }
    /*finally:*/ {
      if (__pyx_t_3) {
        __pyx_t_7 = PyObject_Call(__pyx_t_3, __pyx_k_tuple_393, NULL);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
    }
    goto __pyx_L22;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L1_error;
    __pyx_L22:;
  }

  /* "pyfmi\fmi.pyx":6838
 *             log.append(line.strip("\n"))
 * 
 *     for i in range(len(log)):             # <<<<<<<<<<<<<<
 *         print log[i]
 * 
 */
  __pyx_t_13 = PyList_GET_SIZE(((PyObject *)__pyx_v_log)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6838; __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 = 6838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_13 = 0;
    __pyx_t_14 = NULL;
  } else {
    __pyx_t_13 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_14 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (!__pyx_t_14 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_14 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_14(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF(__pyx_v_i);
    __pyx_v_i = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pyfmi\fmi.pyx":6839
 * 
 *     for i in range(len(log)):
 *         print log[i]             # <<<<<<<<<<<<<<
 * 
 * def load_fmu(fmu, path = '.', enable_logging = None, log_file_name = "", kind = 'auto', log_level=FMI_DEFAULT_LOG_LEVEL):
 */
    __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_log), __pyx_v_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_PrintOne(0, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pyfmi.fmi._handle_load_fmu_exception", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_log);
  __Pyx_XDECREF(__pyx_v_file);
  __Pyx_XDECREF(__pyx_v_line);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5pyfmi_3fmi_13load_fmu(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5pyfmi_3fmi_12load_fmu[] = "\n    Helper method for creating a model instance.\n\n    Parameters::\n\n        fmu --\n            Name of the fmu as a string.\n\n        path --\n            Path to the fmu-directory.\n            Default: '.' (working directory)\n\n        enable_logging --\n            Boolean for acesss to logging-messages.\n            Default: True\n\n        log_file_name --\n            Filename for file used to save logmessages.\n            Default: \"\" (Generates automatically)\n\n        kind --\n            String indicating the kind of model to create. This is only\n            needed if a FMU contains both a ME and CS model.\n            Availible options:\n                - 'ME'\n                - 'CS'\n                - 'auto'\n            Default: 'auto' (Chooses ME before CS if both available)\n\n    Returns::\n\n        A model instance corresponding to the loaded FMU.\n    ";
static PyMethodDef __pyx_mdef_5pyfmi_3fmi_13load_fmu = {__Pyx_NAMESTR("load_fmu"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13load_fmu, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12load_fmu)};
static PyObject *__pyx_pw_5pyfmi_3fmi_13load_fmu(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fmu = 0;
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_enable_logging = 0;
  PyObject *__pyx_v_log_file_name = 0;
  PyObject *__pyx_v_kind = 0;
  PyObject *__pyx_v_log_level = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("load_fmu (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fmu,&__pyx_n_s__path,&__pyx_n_s__enable_logging,&__pyx_n_s__log_file_name,&__pyx_n_s__kind,&__pyx_n_s__log_level,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_kp_s_30);

    /* "pyfmi\fmi.pyx":6841
 *         print log[i]
 * 
 * def load_fmu(fmu, path = '.', enable_logging = None, log_file_name = "", kind = 'auto', log_level=FMI_DEFAULT_LOG_LEVEL):             # <<<<<<<<<<<<<<
 *     """
 *     Helper method for creating a model instance.
 */
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)__pyx_kp_s_12);
    values[4] = ((PyObject *)__pyx_n_s__auto);
    values[5] = __pyx_k_394;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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__fmu)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__enable_logging);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__log_file_name);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__kind);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__log_level);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "load_fmu") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_fmu = values[0];
    __pyx_v_path = values[1];
    __pyx_v_enable_logging = values[2];
    __pyx_v_log_file_name = values[3];
    __pyx_v_kind = values[4];
    __pyx_v_log_level = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("load_fmu", 0, 1, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyfmi.fmi.load_fmu", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5pyfmi_3fmi_12load_fmu(__pyx_self, __pyx_v_fmu, __pyx_v_path, __pyx_v_enable_logging, __pyx_v_log_file_name, __pyx_v_kind, __pyx_v_log_level);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5pyfmi_3fmi_12load_fmu(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fmu, PyObject *__pyx_v_path, PyObject *__pyx_v_enable_logging, PyObject *__pyx_v_log_file_name, PyObject *__pyx_v_kind, PyObject *__pyx_v_log_level) {
  fmi_import_context_t *__pyx_v_context;
  struct jm_callbacks __pyx_v_callbacks;
  fmi1_callback_functions_t __pyx_v_callBackFunctions_1;
  fmi2_callback_functions_t __pyx_v_callBackFunctions_2;
  jm_string __pyx_v_last_error;
  fmi_version_enu_t __pyx_v_version;
  fmi1_import_t *__pyx_v_fmu_1;
  fmi2_import_t *__pyx_v_fmu_2;
  enum fmi1_fmu_kind_enu_t __pyx_v_fmu_1_kind;
  fmi2_fmu_kind_enu_t __pyx_v_fmu_2_kind;
  char *__pyx_v_log_file_c;
  PyObject *__pyx_v_fmu_temp_dir = NULL;
  PyObject *__pyx_v_model = NULL;
  PyObject *__pyx_v_log_file = NULL;
  PyObject *__pyx_v_fmu_full_path = NULL;
  PyObject *__pyx_v_original_enable_logging = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  jm_log_level_enu_t __pyx_t_9;
  char *__pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("load_fmu", 0);
  __Pyx_INCREF(__pyx_v_enable_logging);

  /* "pyfmi\fmi.pyx":6895
 * 
 *     #Variables for deallocation
 *     fmu_temp_dir = None             # <<<<<<<<<<<<<<
 *     model        = None
 *     log_file     = encode(create_temp_file())
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_fmu_temp_dir = Py_None;

  /* "pyfmi\fmi.pyx":6896
 *     #Variables for deallocation
 *     fmu_temp_dir = None
 *     model        = None             # <<<<<<<<<<<<<<
 *     log_file     = encode(create_temp_file())
 *     log_file_c = <char*>FMIL.malloc((FMIL.strlen(log_file)+1)*sizeof(char))
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_model = Py_None;

  /* "pyfmi\fmi.pyx":6897
 *     fmu_temp_dir = None
 *     model        = None
 *     log_file     = encode(create_temp_file())             # <<<<<<<<<<<<<<
 *     log_file_c = <char*>FMIL.malloc((FMIL.strlen(log_file)+1)*sizeof(char))
 *     FMIL.strcpy(log_file_c, log_file)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__create_temp_file); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_log_file = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyfmi\fmi.pyx":6898
 *     model        = None
 *     log_file     = encode(create_temp_file())
 *     log_file_c = <char*>FMIL.malloc((FMIL.strlen(log_file)+1)*sizeof(char))             # <<<<<<<<<<<<<<
 *     FMIL.strcpy(log_file_c, log_file)
 * 
 */
  __pyx_t_4 = PyBytes_AsString(__pyx_v_log_file); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_log_file_c = ((char *)malloc(((strlen(__pyx_t_4) + 1) * (sizeof(char)))));

  /* "pyfmi\fmi.pyx":6899
 *     log_file     = encode(create_temp_file())
 *     log_file_c = <char*>FMIL.malloc((FMIL.strlen(log_file)+1)*sizeof(char))
 *     FMIL.strcpy(log_file_c, log_file)             # <<<<<<<<<<<<<<
 * 
 *     # Check that the file referenced by fmu has the correct file-ending
 */
  __pyx_t_4 = PyBytes_AsString(__pyx_v_log_file); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  strcpy(__pyx_v_log_file_c, __pyx_t_4);

  /* "pyfmi\fmi.pyx":6902
 * 
 *     # Check that the file referenced by fmu has the correct file-ending
 *     fmu_full_path = os.path.abspath(os.path.join(path,fmu))             # <<<<<<<<<<<<<<
 *     if not fmu_full_path.endswith('.fmu'):
 *         raise FMUException("FMUModel must be instantiated with an FMU (.fmu) file.")
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__abspath); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__path); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__join); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __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 = 6902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_path);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  __Pyx_INCREF(__pyx_v_fmu);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_fmu);
  __Pyx_GIVEREF(__pyx_v_fmu);
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_v_fmu_full_path = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":6903
 *     # Check that the file referenced by fmu has the correct file-ending
 *     fmu_full_path = os.path.abspath(os.path.join(path,fmu))
 *     if not fmu_full_path.endswith('.fmu'):             # <<<<<<<<<<<<<<
 *         raise FMUException("FMUModel must be instantiated with an FMU (.fmu) file.")
 * 
 */
  __pyx_t_5 = PyObject_GetAttr(__pyx_v_fmu_full_path, __pyx_n_s__endswith); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_395), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = (!__pyx_t_6);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":6904
 *     fmu_full_path = os.path.abspath(os.path.join(path,fmu))
 *     if not fmu_full_path.endswith('.fmu'):
 *         raise FMUException("FMUModel must be instantiated with an FMU (.fmu) file.")             # <<<<<<<<<<<<<<
 * 
 *     #Check that the file exists
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_396), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "pyfmi\fmi.pyx":6907
 * 
 *     #Check that the file exists
 *     if not os.path.isfile(fmu_full_path):             # <<<<<<<<<<<<<<
 *         raise FMUException('Could not locate the FMU in the specified directory.')
 * 
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__path); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__isfile); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_fmu_full_path);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_fmu_full_path);
  __Pyx_GIVEREF(__pyx_v_fmu_full_path);
  __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = (!__pyx_t_7);
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":6908
 *     #Check that the file exists
 *     if not os.path.isfile(fmu_full_path):
 *         raise FMUException('Could not locate the FMU in the specified directory.')             # <<<<<<<<<<<<<<
 * 
 *     #Check that kind-argument is well-defined
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_397), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "pyfmi\fmi.pyx":6911
 * 
 *     #Check that kind-argument is well-defined
 *     if not kind.lower() == 'auto':             # <<<<<<<<<<<<<<
 *         if (kind.upper() != 'ME' and kind.upper() != 'CS'):
 *             raise FMUException('Input-argument "kind" can only be "ME", "CS" or "auto" (default) and not: ' + kind)
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_kind, __pyx_n_s__lower); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_n_s__auto), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = (!__pyx_t_6);
  if (__pyx_t_7) {

    /* "pyfmi\fmi.pyx":6912
 *     #Check that kind-argument is well-defined
 *     if not kind.lower() == 'auto':
 *         if (kind.upper() != 'ME' and kind.upper() != 'CS'):             # <<<<<<<<<<<<<<
 *             raise FMUException('Input-argument "kind" can only be "ME", "CS" or "auto" (default) and not: ' + kind)
 * 
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_kind, __pyx_n_s__upper); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_n_s__ME), Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_7) {
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_kind, __pyx_n_s__upper); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_n_s__CS), Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = __pyx_t_6;
    } else {
      __pyx_t_8 = __pyx_t_7;
    }
    if (__pyx_t_8) {

      /* "pyfmi\fmi.pyx":6913
 *     if not kind.lower() == 'auto':
 *         if (kind.upper() != 'ME' and kind.upper() != 'CS'):
 *             raise FMUException('Input-argument "kind" can only be "ME", "CS" or "auto" (default) and not: ' + kind)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_kp_s_398), __pyx_v_kind); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L6;
    }
    __pyx_L6:;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pyfmi\fmi.pyx":6917
 * 
 *     #Specify FMI related callbacks
 *     callbacks.malloc    = FMIL.malloc             # <<<<<<<<<<<<<<
 *     callbacks.calloc    = FMIL.calloc
 *     callbacks.realloc   = FMIL.realloc
 */
  __pyx_v_callbacks.malloc = malloc;

  /* "pyfmi\fmi.pyx":6918
 *     #Specify FMI related callbacks
 *     callbacks.malloc    = FMIL.malloc
 *     callbacks.calloc    = FMIL.calloc             # <<<<<<<<<<<<<<
 *     callbacks.realloc   = FMIL.realloc
 *     callbacks.free      = FMIL.free
 */
  __pyx_v_callbacks.calloc = calloc;

  /* "pyfmi\fmi.pyx":6919
 *     callbacks.malloc    = FMIL.malloc
 *     callbacks.calloc    = FMIL.calloc
 *     callbacks.realloc   = FMIL.realloc             # <<<<<<<<<<<<<<
 *     callbacks.free      = FMIL.free
 *     callbacks.logger    = importlogger_load_fmu
 */
  __pyx_v_callbacks.realloc = realloc;

  /* "pyfmi\fmi.pyx":6920
 *     callbacks.calloc    = FMIL.calloc
 *     callbacks.realloc   = FMIL.realloc
 *     callbacks.free      = FMIL.free             # <<<<<<<<<<<<<<
 *     callbacks.logger    = importlogger_load_fmu
 *     callbacks.context   = <void*>log_file_c
 */
  __pyx_v_callbacks.free = free;

  /* "pyfmi\fmi.pyx":6921
 *     callbacks.realloc   = FMIL.realloc
 *     callbacks.free      = FMIL.free
 *     callbacks.logger    = importlogger_load_fmu             # <<<<<<<<<<<<<<
 *     callbacks.context   = <void*>log_file_c
 *     #callbacks.log_level = FMIL.jm_log_level_warning if enable_logging else FMIL.jm_log_level_nothing
 */
  __pyx_v_callbacks.logger = __pyx_f_5pyfmi_3fmi_importlogger_load_fmu;

  /* "pyfmi\fmi.pyx":6922
 *     callbacks.free      = FMIL.free
 *     callbacks.logger    = importlogger_load_fmu
 *     callbacks.context   = <void*>log_file_c             # <<<<<<<<<<<<<<
 *     #callbacks.log_level = FMIL.jm_log_level_warning if enable_logging else FMIL.jm_log_level_nothing
 *     original_enable_logging = enable_logging
 */
  __pyx_v_callbacks.context = ((void *)__pyx_v_log_file_c);

  /* "pyfmi\fmi.pyx":6924
 *     callbacks.context   = <void*>log_file_c
 *     #callbacks.log_level = FMIL.jm_log_level_warning if enable_logging else FMIL.jm_log_level_nothing
 *     original_enable_logging = enable_logging             # <<<<<<<<<<<<<<
 * 
 *     if enable_logging==None:
 */
  __Pyx_INCREF(__pyx_v_enable_logging);
  __pyx_v_original_enable_logging = __pyx_v_enable_logging;

  /* "pyfmi\fmi.pyx":6926
 *     original_enable_logging = enable_logging
 * 
 *     if enable_logging==None:             # <<<<<<<<<<<<<<
 *         if log_level >= FMIL.jm_log_level_nothing and log_level <= FMIL.jm_log_level_all:
 *             if log_level == FMIL.jm_log_level_nothing:
 */
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_enable_logging, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_8) {

    /* "pyfmi\fmi.pyx":6927
 * 
 *     if enable_logging==None:
 *         if log_level >= FMIL.jm_log_level_nothing and log_level <= FMIL.jm_log_level_all:             # <<<<<<<<<<<<<<
 *             if log_level == FMIL.jm_log_level_nothing:
 *                 enable_logging = False
 */
    __pyx_t_3 = PyInt_FromLong(jm_log_level_nothing); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyObject_RichCompare(__pyx_v_log_level, __pyx_t_3, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_8) {
      __pyx_t_5 = PyInt_FromLong(jm_log_level_all); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_log_level, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __pyx_t_7;
    } else {
      __pyx_t_6 = __pyx_t_8;
    }
    if (__pyx_t_6) {

      /* "pyfmi\fmi.pyx":6928
 *     if enable_logging==None:
 *         if log_level >= FMIL.jm_log_level_nothing and log_level <= FMIL.jm_log_level_all:
 *             if log_level == FMIL.jm_log_level_nothing:             # <<<<<<<<<<<<<<
 *                 enable_logging = False
 *             else:
 */
      __pyx_t_3 = PyInt_FromLong(jm_log_level_nothing); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_log_level, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6928; __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[0]; __pyx_lineno = 6928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {

        /* "pyfmi\fmi.pyx":6929
 *         if log_level >= FMIL.jm_log_level_nothing and log_level <= FMIL.jm_log_level_all:
 *             if log_level == FMIL.jm_log_level_nothing:
 *                 enable_logging = False             # <<<<<<<<<<<<<<
 *             else:
 *                 enable_logging = True
 */
        __pyx_t_5 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_v_enable_logging);
        __pyx_v_enable_logging = __pyx_t_5;
        __pyx_t_5 = 0;
        goto __pyx_L9;
      }
      /*else*/ {

        /* "pyfmi\fmi.pyx":6931
 *                 enable_logging = False
 *             else:
 *                 enable_logging = True             # <<<<<<<<<<<<<<
 *             callbacks.log_level = log_level
 *         else:
 */
        __pyx_t_5 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_v_enable_logging);
        __pyx_v_enable_logging = __pyx_t_5;
        __pyx_t_5 = 0;
      }
      __pyx_L9:;

      /* "pyfmi\fmi.pyx":6932
 *             else:
 *                 enable_logging = True
 *             callbacks.log_level = log_level             # <<<<<<<<<<<<<<
 *         else:
 *             raise FMUException("The log level must be between %d and %d"%(FMIL.jm_log_level_nothing, FMIL.jm_log_level_all))
 */
      __pyx_t_9 = ((jm_log_level_enu_t)PyInt_AsLong(__pyx_v_log_level)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_callbacks.log_level = __pyx_t_9;
      goto __pyx_L8;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":6934
 *             callbacks.log_level = log_level
 *         else:
 *             raise FMUException("The log level must be between %d and %d"%(FMIL.jm_log_level_nothing, FMIL.jm_log_level_all))             # <<<<<<<<<<<<<<
 *     else:
 *         logging.warning("The attribute 'enable_logging' is deprecated. Please use 'log_level' instead. Setting 'log_level' to INFO...")
 */
      __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyInt_FromLong(jm_log_level_nothing); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyInt_FromLong(jm_log_level_all); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6934; __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 = 6934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_3 = 0;
      __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_32), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
      __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L8:;
    goto __pyx_L7;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":6936
 *             raise FMUException("The log level must be between %d and %d"%(FMIL.jm_log_level_nothing, FMIL.jm_log_level_all))
 *     else:
 *         logging.warning("The attribute 'enable_logging' is deprecated. Please use 'log_level' instead. Setting 'log_level' to INFO...")             # <<<<<<<<<<<<<<
 *         callbacks.log_level = FMIL.jm_log_level_info if enable_logging else FMIL.jm_log_level_error
 * 
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logging); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__warning); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_399), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyfmi\fmi.pyx":6937
 *     else:
 *         logging.warning("The attribute 'enable_logging' is deprecated. Please use 'log_level' instead. Setting 'log_level' to INFO...")
 *         callbacks.log_level = FMIL.jm_log_level_info if enable_logging else FMIL.jm_log_level_error             # <<<<<<<<<<<<<<
 * 
 *     #Specify the xml_callbacks for FMU2
 */
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_enable_logging); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_6) {
      __pyx_t_9 = jm_log_level_info;
    } else {
      __pyx_t_9 = jm_log_level_error;
    }
    __pyx_v_callbacks.log_level = __pyx_t_9;
  }
  __pyx_L7:;

  /* "pyfmi\fmi.pyx":6946
 * 
 *     #Specify the general FMU1 callback functions
 *     callBackFunctions_1.logger         = FMIL.fmi1_log_forwarding             # <<<<<<<<<<<<<<
 *     callBackFunctions_1.allocateMemory = FMIL.calloc
 *     callBackFunctions_1.freeMemory     = FMIL.free
 */
  __pyx_v_callBackFunctions_1.logger = fmi1_log_forwarding;

  /* "pyfmi\fmi.pyx":6947
 *     #Specify the general FMU1 callback functions
 *     callBackFunctions_1.logger         = FMIL.fmi1_log_forwarding
 *     callBackFunctions_1.allocateMemory = FMIL.calloc             # <<<<<<<<<<<<<<
 *     callBackFunctions_1.freeMemory     = FMIL.free
 * 
 */
  __pyx_v_callBackFunctions_1.allocateMemory = calloc;

  /* "pyfmi\fmi.pyx":6948
 *     callBackFunctions_1.logger         = FMIL.fmi1_log_forwarding
 *     callBackFunctions_1.allocateMemory = FMIL.calloc
 *     callBackFunctions_1.freeMemory     = FMIL.free             # <<<<<<<<<<<<<<
 * 
 *     #Specify the general FMU2 callback functions
 */
  __pyx_v_callBackFunctions_1.freeMemory = free;

  /* "pyfmi\fmi.pyx":6951
 * 
 *     #Specify the general FMU2 callback functions
 *     callBackFunctions_2.logger               = FMIL.fmi2_log_forwarding             # <<<<<<<<<<<<<<
 *     callBackFunctions_2.allocateMemory       = FMIL.calloc
 *     callBackFunctions_2.freeMemory           = FMIL.free
 */
  __pyx_v_callBackFunctions_2.logger = fmi2_log_forwarding;

  /* "pyfmi\fmi.pyx":6952
 *     #Specify the general FMU2 callback functions
 *     callBackFunctions_2.logger               = FMIL.fmi2_log_forwarding
 *     callBackFunctions_2.allocateMemory       = FMIL.calloc             # <<<<<<<<<<<<<<
 *     callBackFunctions_2.freeMemory           = FMIL.free
 * 
 */
  __pyx_v_callBackFunctions_2.allocateMemory = calloc;

  /* "pyfmi\fmi.pyx":6953
 *     callBackFunctions_2.logger               = FMIL.fmi2_log_forwarding
 *     callBackFunctions_2.allocateMemory       = FMIL.calloc
 *     callBackFunctions_2.freeMemory           = FMIL.free             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_callBackFunctions_2.freeMemory = free;

  /* "pyfmi\fmi.pyx":6957
 * 
 *     # Create a struct for allocation
 *     context = FMIL.fmi_import_allocate_context(&callbacks)             # <<<<<<<<<<<<<<
 * 
 *     #Get the FMI version of the provided model
 */
  __pyx_v_context = fmi_import_allocate_context((&__pyx_v_callbacks));

  /* "pyfmi\fmi.pyx":6960
 * 
 *     #Get the FMI version of the provided model
 *     fmu_temp_dir = encode(create_temp_dir())             # <<<<<<<<<<<<<<
 *     fmu_full_path = encode(fmu_full_path)
 *     version = FMIL.fmi_import_get_fmi_version(context, fmu_full_path, fmu_temp_dir)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__create_temp_dir); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_v_fmu_temp_dir);
  __pyx_v_fmu_temp_dir = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "pyfmi\fmi.pyx":6961
 *     #Get the FMI version of the provided model
 *     fmu_temp_dir = encode(create_temp_dir())
 *     fmu_full_path = encode(fmu_full_path)             # <<<<<<<<<<<<<<
 *     version = FMIL.fmi_import_get_fmi_version(context, fmu_full_path, fmu_temp_dir)
 * 
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__encode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_fmu_full_path);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_fmu_full_path);
  __Pyx_GIVEREF(__pyx_v_fmu_full_path);
  __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_v_fmu_full_path);
  __pyx_v_fmu_full_path = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6962
 *     fmu_temp_dir = encode(create_temp_dir())
 *     fmu_full_path = encode(fmu_full_path)
 *     version = FMIL.fmi_import_get_fmi_version(context, fmu_full_path, fmu_temp_dir)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = PyBytes_AsString(__pyx_v_fmu_full_path); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_10 = PyBytes_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_version = fmi_import_get_fmi_version(__pyx_v_context, __pyx_t_4, __pyx_t_10);

  /* "pyfmi\fmi.pyx":6966
 * 
 *     #Check the version
 *     if version == FMIL.fmi_version_unknown_enu:             # <<<<<<<<<<<<<<
 *         #Delete context
 *         last_error = FMIL.jm_get_last_error(&callbacks)
 */
  __pyx_t_6 = (__pyx_v_version == fmi_version_unknown_enu);
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":6968
 *     if version == FMIL.fmi_version_unknown_enu:
 *         #Delete context
 *         last_error = FMIL.jm_get_last_error(&callbacks)             # <<<<<<<<<<<<<<
 *         FMIL.fmi_import_free_context(context)
 *         FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)
 */
    __pyx_v_last_error = jm_get_last_error((&__pyx_v_callbacks));

    /* "pyfmi\fmi.pyx":6969
 *         #Delete context
 *         last_error = FMIL.jm_get_last_error(&callbacks)
 *         FMIL.fmi_import_free_context(context)             # <<<<<<<<<<<<<<
 *         FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)
 *         if callbacks.log_level >= FMIL.jm_log_level_error:
 */
    fmi_import_free_context(__pyx_v_context);

    /* "pyfmi\fmi.pyx":6970
 *         last_error = FMIL.jm_get_last_error(&callbacks)
 *         FMIL.fmi_import_free_context(context)
 *         FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)             # <<<<<<<<<<<<<<
 *         if callbacks.log_level >= FMIL.jm_log_level_error:
 *             _handle_load_fmu_exception(fmu, log_file)
 */
    __pyx_t_10 = PyBytes_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_10);

    /* "pyfmi\fmi.pyx":6971
 *         FMIL.fmi_import_free_context(context)
 *         FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)
 *         if callbacks.log_level >= FMIL.jm_log_level_error:             # <<<<<<<<<<<<<<
 *             _handle_load_fmu_exception(fmu, log_file)
 *             raise FMUException("The FMU version could not be determined. "+decode(last_error))
 */
    __pyx_t_6 = (__pyx_v_callbacks.log_level >= jm_log_level_error);
    if (__pyx_t_6) {

      /* "pyfmi\fmi.pyx":6972
 *         FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)
 *         if callbacks.log_level >= FMIL.jm_log_level_error:
 *             _handle_load_fmu_exception(fmu, log_file)             # <<<<<<<<<<<<<<
 *             raise FMUException("The FMU version could not be determined. "+decode(last_error))
 *         else:
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_400); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6972; __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 = 6972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_fmu);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_fmu);
      __Pyx_GIVEREF(__pyx_v_fmu);
      __Pyx_INCREF(__pyx_v_log_file);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_log_file);
      __Pyx_GIVEREF(__pyx_v_log_file);
      __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "pyfmi\fmi.pyx":6973
 *         if callbacks.log_level >= FMIL.jm_log_level_error:
 *             _handle_load_fmu_exception(fmu, log_file)
 *             raise FMUException("The FMU version could not be determined. "+decode(last_error))             # <<<<<<<<<<<<<<
 *         else:
 *             _handle_load_fmu_exception(fmu, log_file)
 */
      __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyBytes_FromString(__pyx_v_last_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
      __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 = 6973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_kp_s_39), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L11;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":6975
 *             raise FMUException("The FMU version could not be determined. "+decode(last_error))
 *         else:
 *             _handle_load_fmu_exception(fmu, log_file)             # <<<<<<<<<<<<<<
 *             raise FMUException("The FMU version could not be determined. Enable logging for possibly more information.")
 * 
 */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s_400); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_fmu);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_fmu);
      __Pyx_GIVEREF(__pyx_v_fmu);
      __Pyx_INCREF(__pyx_v_log_file);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_log_file);
      __Pyx_GIVEREF(__pyx_v_log_file);
      __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "pyfmi\fmi.pyx":6976
 *         else:
 *             _handle_load_fmu_exception(fmu, log_file)
 *             raise FMUException("The FMU version could not be determined. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 * 
 *     if version > 2:
 */
      __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_401), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L11:;
    goto __pyx_L10;
  }
  __pyx_L10:;

  /* "pyfmi\fmi.pyx":6978
 *             raise FMUException("The FMU version could not be determined. Enable logging for possibly more information.")
 * 
 *     if version > 2:             # <<<<<<<<<<<<<<
 *         #Delete the context
 *         last_error = FMIL.jm_get_last_error(&callbacks)
 */
  __pyx_t_6 = (__pyx_v_version > 2);
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":6980
 *     if version > 2:
 *         #Delete the context
 *         last_error = FMIL.jm_get_last_error(&callbacks)             # <<<<<<<<<<<<<<
 *         FMIL.fmi_import_free_context(context)
 *         FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)
 */
    __pyx_v_last_error = jm_get_last_error((&__pyx_v_callbacks));

    /* "pyfmi\fmi.pyx":6981
 *         #Delete the context
 *         last_error = FMIL.jm_get_last_error(&callbacks)
 *         FMIL.fmi_import_free_context(context)             # <<<<<<<<<<<<<<
 *         FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)
 *         if callbacks.log_level >= FMIL.jm_log_level_error:
 */
    fmi_import_free_context(__pyx_v_context);

    /* "pyfmi\fmi.pyx":6982
 *         last_error = FMIL.jm_get_last_error(&callbacks)
 *         FMIL.fmi_import_free_context(context)
 *         FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)             # <<<<<<<<<<<<<<
 *         if callbacks.log_level >= FMIL.jm_log_level_error:
 *             _handle_load_fmu_exception(fmu, log_file)
 */
    __pyx_t_10 = PyBytes_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_10);

    /* "pyfmi\fmi.pyx":6983
 *         FMIL.fmi_import_free_context(context)
 *         FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)
 *         if callbacks.log_level >= FMIL.jm_log_level_error:             # <<<<<<<<<<<<<<
 *             _handle_load_fmu_exception(fmu, log_file)
 *             raise FMUException("The FMU version is unsupported. "+decode(last_error))
 */
    __pyx_t_6 = (__pyx_v_callbacks.log_level >= jm_log_level_error);
    if (__pyx_t_6) {

      /* "pyfmi\fmi.pyx":6984
 *         FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)
 *         if callbacks.log_level >= FMIL.jm_log_level_error:
 *             _handle_load_fmu_exception(fmu, log_file)             # <<<<<<<<<<<<<<
 *             raise FMUException("The FMU version is unsupported. "+decode(last_error))
 *         else:
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_400); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_v_fmu);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_fmu);
      __Pyx_GIVEREF(__pyx_v_fmu);
      __Pyx_INCREF(__pyx_v_log_file);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_log_file);
      __Pyx_GIVEREF(__pyx_v_log_file);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "pyfmi\fmi.pyx":6985
 *         if callbacks.log_level >= FMIL.jm_log_level_error:
 *             _handle_load_fmu_exception(fmu, log_file)
 *             raise FMUException("The FMU version is unsupported. "+decode(last_error))             # <<<<<<<<<<<<<<
 *         else:
 *             _handle_load_fmu_exception(fmu, log_file)
 */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = PyBytes_FromString(__pyx_v_last_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
      __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_kp_s_402), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __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 = 6985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L13;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":6987
 *             raise FMUException("The FMU version is unsupported. "+decode(last_error))
 *         else:
 *             _handle_load_fmu_exception(fmu, log_file)             # <<<<<<<<<<<<<<
 *             raise FMUException("The FMU version is unsupported. Enable logging for possibly more information.")
 * 
 */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s_400); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_fmu);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_fmu);
      __Pyx_GIVEREF(__pyx_v_fmu);
      __Pyx_INCREF(__pyx_v_log_file);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_log_file);
      __Pyx_GIVEREF(__pyx_v_log_file);
      __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6987; __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;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "pyfmi\fmi.pyx":6988
 *         else:
 *             _handle_load_fmu_exception(fmu, log_file)
 *             raise FMUException("The FMU version is unsupported. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_404), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L13:;
    goto __pyx_L12;
  }
  __pyx_L12:;

  /* "pyfmi\fmi.pyx":6992
 * 
 *     #Parse the xml
 *     if version == FMIL.fmi_version_1_enu:             # <<<<<<<<<<<<<<
 *         #Check the fmu-kind
 *         fmu_1 = FMIL.fmi1_import_parse_xml(context, fmu_temp_dir)
 */
  __pyx_t_6 = (__pyx_v_version == fmi_version_1_enu);
  if (__pyx_t_6) {

    /* "pyfmi\fmi.pyx":6994
 *     if version == FMIL.fmi_version_1_enu:
 *         #Check the fmu-kind
 *         fmu_1 = FMIL.fmi1_import_parse_xml(context, fmu_temp_dir)             # <<<<<<<<<<<<<<
 * 
 *         if fmu_1 is NULL:
 */
    __pyx_t_10 = PyBytes_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_fmu_1 = fmi1_import_parse_xml(__pyx_v_context, __pyx_t_10);

    /* "pyfmi\fmi.pyx":6996
 *         fmu_1 = FMIL.fmi1_import_parse_xml(context, fmu_temp_dir)
 * 
 *         if fmu_1 is NULL:             # <<<<<<<<<<<<<<
 *             #Delete the context
 *             last_error = FMIL.jm_get_last_error(&callbacks)
 */
    __pyx_t_6 = (__pyx_v_fmu_1 == NULL);
    if (__pyx_t_6) {

      /* "pyfmi\fmi.pyx":6998
 *         if fmu_1 is NULL:
 *             #Delete the context
 *             last_error = FMIL.jm_get_last_error(&callbacks)             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_free_context(context)
 *             FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)
 */
      __pyx_v_last_error = jm_get_last_error((&__pyx_v_callbacks));

      /* "pyfmi\fmi.pyx":6999
 *             #Delete the context
 *             last_error = FMIL.jm_get_last_error(&callbacks)
 *             FMIL.fmi_import_free_context(context)             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)
 *             if callbacks.log_level >= FMIL.jm_log_level_error:
 */
      fmi_import_free_context(__pyx_v_context);

      /* "pyfmi\fmi.pyx":7000
 *             last_error = FMIL.jm_get_last_error(&callbacks)
 *             FMIL.fmi_import_free_context(context)
 *             FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)             # <<<<<<<<<<<<<<
 *             if callbacks.log_level >= FMIL.jm_log_level_error:
 *                 _handle_load_fmu_exception(fmu, log_file)
 */
      __pyx_t_10 = PyBytes_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_10);

      /* "pyfmi\fmi.pyx":7001
 *             FMIL.fmi_import_free_context(context)
 *             FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)
 *             if callbacks.log_level >= FMIL.jm_log_level_error:             # <<<<<<<<<<<<<<
 *                 _handle_load_fmu_exception(fmu, log_file)
 *                 raise FMUException("The XML-could not be read. "+decode(last_error))
 */
      __pyx_t_6 = (__pyx_v_callbacks.log_level >= jm_log_level_error);
      if (__pyx_t_6) {

        /* "pyfmi\fmi.pyx":7002
 *             FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)
 *             if callbacks.log_level >= FMIL.jm_log_level_error:
 *                 _handle_load_fmu_exception(fmu, log_file)             # <<<<<<<<<<<<<<
 *                 raise FMUException("The XML-could not be read. "+decode(last_error))
 *             else:
 */
        __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_400); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_v_fmu);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_fmu);
        __Pyx_GIVEREF(__pyx_v_fmu);
        __Pyx_INCREF(__pyx_v_log_file);
        PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_log_file);
        __Pyx_GIVEREF(__pyx_v_log_file);
        __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "pyfmi\fmi.pyx":7003
 *             if callbacks.log_level >= FMIL.jm_log_level_error:
 *                 _handle_load_fmu_exception(fmu, log_file)
 *                 raise FMUException("The XML-could not be read. "+decode(last_error))             # <<<<<<<<<<<<<<
 *             else:
 *                 _handle_load_fmu_exception(fmu, log_file)
 */
        __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_1 = PyBytes_FromString(__pyx_v_last_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_1));
        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_1));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
        __pyx_t_1 = 0;
        __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
        __pyx_t_5 = PyNumber_Add(((PyObject *)__pyx_kp_s_202), __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        __Pyx_Raise(__pyx_t_5, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L16;
      }
      /*else*/ {

        /* "pyfmi\fmi.pyx":7005
 *                 raise FMUException("The XML-could not be read. "+decode(last_error))
 *             else:
 *                 _handle_load_fmu_exception(fmu, log_file)             # <<<<<<<<<<<<<<
 *                 raise FMUException('The XML-could not be read. Enable logging for possible nore information.')
 * 
 */
        __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s_400); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_v_fmu);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_fmu);
        __Pyx_GIVEREF(__pyx_v_fmu);
        __Pyx_INCREF(__pyx_v_log_file);
        PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_log_file);
        __Pyx_GIVEREF(__pyx_v_log_file);
        __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "pyfmi\fmi.pyx":7006
 *             else:
 *                 _handle_load_fmu_exception(fmu, log_file)
 *                 raise FMUException('The XML-could not be read. Enable logging for possible nore information.')             # <<<<<<<<<<<<<<
 * 
 *         fmu_1_kind = FMIL.fmi1_import_get_fmu_kind(fmu_1)
 */
        __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_405), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L16:;
      goto __pyx_L15;
    }
    __pyx_L15:;

    /* "pyfmi\fmi.pyx":7008
 *                 raise FMUException('The XML-could not be read. Enable logging for possible nore information.')
 * 
 *         fmu_1_kind = FMIL.fmi1_import_get_fmu_kind(fmu_1)             # <<<<<<<<<<<<<<
 * 
 *         #Compare fmu_kind with input-specified kind
 */
    __pyx_v_fmu_1_kind = fmi1_import_get_fmu_kind(__pyx_v_fmu_1);

    /* "pyfmi\fmi.pyx":7011
 * 
 *         #Compare fmu_kind with input-specified kind
 *         if fmu_1_kind == FMI_ME and kind.upper() != 'CS':             # <<<<<<<<<<<<<<
 *             model=FMUModelME1(fmu, path, original_enable_logging, log_file_name,log_level)
 *         elif fmu_1_kind == FMI_CS_STANDALONE and kind.upper() != 'ME':
 */
    __pyx_t_1 = PyInt_FromLong(__pyx_v_fmu_1_kind); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_ME); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_6) {
      __pyx_t_5 = PyObject_GetAttr(__pyx_v_kind, __pyx_n_s__upper); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_n_s__CS), Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = __pyx_t_8;
    } else {
      __pyx_t_7 = __pyx_t_6;
    }
    if (__pyx_t_7) {

      /* "pyfmi\fmi.pyx":7012
 *         #Compare fmu_kind with input-specified kind
 *         if fmu_1_kind == FMI_ME and kind.upper() != 'CS':
 *             model=FMUModelME1(fmu, path, original_enable_logging, log_file_name,log_level)             # <<<<<<<<<<<<<<
 *         elif fmu_1_kind == FMI_CS_STANDALONE and kind.upper() != 'ME':
 *             model=FMUModelCS1(fmu, path, original_enable_logging, log_file_name,log_level)
 */
      __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_v_fmu);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_fmu);
      __Pyx_GIVEREF(__pyx_v_fmu);
      __Pyx_INCREF(__pyx_v_path);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_path);
      __Pyx_GIVEREF(__pyx_v_path);
      __Pyx_INCREF(__pyx_v_original_enable_logging);
      PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_original_enable_logging);
      __Pyx_GIVEREF(__pyx_v_original_enable_logging);
      __Pyx_INCREF(__pyx_v_log_file_name);
      PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_log_file_name);
      __Pyx_GIVEREF(__pyx_v_log_file_name);
      __Pyx_INCREF(__pyx_v_log_level);
      PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_v_log_level);
      __Pyx_GIVEREF(__pyx_v_log_level);
      __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelME1)), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_v_model);
      __pyx_v_model = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L17;
    }

    /* "pyfmi\fmi.pyx":7013
 *         if fmu_1_kind == FMI_ME and kind.upper() != 'CS':
 *             model=FMUModelME1(fmu, path, original_enable_logging, log_file_name,log_level)
 *         elif fmu_1_kind == FMI_CS_STANDALONE and kind.upper() != 'ME':             # <<<<<<<<<<<<<<
 *             model=FMUModelCS1(fmu, path, original_enable_logging, log_file_name,log_level)
 *         elif fmu_1_kind == FMIL.fmi1_fmu_kind_enu_cs_tool:
 */
    __pyx_t_2 = PyInt_FromLong(__pyx_v_fmu_1_kind); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMI_CS_STANDALONE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_7) {
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_kind, __pyx_n_s__upper); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, ((PyObject *)__pyx_n_s__ME), Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = __pyx_t_6;
    } else {
      __pyx_t_8 = __pyx_t_7;
    }
    if (__pyx_t_8) {

      /* "pyfmi\fmi.pyx":7014
 *             model=FMUModelME1(fmu, path, original_enable_logging, log_file_name,log_level)
 *         elif fmu_1_kind == FMI_CS_STANDALONE and kind.upper() != 'ME':
 *             model=FMUModelCS1(fmu, path, original_enable_logging, log_file_name,log_level)             # <<<<<<<<<<<<<<
 *         elif fmu_1_kind == FMIL.fmi1_fmu_kind_enu_cs_tool:
 *             FMIL.fmi1_import_free(fmu_1)
 */
      __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_fmu);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_fmu);
      __Pyx_GIVEREF(__pyx_v_fmu);
      __Pyx_INCREF(__pyx_v_path);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_path);
      __Pyx_GIVEREF(__pyx_v_path);
      __Pyx_INCREF(__pyx_v_original_enable_logging);
      PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_original_enable_logging);
      __Pyx_GIVEREF(__pyx_v_original_enable_logging);
      __Pyx_INCREF(__pyx_v_log_file_name);
      PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_log_file_name);
      __Pyx_GIVEREF(__pyx_v_log_file_name);
      __Pyx_INCREF(__pyx_v_log_level);
      PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_log_level);
      __Pyx_GIVEREF(__pyx_v_log_level);
      __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelCS1)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_v_model);
      __pyx_v_model = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L17;
    }

    /* "pyfmi\fmi.pyx":7015
 *         elif fmu_1_kind == FMI_CS_STANDALONE and kind.upper() != 'ME':
 *             model=FMUModelCS1(fmu, path, original_enable_logging, log_file_name,log_level)
 *         elif fmu_1_kind == FMIL.fmi1_fmu_kind_enu_cs_tool:             # <<<<<<<<<<<<<<
 *             FMIL.fmi1_import_free(fmu_1)
 *             FMIL.fmi_import_free_context(context)
 */
    __pyx_t_8 = (__pyx_v_fmu_1_kind == fmi1_fmu_kind_enu_cs_tool);
    if (__pyx_t_8) {

      /* "pyfmi\fmi.pyx":7016
 *             model=FMUModelCS1(fmu, path, original_enable_logging, log_file_name,log_level)
 *         elif fmu_1_kind == FMIL.fmi1_fmu_kind_enu_cs_tool:
 *             FMIL.fmi1_import_free(fmu_1)             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_free_context(context)
 *             FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)
 */
      fmi1_import_free(__pyx_v_fmu_1);

      /* "pyfmi\fmi.pyx":7017
 *         elif fmu_1_kind == FMIL.fmi1_fmu_kind_enu_cs_tool:
 *             FMIL.fmi1_import_free(fmu_1)
 *             FMIL.fmi_import_free_context(context)             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)
 *             _handle_load_fmu_exception(fmu, log_file)
 */
      fmi_import_free_context(__pyx_v_context);

      /* "pyfmi\fmi.pyx":7018
 *             FMIL.fmi1_import_free(fmu_1)
 *             FMIL.fmi_import_free_context(context)
 *             FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)             # <<<<<<<<<<<<<<
 *             _handle_load_fmu_exception(fmu, log_file)
 *             raise FMUException("PyFMI does not support co-simulation tool")
 */
      __pyx_t_10 = PyBytes_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_10);

      /* "pyfmi\fmi.pyx":7019
 *             FMIL.fmi_import_free_context(context)
 *             FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)
 *             _handle_load_fmu_exception(fmu, log_file)             # <<<<<<<<<<<<<<
 *             raise FMUException("PyFMI does not support co-simulation tool")
 *         else:
 */
      __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s_400); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_fmu);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_fmu);
      __Pyx_GIVEREF(__pyx_v_fmu);
      __Pyx_INCREF(__pyx_v_log_file);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_log_file);
      __Pyx_GIVEREF(__pyx_v_log_file);
      __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pyfmi\fmi.pyx":7020
 *             FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)
 *             _handle_load_fmu_exception(fmu, log_file)
 *             raise FMUException("PyFMI does not support co-simulation tool")             # <<<<<<<<<<<<<<
 *         else:
 *             FMIL.fmi1_import_free(fmu_1)
 */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_407), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L17;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":7022
 *             raise FMUException("PyFMI does not support co-simulation tool")
 *         else:
 *             FMIL.fmi1_import_free(fmu_1)             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_free_context(context)
 *             FMIL.fmi_import_rmdir(&callbacks,fmu_temp_dir)
 */
      fmi1_import_free(__pyx_v_fmu_1);

      /* "pyfmi\fmi.pyx":7023
 *         else:
 *             FMIL.fmi1_import_free(fmu_1)
 *             FMIL.fmi_import_free_context(context)             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_rmdir(&callbacks,fmu_temp_dir)
 *             _handle_load_fmu_exception(fmu, log_file)
 */
      fmi_import_free_context(__pyx_v_context);

      /* "pyfmi\fmi.pyx":7024
 *             FMIL.fmi1_import_free(fmu_1)
 *             FMIL.fmi_import_free_context(context)
 *             FMIL.fmi_import_rmdir(&callbacks,fmu_temp_dir)             # <<<<<<<<<<<<<<
 *             _handle_load_fmu_exception(fmu, log_file)
 *             raise FMUException('FMU is a ' + FMIL.fmi1_fmu_kind_to_string(fmu_1_kind) + ' and not a ' + kind.upper())
 */
      __pyx_t_10 = PyBytes_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_10);

      /* "pyfmi\fmi.pyx":7025
 *             FMIL.fmi_import_free_context(context)
 *             FMIL.fmi_import_rmdir(&callbacks,fmu_temp_dir)
 *             _handle_load_fmu_exception(fmu, log_file)             # <<<<<<<<<<<<<<
 *             raise FMUException('FMU is a ' + FMIL.fmi1_fmu_kind_to_string(fmu_1_kind) + ' and not a ' + kind.upper())
 * 
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_400); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7025; __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 = 7025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_fmu);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_fmu);
      __Pyx_GIVEREF(__pyx_v_fmu);
      __Pyx_INCREF(__pyx_v_log_file);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_log_file);
      __Pyx_GIVEREF(__pyx_v_log_file);
      __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "pyfmi\fmi.pyx":7026
 *             FMIL.fmi_import_rmdir(&callbacks,fmu_temp_dir)
 *             _handle_load_fmu_exception(fmu, log_file)
 *             raise FMUException('FMU is a ' + FMIL.fmi1_fmu_kind_to_string(fmu_1_kind) + ' and not a ' + kind.upper())             # <<<<<<<<<<<<<<
 * 
 *     elif version == FMIL.fmi_version_2_0_enu:
 */
      __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = PyBytes_FromString(fmi1_fmu_kind_to_string(__pyx_v_fmu_1_kind)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __pyx_t_1 = PyNumber_Add(((PyObject *)__pyx_kp_s_408), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_t_2 = PyNumber_Add(__pyx_t_1, ((PyObject *)__pyx_kp_s_409)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_kind, __pyx_n_s__upper); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L17:;
    goto __pyx_L14;
  }

  /* "pyfmi\fmi.pyx":7028
 *             raise FMUException('FMU is a ' + FMIL.fmi1_fmu_kind_to_string(fmu_1_kind) + ' and not a ' + kind.upper())
 * 
 *     elif version == FMIL.fmi_version_2_0_enu:             # <<<<<<<<<<<<<<
 *         #Check fmu-kind and compare with input-specified kind
 *         fmu_2 = FMIL.fmi2_import_parse_xml(context, fmu_temp_dir, NULL)
 */
  __pyx_t_8 = (__pyx_v_version == fmi_version_2_0_enu);
  if (__pyx_t_8) {

    /* "pyfmi\fmi.pyx":7030
 *     elif version == FMIL.fmi_version_2_0_enu:
 *         #Check fmu-kind and compare with input-specified kind
 *         fmu_2 = FMIL.fmi2_import_parse_xml(context, fmu_temp_dir, NULL)             # <<<<<<<<<<<<<<
 * 
 *         if fmu_2 is NULL:
 */
    __pyx_t_10 = PyBytes_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_fmu_2 = fmi2_import_parse_xml(__pyx_v_context, __pyx_t_10, NULL);

    /* "pyfmi\fmi.pyx":7032
 *         fmu_2 = FMIL.fmi2_import_parse_xml(context, fmu_temp_dir, NULL)
 * 
 *         if fmu_2 is NULL:             # <<<<<<<<<<<<<<
 *             #Delete the context
 *             last_error = FMIL.jm_get_last_error(&callbacks)
 */
    __pyx_t_8 = (__pyx_v_fmu_2 == NULL);
    if (__pyx_t_8) {

      /* "pyfmi\fmi.pyx":7034
 *         if fmu_2 is NULL:
 *             #Delete the context
 *             last_error = FMIL.jm_get_last_error(&callbacks)             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_free_context(context)
 *             FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)
 */
      __pyx_v_last_error = jm_get_last_error((&__pyx_v_callbacks));

      /* "pyfmi\fmi.pyx":7035
 *             #Delete the context
 *             last_error = FMIL.jm_get_last_error(&callbacks)
 *             FMIL.fmi_import_free_context(context)             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)
 *             if callbacks.log_level >= FMIL.jm_log_level_error:
 */
      fmi_import_free_context(__pyx_v_context);

      /* "pyfmi\fmi.pyx":7036
 *             last_error = FMIL.jm_get_last_error(&callbacks)
 *             FMIL.fmi_import_free_context(context)
 *             FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)             # <<<<<<<<<<<<<<
 *             if callbacks.log_level >= FMIL.jm_log_level_error:
 *                 _handle_load_fmu_exception(fmu, log_file)
 */
      __pyx_t_10 = PyBytes_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_10);

      /* "pyfmi\fmi.pyx":7037
 *             FMIL.fmi_import_free_context(context)
 *             FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)
 *             if callbacks.log_level >= FMIL.jm_log_level_error:             # <<<<<<<<<<<<<<
 *                 _handle_load_fmu_exception(fmu, log_file)
 *                 raise FMUException("The XML-could not be read. "+decode(last_error))
 */
      __pyx_t_8 = (__pyx_v_callbacks.log_level >= jm_log_level_error);
      if (__pyx_t_8) {

        /* "pyfmi\fmi.pyx":7038
 *             FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)
 *             if callbacks.log_level >= FMIL.jm_log_level_error:
 *                 _handle_load_fmu_exception(fmu, log_file)             # <<<<<<<<<<<<<<
 *                 raise FMUException("The XML-could not be read. "+decode(last_error))
 *             else:
 */
        __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_400); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_v_fmu);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_fmu);
        __Pyx_GIVEREF(__pyx_v_fmu);
        __Pyx_INCREF(__pyx_v_log_file);
        PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_log_file);
        __Pyx_GIVEREF(__pyx_v_log_file);
        __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "pyfmi\fmi.pyx":7039
 *             if callbacks.log_level >= FMIL.jm_log_level_error:
 *                 _handle_load_fmu_exception(fmu, log_file)
 *                 raise FMUException("The XML-could not be read. "+decode(last_error))             # <<<<<<<<<<<<<<
 *             else:
 *                 _handle_load_fmu_exception(fmu, log_file)
 */
        __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_1 = PyBytes_FromString(__pyx_v_last_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_1));
        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
        __pyx_t_1 = 0;
        __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
        __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_kp_s_202), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L19;
      }
      /*else*/ {

        /* "pyfmi\fmi.pyx":7041
 *                 raise FMUException("The XML-could not be read. "+decode(last_error))
 *             else:
 *                 _handle_load_fmu_exception(fmu, log_file)             # <<<<<<<<<<<<<<
 *                 raise FMUException('The XML-could not be read. Enable logging for possible nore information.')
 * 
 */
        __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s_400); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_v_fmu);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_fmu);
        __Pyx_GIVEREF(__pyx_v_fmu);
        __Pyx_INCREF(__pyx_v_log_file);
        PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_log_file);
        __Pyx_GIVEREF(__pyx_v_log_file);
        __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "pyfmi\fmi.pyx":7042
 *             else:
 *                 _handle_load_fmu_exception(fmu, log_file)
 *                 raise FMUException('The XML-could not be read. Enable logging for possible nore information.')             # <<<<<<<<<<<<<<
 * 
 *         fmu_2_kind = FMIL.fmi2_import_get_fmu_kind(fmu_2)
 */
        __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_410), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L19:;
      goto __pyx_L18;
    }
    __pyx_L18:;

    /* "pyfmi\fmi.pyx":7044
 *                 raise FMUException('The XML-could not be read. Enable logging for possible nore information.')
 * 
 *         fmu_2_kind = FMIL.fmi2_import_get_fmu_kind(fmu_2)             # <<<<<<<<<<<<<<
 * 
 *         #FMU kind is unknown
 */
    __pyx_v_fmu_2_kind = fmi2_import_get_fmu_kind(__pyx_v_fmu_2);

    /* "pyfmi\fmi.pyx":7047
 * 
 *         #FMU kind is unknown
 *         if fmu_2_kind == FMIL.fmi2_fmu_kind_unknown:             # <<<<<<<<<<<<<<
 *             last_error = FMIL.jm_get_last_error(&callbacks)
 *             FMIL.fmi2_import_free(fmu_2)
 */
    __pyx_t_8 = (__pyx_v_fmu_2_kind == fmi2_fmu_kind_unknown);
    if (__pyx_t_8) {

      /* "pyfmi\fmi.pyx":7048
 *         #FMU kind is unknown
 *         if fmu_2_kind == FMIL.fmi2_fmu_kind_unknown:
 *             last_error = FMIL.jm_get_last_error(&callbacks)             # <<<<<<<<<<<<<<
 *             FMIL.fmi2_import_free(fmu_2)
 *             FMIL.fmi_import_free_context(context)
 */
      __pyx_v_last_error = jm_get_last_error((&__pyx_v_callbacks));

      /* "pyfmi\fmi.pyx":7049
 *         if fmu_2_kind == FMIL.fmi2_fmu_kind_unknown:
 *             last_error = FMIL.jm_get_last_error(&callbacks)
 *             FMIL.fmi2_import_free(fmu_2)             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_free_context(context)
 *             FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)
 */
      fmi2_import_free(__pyx_v_fmu_2);

      /* "pyfmi\fmi.pyx":7050
 *             last_error = FMIL.jm_get_last_error(&callbacks)
 *             FMIL.fmi2_import_free(fmu_2)
 *             FMIL.fmi_import_free_context(context)             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)
 *             if callbacks.log_level >= FMIL.jm_log_level_error:
 */
      fmi_import_free_context(__pyx_v_context);

      /* "pyfmi\fmi.pyx":7051
 *             FMIL.fmi2_import_free(fmu_2)
 *             FMIL.fmi_import_free_context(context)
 *             FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)             # <<<<<<<<<<<<<<
 *             if callbacks.log_level >= FMIL.jm_log_level_error:
 *                 _handle_load_fmu_exception(fmu, log_file)
 */
      __pyx_t_10 = PyBytes_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_10);

      /* "pyfmi\fmi.pyx":7052
 *             FMIL.fmi_import_free_context(context)
 *             FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)
 *             if callbacks.log_level >= FMIL.jm_log_level_error:             # <<<<<<<<<<<<<<
 *                 _handle_load_fmu_exception(fmu, log_file)
 *                 raise FMUException("The FMU kind could not be determined. "+decode(last_error))
 */
      __pyx_t_8 = (__pyx_v_callbacks.log_level >= jm_log_level_error);
      if (__pyx_t_8) {

        /* "pyfmi\fmi.pyx":7053
 *             FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)
 *             if callbacks.log_level >= FMIL.jm_log_level_error:
 *                 _handle_load_fmu_exception(fmu, log_file)             # <<<<<<<<<<<<<<
 *                 raise FMUException("The FMU kind could not be determined. "+decode(last_error))
 *             else:
 */
        __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_400); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_v_fmu);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_fmu);
        __Pyx_GIVEREF(__pyx_v_fmu);
        __Pyx_INCREF(__pyx_v_log_file);
        PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_log_file);
        __Pyx_GIVEREF(__pyx_v_log_file);
        __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "pyfmi\fmi.pyx":7054
 *             if callbacks.log_level >= FMIL.jm_log_level_error:
 *                 _handle_load_fmu_exception(fmu, log_file)
 *                 raise FMUException("The FMU kind could not be determined. "+decode(last_error))             # <<<<<<<<<<<<<<
 *             else:
 *                 _handle_load_fmu_exception(fmu, log_file)
 */
        __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_1 = PyBytes_FromString(__pyx_v_last_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_1));
        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
        __pyx_t_1 = 0;
        __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
        __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_kp_s_205), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7054; __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;
        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L21;
      }
      /*else*/ {

        /* "pyfmi\fmi.pyx":7056
 *                 raise FMUException("The FMU kind could not be determined. "+decode(last_error))
 *             else:
 *                 _handle_load_fmu_exception(fmu, log_file)             # <<<<<<<<<<<<<<
 *                 raise FMUException("The FMU kind could not be determined. Enable logging for possibly more information.")
 * 
 */
        __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s_400); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_v_fmu);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_fmu);
        __Pyx_GIVEREF(__pyx_v_fmu);
        __Pyx_INCREF(__pyx_v_log_file);
        PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_log_file);
        __Pyx_GIVEREF(__pyx_v_log_file);
        __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 = 7056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "pyfmi\fmi.pyx":7057
 *             else:
 *                 _handle_load_fmu_exception(fmu, log_file)
 *                 raise FMUException("The FMU kind could not be determined. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 * 
 *         #FMU kind is known
 */
        __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_411), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L21:;
      goto __pyx_L20;
    }
    __pyx_L20:;

    /* "pyfmi\fmi.pyx":7060
 * 
 *         #FMU kind is known
 *         if kind.lower() == 'auto':             # <<<<<<<<<<<<<<
 *             if fmu_2_kind == FMIL.fmi2_fmu_kind_cs:
 *                 model = FMUModelCS2(fmu, path, original_enable_logging, log_file_name,log_level)
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_kind, __pyx_n_s__lower); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7060; __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 = 7060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_n_s__auto), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_8) {

      /* "pyfmi\fmi.pyx":7061
 *         #FMU kind is known
 *         if kind.lower() == 'auto':
 *             if fmu_2_kind == FMIL.fmi2_fmu_kind_cs:             # <<<<<<<<<<<<<<
 *                 model = FMUModelCS2(fmu, path, original_enable_logging, log_file_name,log_level)
 *             elif fmu_2_kind == FMIL.fmi2_fmu_kind_me or fmu_2_kind == FMIL.fmi2_fmu_kind_me_and_cs:
 */
      __pyx_t_8 = (__pyx_v_fmu_2_kind == fmi2_fmu_kind_cs);
      if (__pyx_t_8) {

        /* "pyfmi\fmi.pyx":7062
 *         if kind.lower() == 'auto':
 *             if fmu_2_kind == FMIL.fmi2_fmu_kind_cs:
 *                 model = FMUModelCS2(fmu, path, original_enable_logging, log_file_name,log_level)             # <<<<<<<<<<<<<<
 *             elif fmu_2_kind == FMIL.fmi2_fmu_kind_me or fmu_2_kind == FMIL.fmi2_fmu_kind_me_and_cs:
 *                 model = FMUModelME2(fmu, path, original_enable_logging, log_file_name,log_level)
 */
        __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_v_fmu);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_fmu);
        __Pyx_GIVEREF(__pyx_v_fmu);
        __Pyx_INCREF(__pyx_v_path);
        PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_path);
        __Pyx_GIVEREF(__pyx_v_path);
        __Pyx_INCREF(__pyx_v_original_enable_logging);
        PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_original_enable_logging);
        __Pyx_GIVEREF(__pyx_v_original_enable_logging);
        __Pyx_INCREF(__pyx_v_log_file_name);
        PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_log_file_name);
        __Pyx_GIVEREF(__pyx_v_log_file_name);
        __Pyx_INCREF(__pyx_v_log_level);
        PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_log_level);
        __Pyx_GIVEREF(__pyx_v_log_level);
        __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelCS2)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_v_model);
        __pyx_v_model = __pyx_t_2;
        __pyx_t_2 = 0;
        goto __pyx_L23;
      }

      /* "pyfmi\fmi.pyx":7063
 *             if fmu_2_kind == FMIL.fmi2_fmu_kind_cs:
 *                 model = FMUModelCS2(fmu, path, original_enable_logging, log_file_name,log_level)
 *             elif fmu_2_kind == FMIL.fmi2_fmu_kind_me or fmu_2_kind == FMIL.fmi2_fmu_kind_me_and_cs:             # <<<<<<<<<<<<<<
 *                 model = FMUModelME2(fmu, path, original_enable_logging, log_file_name,log_level)
 *         elif kind.upper() == 'CS':
 */
      __pyx_t_8 = (__pyx_v_fmu_2_kind == fmi2_fmu_kind_me);
      if (!__pyx_t_8) {
        __pyx_t_7 = (__pyx_v_fmu_2_kind == fmi2_fmu_kind_me_and_cs);
        __pyx_t_6 = __pyx_t_7;
      } else {
        __pyx_t_6 = __pyx_t_8;
      }
      if (__pyx_t_6) {

        /* "pyfmi\fmi.pyx":7064
 *                 model = FMUModelCS2(fmu, path, original_enable_logging, log_file_name,log_level)
 *             elif fmu_2_kind == FMIL.fmi2_fmu_kind_me or fmu_2_kind == FMIL.fmi2_fmu_kind_me_and_cs:
 *                 model = FMUModelME2(fmu, path, original_enable_logging, log_file_name,log_level)             # <<<<<<<<<<<<<<
 *         elif kind.upper() == 'CS':
 *             if fmu_2_kind == FMIL.fmi2_fmu_kind_cs or fmu_2_kind == FMIL.fmi2_fmu_kind_me_and_cs:
 */
        __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_v_fmu);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_fmu);
        __Pyx_GIVEREF(__pyx_v_fmu);
        __Pyx_INCREF(__pyx_v_path);
        PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_path);
        __Pyx_GIVEREF(__pyx_v_path);
        __Pyx_INCREF(__pyx_v_original_enable_logging);
        PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_original_enable_logging);
        __Pyx_GIVEREF(__pyx_v_original_enable_logging);
        __Pyx_INCREF(__pyx_v_log_file_name);
        PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_log_file_name);
        __Pyx_GIVEREF(__pyx_v_log_file_name);
        __Pyx_INCREF(__pyx_v_log_level);
        PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_log_level);
        __Pyx_GIVEREF(__pyx_v_log_level);
        __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelME2)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_v_model);
        __pyx_v_model = __pyx_t_1;
        __pyx_t_1 = 0;
        goto __pyx_L23;
      }
      __pyx_L23:;
      goto __pyx_L22;
    }

    /* "pyfmi\fmi.pyx":7065
 *             elif fmu_2_kind == FMIL.fmi2_fmu_kind_me or fmu_2_kind == FMIL.fmi2_fmu_kind_me_and_cs:
 *                 model = FMUModelME2(fmu, path, original_enable_logging, log_file_name,log_level)
 *         elif kind.upper() == 'CS':             # <<<<<<<<<<<<<<
 *             if fmu_2_kind == FMIL.fmi2_fmu_kind_cs or fmu_2_kind == FMIL.fmi2_fmu_kind_me_and_cs:
 *                 model = FMUModelCS2(fmu, path, original_enable_logging, log_file_name,log_level)
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_kind, __pyx_n_s__upper); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7065; __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 = 7065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_n_s__CS), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_6) {

      /* "pyfmi\fmi.pyx":7066
 *                 model = FMUModelME2(fmu, path, original_enable_logging, log_file_name,log_level)
 *         elif kind.upper() == 'CS':
 *             if fmu_2_kind == FMIL.fmi2_fmu_kind_cs or fmu_2_kind == FMIL.fmi2_fmu_kind_me_and_cs:             # <<<<<<<<<<<<<<
 *                 model = FMUModelCS2(fmu, path, original_enable_logging, log_file_name,log_level)
 *         elif kind.upper() == 'ME':
 */
      __pyx_t_6 = (__pyx_v_fmu_2_kind == fmi2_fmu_kind_cs);
      if (!__pyx_t_6) {
        __pyx_t_8 = (__pyx_v_fmu_2_kind == fmi2_fmu_kind_me_and_cs);
        __pyx_t_7 = __pyx_t_8;
      } else {
        __pyx_t_7 = __pyx_t_6;
      }
      if (__pyx_t_7) {

        /* "pyfmi\fmi.pyx":7067
 *         elif kind.upper() == 'CS':
 *             if fmu_2_kind == FMIL.fmi2_fmu_kind_cs or fmu_2_kind == FMIL.fmi2_fmu_kind_me_and_cs:
 *                 model = FMUModelCS2(fmu, path, original_enable_logging, log_file_name,log_level)             # <<<<<<<<<<<<<<
 *         elif kind.upper() == 'ME':
 *             if fmu_2_kind == FMIL.fmi2_fmu_kind_me or fmu_2_kind == FMIL.fmi2_fmu_kind_me_and_cs:
 */
        __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_v_fmu);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_fmu);
        __Pyx_GIVEREF(__pyx_v_fmu);
        __Pyx_INCREF(__pyx_v_path);
        PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_path);
        __Pyx_GIVEREF(__pyx_v_path);
        __Pyx_INCREF(__pyx_v_original_enable_logging);
        PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_original_enable_logging);
        __Pyx_GIVEREF(__pyx_v_original_enable_logging);
        __Pyx_INCREF(__pyx_v_log_file_name);
        PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_log_file_name);
        __Pyx_GIVEREF(__pyx_v_log_file_name);
        __Pyx_INCREF(__pyx_v_log_level);
        PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_log_level);
        __Pyx_GIVEREF(__pyx_v_log_level);
        __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelCS2)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_v_model);
        __pyx_v_model = __pyx_t_2;
        __pyx_t_2 = 0;
        goto __pyx_L24;
      }
      __pyx_L24:;
      goto __pyx_L22;
    }

    /* "pyfmi\fmi.pyx":7068
 *             if fmu_2_kind == FMIL.fmi2_fmu_kind_cs or fmu_2_kind == FMIL.fmi2_fmu_kind_me_and_cs:
 *                 model = FMUModelCS2(fmu, path, original_enable_logging, log_file_name,log_level)
 *         elif kind.upper() == 'ME':             # <<<<<<<<<<<<<<
 *             if fmu_2_kind == FMIL.fmi2_fmu_kind_me or fmu_2_kind == FMIL.fmi2_fmu_kind_me_and_cs:
 *                 model = FMUModelME2(fmu, path, original_enable_logging, log_file_name,log_level)
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_kind, __pyx_n_s__upper); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7068; __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 = 7068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, ((PyObject *)__pyx_n_s__ME), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_7) {

      /* "pyfmi\fmi.pyx":7069
 *                 model = FMUModelCS2(fmu, path, original_enable_logging, log_file_name,log_level)
 *         elif kind.upper() == 'ME':
 *             if fmu_2_kind == FMIL.fmi2_fmu_kind_me or fmu_2_kind == FMIL.fmi2_fmu_kind_me_and_cs:             # <<<<<<<<<<<<<<
 *                 model = FMUModelME2(fmu, path, original_enable_logging, log_file_name,log_level)
 * 
 */
      __pyx_t_7 = (__pyx_v_fmu_2_kind == fmi2_fmu_kind_me);
      if (!__pyx_t_7) {
        __pyx_t_6 = (__pyx_v_fmu_2_kind == fmi2_fmu_kind_me_and_cs);
        __pyx_t_8 = __pyx_t_6;
      } else {
        __pyx_t_8 = __pyx_t_7;
      }
      if (__pyx_t_8) {

        /* "pyfmi\fmi.pyx":7070
 *         elif kind.upper() == 'ME':
 *             if fmu_2_kind == FMIL.fmi2_fmu_kind_me or fmu_2_kind == FMIL.fmi2_fmu_kind_me_and_cs:
 *                 model = FMUModelME2(fmu, path, original_enable_logging, log_file_name,log_level)             # <<<<<<<<<<<<<<
 * 
 *         #Could not match FMU kind with input-specified kind
 */
        __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_v_fmu);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_fmu);
        __Pyx_GIVEREF(__pyx_v_fmu);
        __Pyx_INCREF(__pyx_v_path);
        PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_path);
        __Pyx_GIVEREF(__pyx_v_path);
        __Pyx_INCREF(__pyx_v_original_enable_logging);
        PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_original_enable_logging);
        __Pyx_GIVEREF(__pyx_v_original_enable_logging);
        __Pyx_INCREF(__pyx_v_log_file_name);
        PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_log_file_name);
        __Pyx_GIVEREF(__pyx_v_log_file_name);
        __Pyx_INCREF(__pyx_v_log_level);
        PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_log_level);
        __Pyx_GIVEREF(__pyx_v_log_level);
        __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pyfmi_3fmi_FMUModelME2)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_v_model);
        __pyx_v_model = __pyx_t_1;
        __pyx_t_1 = 0;
        goto __pyx_L25;
      }
      __pyx_L25:;
      goto __pyx_L22;
    }
    __pyx_L22:;

    /* "pyfmi\fmi.pyx":7073
 * 
 *         #Could not match FMU kind with input-specified kind
 *         if model is None:             # <<<<<<<<<<<<<<
 *             FMIL.fmi2_import_free(fmu_2)
 *             FMIL.fmi_import_free_context(context)
 */
    __pyx_t_8 = (__pyx_v_model == Py_None);
    if (__pyx_t_8) {

      /* "pyfmi\fmi.pyx":7074
 *         #Could not match FMU kind with input-specified kind
 *         if model is None:
 *             FMIL.fmi2_import_free(fmu_2)             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_free_context(context)
 *             FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)
 */
      fmi2_import_free(__pyx_v_fmu_2);

      /* "pyfmi\fmi.pyx":7075
 *         if model is None:
 *             FMIL.fmi2_import_free(fmu_2)
 *             FMIL.fmi_import_free_context(context)             # <<<<<<<<<<<<<<
 *             FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)
 *             _handle_load_fmu_exception(fmu, log_file)
 */
      fmi_import_free_context(__pyx_v_context);

      /* "pyfmi\fmi.pyx":7076
 *             FMIL.fmi2_import_free(fmu_2)
 *             FMIL.fmi_import_free_context(context)
 *             FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)             # <<<<<<<<<<<<<<
 *             _handle_load_fmu_exception(fmu, log_file)
 *             raise FMUException('FMU is a ' + FMIL.fmi2_fmu_kind_to_string(fmu_2_kind) + ' and not a ' + kind.upper())
 */
      __pyx_t_10 = PyBytes_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_10);

      /* "pyfmi\fmi.pyx":7077
 *             FMIL.fmi_import_free_context(context)
 *             FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)
 *             _handle_load_fmu_exception(fmu, log_file)             # <<<<<<<<<<<<<<
 *             raise FMUException('FMU is a ' + FMIL.fmi2_fmu_kind_to_string(fmu_2_kind) + ' and not a ' + kind.upper())
 * 
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_400); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7077; __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 = 7077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_fmu);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_fmu);
      __Pyx_GIVEREF(__pyx_v_fmu);
      __Pyx_INCREF(__pyx_v_log_file);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_log_file);
      __Pyx_GIVEREF(__pyx_v_log_file);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "pyfmi\fmi.pyx":7078
 *             FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)
 *             _handle_load_fmu_exception(fmu, log_file)
 *             raise FMUException('FMU is a ' + FMIL.fmi2_fmu_kind_to_string(fmu_2_kind) + ' and not a ' + kind.upper())             # <<<<<<<<<<<<<<
 * 
 *     else:
 */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyBytes_FromString(fmi2_fmu_kind_to_string(__pyx_v_fmu_2_kind)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __pyx_t_1 = PyNumber_Add(((PyObject *)__pyx_kp_s_408), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_t_2 = PyNumber_Add(__pyx_t_1, ((PyObject *)__pyx_kp_s_409)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_kind, __pyx_n_s__upper); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L26;
    }
    __pyx_L26:;
    goto __pyx_L14;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":7084
 * 
 *         #Delete the context
 *         last_error = FMIL.jm_get_last_error(&callbacks)             # <<<<<<<<<<<<<<
 *         FMIL.fmi_import_free_context(context)
 *         FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)
 */
    __pyx_v_last_error = jm_get_last_error((&__pyx_v_callbacks));

    /* "pyfmi\fmi.pyx":7085
 *         #Delete the context
 *         last_error = FMIL.jm_get_last_error(&callbacks)
 *         FMIL.fmi_import_free_context(context)             # <<<<<<<<<<<<<<
 *         FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)
 *         if callbacks.log_level >= FMIL.jm_log_level_error:
 */
    fmi_import_free_context(__pyx_v_context);

    /* "pyfmi\fmi.pyx":7086
 *         last_error = FMIL.jm_get_last_error(&callbacks)
 *         FMIL.fmi_import_free_context(context)
 *         FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)             # <<<<<<<<<<<<<<
 *         if callbacks.log_level >= FMIL.jm_log_level_error:
 *             _handle_load_fmu_exception(fmu, log_file)
 */
    __pyx_t_10 = PyBytes_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_10);

    /* "pyfmi\fmi.pyx":7087
 *         FMIL.fmi_import_free_context(context)
 *         FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)
 *         if callbacks.log_level >= FMIL.jm_log_level_error:             # <<<<<<<<<<<<<<
 *             _handle_load_fmu_exception(fmu, log_file)
 *             raise FMUException("The FMU version is not found. "+decode(last_error))
 */
    __pyx_t_8 = (__pyx_v_callbacks.log_level >= jm_log_level_error);
    if (__pyx_t_8) {

      /* "pyfmi\fmi.pyx":7088
 *         FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)
 *         if callbacks.log_level >= FMIL.jm_log_level_error:
 *             _handle_load_fmu_exception(fmu, log_file)             # <<<<<<<<<<<<<<
 *             raise FMUException("The FMU version is not found. "+decode(last_error))
 *         else:
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_400); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_v_fmu);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_fmu);
      __Pyx_GIVEREF(__pyx_v_fmu);
      __Pyx_INCREF(__pyx_v_log_file);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_log_file);
      __Pyx_GIVEREF(__pyx_v_log_file);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "pyfmi\fmi.pyx":7089
 *         if callbacks.log_level >= FMIL.jm_log_level_error:
 *             _handle_load_fmu_exception(fmu, log_file)
 *             raise FMUException("The FMU version is not found. "+decode(last_error))             # <<<<<<<<<<<<<<
 *         else:
 *             _handle_load_fmu_exception(fmu, log_file)
 */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__decode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = PyBytes_FromString(__pyx_v_last_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
      __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_kp_s_412), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __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 = 7089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L27;
    }
    /*else*/ {

      /* "pyfmi\fmi.pyx":7091
 *             raise FMUException("The FMU version is not found. "+decode(last_error))
 *         else:
 *             _handle_load_fmu_exception(fmu, log_file)             # <<<<<<<<<<<<<<
 *             raise FMUException("The FMU version is not found. Enable logging for possibly more information.")
 * 
 */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s_400); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_fmu);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_fmu);
      __Pyx_GIVEREF(__pyx_v_fmu);
      __Pyx_INCREF(__pyx_v_log_file);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_log_file);
      __Pyx_GIVEREF(__pyx_v_log_file);
      __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7091; __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;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "pyfmi\fmi.pyx":7092
 *         else:
 *             _handle_load_fmu_exception(fmu, log_file)
 *             raise FMUException("The FMU version is not found. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 * 
 *     #Delete
 */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FMUException); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_414), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L27:;
  }
  __pyx_L14:;

  /* "pyfmi\fmi.pyx":7095
 * 
 *     #Delete
 *     if version == FMIL.fmi_version_1_enu:             # <<<<<<<<<<<<<<
 *         FMIL.fmi1_import_free(fmu_1)
 *         FMIL.fmi_import_free_context(context)
 */
  __pyx_t_8 = (__pyx_v_version == fmi_version_1_enu);
  if (__pyx_t_8) {

    /* "pyfmi\fmi.pyx":7096
 *     #Delete
 *     if version == FMIL.fmi_version_1_enu:
 *         FMIL.fmi1_import_free(fmu_1)             # <<<<<<<<<<<<<<
 *         FMIL.fmi_import_free_context(context)
 *         FMIL.fmi_import_rmdir(&callbacks,fmu_temp_dir)
 */
    fmi1_import_free(__pyx_v_fmu_1);

    /* "pyfmi\fmi.pyx":7097
 *     if version == FMIL.fmi_version_1_enu:
 *         FMIL.fmi1_import_free(fmu_1)
 *         FMIL.fmi_import_free_context(context)             # <<<<<<<<<<<<<<
 *         FMIL.fmi_import_rmdir(&callbacks,fmu_temp_dir)
 * 
 */
    fmi_import_free_context(__pyx_v_context);

    /* "pyfmi\fmi.pyx":7098
 *         FMIL.fmi1_import_free(fmu_1)
 *         FMIL.fmi_import_free_context(context)
 *         FMIL.fmi_import_rmdir(&callbacks,fmu_temp_dir)             # <<<<<<<<<<<<<<
 * 
 *     if version == FMIL.fmi_version_2_0_enu:
 */
    __pyx_t_10 = PyBytes_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_10);
    goto __pyx_L28;
  }
  __pyx_L28:;

  /* "pyfmi\fmi.pyx":7100
 *         FMIL.fmi_import_rmdir(&callbacks,fmu_temp_dir)
 * 
 *     if version == FMIL.fmi_version_2_0_enu:             # <<<<<<<<<<<<<<
 *         FMIL.fmi2_import_free(fmu_2)
 *         FMIL.fmi_import_free_context(context)
 */
  __pyx_t_8 = (__pyx_v_version == fmi_version_2_0_enu);
  if (__pyx_t_8) {

    /* "pyfmi\fmi.pyx":7101
 * 
 *     if version == FMIL.fmi_version_2_0_enu:
 *         FMIL.fmi2_import_free(fmu_2)             # <<<<<<<<<<<<<<
 *         FMIL.fmi_import_free_context(context)
 *         FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)
 */
    fmi2_import_free(__pyx_v_fmu_2);

    /* "pyfmi\fmi.pyx":7102
 *     if version == FMIL.fmi_version_2_0_enu:
 *         FMIL.fmi2_import_free(fmu_2)
 *         FMIL.fmi_import_free_context(context)             # <<<<<<<<<<<<<<
 *         FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)
 * 
 */
    fmi_import_free_context(__pyx_v_context);

    /* "pyfmi\fmi.pyx":7103
 *         FMIL.fmi2_import_free(fmu_2)
 *         FMIL.fmi_import_free_context(context)
 *         FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)             # <<<<<<<<<<<<<<
 * 
 *     #Delete log file
 */
    __pyx_t_10 = PyBytes_AsString(__pyx_v_fmu_temp_dir); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    fmi_import_rmdir((&__pyx_v_callbacks), __pyx_t_10);
    goto __pyx_L29;
  }
  __pyx_L29:;

  /* "pyfmi\fmi.pyx":7106
 * 
 *     #Delete log file
 *     delete_temp_file(log_file)             # <<<<<<<<<<<<<<
 *     FMIL.free(log_file_c)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__delete_temp_file); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_log_file);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_log_file);
  __Pyx_GIVEREF(__pyx_v_log_file);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":7107
 *     #Delete log file
 *     delete_temp_file(log_file)
 *     FMIL.free(log_file_c)             # <<<<<<<<<<<<<<
 * 
 *     return model
 */
  free(__pyx_v_log_file_c);

  /* "pyfmi\fmi.pyx":7109
 *     FMIL.free(log_file_c)
 * 
 *     return model             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_model);
  __pyx_r = __pyx_v_model;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyfmi.fmi.load_fmu", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fmu_temp_dir);
  __Pyx_XDECREF(__pyx_v_model);
  __Pyx_XDECREF(__pyx_v_log_file);
  __Pyx_XDECREF(__pyx_v_fmu_full_path);
  __Pyx_XDECREF(__pyx_v_original_enable_logging);
  __Pyx_XDECREF(__pyx_v_enable_logging);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* 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):             # <<<<<<<<<<<<<<
 *             # This implementation of getbuffer is geared towards Cython
 *             # requirements, and does not yet fullfill the PEP.
 */

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;
  int __pyx_v_endian_detector;
  int __pyx_v_little_endian;
  int __pyx_v_t;
  char *__pyx_v_f;
  PyArray_Descr *__pyx_v_descr = 0;
  int __pyx_v_offset;
  int __pyx_v_hasfields;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  char *__pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __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":200
 *             # of flags
 * 
 *             if info == NULL: return             # <<<<<<<<<<<<<<
 * 
 *             cdef int copy_shape, i, ndim
 */
  __pyx_t_1 = (__pyx_v_info == NULL);
  if (__pyx_t_1) {
    __pyx_r = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "numpy.pxd":203
 * 
 *             cdef int copy_shape, i, ndim
 *             cdef int endian_detector = 1             # <<<<<<<<<<<<<<
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 * 
 */
  __pyx_v_endian_detector = 1;

  /* "numpy.pxd":204
 *             cdef int copy_shape, i, ndim
 *             cdef int endian_detector = 1
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
 * 
 *             ndim = PyArray_NDIM(self)
 */
  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);

  /* "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(__pyx_v_self);

  /* "numpy.pxd":208
 *             ndim = PyArray_NDIM(self)
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 copy_shape = 1
 *             else:
 */
  __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t)));
  if (__pyx_t_1) {

    /* "numpy.pxd":209
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 copy_shape = 1             # <<<<<<<<<<<<<<
 *             else:
 *                 copy_shape = 0
 */
    __pyx_v_copy_shape = 1;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "numpy.pxd":211
 *                 copy_shape = 1
 *             else:
 *                 copy_shape = 0             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 */
    __pyx_v_copy_shape = 0;
  }
  __pyx_L4:;

  /* "numpy.pxd":213
 *                 copy_shape = 0
 * 
 *             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_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS);
  if (__pyx_t_1) {

    /* "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(__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":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_416), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __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[2]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "numpy.pxd":217
 *                 raise ValueError(u"ndarray is not C contiguous")
 * 
 *             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_3 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS);
  if (__pyx_t_3) {

    /* "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(__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":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_418), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __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[2]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "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(__pyx_v_self);

  /* "numpy.pxd":222
 * 
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim             # <<<<<<<<<<<<<<
 *             if copy_shape:
 *                 # Allocate new buffer for strides and shape info.
 */
  __pyx_v_info->ndim = __pyx_v_ndim;

  /* "numpy.pxd":223
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim
 *             if copy_shape:             # <<<<<<<<<<<<<<
 *                 # Allocate new buffer for strides and shape info.
 *                 # This is allocated as one block, strides first.
 */
  if (__pyx_v_copy_shape) {

    /* "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)             # <<<<<<<<<<<<<<
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):
 */
    __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));

    /* "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             # <<<<<<<<<<<<<<
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 */
    __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);

    /* "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):             # <<<<<<<<<<<<<<
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 */
    __pyx_t_5 = __pyx_v_ndim;
    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
      __pyx_v_i = __pyx_t_6;

      /* "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(__pyx_v_self)[__pyx_v_i]);

      /* "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(__pyx_v_self)[__pyx_v_i]);
    }
    goto __pyx_L7;
  }
  /*else*/ {

    /* "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(__pyx_v_self));

    /* "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(__pyx_v_self));
  }
  __pyx_L7:;

  /* "numpy.pxd":234
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 *                 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->suboffsets = NULL;

  /* "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(__pyx_v_self);

  /* "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(__pyx_v_self));

  /* "numpy.pxd":239
 * 
 *             cdef int t
 *             cdef char* f = NULL             # <<<<<<<<<<<<<<
 *             cdef dtype descr = self.descr
 *             cdef list stack
 */
  __pyx_v_f = NULL;

  /* "numpy.pxd":240
 *             cdef int t
 *             cdef char* f = NULL
 *             cdef dtype descr = self.descr             # <<<<<<<<<<<<<<
 *             cdef list stack
 *             cdef int offset
 */
  __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":244
 *             cdef int offset
 * 
 *             cdef bint hasfields = PyDataType_HASFIELDS(descr)             # <<<<<<<<<<<<<<
 * 
 *             if not hasfields and not copy_shape:
 */
  __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);

  /* "numpy.pxd":246
 *             cdef bint hasfields = PyDataType_HASFIELDS(descr)
 * 
 *             if not hasfields and not copy_shape:             # <<<<<<<<<<<<<<
 *                 # do not call releasebuffer
 *                 info.obj = None
 */
  __pyx_t_2 = (!__pyx_v_hasfields);
  if (__pyx_t_2) {
    __pyx_t_3 = (!__pyx_v_copy_shape);
    __pyx_t_1 = __pyx_t_3;
  } else {
    __pyx_t_1 = __pyx_t_2;
  }
  if (__pyx_t_1) {

    /* "numpy.pxd":248
 *             if not hasfields and not copy_shape:
 *                 # do not call releasebuffer
 *                 info.obj = None             # <<<<<<<<<<<<<<
 *             else:
 *                 # need to call releasebuffer
 */
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj);
    __pyx_v_info->obj = Py_None;
    goto __pyx_L10;
  }
  /*else*/ {

    /* "numpy.pxd":251
 *             else:
 *                 # need to call releasebuffer
 *                 info.obj = self             # <<<<<<<<<<<<<<
 * 
 *             if not hasfields:
 */
    __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 = ((PyObject *)__pyx_v_self);
  }
  __pyx_L10:;

  /* "numpy.pxd":253
 *                 info.obj = self
 * 
 *             if not hasfields:             # <<<<<<<<<<<<<<
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or
 */
  __pyx_t_1 = (!__pyx_v_hasfields);
  if (__pyx_t_1) {

    /* "numpy.pxd":254
 * 
 *             if not hasfields:
 *                 t = descr.type_num             # <<<<<<<<<<<<<<
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):
 */
    __pyx_t_5 = __pyx_v_descr->type_num;
    __pyx_v_t = __pyx_t_5;

    /* "numpy.pxd":255
 *             if not hasfields:
 *                 t = descr.type_num
 *                 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 == '>');
    if (__pyx_t_1) {
      __pyx_t_2 = __pyx_v_little_endian;
    } else {
      __pyx_t_2 = __pyx_t_1;
    }
    if (!__pyx_t_2) {

      /* "numpy.pxd":256
 *                 t = descr.type_num
 *                 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"
 */
      __pyx_t_1 = (__pyx_v_descr->byteorder == '<');
      if (__pyx_t_1) {
        __pyx_t_3 = (!__pyx_v_little_endian);
        __pyx_t_7 = __pyx_t_3;
      } else {
        __pyx_t_7 = __pyx_t_1;
      }
      __pyx_t_1 = __pyx_t_7;
    } else {
      __pyx_t_1 = __pyx_t_2;
    }
    if (__pyx_t_1) {

      /* "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_420), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __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[2]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L12;
    }
    __pyx_L12:;

    /* "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"
 *                 elif t == NPY_SHORT:       f = "h"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_BYTE);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__b;
      goto __pyx_L13;
    }

    /* "numpy.pxd":259
 *                     raise ValueError(u"Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_UBYTE);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__B;
      goto __pyx_L13;
    }

    /* "numpy.pxd":260
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_SHORT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__h;
      goto __pyx_L13;
    }

    /* "numpy.pxd":261
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_USHORT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__H;
      goto __pyx_L13;
    }

    /* "numpy.pxd":262
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_INT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__i;
      goto __pyx_L13;
    }

    /* "numpy.pxd":263
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_UINT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__I;
      goto __pyx_L13;
    }

    /* "numpy.pxd":264
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_LONG);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__l;
      goto __pyx_L13;
    }

    /* "numpy.pxd":265
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_ULONG);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__L;
      goto __pyx_L13;
    }

    /* "numpy.pxd":266
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_LONGLONG);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__q;
      goto __pyx_L13;
    }

    /* "numpy.pxd":267
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_ULONGLONG);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__Q;
      goto __pyx_L13;
    }

    /* "numpy.pxd":268
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_FLOAT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__f;
      goto __pyx_L13;
    }

    /* "numpy.pxd":269
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_DOUBLE);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__d;
      goto __pyx_L13;
    }

    /* "numpy.pxd":270
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_LONGDOUBLE);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__g;
      goto __pyx_L13;
    }

    /* "numpy.pxd":271
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_CFLOAT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__Zf;
      goto __pyx_L13;
    }

    /* "numpy.pxd":272
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 *                 elif t == NPY_OBJECT:      f = "O"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_CDOUBLE);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__Zd;
      goto __pyx_L13;
    }

    /* "numpy.pxd":273
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_OBJECT:      f = "O"
 *                 else:
 */
    __pyx_t_1 = (__pyx_v_t == NPY_CLONGDOUBLE);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__Zg;
      goto __pyx_L13;
    }

    /* "numpy.pxd":274
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 */
    __pyx_t_1 = (__pyx_v_t == NPY_OBJECT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__O;
      goto __pyx_L13;
    }
    /*else*/ {

      /* "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[2]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_421), __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __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[2]; __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[2]; __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[2]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L13:;

    /* "numpy.pxd":277
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *                 info.format = f             # <<<<<<<<<<<<<<
 *                 return
 *             else:
 */
    __pyx_v_info->format = __pyx_v_f;

    /* "numpy.pxd":278
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *                 info.format = f
 *                 return             # <<<<<<<<<<<<<<
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 */
    __pyx_r = 0;
    goto __pyx_L0;
    goto __pyx_L11;
  }
  /*else*/ {

    /* "numpy.pxd":280
 *                 return
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)             # <<<<<<<<<<<<<<
 *                 info.format[0] = c'^' # Native data types, manual alignment
 *                 offset = 0
 */
    __pyx_v_info->format = ((char *)malloc(255));

    /* "numpy.pxd":281
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 *                 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":282
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 *                 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":285
 *                 f = _util_dtypestring(descr, info.format + 1,
 *                                       info.format + _buffer_format_string_len,
 *                                       &offset)             # <<<<<<<<<<<<<<
 *                 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[2]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_f = __pyx_t_9;

    /* "numpy.pxd":286
 *                                       info.format + _buffer_format_string_len,
 *                                       &offset)
 *                 f[0] = c'\0' # Terminate format string             # <<<<<<<<<<<<<<
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 */
    (__pyx_v_f[0]) = '\x00';
  }
  __pyx_L11:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) {
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
  }
  goto __pyx_L2;
  __pyx_L0:;
  if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
    __Pyx_GOTREF(Py_None);
    __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
  }
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_descr);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* 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 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__", 0);

  /* "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(__pyx_v_self);
  if (__pyx_t_1) {

    /* "numpy.pxd":290
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)             # <<<<<<<<<<<<<<
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 stdlib.free(info.strides)
 */
    free(__pyx_v_info->format);
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "numpy.pxd":291
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 stdlib.free(info.strides)
 *                 # info.shape was stored after info.strides in the same block
 */
  __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t)));
  if (__pyx_t_1) {

    /* "numpy.pxd":292
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 stdlib.free(info.strides)             # <<<<<<<<<<<<<<
 *                 # info.shape was stored after info.strides in the same block
 * 
 */
    free(__pyx_v_info->strides);
    goto __pyx_L4;
  }
  __pyx_L4:;

  __Pyx_RefNannyFinishContext();
}

/* "numpy.pxd":768
 * ctypedef npy_cdouble     complex_t
 * 
 * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
  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("PyArray_MultiIterNew1", 0);

  /* "numpy.pxd":769
 * 
 * cdef inline object PyArray_MultiIterNew1(a):
 *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
 * 
 * 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[2]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "numpy.pxd":771
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  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("PyArray_MultiIterNew2", 0);

  /* "numpy.pxd":772
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
 * 
 * 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[2]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "numpy.pxd":774
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
  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("PyArray_MultiIterNew3", 0);

  /* "numpy.pxd":775
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
 * 
 * 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[2]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "numpy.pxd":777
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
  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("PyArray_MultiIterNew4", 0);

  /* "numpy.pxd":778
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
 * 
 * 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[2]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "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):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
  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("PyArray_MultiIterNew5", 0);

  /* "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)             # <<<<<<<<<<<<<<
 * 
 * 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[2]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "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:             # <<<<<<<<<<<<<<
 *     # Recursive utility function used in __getbuffer__ to get format
 *     # string. The new location in the format string is returned.
 */

static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
  PyArray_Descr *__pyx_v_child = 0;
  int __pyx_v_endian_detector;
  int __pyx_v_little_endian;
  PyObject *__pyx_v_fields = 0;
  PyObject *__pyx_v_childname = NULL;
  PyObject *__pyx_v_new_offset = NULL;
  PyObject *__pyx_v_t = NULL;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  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", 0);

  /* "numpy.pxd":790
 *     cdef int delta_offset
 *     cdef tuple i
 *     cdef int endian_detector = 1             # <<<<<<<<<<<<<<
 *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 *     cdef tuple fields
 */
  __pyx_v_endian_detector = 1;

  /* "numpy.pxd":791
 *     cdef tuple i
 *     cdef int endian_detector = 1
 *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
 *     cdef tuple fields
 * 
 */
  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);

  /* "numpy.pxd":794
 *     cdef tuple fields
 * 
 *     for childname in descr.names:             # <<<<<<<<<<<<<<
 *         fields = descr.fields[childname]
 *         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[2]; __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;
    #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[2]; __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[2]; __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":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[2]; __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[2]; __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":796
 *     for childname in descr.names:
 *         fields = descr.fields[childname]
 *         child, new_offset = fields             # <<<<<<<<<<<<<<
 * 
 *         if (end - f) - (new_offset - offset[0]) < 15:
 */
    if (likely(PyTuple_CheckExact(((PyObject *)__pyx_v_fields)))) {
      PyObject* sequence = ((PyObject *)__pyx_v_fields);
      #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[2]; __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_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      #endif
    } else if (1) {
      __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[2]; __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[2]; __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[2]; __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[2]; __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[2]; __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;
    __Pyx_XDECREF(__pyx_v_new_offset);
    __pyx_v_new_offset = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "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[2]; __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[2]; __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[2]; __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[2]; __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); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_7) {

      /* "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 == c'>' and little_endian) or
 */
      __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_423), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __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[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L7;
    }
    __pyx_L7:;

    /* "numpy.pxd":801
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 *         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_7 = (__pyx_v_child->byteorder == '>');
    if (__pyx_t_7) {
      __pyx_t_8 = __pyx_v_little_endian;
    } else {
      __pyx_t_8 = __pyx_t_7;
    }
    if (!__pyx_t_8) {

      /* "numpy.pxd":802
 * 
 *         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_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_10 = __pyx_t_7;
      }
      __pyx_t_7 = __pyx_t_10;
    } else {
      __pyx_t_7 = __pyx_t_8;
    }
    if (__pyx_t_7) {

      /* "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_424), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __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[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L8;
    }
    __pyx_L8:;

    /* "numpy.pxd":813
 * 
 *         # Output padding bytes
 *         while offset[0] < new_offset:             # <<<<<<<<<<<<<<
 *             f[0] = 120 # "x"; pad byte
 *             f += 1
 */
    while (1) {
      __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __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); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!__pyx_t_7) break;

      /* "numpy.pxd":814
 *         # Output padding bytes
 *         while offset[0] < new_offset:
 *             f[0] = 120 # "x"; pad byte             # <<<<<<<<<<<<<<
 *             f += 1
 *             offset[0] += 1
 */
      (__pyx_v_f[0]) = 120;

      /* "numpy.pxd":815
 *         while offset[0] < new_offset:
 *             f[0] = 120 # "x"; pad byte
 *             f += 1             # <<<<<<<<<<<<<<
 *             offset[0] += 1
 * 
 */
      __pyx_v_f = (__pyx_v_f + 1);

      /* "numpy.pxd":816
 *             f[0] = 120 # "x"; pad byte
 *             f += 1
 *             offset[0] += 1             # <<<<<<<<<<<<<<
 * 
 *         offset[0] += child.itemsize
 */
      __pyx_t_11 = 0;
      (__pyx_v_offset[__pyx_t_11]) = ((__pyx_v_offset[__pyx_t_11]) + 1);
    }

    /* "numpy.pxd":818
 *             offset[0] += 1
 * 
 *         offset[0] += child.itemsize             # <<<<<<<<<<<<<<
 * 
 *         if not PyDataType_HASFIELDS(child):
 */
    __pyx_t_11 = 0;
    (__pyx_v_offset[__pyx_t_11]) = ((__pyx_v_offset[__pyx_t_11]) + __pyx_v_child->elsize);

    /* "numpy.pxd":820
 *         offset[0] += child.itemsize
 * 
 *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
 *             t = child.type_num
 *             if end - f < 5:
 */
    __pyx_t_7 = (!PyDataType_HASFIELDS(__pyx_v_child));
    if (__pyx_t_7) {

      /* "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[2]; __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":822
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num
 *             if end - f < 5:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError(u"Format string allocated too short.")
 * 
 */
      __pyx_t_7 = ((__pyx_v_end - __pyx_v_f) < 5);
      if (__pyx_t_7) {

        /* "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_426), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __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[2]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L12;
      }
      __pyx_L12:;

      /* "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[2]; __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); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 98;
        goto __pyx_L13;
      }

      /* "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[2]; __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); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 66;
        goto __pyx_L13;
      }

      /* "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[2]; __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); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 104;
        goto __pyx_L13;
      }

      /* "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[2]; __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); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 72;
        goto __pyx_L13;
      }

      /* "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[2]; __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); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 105;
        goto __pyx_L13;
      }

      /* "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[2]; __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); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 73;
        goto __pyx_L13;
      }

      /* "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[2]; __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); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 108;
        goto __pyx_L13;
      }

      /* "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[2]; __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); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 76;
        goto __pyx_L13;
      }

      /* "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[2]; __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); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 113;
        goto __pyx_L13;
      }

      /* "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[2]; __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); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 81;
        goto __pyx_L13;
      }

      /* "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[2]; __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); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 102;
        goto __pyx_L13;
      }

      /* "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[2]; __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); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 100;
        goto __pyx_L13;
      }

      /* "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[2]; __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); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 103;
        goto __pyx_L13;
      }

      /* "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[2]; __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); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 102;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L13;
      }

      /* "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[2]; __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); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 100;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L13;
      }

      /* "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[2]; __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); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 103;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L13;
      }

      /* "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[2]; __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); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_7) {
        (__pyx_v_f[0]) = 79;
        goto __pyx_L13;
      }
      /*else*/ {

        /* "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_421), __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __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[2]; __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[2]; __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[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L13:;

      /* "numpy.pxd":845
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *             f += 1             # <<<<<<<<<<<<<<
 *         else:
 *             # Cython ignores struct boundary information ("T{...}"),
 */
      __pyx_v_f = (__pyx_v_f + 1);
      goto __pyx_L11;
    }
    /*else*/ {

      /* "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_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[2]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_f = __pyx_t_12;
    }
    __pyx_L11:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "numpy.pxd":850
 *             # so don't output it
 *             f = _util_dtypestring(child, f, end, offset)
 *     return f             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_f;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_child);
  __Pyx_XDECREF(__pyx_v_fields);
  __Pyx_XDECREF(__pyx_v_childname);
  __Pyx_XDECREF(__pyx_v_new_offset);
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "numpy.pxd":965
 * 
 * 
 * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
 *      cdef PyObject* baseptr
 *      if base is None:
 */

static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
  PyObject *__pyx_v_baseptr;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("set_array_base", 0);

  /* "numpy.pxd":967
 * cdef inline void set_array_base(ndarray arr, object base):
 *      cdef PyObject* baseptr
 *      if base is None:             # <<<<<<<<<<<<<<
 *          baseptr = NULL
 *      else:
 */
  __pyx_t_1 = (__pyx_v_base == Py_None);
  if (__pyx_t_1) {

    /* "numpy.pxd":968
 *      cdef PyObject* baseptr
 *      if base is None:
 *          baseptr = NULL             # <<<<<<<<<<<<<<
 *      else:
 *          Py_INCREF(base) # important to do this before decref below!
 */
    __pyx_v_baseptr = NULL;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "numpy.pxd":970
 *          baseptr = NULL
 *      else:
 *          Py_INCREF(base) # important to do this before decref below!             # <<<<<<<<<<<<<<
 *          baseptr = <PyObject*>base
 *      Py_XDECREF(arr.base)
 */
    Py_INCREF(__pyx_v_base);

    /* "numpy.pxd":971
 *      else:
 *          Py_INCREF(base) # important to do this before decref below!
 *          baseptr = <PyObject*>base             # <<<<<<<<<<<<<<
 *      Py_XDECREF(arr.base)
 *      arr.base = baseptr
 */
    __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
  }
  __pyx_L3:;

  /* "numpy.pxd":972
 *          Py_INCREF(base) # important to do this before decref below!
 *          baseptr = <PyObject*>base
 *      Py_XDECREF(arr.base)             # <<<<<<<<<<<<<<
 *      arr.base = baseptr
 * 
 */
  Py_XDECREF(__pyx_v_arr->base);

  /* "numpy.pxd":973
 *          baseptr = <PyObject*>base
 *      Py_XDECREF(arr.base)
 *      arr.base = baseptr             # <<<<<<<<<<<<<<
 * 
 * cdef inline object get_array_base(ndarray arr):
 */
  __pyx_v_arr->base = __pyx_v_baseptr;

  __Pyx_RefNannyFinishContext();
}

/* "numpy.pxd":975
 *      arr.base = baseptr
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     if arr.base is NULL:
 *         return None
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("get_array_base", 0);

  /* "numpy.pxd":976
 * 
 * cdef inline object get_array_base(ndarray arr):
 *     if arr.base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arr->base == NULL);
  if (__pyx_t_1) {

    /* "numpy.pxd":977
 * cdef inline object get_array_base(ndarray arr):
 *     if arr.base is NULL:
 *         return None             # <<<<<<<<<<<<<<
 *     else:
 *         return <object>arr.base
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "numpy.pxd":979
 *         return None
 *     else:
 *         return <object>arr.base             # <<<<<<<<<<<<<<
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
    __pyx_r = ((PyObject *)__pyx_v_arr->base);
    goto __pyx_L0;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static struct __pyx_vtabstruct_5pyfmi_3fmi_ModelBase __pyx_vtable_5pyfmi_3fmi_ModelBase;

static PyObject *__pyx_tp_new_5pyfmi_3fmi_ModelBase(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_5pyfmi_3fmi_ModelBase *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_5pyfmi_3fmi_ModelBase *)o);
  p->__pyx_vtab = __pyx_vtabptr_5pyfmi_3fmi_ModelBase;
  p->_log = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_5pyfmi_3fmi_ModelBase(PyObject *o) {
  struct __pyx_obj_5pyfmi_3fmi_ModelBase *p = (struct __pyx_obj_5pyfmi_3fmi_ModelBase *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->_log);
  PyObject_GC_Track(o);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_5pyfmi_3fmi_ModelBase(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5pyfmi_3fmi_ModelBase *p = (struct __pyx_obj_5pyfmi_3fmi_ModelBase *)o;
  if (p->_log) {
    e = (*v)(p->_log, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5pyfmi_3fmi_ModelBase(PyObject *o) {
  struct __pyx_obj_5pyfmi_3fmi_ModelBase *p = (struct __pyx_obj_5pyfmi_3fmi_ModelBase *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->_log);
  p->_log = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_5pyfmi_3fmi_ModelBase[] = {
  {__Pyx_NAMESTR("set"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_9ModelBase_1set, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_9ModelBase_set)},
  {__Pyx_NAMESTR("get"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_9ModelBase_3get, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_9ModelBase_2get)},
  {__Pyx_NAMESTR("_exec_algorithm"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_9ModelBase_5_exec_algorithm, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_9ModelBase_4_exec_algorithm)},
  {__Pyx_NAMESTR("_exec_simulate_algorithm"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_9ModelBase_7_exec_simulate_algorithm, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_9ModelBase_6_exec_simulate_algorithm)},
  {__Pyx_NAMESTR("_exec_estimate_algorithm"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_9ModelBase_9_exec_estimate_algorithm, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_9ModelBase_8_exec_estimate_algorithm)},
  {__Pyx_NAMESTR("_default_options"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_9ModelBase_11_default_options, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_9ModelBase_10_default_options)},
  {__Pyx_NAMESTR("estimate"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_9ModelBase_13estimate, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_9ModelBase_12estimate)},
  {__Pyx_NAMESTR("estimate_options"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_9ModelBase_15estimate_options, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_9ModelBase_14estimate_options)},
  {__Pyx_NAMESTR("get_log_file_name"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_9ModelBase_17get_log_file_name, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_number_of_lines_log"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_9ModelBase_19get_number_of_lines_log, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_9ModelBase_18get_number_of_lines_log)},
  {__Pyx_NAMESTR("print_log"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_9ModelBase_21print_log, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_9ModelBase_20print_log)},
  {__Pyx_NAMESTR("get_log"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_9ModelBase_23get_log, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_9ModelBase_22get_log)},
  {__Pyx_NAMESTR("append_log_message"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_9ModelBase_25append_log_message, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("set_log_level"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_9ModelBase_27set_log_level, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_9ModelBase_26set_log_level)},
  {__Pyx_NAMESTR("_convert_filter"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_9ModelBase_29_convert_filter, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_9ModelBase_28_convert_filter)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_ModelBase = {
  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_ModelBase = {
  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_ModelBase = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_ModelBase = {
  #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_type_5pyfmi_3fmi_ModelBase = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pyfmi.fmi.ModelBase"), /*tp_name*/
  sizeof(struct __pyx_obj_5pyfmi_3fmi_ModelBase), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5pyfmi_3fmi_ModelBase, /*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_ModelBase, /*tp_as_number*/
  &__pyx_tp_as_sequence_ModelBase, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_ModelBase, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_ModelBase, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("\n    Abstract Model class containing base functionality.\n    "), /*tp_doc*/
  __pyx_tp_traverse_5pyfmi_3fmi_ModelBase, /*tp_traverse*/
  __pyx_tp_clear_5pyfmi_3fmi_ModelBase, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5pyfmi_3fmi_ModelBase, /*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_5pyfmi_3fmi_ModelBase, /*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_5pyfmi_3fmi_ScalarVariable(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *)o);
  p->_name = Py_None; Py_INCREF(Py_None);
  p->_description = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_5pyfmi_3fmi_ScalarVariable(PyObject *o) {
  struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *p = (struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->_name);
  Py_CLEAR(p->_description);
  PyObject_GC_Track(o);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_5pyfmi_3fmi_ScalarVariable(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *p = (struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *)o;
  if (p->_name) {
    e = (*v)(p->_name, a); if (e) return e;
  }
  if (p->_description) {
    e = (*v)(p->_description, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5pyfmi_3fmi_ScalarVariable(PyObject *o) {
  struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *p = (struct __pyx_obj_5pyfmi_3fmi_ScalarVariable *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->_name);
  p->_name = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_description);
  p->_description = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_5pyfmi_3fmi_ScalarVariable[] = {
  {__Pyx_NAMESTR("_get_name"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_14ScalarVariable_3_get_name, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_14ScalarVariable_2_get_name)},
  {__Pyx_NAMESTR("_get_value_reference"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_14ScalarVariable_5_get_value_reference, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_14ScalarVariable_4_get_value_reference)},
  {__Pyx_NAMESTR("_get_type"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_14ScalarVariable_7_get_type, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_14ScalarVariable_6_get_type)},
  {__Pyx_NAMESTR("_get_description"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_14ScalarVariable_9_get_description, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_14ScalarVariable_8_get_description)},
  {__Pyx_NAMESTR("_get_variability"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_14ScalarVariable_11_get_variability, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_14ScalarVariable_10_get_variability)},
  {__Pyx_NAMESTR("_get_causality"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_14ScalarVariable_13_get_causality, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_14ScalarVariable_12_get_causality)},
  {__Pyx_NAMESTR("_get_alias"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_14ScalarVariable_15_get_alias, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_14ScalarVariable_14_get_alias)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_ScalarVariable = {
  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_ScalarVariable = {
  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_ScalarVariable = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_ScalarVariable = {
  #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_type_5pyfmi_3fmi_ScalarVariable = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pyfmi.fmi.ScalarVariable"), /*tp_name*/
  sizeof(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5pyfmi_3fmi_ScalarVariable, /*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_ScalarVariable, /*tp_as_number*/
  &__pyx_tp_as_sequence_ScalarVariable, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_ScalarVariable, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_ScalarVariable, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("\n    Class defining data structure based on the XML element ScalarVariable.\n    "), /*tp_doc*/
  __pyx_tp_traverse_5pyfmi_3fmi_ScalarVariable, /*tp_traverse*/
  __pyx_tp_clear_5pyfmi_3fmi_ScalarVariable, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5pyfmi_3fmi_ScalarVariable, /*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*/
  __pyx_pw_5pyfmi_3fmi_14ScalarVariable_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5pyfmi_3fmi_ScalarVariable, /*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_5pyfmi_3fmi_ScalarVariable2(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *)o);
  p->_name = Py_None; Py_INCREF(Py_None);
  p->_description = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_5pyfmi_3fmi_ScalarVariable2(PyObject *o) {
  struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *p = (struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->_name);
  Py_CLEAR(p->_description);
  PyObject_GC_Track(o);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_5pyfmi_3fmi_ScalarVariable2(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *p = (struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *)o;
  if (p->_name) {
    e = (*v)(p->_name, a); if (e) return e;
  }
  if (p->_description) {
    e = (*v)(p->_description, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5pyfmi_3fmi_ScalarVariable2(PyObject *o) {
  struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *p = (struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2 *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->_name);
  p->_name = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_description);
  p->_description = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_5pyfmi_3fmi_ScalarVariable2[] = {
  {__Pyx_NAMESTR("_get_name"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_15ScalarVariable2_3_get_name, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_15ScalarVariable2_2_get_name)},
  {__Pyx_NAMESTR("_get_value_reference"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_15ScalarVariable2_5_get_value_reference, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_15ScalarVariable2_4_get_value_reference)},
  {__Pyx_NAMESTR("_get_type"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_15ScalarVariable2_7_get_type, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_15ScalarVariable2_6_get_type)},
  {__Pyx_NAMESTR("_get_description"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_15ScalarVariable2_9_get_description, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_15ScalarVariable2_8_get_description)},
  {__Pyx_NAMESTR("_get_variability"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_15ScalarVariable2_11_get_variability, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_15ScalarVariable2_10_get_variability)},
  {__Pyx_NAMESTR("_get_causality"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_15ScalarVariable2_13_get_causality, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_15ScalarVariable2_12_get_causality)},
  {__Pyx_NAMESTR("_get_alias"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_15ScalarVariable2_15_get_alias, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_15ScalarVariable2_14_get_alias)},
  {__Pyx_NAMESTR("_get_initial"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_15ScalarVariable2_17_get_initial, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_15ScalarVariable2_16_get_initial)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_ScalarVariable2 = {
  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_ScalarVariable2 = {
  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_ScalarVariable2 = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_ScalarVariable2 = {
  #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_type_5pyfmi_3fmi_ScalarVariable2 = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pyfmi.fmi.ScalarVariable2"), /*tp_name*/
  sizeof(struct __pyx_obj_5pyfmi_3fmi_ScalarVariable2), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5pyfmi_3fmi_ScalarVariable2, /*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_ScalarVariable2, /*tp_as_number*/
  &__pyx_tp_as_sequence_ScalarVariable2, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_ScalarVariable2, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_ScalarVariable2, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("\n    Class defining data structure based on the XML element ScalarVariable.\n    "), /*tp_doc*/
  __pyx_tp_traverse_5pyfmi_3fmi_ScalarVariable2, /*tp_traverse*/
  __pyx_tp_clear_5pyfmi_3fmi_ScalarVariable2, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5pyfmi_3fmi_ScalarVariable2, /*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*/
  __pyx_pw_5pyfmi_3fmi_15ScalarVariable2_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5pyfmi_3fmi_ScalarVariable2, /*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_5pyfmi_3fmi_FMUState2(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  return o;
}

static void __pyx_tp_dealloc_5pyfmi_3fmi_FMUState2(PyObject *o) {
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_5pyfmi_3fmi_FMUState2[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_FMUState2 = {
  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_FMUState2 = {
  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_FMUState2 = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_FMUState2 = {
  #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_type_5pyfmi_3fmi_FMUState2 = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pyfmi.fmi.FMUState2"), /*tp_name*/
  sizeof(struct __pyx_obj_5pyfmi_3fmi_FMUState2), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5pyfmi_3fmi_FMUState2, /*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_FMUState2, /*tp_as_number*/
  &__pyx_tp_as_sequence_FMUState2, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_FMUState2, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_FMUState2, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  __Pyx_DOCSTR("\n    Class containing a pointer to a FMU-state.\n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5pyfmi_3fmi_FMUState2, /*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*/
  __pyx_pw_5pyfmi_3fmi_9FMUState2_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5pyfmi_3fmi_FMUState2, /*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 struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase __pyx_vtable_5pyfmi_3fmi_FMUModelBase;

static PyObject *__pyx_tp_new_5pyfmi_3fmi_FMUModelBase(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *p;
  PyObject *o = __pyx_tp_new_5pyfmi_3fmi_ModelBase(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pyfmi_3fmi_ModelBase*)__pyx_vtabptr_5pyfmi_3fmi_FMUModelBase;
  p->__t = Py_None; Py_INCREF(Py_None);
  p->_file_open = Py_None; Py_INCREF(Py_None);
  p->_npoints = Py_None; Py_INCREF(Py_None);
  p->_enable_logging = Py_None; Py_INCREF(Py_None);
  p->_pyEventInfo = Py_None; Py_INCREF(Py_None);
  p->_allocated_list = Py_None; Py_INCREF(Py_None);
  p->_modelid = Py_None; Py_INCREF(Py_None);
  p->_modelname = Py_None; Py_INCREF(Py_None);
  p->_save_real_variables_val = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_save_int_variables_val = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_save_bool_variables_val = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_5pyfmi_3fmi_FMUModelBase(PyObject *o) {
  struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *p = (struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__t);
  Py_CLEAR(p->_file_open);
  Py_CLEAR(p->_npoints);
  Py_CLEAR(p->_enable_logging);
  Py_CLEAR(p->_pyEventInfo);
  Py_CLEAR(p->_allocated_list);
  Py_CLEAR(p->_modelid);
  Py_CLEAR(p->_modelname);
  Py_CLEAR(p->_save_real_variables_val);
  Py_CLEAR(p->_save_int_variables_val);
  Py_CLEAR(p->_save_bool_variables_val);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_5pyfmi_3fmi_ModelBase(o);
}

static int __pyx_tp_traverse_5pyfmi_3fmi_FMUModelBase(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *p = (struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)o;
  e = __pyx_tp_traverse_5pyfmi_3fmi_ModelBase(o, v, a); if (e) return e;
  if (p->__t) {
    e = (*v)(p->__t, a); if (e) return e;
  }
  if (p->_file_open) {
    e = (*v)(p->_file_open, a); if (e) return e;
  }
  if (p->_npoints) {
    e = (*v)(p->_npoints, a); if (e) return e;
  }
  if (p->_enable_logging) {
    e = (*v)(p->_enable_logging, a); if (e) return e;
  }
  if (p->_pyEventInfo) {
    e = (*v)(p->_pyEventInfo, a); if (e) return e;
  }
  if (p->_allocated_list) {
    e = (*v)(p->_allocated_list, a); if (e) return e;
  }
  if (p->_modelid) {
    e = (*v)(p->_modelid, a); if (e) return e;
  }
  if (p->_modelname) {
    e = (*v)(p->_modelname, a); if (e) return e;
  }
  if (p->_save_real_variables_val) {
    e = (*v)(p->_save_real_variables_val, a); if (e) return e;
  }
  if (p->_save_int_variables_val) {
    e = (*v)(p->_save_int_variables_val, a); if (e) return e;
  }
  if (p->_save_bool_variables_val) {
    e = (*v)(p->_save_bool_variables_val, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5pyfmi_3fmi_FMUModelBase(PyObject *o) {
  struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *p = (struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *)o;
  PyObject* tmp;
  __pyx_tp_clear_5pyfmi_3fmi_ModelBase(o);
  tmp = ((PyObject*)p->__t);
  p->__t = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_file_open);
  p->_file_open = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_npoints);
  p->_npoints = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_enable_logging);
  p->_enable_logging = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_pyEventInfo);
  p->_pyEventInfo = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_allocated_list);
  p->_allocated_list = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_modelid);
  p->_modelid = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_modelname);
  p->_modelname = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_save_real_variables_val);
  p->_save_real_variables_val = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_save_int_variables_val);
  p->_save_int_variables_val = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_save_bool_variables_val);
  p->_save_bool_variables_val = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_12FMUModelBase___t(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_3__t_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_12FMUModelBase___t(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_3__t_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_3__t_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_12FMUModelBase__file_open(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_10_file_open_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_12FMUModelBase__file_open(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_10_file_open_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_10_file_open_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_12FMUModelBase__npoints(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_8_npoints_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_12FMUModelBase__npoints(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_8_npoints_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_8_npoints_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_12FMUModelBase__enable_logging(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_15_enable_logging_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_12FMUModelBase__enable_logging(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_15_enable_logging_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_15_enable_logging_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_12FMUModelBase__pyEventInfo(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_12FMUModelBase__pyEventInfo(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_12_pyEventInfo_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_12FMUModelBase__save_real_variables_val(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_12FMUModelBase__save_real_variables_val(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_real_variables_val_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_12FMUModelBase__save_int_variables_val(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_12FMUModelBase__save_int_variables_val(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_23_save_int_variables_val_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_12FMUModelBase__save_bool_variables_val(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_12FMUModelBase__save_bool_variables_val(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_12FMUModelBase_24_save_bool_variables_val_5__del__(o);
  }
}

static PyMethodDef __pyx_methods_5pyfmi_3fmi_FMUModelBase[] = {
  {__Pyx_NAMESTR("_internal_set_fmu_null"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_3_internal_set_fmu_null, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_2_internal_set_fmu_null)},
  {__Pyx_NAMESTR("_get_version"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_5_get_version, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_4_get_version)},
  {__Pyx_NAMESTR("get_ode_sizes"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_7get_ode_sizes, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_6get_ode_sizes)},
  {__Pyx_NAMESTR("get_real"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_9get_real, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_8get_real)},
  {__Pyx_NAMESTR("set_real"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_11set_real, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_10set_real)},
  {__Pyx_NAMESTR("get_integer"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_13get_integer, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_12get_integer)},
  {__Pyx_NAMESTR("set_integer"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_15set_integer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_14set_integer)},
  {__Pyx_NAMESTR("get_boolean"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_17get_boolean, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_16get_boolean)},
  {__Pyx_NAMESTR("set_boolean"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_19set_boolean, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_18set_boolean)},
  {__Pyx_NAMESTR("get_string"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_21get_string, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_20get_string)},
  {__Pyx_NAMESTR("set_string"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_23set_string, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_22set_string)},
  {__Pyx_NAMESTR("set_debug_logging"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_25set_debug_logging, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_24set_debug_logging)},
  {__Pyx_NAMESTR("set_fmil_log_level"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_27set_fmil_log_level, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_set"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_29_set, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_28_set)},
  {__Pyx_NAMESTR("_get"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_31_get, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_30_get)},
  {__Pyx_NAMESTR("get_variable_description"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_33get_variable_description, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_32get_variable_description)},
  {__Pyx_NAMESTR("get_variable_data_type"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_35get_variable_data_type, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_34get_variable_data_type)},
  {__Pyx_NAMESTR("get_variable_valueref"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_37get_variable_valueref, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_36get_variable_valueref)},
  {__Pyx_NAMESTR("get_variable_nominal"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_39get_variable_nominal, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_38get_variable_nominal)},
  {__Pyx_NAMESTR("get_variable_fixed"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_41get_variable_fixed, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_40get_variable_fixed)},
  {__Pyx_NAMESTR("get_variable_start"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_43get_variable_start, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_42get_variable_start)},
  {__Pyx_NAMESTR("get_variable_max"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_45get_variable_max, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_44get_variable_max)},
  {__Pyx_NAMESTR("get_variable_min"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_47get_variable_min, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_46get_variable_min)},
  {__Pyx_NAMESTR("get_model_variables"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_49get_model_variables, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_48get_model_variables)},
  {__Pyx_NAMESTR("get_model_time_varying_value_references"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_51get_model_time_varying_value_references, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_50get_model_time_varying_value_references)},
  {__Pyx_NAMESTR("get_variable_alias_base"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_53get_variable_alias_base, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_52get_variable_alias_base)},
  {__Pyx_NAMESTR("get_variable_alias"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_55get_variable_alias, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_54get_variable_alias)},
  {__Pyx_NAMESTR("get_variable_variability"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_57get_variable_variability, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_56get_variable_variability)},
  {__Pyx_NAMESTR("get_variable_by_valueref"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_59get_variable_by_valueref, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_58get_variable_by_valueref)},
  {__Pyx_NAMESTR("get_variable_causality"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_61get_variable_causality, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_60get_variable_causality)},
  {__Pyx_NAMESTR("get_name"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_63get_name, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_62get_name)},
  {__Pyx_NAMESTR("get_identifier"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_65get_identifier, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_64get_identifier)},
  {__Pyx_NAMESTR("get_author"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_67get_author, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_66get_author)},
  {__Pyx_NAMESTR("get_default_experiment_start_time"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_69get_default_experiment_start_time, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_68get_default_experiment_start_time)},
  {__Pyx_NAMESTR("get_default_experiment_stop_time"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_71get_default_experiment_stop_time, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_70get_default_experiment_stop_time)},
  {__Pyx_NAMESTR("get_default_experiment_tolerance"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_73get_default_experiment_tolerance, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_72get_default_experiment_tolerance)},
  {__Pyx_NAMESTR("get_description"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_75get_description, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_74get_description)},
  {__Pyx_NAMESTR("get_generation_tool"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_77get_generation_tool, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_76get_generation_tool)},
  {__Pyx_NAMESTR("get_guid"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_12FMUModelBase_79get_guid, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_12FMUModelBase_78get_guid)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5pyfmi_3fmi_FMUModelBase[] = {
  {(char *)"__t", __pyx_getprop_5pyfmi_3fmi_12FMUModelBase___t, __pyx_setprop_5pyfmi_3fmi_12FMUModelBase___t, 0, 0},
  {(char *)"_file_open", __pyx_getprop_5pyfmi_3fmi_12FMUModelBase__file_open, __pyx_setprop_5pyfmi_3fmi_12FMUModelBase__file_open, 0, 0},
  {(char *)"_npoints", __pyx_getprop_5pyfmi_3fmi_12FMUModelBase__npoints, __pyx_setprop_5pyfmi_3fmi_12FMUModelBase__npoints, 0, 0},
  {(char *)"_enable_logging", __pyx_getprop_5pyfmi_3fmi_12FMUModelBase__enable_logging, __pyx_setprop_5pyfmi_3fmi_12FMUModelBase__enable_logging, 0, 0},
  {(char *)"_pyEventInfo", __pyx_getprop_5pyfmi_3fmi_12FMUModelBase__pyEventInfo, __pyx_setprop_5pyfmi_3fmi_12FMUModelBase__pyEventInfo, 0, 0},
  {(char *)"_save_real_variables_val", __pyx_getprop_5pyfmi_3fmi_12FMUModelBase__save_real_variables_val, __pyx_setprop_5pyfmi_3fmi_12FMUModelBase__save_real_variables_val, 0, 0},
  {(char *)"_save_int_variables_val", __pyx_getprop_5pyfmi_3fmi_12FMUModelBase__save_int_variables_val, __pyx_setprop_5pyfmi_3fmi_12FMUModelBase__save_int_variables_val, 0, 0},
  {(char *)"_save_bool_variables_val", __pyx_getprop_5pyfmi_3fmi_12FMUModelBase__save_bool_variables_val, __pyx_setprop_5pyfmi_3fmi_12FMUModelBase__save_bool_variables_val, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_FMUModelBase = {
  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_FMUModelBase = {
  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_FMUModelBase = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_FMUModelBase = {
  #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_type_5pyfmi_3fmi_FMUModelBase = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pyfmi.fmi.FMUModelBase"), /*tp_name*/
  sizeof(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5pyfmi_3fmi_FMUModelBase, /*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_FMUModelBase, /*tp_as_number*/
  &__pyx_tp_as_sequence_FMUModelBase, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_FMUModelBase, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_FMUModelBase, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("\n    An FMI Model loaded from a DLL.\n    "), /*tp_doc*/
  __pyx_tp_traverse_5pyfmi_3fmi_FMUModelBase, /*tp_traverse*/
  __pyx_tp_clear_5pyfmi_3fmi_FMUModelBase, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5pyfmi_3fmi_FMUModelBase, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_5pyfmi_3fmi_FMUModelBase, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_5pyfmi_3fmi_12FMUModelBase_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5pyfmi_3fmi_FMUModelBase, /*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 struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS1 __pyx_vtable_5pyfmi_3fmi_FMUModelCS1;

static PyObject *__pyx_tp_new_5pyfmi_3fmi_FMUModelCS1(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *p;
  PyObject *o = __pyx_tp_new_5pyfmi_3fmi_FMUModelBase(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pyfmi_3fmi_ModelBase*)__pyx_vtabptr_5pyfmi_3fmi_FMUModelCS1;
  return o;
}

static void __pyx_tp_dealloc_5pyfmi_3fmi_FMUModelCS1(PyObject *o) {
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_5pyfmi_3fmi_11FMUModelCS1_7__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_5pyfmi_3fmi_FMUModelBase(o);
}

static PyMethodDef __pyx_methods_5pyfmi_3fmi_FMUModelCS1[] = {
  {__Pyx_NAMESTR("_get_time"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_3_get_time, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_set_time"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_5_set_time, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("do_step"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_9do_step, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS1_8do_step)},
  {__Pyx_NAMESTR("cancel_step"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_11cancel_step, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS1_10cancel_step)},
  {__Pyx_NAMESTR("get_output_derivatives"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_13get_output_derivatives, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS1_12get_output_derivatives)},
  {__Pyx_NAMESTR("_get_types_platform"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_15_get_types_platform, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS1_14_get_types_platform)},
  {__Pyx_NAMESTR("get_real_status"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_17get_real_status, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS1_16get_real_status)},
  {__Pyx_NAMESTR("set_input_derivatives"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_19set_input_derivatives, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS1_18set_input_derivatives)},
  {__Pyx_NAMESTR("simulate"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_21simulate, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS1_20simulate)},
  {__Pyx_NAMESTR("simulate_options"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_23simulate_options, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS1_22simulate_options)},
  {__Pyx_NAMESTR("initialize"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_25initialize, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS1_24initialize)},
  {__Pyx_NAMESTR("reset"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_27reset, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS1_26reset)},
  {__Pyx_NAMESTR("instantiate_slave"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_29instantiate_slave, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS1_28instantiate_slave)},
  {__Pyx_NAMESTR("get_capability_flags"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_31get_capability_flags, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS1_30get_capability_flags)},
  {__Pyx_NAMESTR("terminate"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_33terminate, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS1_32terminate)},
  {__Pyx_NAMESTR("free_instance"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS1_35free_instance, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS1_34free_instance)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_FMUModelCS1 = {
  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_FMUModelCS1 = {
  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_FMUModelCS1 = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_FMUModelCS1 = {
  #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_type_5pyfmi_3fmi_FMUModelCS1 = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pyfmi.fmi.FMUModelCS1"), /*tp_name*/
  sizeof(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5pyfmi_3fmi_FMUModelCS1, /*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_FMUModelCS1, /*tp_as_number*/
  &__pyx_tp_as_sequence_FMUModelCS1, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_FMUModelCS1, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_FMUModelCS1, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5pyfmi_3fmi_FMUModelBase, /*tp_traverse*/
  __pyx_tp_clear_5pyfmi_3fmi_FMUModelBase, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5pyfmi_3fmi_FMUModelCS1, /*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*/
  __pyx_pw_5pyfmi_3fmi_11FMUModelCS1_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5pyfmi_3fmi_FMUModelCS1, /*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 struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelME1 __pyx_vtable_5pyfmi_3fmi_FMUModelME1;

static PyObject *__pyx_tp_new_5pyfmi_3fmi_FMUModelME1(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *p;
  PyObject *o = __pyx_tp_new_5pyfmi_3fmi_FMUModelBase(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pyfmi_3fmi_ModelBase*)__pyx_vtabptr_5pyfmi_3fmi_FMUModelME1;
  return o;
}

static void __pyx_tp_dealloc_5pyfmi_3fmi_FMUModelME1(PyObject *o) {
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_5pyfmi_3fmi_11FMUModelME1_7__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_5pyfmi_3fmi_FMUModelBase(o);
}

static PyMethodDef __pyx_methods_5pyfmi_3fmi_FMUModelME1[] = {
  {__Pyx_NAMESTR("_get_model_types_platform"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_3_get_model_types_platform, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME1_2_get_model_types_platform)},
  {__Pyx_NAMESTR("reset"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_5reset, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME1_4reset)},
  {__Pyx_NAMESTR("_get_time"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_9_get_time, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_set_time"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_11_set_time, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_get_continuous_states"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_13_get_continuous_states, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_set_continuous_states"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_15_set_continuous_states, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_get_nominal_continuous_states"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_17_get_nominal_continuous_states, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_derivatives"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_19get_derivatives, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME1_18get_derivatives)},
  {__Pyx_NAMESTR("get_event_indicators"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_21get_event_indicators, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME1_20get_event_indicators)},
  {__Pyx_NAMESTR("get_tolerances"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_23get_tolerances, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME1_22get_tolerances)},
  {__Pyx_NAMESTR("event_update"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_25event_update, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME1_24event_update)},
  {__Pyx_NAMESTR("get_event_info"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_27get_event_info, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME1_26get_event_info)},
  {__Pyx_NAMESTR("get_state_value_references"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_29get_state_value_references, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME1_28get_state_value_references)},
  {__Pyx_NAMESTR("completed_integrator_step"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_31completed_integrator_step, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME1_30completed_integrator_step)},
  {__Pyx_NAMESTR("initialize"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_33initialize, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME1_32initialize)},
  {__Pyx_NAMESTR("instantiate_model"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_35instantiate_model, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME1_34instantiate_model)},
  {__Pyx_NAMESTR("simulate"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_37simulate, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME1_36simulate)},
  {__Pyx_NAMESTR("simulate_options"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_39simulate_options, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME1_38simulate_options)},
  {__Pyx_NAMESTR("terminate"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_41terminate, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME1_40terminate)},
  {__Pyx_NAMESTR("free_instance"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME1_43free_instance, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME1_42free_instance)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_FMUModelME1 = {
  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_FMUModelME1 = {
  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_FMUModelME1 = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_FMUModelME1 = {
  #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_type_5pyfmi_3fmi_FMUModelME1 = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pyfmi.fmi.FMUModelME1"), /*tp_name*/
  sizeof(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5pyfmi_3fmi_FMUModelME1, /*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_FMUModelME1, /*tp_as_number*/
  &__pyx_tp_as_sequence_FMUModelME1, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_FMUModelME1, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_FMUModelME1, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("\n    An FMI Model loaded from a DLL.\n    "), /*tp_doc*/
  __pyx_tp_traverse_5pyfmi_3fmi_FMUModelBase, /*tp_traverse*/
  __pyx_tp_clear_5pyfmi_3fmi_FMUModelBase, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5pyfmi_3fmi_FMUModelME1, /*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*/
  __pyx_pw_5pyfmi_3fmi_11FMUModelME1_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5pyfmi_3fmi_FMUModelME1, /*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 struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelBase2 __pyx_vtable_5pyfmi_3fmi_FMUModelBase2;

static PyObject *__pyx_tp_new_5pyfmi_3fmi_FMUModelBase2(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *p;
  PyObject *o = __pyx_tp_new_5pyfmi_3fmi_ModelBase(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pyfmi_3fmi_ModelBase*)__pyx_vtabptr_5pyfmi_3fmi_FMUModelBase2;
  p->_fmu_full_path = Py_None; Py_INCREF(Py_None);
  p->_enable_logging = Py_None; Py_INCREF(Py_None);
  p->_modelId = Py_None; Py_INCREF(Py_None);
  p->_modelName = Py_None; Py_INCREF(Py_None);
  p->_categories = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_save_real_variables_val = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_save_int_variables_val = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_save_bool_variables_val = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->__pyx___t = Py_None; Py_INCREF(Py_None);
  p->_pyEventInfo = Py_None; Py_INCREF(Py_None);
  p->_states_references = Py_None; Py_INCREF(Py_None);
  p->_inputs_references = Py_None; Py_INCREF(Py_None);
  p->_outputs_references = Py_None; Py_INCREF(Py_None);
  p->_derivatives_references = Py_None; Py_INCREF(Py_None);
  p->_derivatives_states_dependencies = Py_None; Py_INCREF(Py_None);
  p->_derivatives_inputs_dependencies = Py_None; Py_INCREF(Py_None);
  p->_outputs_states_dependencies = Py_None; Py_INCREF(Py_None);
  p->_outputs_inputs_dependencies = Py_None; Py_INCREF(Py_None);
  p->_A = Py_None; Py_INCREF(Py_None);
  p->_B = Py_None; Py_INCREF(Py_None);
  p->_C = Py_None; Py_INCREF(Py_None);
  p->_D = Py_None; Py_INCREF(Py_None);
  p->_group_A = Py_None; Py_INCREF(Py_None);
  p->_group_B = Py_None; Py_INCREF(Py_None);
  p->_group_C = Py_None; Py_INCREF(Py_None);
  p->_group_D = Py_None; Py_INCREF(Py_None);
  p->_mask_A = Py_None; Py_INCREF(Py_None);
  p->_A_row_ind = Py_None; Py_INCREF(Py_None);
  p->_A_col_ind = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_5pyfmi_3fmi_FMUModelBase2(PyObject *o) {
  struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *p = (struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->_fmu_full_path);
  Py_CLEAR(p->_enable_logging);
  Py_CLEAR(p->_modelId);
  Py_CLEAR(p->_modelName);
  Py_CLEAR(p->_categories);
  Py_CLEAR(p->_save_real_variables_val);
  Py_CLEAR(p->_save_int_variables_val);
  Py_CLEAR(p->_save_bool_variables_val);
  Py_CLEAR(p->__pyx___t);
  Py_CLEAR(p->_pyEventInfo);
  Py_CLEAR(p->_states_references);
  Py_CLEAR(p->_inputs_references);
  Py_CLEAR(p->_outputs_references);
  Py_CLEAR(p->_derivatives_references);
  Py_CLEAR(p->_derivatives_states_dependencies);
  Py_CLEAR(p->_derivatives_inputs_dependencies);
  Py_CLEAR(p->_outputs_states_dependencies);
  Py_CLEAR(p->_outputs_inputs_dependencies);
  Py_CLEAR(p->_A);
  Py_CLEAR(p->_B);
  Py_CLEAR(p->_C);
  Py_CLEAR(p->_D);
  Py_CLEAR(p->_group_A);
  Py_CLEAR(p->_group_B);
  Py_CLEAR(p->_group_C);
  Py_CLEAR(p->_group_D);
  Py_CLEAR(p->_mask_A);
  Py_CLEAR(p->_A_row_ind);
  Py_CLEAR(p->_A_col_ind);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_5pyfmi_3fmi_ModelBase(o);
}

static int __pyx_tp_traverse_5pyfmi_3fmi_FMUModelBase2(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *p = (struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)o;
  e = __pyx_tp_traverse_5pyfmi_3fmi_ModelBase(o, v, a); if (e) return e;
  if (p->_fmu_full_path) {
    e = (*v)(p->_fmu_full_path, a); if (e) return e;
  }
  if (p->_enable_logging) {
    e = (*v)(p->_enable_logging, a); if (e) return e;
  }
  if (p->_modelId) {
    e = (*v)(p->_modelId, a); if (e) return e;
  }
  if (p->_modelName) {
    e = (*v)(p->_modelName, a); if (e) return e;
  }
  if (p->_categories) {
    e = (*v)(p->_categories, a); if (e) return e;
  }
  if (p->_save_real_variables_val) {
    e = (*v)(p->_save_real_variables_val, a); if (e) return e;
  }
  if (p->_save_int_variables_val) {
    e = (*v)(p->_save_int_variables_val, a); if (e) return e;
  }
  if (p->_save_bool_variables_val) {
    e = (*v)(p->_save_bool_variables_val, a); if (e) return e;
  }
  if (p->__pyx___t) {
    e = (*v)(p->__pyx___t, a); if (e) return e;
  }
  if (p->_pyEventInfo) {
    e = (*v)(p->_pyEventInfo, a); if (e) return e;
  }
  if (p->_states_references) {
    e = (*v)(p->_states_references, a); if (e) return e;
  }
  if (p->_inputs_references) {
    e = (*v)(p->_inputs_references, a); if (e) return e;
  }
  if (p->_outputs_references) {
    e = (*v)(p->_outputs_references, a); if (e) return e;
  }
  if (p->_derivatives_references) {
    e = (*v)(p->_derivatives_references, a); if (e) return e;
  }
  if (p->_derivatives_states_dependencies) {
    e = (*v)(p->_derivatives_states_dependencies, a); if (e) return e;
  }
  if (p->_derivatives_inputs_dependencies) {
    e = (*v)(p->_derivatives_inputs_dependencies, a); if (e) return e;
  }
  if (p->_outputs_states_dependencies) {
    e = (*v)(p->_outputs_states_dependencies, a); if (e) return e;
  }
  if (p->_outputs_inputs_dependencies) {
    e = (*v)(p->_outputs_inputs_dependencies, a); if (e) return e;
  }
  if (p->_A) {
    e = (*v)(p->_A, a); if (e) return e;
  }
  if (p->_B) {
    e = (*v)(p->_B, a); if (e) return e;
  }
  if (p->_C) {
    e = (*v)(p->_C, a); if (e) return e;
  }
  if (p->_D) {
    e = (*v)(p->_D, a); if (e) return e;
  }
  if (p->_group_A) {
    e = (*v)(p->_group_A, a); if (e) return e;
  }
  if (p->_group_B) {
    e = (*v)(p->_group_B, a); if (e) return e;
  }
  if (p->_group_C) {
    e = (*v)(p->_group_C, a); if (e) return e;
  }
  if (p->_group_D) {
    e = (*v)(p->_group_D, a); if (e) return e;
  }
  if (p->_mask_A) {
    e = (*v)(p->_mask_A, a); if (e) return e;
  }
  if (p->_A_row_ind) {
    e = (*v)(p->_A_row_ind, a); if (e) return e;
  }
  if (p->_A_col_ind) {
    e = (*v)(p->_A_col_ind, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5pyfmi_3fmi_FMUModelBase2(PyObject *o) {
  struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *p = (struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *)o;
  PyObject* tmp;
  __pyx_tp_clear_5pyfmi_3fmi_ModelBase(o);
  tmp = ((PyObject*)p->_fmu_full_path);
  p->_fmu_full_path = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_enable_logging);
  p->_enable_logging = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_modelId);
  p->_modelId = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_modelName);
  p->_modelName = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_categories);
  p->_categories = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_save_real_variables_val);
  p->_save_real_variables_val = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_save_int_variables_val);
  p->_save_int_variables_val = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_save_bool_variables_val);
  p->_save_bool_variables_val = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx___t);
  p->__pyx___t = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_pyEventInfo);
  p->_pyEventInfo = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_states_references);
  p->_states_references = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_inputs_references);
  p->_inputs_references = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_outputs_references);
  p->_outputs_references = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_derivatives_references);
  p->_derivatives_references = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_derivatives_states_dependencies);
  p->_derivatives_states_dependencies = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_derivatives_inputs_dependencies);
  p->_derivatives_inputs_dependencies = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_outputs_states_dependencies);
  p->_outputs_states_dependencies = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_outputs_inputs_dependencies);
  p->_outputs_inputs_dependencies = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_A);
  p->_A = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_B);
  p->_B = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_C);
  p->_C = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_D);
  p->_D = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_group_A);
  p->_group_A = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_group_B);
  p->_group_B = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_group_C);
  p->_group_C = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_group_D);
  p->_group_D = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_mask_A);
  p->_mask_A = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_A_row_ind);
  p->_A_row_ind = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_A_col_ind);
  p->_A_col_ind = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_13FMUModelBase2__enable_logging(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_15_enable_logging_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_13FMUModelBase2__enable_logging(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_15_enable_logging_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_15_enable_logging_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_13FMUModelBase2__save_real_variables_val(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_24_save_real_variables_val_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_13FMUModelBase2__save_real_variables_val(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_24_save_real_variables_val_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_24_save_real_variables_val_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_13FMUModelBase2__save_int_variables_val(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_23_save_int_variables_val_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_13FMUModelBase2__save_int_variables_val(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_23_save_int_variables_val_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_23_save_int_variables_val_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_13FMUModelBase2__save_bool_variables_val(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_24_save_bool_variables_val_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_13FMUModelBase2__save_bool_variables_val(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_24_save_bool_variables_val_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_24_save_bool_variables_val_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_13FMUModelBase2__pyEventInfo(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_12_pyEventInfo_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_13FMUModelBase2__pyEventInfo(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_12_pyEventInfo_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_12_pyEventInfo_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_13FMUModelBase2__group_A(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_8_group_A_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_13FMUModelBase2__group_A(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_8_group_A_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_8_group_A_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_13FMUModelBase2__group_B(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_8_group_B_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_13FMUModelBase2__group_B(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_8_group_B_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_8_group_B_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_13FMUModelBase2__group_C(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_8_group_C_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_13FMUModelBase2__group_C(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_8_group_C_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_8_group_C_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_13FMUModelBase2__group_D(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_8_group_D_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_13FMUModelBase2__group_D(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_8_group_D_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_8_group_D_5__del__(o);
  }
}

static PyMethodDef __pyx_methods_5pyfmi_3fmi_FMUModelBase2[] = {
  {__Pyx_NAMESTR("get_real"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_3get_real, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_2get_real)},
  {__Pyx_NAMESTR("set_real"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_5set_real, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_4set_real)},
  {__Pyx_NAMESTR("get_integer"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_7get_integer, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_6get_integer)},
  {__Pyx_NAMESTR("set_integer"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_9set_integer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_8set_integer)},
  {__Pyx_NAMESTR("get_boolean"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_11get_boolean, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_10get_boolean)},
  {__Pyx_NAMESTR("set_boolean"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_13set_boolean, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_12set_boolean)},
  {__Pyx_NAMESTR("get_string"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_15get_string, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_14get_string)},
  {__Pyx_NAMESTR("set_string"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_17set_string, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_16set_string)},
  {__Pyx_NAMESTR("_set"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_19_set, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_18_set)},
  {__Pyx_NAMESTR("_get"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_21_get, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_20_get)},
  {__Pyx_NAMESTR("instantiate"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_23instantiate, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_22instantiate)},
  {__Pyx_NAMESTR("setup_experiment"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_25setup_experiment, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_24setup_experiment)},
  {__Pyx_NAMESTR("reset"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_27reset, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_26reset)},
  {__Pyx_NAMESTR("terminate"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_29terminate, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_28terminate)},
  {__Pyx_NAMESTR("free_instance"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_31free_instance, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_30free_instance)},
  {__Pyx_NAMESTR("exit_initialization_mode"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_33exit_initialization_mode, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_32exit_initialization_mode)},
  {__Pyx_NAMESTR("enter_initialization_mode"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_35enter_initialization_mode, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_34enter_initialization_mode)},
  {__Pyx_NAMESTR("initialize"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_37initialize, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_36initialize)},
  {__Pyx_NAMESTR("set_fmil_log_level"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_39set_fmil_log_level, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_fmil_log_level"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_41get_fmil_log_level, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_40get_fmil_log_level)},
  {__Pyx_NAMESTR("set_debug_logging"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_43set_debug_logging, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_42set_debug_logging)},
  {__Pyx_NAMESTR("get_categories"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_45get_categories, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_44get_categories)},
  {__Pyx_NAMESTR("get_variable_nominal"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_47get_variable_nominal, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_46get_variable_nominal)},
  {__Pyx_NAMESTR("get_variable_by_valueref"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_49get_variable_by_valueref, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_48get_variable_by_valueref)},
  {__Pyx_NAMESTR("get_variable_alias_base"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_51get_variable_alias_base, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_50get_variable_alias_base)},
  {__Pyx_NAMESTR("get_variable_alias"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_53get_variable_alias, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_52get_variable_alias)},
  {__Pyx_NAMESTR("get_model_time_varying_value_references"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_55get_model_time_varying_value_references, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_54get_model_time_varying_value_references)},
  {__Pyx_NAMESTR("get_model_variables"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_57get_model_variables, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_56get_model_variables)},
  {__Pyx_NAMESTR("get_variable_references"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_59get_variable_references, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_58get_variable_references)},
  {__Pyx_NAMESTR("get_variable_valueref"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_61get_variable_valueref, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_60get_variable_valueref)},
  {__Pyx_NAMESTR("get_variable_data_type"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_63get_variable_data_type, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_62get_variable_data_type)},
  {__Pyx_NAMESTR("get_variable_description"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_65get_variable_description, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_64get_variable_description)},
  {__Pyx_NAMESTR("get_variable_variability"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_67get_variable_variability, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_66get_variable_variability)},
  {__Pyx_NAMESTR("get_variable_initial"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_69get_variable_initial, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_68get_variable_initial)},
  {__Pyx_NAMESTR("get_variable_causality"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_71get_variable_causality, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_70get_variable_causality)},
  {__Pyx_NAMESTR("get_variable_start"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_73get_variable_start, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_72get_variable_start)},
  {__Pyx_NAMESTR("get_variable_max"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_75get_variable_max, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_74get_variable_max)},
  {__Pyx_NAMESTR("get_variable_min"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_77get_variable_min, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_76get_variable_min)},
  {__Pyx_NAMESTR("get_fmu_state"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_79get_fmu_state, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_78get_fmu_state)},
  {__Pyx_NAMESTR("set_fmu_state"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_81set_fmu_state, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_80set_fmu_state)},
  {__Pyx_NAMESTR("free_fmu_state"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_83free_fmu_state, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_82free_fmu_state)},
  {__Pyx_NAMESTR("serialize_fmu_state"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_85serialize_fmu_state, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_84serialize_fmu_state)},
  {__Pyx_NAMESTR("deserialize_fmu_state"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_87deserialize_fmu_state, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_86deserialize_fmu_state)},
  {__Pyx_NAMESTR("serialized_fmu_state_size"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_89serialized_fmu_state_size, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_88serialized_fmu_state_size)},
  {__Pyx_NAMESTR("get_ode_sizes"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_91get_ode_sizes, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_90get_ode_sizes)},
  {__Pyx_NAMESTR("get_default_experiment_start_time"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_93get_default_experiment_start_time, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_92get_default_experiment_start_time)},
  {__Pyx_NAMESTR("get_default_experiment_stop_time"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_95get_default_experiment_stop_time, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_94get_default_experiment_stop_time)},
  {__Pyx_NAMESTR("get_default_experiment_tolerance"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_97get_default_experiment_tolerance, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_96get_default_experiment_tolerance)},
  {__Pyx_NAMESTR("get_default_experiment_step"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_99get_default_experiment_step, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_98get_default_experiment_step)},
  {__Pyx_NAMESTR("get_derivatives_list"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_101get_derivatives_list, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_100get_derivatives_list)},
  {__Pyx_NAMESTR("get_output_dependencies"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_103get_output_dependencies, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_102get_output_dependencies)},
  {__Pyx_NAMESTR("get_derivatives_dependencies"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_105get_derivatives_dependencies, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_104get_derivatives_dependencies)},
  {__Pyx_NAMESTR("_get_directional_proxy"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_107_get_directional_proxy, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_get_A"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_109_get_A, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_get_B"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_111_get_B, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_get_C"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_113_get_C, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_get_D"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_115_get_D, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_state_space_representation"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_117get_state_space_representation, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_116get_state_space_representation)},
  {__Pyx_NAMESTR("get_states_list"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_119get_states_list, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_118get_states_list)},
  {__Pyx_NAMESTR("get_input_list"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_121get_input_list, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_120get_input_list)},
  {__Pyx_NAMESTR("get_output_list"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_123get_output_list, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_122get_output_list)},
  {__Pyx_NAMESTR("get_directional_derivative"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_125get_directional_derivative, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_124get_directional_derivative)},
  {__Pyx_NAMESTR("get_version"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_127get_version, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_126get_version)},
  {__Pyx_NAMESTR("get_model_version"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_129get_model_version, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_128get_model_version)},
  {__Pyx_NAMESTR("get_name"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_131get_name, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_130get_name)},
  {__Pyx_NAMESTR("get_author"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_133get_author, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_132get_author)},
  {__Pyx_NAMESTR("get_description"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_135get_description, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_134get_description)},
  {__Pyx_NAMESTR("get_copyright"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_137get_copyright, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_136get_copyright)},
  {__Pyx_NAMESTR("get_license"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_139get_license, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_138get_license)},
  {__Pyx_NAMESTR("get_generation_tool"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_141get_generation_tool, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_140get_generation_tool)},
  {__Pyx_NAMESTR("get_generation_date_and_time"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_143get_generation_date_and_time, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_142get_generation_date_and_time)},
  {__Pyx_NAMESTR("get_guid"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_145get_guid, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_144get_guid)},
  {__Pyx_NAMESTR("get_variable_naming_convention"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_147get_variable_naming_convention, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_146get_variable_naming_convention)},
  {__Pyx_NAMESTR("get_identifier"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_149get_identifier, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_148get_identifier)},
  {__Pyx_NAMESTR("get_model_types_platform"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_13FMUModelBase2_151get_model_types_platform, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_13FMUModelBase2_150get_model_types_platform)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5pyfmi_3fmi_FMUModelBase2[] = {
  {(char *)"_enable_logging", __pyx_getprop_5pyfmi_3fmi_13FMUModelBase2__enable_logging, __pyx_setprop_5pyfmi_3fmi_13FMUModelBase2__enable_logging, 0, 0},
  {(char *)"_save_real_variables_val", __pyx_getprop_5pyfmi_3fmi_13FMUModelBase2__save_real_variables_val, __pyx_setprop_5pyfmi_3fmi_13FMUModelBase2__save_real_variables_val, 0, 0},
  {(char *)"_save_int_variables_val", __pyx_getprop_5pyfmi_3fmi_13FMUModelBase2__save_int_variables_val, __pyx_setprop_5pyfmi_3fmi_13FMUModelBase2__save_int_variables_val, 0, 0},
  {(char *)"_save_bool_variables_val", __pyx_getprop_5pyfmi_3fmi_13FMUModelBase2__save_bool_variables_val, __pyx_setprop_5pyfmi_3fmi_13FMUModelBase2__save_bool_variables_val, 0, 0},
  {(char *)"_pyEventInfo", __pyx_getprop_5pyfmi_3fmi_13FMUModelBase2__pyEventInfo, __pyx_setprop_5pyfmi_3fmi_13FMUModelBase2__pyEventInfo, 0, 0},
  {(char *)"_group_A", __pyx_getprop_5pyfmi_3fmi_13FMUModelBase2__group_A, __pyx_setprop_5pyfmi_3fmi_13FMUModelBase2__group_A, 0, 0},
  {(char *)"_group_B", __pyx_getprop_5pyfmi_3fmi_13FMUModelBase2__group_B, __pyx_setprop_5pyfmi_3fmi_13FMUModelBase2__group_B, 0, 0},
  {(char *)"_group_C", __pyx_getprop_5pyfmi_3fmi_13FMUModelBase2__group_C, __pyx_setprop_5pyfmi_3fmi_13FMUModelBase2__group_C, 0, 0},
  {(char *)"_group_D", __pyx_getprop_5pyfmi_3fmi_13FMUModelBase2__group_D, __pyx_setprop_5pyfmi_3fmi_13FMUModelBase2__group_D, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_FMUModelBase2 = {
  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_FMUModelBase2 = {
  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_FMUModelBase2 = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_FMUModelBase2 = {
  #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_type_5pyfmi_3fmi_FMUModelBase2 = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pyfmi.fmi.FMUModelBase2"), /*tp_name*/
  sizeof(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5pyfmi_3fmi_FMUModelBase2, /*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_FMUModelBase2, /*tp_as_number*/
  &__pyx_tp_as_sequence_FMUModelBase2, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_FMUModelBase2, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_FMUModelBase2, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("\n    FMI Model loaded from a dll.\n    "), /*tp_doc*/
  __pyx_tp_traverse_5pyfmi_3fmi_FMUModelBase2, /*tp_traverse*/
  __pyx_tp_clear_5pyfmi_3fmi_FMUModelBase2, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5pyfmi_3fmi_FMUModelBase2, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_5pyfmi_3fmi_FMUModelBase2, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5pyfmi_3fmi_FMUModelBase2, /*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 struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelCS2 __pyx_vtable_5pyfmi_3fmi_FMUModelCS2;

static PyObject *__pyx_tp_new_5pyfmi_3fmi_FMUModelCS2(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *p;
  PyObject *o = __pyx_tp_new_5pyfmi_3fmi_FMUModelBase2(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pyfmi_3fmi_ModelBase*)__pyx_vtabptr_5pyfmi_3fmi_FMUModelCS2;
  return o;
}

static void __pyx_tp_dealloc_5pyfmi_3fmi_FMUModelCS2(PyObject *o) {
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_5pyfmi_3fmi_11FMUModelCS2_3__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_5pyfmi_3fmi_FMUModelBase2(o);
}

static PyMethodDef __pyx_methods_5pyfmi_3fmi_FMUModelCS2[] = {
  {__Pyx_NAMESTR("_get_time"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_5_get_time, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS2_4_get_time)},
  {__Pyx_NAMESTR("_set_time"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_7_set_time, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS2_6_set_time)},
  {__Pyx_NAMESTR("do_step"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_9do_step, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS2_8do_step)},
  {__Pyx_NAMESTR("cancel_step"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_11cancel_step, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS2_10cancel_step)},
  {__Pyx_NAMESTR("set_input_derivatives"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_13set_input_derivatives, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS2_12set_input_derivatives)},
  {__Pyx_NAMESTR("get_output_derivatives"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_15get_output_derivatives, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS2_14get_output_derivatives)},
  {__Pyx_NAMESTR("get_status"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_17get_status, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS2_16get_status)},
  {__Pyx_NAMESTR("get_real_status"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_19get_real_status, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS2_18get_real_status)},
  {__Pyx_NAMESTR("get_integer_status"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_21get_integer_status, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS2_20get_integer_status)},
  {__Pyx_NAMESTR("get_boolean_status"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_23get_boolean_status, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS2_22get_boolean_status)},
  {__Pyx_NAMESTR("get_string_status"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_25get_string_status, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS2_24get_string_status)},
  {__Pyx_NAMESTR("simulate"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_27simulate, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS2_26simulate)},
  {__Pyx_NAMESTR("simulate_options"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_29simulate_options, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS2_28simulate_options)},
  {__Pyx_NAMESTR("get_capability_flags"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_31get_capability_flags, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS2_30get_capability_flags)},
  {__Pyx_NAMESTR("_provides_directional_derivatives"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_33_provides_directional_derivatives, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS2_32_provides_directional_derivatives)},
  {__Pyx_NAMESTR("_supports_get_set_FMU_state"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelCS2_35_supports_get_set_FMU_state, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelCS2_34_supports_get_set_FMU_state)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_FMUModelCS2 = {
  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_FMUModelCS2 = {
  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_FMUModelCS2 = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_FMUModelCS2 = {
  #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_type_5pyfmi_3fmi_FMUModelCS2 = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pyfmi.fmi.FMUModelCS2"), /*tp_name*/
  sizeof(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5pyfmi_3fmi_FMUModelCS2, /*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_FMUModelCS2, /*tp_as_number*/
  &__pyx_tp_as_sequence_FMUModelCS2, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_FMUModelCS2, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_FMUModelCS2, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("\n    Co-simulation model loaded from a dll\n    "), /*tp_doc*/
  __pyx_tp_traverse_5pyfmi_3fmi_FMUModelBase2, /*tp_traverse*/
  __pyx_tp_clear_5pyfmi_3fmi_FMUModelBase2, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5pyfmi_3fmi_FMUModelCS2, /*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*/
  __pyx_pw_5pyfmi_3fmi_11FMUModelCS2_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5pyfmi_3fmi_FMUModelCS2, /*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 struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModelME2 __pyx_vtable_5pyfmi_3fmi_FMUModelME2;

static PyObject *__pyx_tp_new_5pyfmi_3fmi_FMUModelME2(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *p;
  PyObject *o = __pyx_tp_new_5pyfmi_3fmi_FMUModelBase2(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pyfmi_3fmi_ModelBase*)__pyx_vtabptr_5pyfmi_3fmi_FMUModelME2;
  p->force_finite_differences = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_5pyfmi_3fmi_FMUModelME2(PyObject *o) {
  struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *p = (struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)o;
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_5pyfmi_3fmi_11FMUModelME2_3__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->force_finite_differences);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_5pyfmi_3fmi_FMUModelBase2(o);
}

static int __pyx_tp_traverse_5pyfmi_3fmi_FMUModelME2(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *p = (struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)o;
  e = __pyx_tp_traverse_5pyfmi_3fmi_FMUModelBase2(o, v, a); if (e) return e;
  if (p->force_finite_differences) {
    e = (*v)(p->force_finite_differences, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5pyfmi_3fmi_FMUModelME2(PyObject *o) {
  struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *p = (struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *)o;
  PyObject* tmp;
  __pyx_tp_clear_5pyfmi_3fmi_FMUModelBase2(o);
  tmp = ((PyObject*)p->force_finite_differences);
  p->force_finite_differences = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_5pyfmi_3fmi_11FMUModelME2_force_finite_differences(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5pyfmi_3fmi_11FMUModelME2_24force_finite_differences_1__get__(o);
}

static int __pyx_setprop_5pyfmi_3fmi_11FMUModelME2_force_finite_differences(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5pyfmi_3fmi_11FMUModelME2_24force_finite_differences_3__set__(o, v);
  }
  else {
    return __pyx_pw_5pyfmi_3fmi_11FMUModelME2_24force_finite_differences_5__del__(o);
  }
}

static PyMethodDef __pyx_methods_5pyfmi_3fmi_FMUModelME2[] = {
  {__Pyx_NAMESTR("_get_time"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_5_get_time, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME2_4_get_time)},
  {__Pyx_NAMESTR("_set_time"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_7_set_time, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME2_6_set_time)},
  {__Pyx_NAMESTR("get_event_info"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_9get_event_info, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME2_8get_event_info)},
  {__Pyx_NAMESTR("enter_event_mode"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_11enter_event_mode, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME2_10enter_event_mode)},
  {__Pyx_NAMESTR("enter_continuous_time_mode"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_13enter_continuous_time_mode, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME2_12enter_continuous_time_mode)},
  {__Pyx_NAMESTR("get_event_indicators"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_15get_event_indicators, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME2_14get_event_indicators)},
  {__Pyx_NAMESTR("event_update"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_17event_update, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME2_16event_update)},
  {__Pyx_NAMESTR("get_tolerances"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_19get_tolerances, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME2_18get_tolerances)},
  {__Pyx_NAMESTR("completed_integrator_step"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_21completed_integrator_step, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME2_20completed_integrator_step)},
  {__Pyx_NAMESTR("_get_continuous_states"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_23_get_continuous_states, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME2_22_get_continuous_states)},
  {__Pyx_NAMESTR("_set_continuous_states"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_25_set_continuous_states, METH_O, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME2_24_set_continuous_states)},
  {__Pyx_NAMESTR("_get_nominal_continuous_states"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_27_get_nominal_continuous_states, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME2_26_get_nominal_continuous_states)},
  {__Pyx_NAMESTR("get_derivatives"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_29get_derivatives, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME2_28get_derivatives)},
  {__Pyx_NAMESTR("simulate"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_31simulate, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME2_30simulate)},
  {__Pyx_NAMESTR("simulate_options"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_33simulate_options, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME2_32simulate_options)},
  {__Pyx_NAMESTR("get_capability_flags"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_35get_capability_flags, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME2_34get_capability_flags)},
  {__Pyx_NAMESTR("_provides_directional_derivatives"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_37_provides_directional_derivatives, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME2_36_provides_directional_derivatives)},
  {__Pyx_NAMESTR("_supports_get_set_FMU_state"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_39_supports_get_set_FMU_state, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pyfmi_3fmi_11FMUModelME2_38_supports_get_set_FMU_state)},
  {__Pyx_NAMESTR("_get_directional_proxy"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_41_get_directional_proxy, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_estimate_directional_derivative"), (PyCFunction)__pyx_pw_5pyfmi_3fmi_11FMUModelME2_43_estimate_directional_derivative, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5pyfmi_3fmi_FMUModelME2[] = {
  {(char *)"force_finite_differences", __pyx_getprop_5pyfmi_3fmi_11FMUModelME2_force_finite_differences, __pyx_setprop_5pyfmi_3fmi_11FMUModelME2_force_finite_differences, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_FMUModelME2 = {
  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_FMUModelME2 = {
  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_FMUModelME2 = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_FMUModelME2 = {
  #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_type_5pyfmi_3fmi_FMUModelME2 = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pyfmi.fmi.FMUModelME2"), /*tp_name*/
  sizeof(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5pyfmi_3fmi_FMUModelME2, /*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_FMUModelME2, /*tp_as_number*/
  &__pyx_tp_as_sequence_FMUModelME2, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_FMUModelME2, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_FMUModelME2, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("\n    Model-exchange model loaded from a dll\n    "), /*tp_doc*/
  __pyx_tp_traverse_5pyfmi_3fmi_FMUModelME2, /*tp_traverse*/
  __pyx_tp_clear_5pyfmi_3fmi_FMUModelME2, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5pyfmi_3fmi_FMUModelME2, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_5pyfmi_3fmi_FMUModelME2, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_5pyfmi_3fmi_11FMUModelME2_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5pyfmi_3fmi_FMUModelME2, /*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 struct __pyx_vtabstruct_5pyfmi_3fmi_FMUModel __pyx_vtable_5pyfmi_3fmi_FMUModel;

static PyObject *__pyx_tp_new_5pyfmi_3fmi_FMUModel(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5pyfmi_3fmi_FMUModel *p;
  PyObject *o = __pyx_tp_new_5pyfmi_3fmi_FMUModelBase(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_5pyfmi_3fmi_FMUModel *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pyfmi_3fmi_ModelBase*)__pyx_vtabptr_5pyfmi_3fmi_FMUModel;
  return o;
}

static PyMethodDef __pyx_methods_5pyfmi_3fmi_FMUModel[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_FMUModel = {
  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_FMUModel = {
  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_FMUModel = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_FMUModel = {
  #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_type_5pyfmi_3fmi_FMUModel = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pyfmi.fmi.FMUModel"), /*tp_name*/
  sizeof(struct __pyx_obj_5pyfmi_3fmi_FMUModel), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5pyfmi_3fmi_FMUModelME1, /*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_FMUModel, /*tp_as_number*/
  &__pyx_tp_as_sequence_FMUModel, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_FMUModel, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_FMUModel, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5pyfmi_3fmi_FMUModelBase, /*tp_traverse*/
  __pyx_tp_clear_5pyfmi_3fmi_FMUModelBase, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5pyfmi_3fmi_FMUModel, /*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*/
  __pyx_pw_5pyfmi_3fmi_8FMUModel_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5pyfmi_3fmi_FMUModel, /*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_5pyfmi_3fmi___pyx_scope_struct__get_number_of_lines_log(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_5pyfmi_3fmi___pyx_scope_struct__get_number_of_lines_log *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_5pyfmi_3fmi___pyx_scope_struct__get_number_of_lines_log *)o);
  p->__pyx_v_file = 0;
  return o;
}

static void __pyx_tp_dealloc_5pyfmi_3fmi___pyx_scope_struct__get_number_of_lines_log(PyObject *o) {
  struct __pyx_obj_5pyfmi_3fmi___pyx_scope_struct__get_number_of_lines_log *p = (struct __pyx_obj_5pyfmi_3fmi___pyx_scope_struct__get_number_of_lines_log *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_file);
  PyObject_GC_Track(o);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_5pyfmi_3fmi___pyx_scope_struct__get_number_of_lines_log(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5pyfmi_3fmi___pyx_scope_struct__get_number_of_lines_log *p = (struct __pyx_obj_5pyfmi_3fmi___pyx_scope_struct__get_number_of_lines_log *)o;
  if (p->__pyx_v_file) {
    e = (*v)(p->__pyx_v_file, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5pyfmi_3fmi___pyx_scope_struct__get_number_of_lines_log(PyObject *o) {
  struct __pyx_obj_5pyfmi_3fmi___pyx_scope_struct__get_number_of_lines_log *p = (struct __pyx_obj_5pyfmi_3fmi___pyx_scope_struct__get_number_of_lines_log *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->__pyx_v_file);
  p->__pyx_v_file = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_5pyfmi_3fmi___pyx_scope_struct__get_number_of_lines_log[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct__get_number_of_lines_log = {
  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_scope_struct__get_number_of_lines_log = {
  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_scope_struct__get_number_of_lines_log = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct__get_number_of_lines_log = {
  #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_type_5pyfmi_3fmi___pyx_scope_struct__get_number_of_lines_log = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pyfmi.fmi.__pyx_scope_struct__get_number_of_lines_log"), /*tp_name*/
  sizeof(struct __pyx_obj_5pyfmi_3fmi___pyx_scope_struct__get_number_of_lines_log), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5pyfmi_3fmi___pyx_scope_struct__get_number_of_lines_log, /*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_scope_struct__get_number_of_lines_log, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct__get_number_of_lines_log, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct__get_number_of_lines_log, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct__get_number_of_lines_log, /*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_5pyfmi_3fmi___pyx_scope_struct__get_number_of_lines_log, /*tp_traverse*/
  __pyx_tp_clear_5pyfmi_3fmi___pyx_scope_struct__get_number_of_lines_log, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5pyfmi_3fmi___pyx_scope_struct__get_number_of_lines_log, /*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_5pyfmi_3fmi___pyx_scope_struct__get_number_of_lines_log, /*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_5pyfmi_3fmi___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_5pyfmi_3fmi___pyx_scope_struct_1_genexpr *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_5pyfmi_3fmi___pyx_scope_struct_1_genexpr *)o);
  p->__pyx_outer_scope = 0;
  p->__pyx_v_line = 0;
  p->__pyx_t_0 = 0;
  return o;
}

static void __pyx_tp_dealloc_5pyfmi_3fmi___pyx_scope_struct_1_genexpr(PyObject *o) {
  struct __pyx_obj_5pyfmi_3fmi___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_5pyfmi_3fmi___pyx_scope_struct_1_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_line);
  Py_CLEAR(p->__pyx_t_0);
  PyObject_GC_Track(o);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_5pyfmi_3fmi___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5pyfmi_3fmi___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_5pyfmi_3fmi___pyx_scope_struct_1_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_line) {
    e = (*v)(p->__pyx_v_line, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5pyfmi_3fmi___pyx_scope_struct_1_genexpr(PyObject *o) {
  struct __pyx_obj_5pyfmi_3fmi___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_5pyfmi_3fmi___pyx_scope_struct_1_genexpr *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_5pyfmi_3fmi___pyx_scope_struct__get_number_of_lines_log *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_line);
  p->__pyx_v_line = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_5pyfmi_3fmi___pyx_scope_struct_1_genexpr[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_1_genexpr = {
  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_scope_struct_1_genexpr = {
  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_scope_struct_1_genexpr = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_1_genexpr = {
  #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_type_5pyfmi_3fmi___pyx_scope_struct_1_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pyfmi.fmi.__pyx_scope_struct_1_genexpr"), /*tp_name*/
  sizeof(struct __pyx_obj_5pyfmi_3fmi___pyx_scope_struct_1_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5pyfmi_3fmi___pyx_scope_struct_1_genexpr, /*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_scope_struct_1_genexpr, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_1_genexpr, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_1_genexpr, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct_1_genexpr, /*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_5pyfmi_3fmi___pyx_scope_struct_1_genexpr, /*tp_traverse*/
  __pyx_tp_clear_5pyfmi_3fmi___pyx_scope_struct_1_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5pyfmi_3fmi___pyx_scope_struct_1_genexpr, /*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_5pyfmi_3fmi___pyx_scope_struct_1_genexpr, /*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 PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
  #if PY_VERSION_HEX < 0x03020000
    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
  #else
    PyModuleDef_HEAD_INIT,
  #endif
    __Pyx_NAMESTR("fmi"),
    __Pyx_DOCSTR(__pyx_k_427), /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
  {&__pyx_n_s_103, __pyx_k_103, sizeof(__pyx_k_103), 0, 0, 1, 1},
  {&__pyx_kp_s_104, __pyx_k_104, sizeof(__pyx_k_104), 0, 0, 1, 0},
  {&__pyx_n_s_105, __pyx_k_105, sizeof(__pyx_k_105), 0, 0, 1, 1},
  {&__pyx_kp_s_107, __pyx_k_107, sizeof(__pyx_k_107), 0, 0, 1, 0},
  {&__pyx_n_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 1},
  {&__pyx_kp_s_110, __pyx_k_110, sizeof(__pyx_k_110), 0, 0, 1, 0},
  {&__pyx_kp_s_111, __pyx_k_111, sizeof(__pyx_k_111), 0, 0, 1, 0},
  {&__pyx_kp_s_113, __pyx_k_113, sizeof(__pyx_k_113), 0, 0, 1, 0},
  {&__pyx_kp_s_115, __pyx_k_115, sizeof(__pyx_k_115), 0, 0, 1, 0},
  {&__pyx_kp_s_117, __pyx_k_117, sizeof(__pyx_k_117), 0, 0, 1, 0},
  {&__pyx_kp_s_119, __pyx_k_119, sizeof(__pyx_k_119), 0, 0, 1, 0},
  {&__pyx_kp_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 0},
  {&__pyx_kp_s_121, __pyx_k_121, sizeof(__pyx_k_121), 0, 0, 1, 0},
  {&__pyx_kp_s_123, __pyx_k_123, sizeof(__pyx_k_123), 0, 0, 1, 0},
  {&__pyx_kp_s_126, __pyx_k_126, sizeof(__pyx_k_126), 0, 0, 1, 0},
  {&__pyx_n_s_129, __pyx_k_129, sizeof(__pyx_k_129), 0, 0, 1, 1},
  {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0},
  {&__pyx_n_s_130, __pyx_k_130, sizeof(__pyx_k_130), 0, 0, 1, 1},
  {&__pyx_n_s_131, __pyx_k_131, sizeof(__pyx_k_131), 0, 0, 1, 1},
  {&__pyx_kp_s_135, __pyx_k_135, sizeof(__pyx_k_135), 0, 0, 1, 0},
  {&__pyx_kp_s_137, __pyx_k_137, sizeof(__pyx_k_137), 0, 0, 1, 0},
  {&__pyx_n_s_140, __pyx_k_140, sizeof(__pyx_k_140), 0, 0, 1, 1},
  {&__pyx_kp_s_141, __pyx_k_141, sizeof(__pyx_k_141), 0, 0, 1, 0},
  {&__pyx_kp_s_143, __pyx_k_143, sizeof(__pyx_k_143), 0, 0, 1, 0},
  {&__pyx_n_s_145, __pyx_k_145, sizeof(__pyx_k_145), 0, 0, 1, 1},
  {&__pyx_n_s_146, __pyx_k_146, sizeof(__pyx_k_146), 0, 0, 1, 1},
  {&__pyx_n_s_147, __pyx_k_147, sizeof(__pyx_k_147), 0, 0, 1, 1},
  {&__pyx_n_s_148, __pyx_k_148, sizeof(__pyx_k_148), 0, 0, 1, 1},
  {&__pyx_n_s_149, __pyx_k_149, sizeof(__pyx_k_149), 0, 0, 1, 1},
  {&__pyx_n_s_150, __pyx_k_150, sizeof(__pyx_k_150), 0, 0, 1, 1},
  {&__pyx_kp_s_152, __pyx_k_152, sizeof(__pyx_k_152), 0, 0, 1, 0},
  {&__pyx_kp_s_154, __pyx_k_154, sizeof(__pyx_k_154), 0, 0, 1, 0},
  {&__pyx_kp_s_156, __pyx_k_156, sizeof(__pyx_k_156), 0, 0, 1, 0},
  {&__pyx_kp_s_158, __pyx_k_158, sizeof(__pyx_k_158), 0, 0, 1, 0},
  {&__pyx_kp_s_160, __pyx_k_160, sizeof(__pyx_k_160), 0, 0, 1, 0},
  {&__pyx_kp_s_162, __pyx_k_162, sizeof(__pyx_k_162), 0, 0, 1, 0},
  {&__pyx_kp_s_164, __pyx_k_164, sizeof(__pyx_k_164), 0, 0, 1, 0},
  {&__pyx_kp_s_166, __pyx_k_166, sizeof(__pyx_k_166), 0, 0, 1, 0},
  {&__pyx_kp_s_167, __pyx_k_167, sizeof(__pyx_k_167), 0, 0, 1, 0},
  {&__pyx_n_s_169, __pyx_k_169, sizeof(__pyx_k_169), 0, 0, 1, 1},
  {&__pyx_n_s_170, __pyx_k_170, sizeof(__pyx_k_170), 0, 0, 1, 1},
  {&__pyx_kp_s_172, __pyx_k_172, sizeof(__pyx_k_172), 0, 0, 1, 0},
  {&__pyx_n_s_173, __pyx_k_173, sizeof(__pyx_k_173), 0, 0, 1, 1},
  {&__pyx_kp_s_174, __pyx_k_174, sizeof(__pyx_k_174), 0, 0, 1, 0},
  {&__pyx_kp_s_176, __pyx_k_176, sizeof(__pyx_k_176), 0, 0, 1, 0},
  {&__pyx_kp_s_179, __pyx_k_179, sizeof(__pyx_k_179), 0, 0, 1, 0},
  {&__pyx_kp_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 0},
  {&__pyx_kp_s_181, __pyx_k_181, sizeof(__pyx_k_181), 0, 0, 1, 0},
  {&__pyx_kp_s_183, __pyx_k_183, sizeof(__pyx_k_183), 0, 0, 1, 0},
  {&__pyx_kp_s_185, __pyx_k_185, sizeof(__pyx_k_185), 0, 0, 1, 0},
  {&__pyx_kp_s_188, __pyx_k_188, sizeof(__pyx_k_188), 0, 0, 1, 0},
  {&__pyx_kp_s_196, __pyx_k_196, sizeof(__pyx_k_196), 0, 0, 1, 0},
  {&__pyx_kp_s_199, __pyx_k_199, sizeof(__pyx_k_199), 0, 0, 1, 0},
  {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0},
  {&__pyx_kp_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 0},
  {&__pyx_kp_s_200, __pyx_k_200, sizeof(__pyx_k_200), 0, 0, 1, 0},
  {&__pyx_kp_s_202, __pyx_k_202, sizeof(__pyx_k_202), 0, 0, 1, 0},
  {&__pyx_kp_s_203, __pyx_k_203, sizeof(__pyx_k_203), 0, 0, 1, 0},
  {&__pyx_kp_s_205, __pyx_k_205, sizeof(__pyx_k_205), 0, 0, 1, 0},
  {&__pyx_kp_s_206, __pyx_k_206, sizeof(__pyx_k_206), 0, 0, 1, 0},
  {&__pyx_kp_s_208, __pyx_k_208, sizeof(__pyx_k_208), 0, 0, 1, 0},
  {&__pyx_kp_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 0},
  {&__pyx_kp_s_210, __pyx_k_210, sizeof(__pyx_k_210), 0, 0, 1, 0},
  {&__pyx_kp_s_230, __pyx_k_230, sizeof(__pyx_k_230), 0, 0, 1, 0},
  {&__pyx_kp_s_235, __pyx_k_235, sizeof(__pyx_k_235), 0, 0, 1, 0},
  {&__pyx_kp_s_237, __pyx_k_237, sizeof(__pyx_k_237), 0, 0, 1, 0},
  {&__pyx_kp_s_239, __pyx_k_239, sizeof(__pyx_k_239), 0, 0, 1, 0},
  {&__pyx_kp_s_241, __pyx_k_241, sizeof(__pyx_k_241), 0, 0, 1, 0},
  {&__pyx_kp_s_243, __pyx_k_243, sizeof(__pyx_k_243), 0, 0, 1, 0},
  {&__pyx_kp_s_245, __pyx_k_245, sizeof(__pyx_k_245), 0, 0, 1, 0},
  {&__pyx_kp_s_247, __pyx_k_247, sizeof(__pyx_k_247), 0, 0, 1, 0},
  {&__pyx_kp_s_249, __pyx_k_249, sizeof(__pyx_k_249), 0, 0, 1, 0},
  {&__pyx_kp_s_251, __pyx_k_251, sizeof(__pyx_k_251), 0, 0, 1, 0},
  {&__pyx_kp_s_253, __pyx_k_253, sizeof(__pyx_k_253), 0, 0, 1, 0},
  {&__pyx_kp_s_255, __pyx_k_255, sizeof(__pyx_k_255), 0, 0, 1, 0},
  {&__pyx_n_s_257, __pyx_k_257, sizeof(__pyx_k_257), 0, 0, 1, 1},
  {&__pyx_n_s_258, __pyx_k_258, sizeof(__pyx_k_258), 0, 0, 1, 1},
  {&__pyx_kp_s_260, __pyx_k_260, sizeof(__pyx_k_260), 0, 0, 1, 0},
  {&__pyx_kp_s_263, __pyx_k_263, sizeof(__pyx_k_263), 0, 0, 1, 0},
  {&__pyx_n_s_271, __pyx_k_271, sizeof(__pyx_k_271), 0, 0, 1, 1},
  {&__pyx_n_s_275, __pyx_k_275, sizeof(__pyx_k_275), 0, 0, 1, 1},
  {&__pyx_kp_s_276, __pyx_k_276, sizeof(__pyx_k_276), 0, 0, 1, 0},
  {&__pyx_kp_s_278, __pyx_k_278, sizeof(__pyx_k_278), 0, 0, 1, 0},
  {&__pyx_kp_s_280, __pyx_k_280, sizeof(__pyx_k_280), 0, 0, 1, 0},
  {&__pyx_kp_s_282, __pyx_k_282, sizeof(__pyx_k_282), 0, 0, 1, 0},
  {&__pyx_kp_s_285, __pyx_k_285, sizeof(__pyx_k_285), 0, 0, 1, 0},
  {&__pyx_kp_s_286, __pyx_k_286, sizeof(__pyx_k_286), 0, 0, 1, 0},
  {&__pyx_n_s_288, __pyx_k_288, sizeof(__pyx_k_288), 0, 0, 1, 1},
  {&__pyx_n_s_289, __pyx_k_289, sizeof(__pyx_k_289), 0, 0, 1, 1},
  {&__pyx_kp_s_290, __pyx_k_290, sizeof(__pyx_k_290), 0, 0, 1, 0},
  {&__pyx_kp_s_292, __pyx_k_292, sizeof(__pyx_k_292), 0, 0, 1, 0},
  {&__pyx_n_s_294, __pyx_k_294, sizeof(__pyx_k_294), 0, 0, 1, 1},
  {&__pyx_kp_s_295, __pyx_k_295, sizeof(__pyx_k_295), 0, 0, 1, 0},
  {&__pyx_n_s_297, __pyx_k_297, sizeof(__pyx_k_297), 0, 0, 1, 1},
  {&__pyx_n_s_298, __pyx_k_298, sizeof(__pyx_k_298), 0, 0, 1, 1},
  {&__pyx_kp_s_299, __pyx_k_299, sizeof(__pyx_k_299), 0, 0, 1, 0},
  {&__pyx_kp_s_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 0, 1, 0},
  {&__pyx_n_s_302, __pyx_k_302, sizeof(__pyx_k_302), 0, 0, 1, 1},
  {&__pyx_n_s_303, __pyx_k_303, sizeof(__pyx_k_303), 0, 0, 1, 1},
  {&__pyx_kp_s_308, __pyx_k_308, sizeof(__pyx_k_308), 0, 0, 1, 0},
  {&__pyx_kp_s_310, __pyx_k_310, sizeof(__pyx_k_310), 0, 0, 1, 0},
  {&__pyx_n_s_312, __pyx_k_312, sizeof(__pyx_k_312), 0, 0, 1, 1},
  {&__pyx_kp_s_313, __pyx_k_313, sizeof(__pyx_k_313), 0, 0, 1, 0},
  {&__pyx_kp_s_315, __pyx_k_315, sizeof(__pyx_k_315), 0, 0, 1, 0},
  {&__pyx_kp_s_317, __pyx_k_317, sizeof(__pyx_k_317), 0, 0, 1, 0},
  {&__pyx_kp_s_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 0, 1, 0},
  {&__pyx_kp_s_322, __pyx_k_322, sizeof(__pyx_k_322), 0, 0, 1, 0},
  {&__pyx_n_s_324, __pyx_k_324, sizeof(__pyx_k_324), 0, 0, 1, 1},
  {&__pyx_kp_s_325, __pyx_k_325, sizeof(__pyx_k_325), 0, 0, 1, 0},
  {&__pyx_kp_s_328, __pyx_k_328, sizeof(__pyx_k_328), 0, 0, 1, 0},
  {&__pyx_kp_s_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 0, 1, 0},
  {&__pyx_kp_s_336, __pyx_k_336, sizeof(__pyx_k_336), 0, 0, 1, 0},
  {&__pyx_kp_s_338, __pyx_k_338, sizeof(__pyx_k_338), 0, 0, 1, 0},
  {&__pyx_n_s_349, __pyx_k_349, sizeof(__pyx_k_349), 0, 0, 1, 1},
  {&__pyx_kp_s_35, __pyx_k_35, sizeof(__pyx_k_35), 0, 0, 1, 0},
  {&__pyx_n_s_350, __pyx_k_350, sizeof(__pyx_k_350), 0, 0, 1, 1},
  {&__pyx_n_s_351, __pyx_k_351, sizeof(__pyx_k_351), 0, 0, 1, 1},
  {&__pyx_kp_s_354, __pyx_k_354, sizeof(__pyx_k_354), 0, 0, 1, 0},
  {&__pyx_n_s_358, __pyx_k_358, sizeof(__pyx_k_358), 0, 0, 1, 1},
  {&__pyx_n_s_359, __pyx_k_359, sizeof(__pyx_k_359), 0, 0, 1, 1},
  {&__pyx_n_s_360, __pyx_k_360, sizeof(__pyx_k_360), 0, 0, 1, 1},
  {&__pyx_n_s_361, __pyx_k_361, sizeof(__pyx_k_361), 0, 0, 1, 1},
  {&__pyx_kp_s_362, __pyx_k_362, sizeof(__pyx_k_362), 0, 0, 1, 0},
  {&__pyx_kp_s_364, __pyx_k_364, sizeof(__pyx_k_364), 0, 0, 1, 0},
  {&__pyx_n_s_368, __pyx_k_368, sizeof(__pyx_k_368), 0, 0, 1, 1},
  {&__pyx_kp_s_37, __pyx_k_37, sizeof(__pyx_k_37), 0, 0, 1, 0},
  {&__pyx_n_s_376, __pyx_k_376, sizeof(__pyx_k_376), 0, 0, 1, 1},
  {&__pyx_n_s_377, __pyx_k_377, sizeof(__pyx_k_377), 0, 0, 1, 1},
  {&__pyx_n_s_379, __pyx_k_379, sizeof(__pyx_k_379), 0, 0, 1, 1},
  {&__pyx_n_s_381, __pyx_k_381, sizeof(__pyx_k_381), 0, 0, 1, 1},
  {&__pyx_kp_s_383, __pyx_k_383, sizeof(__pyx_k_383), 0, 0, 1, 0},
  {&__pyx_kp_s_388, __pyx_k_388, sizeof(__pyx_k_388), 0, 0, 1, 0},
  {&__pyx_kp_s_39, __pyx_k_39, sizeof(__pyx_k_39), 0, 0, 1, 0},
  {&__pyx_kp_s_398, __pyx_k_398, sizeof(__pyx_k_398), 0, 0, 1, 0},
  {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0},
  {&__pyx_kp_s_40, __pyx_k_40, sizeof(__pyx_k_40), 0, 0, 1, 0},
  {&__pyx_n_s_400, __pyx_k_400, sizeof(__pyx_k_400), 0, 0, 1, 1},
  {&__pyx_kp_s_402, __pyx_k_402, sizeof(__pyx_k_402), 0, 0, 1, 0},
  {&__pyx_kp_s_403, __pyx_k_403, sizeof(__pyx_k_403), 0, 0, 1, 0},
  {&__pyx_kp_s_406, __pyx_k_406, sizeof(__pyx_k_406), 0, 0, 1, 0},
  {&__pyx_kp_s_408, __pyx_k_408, sizeof(__pyx_k_408), 0, 0, 1, 0},
  {&__pyx_kp_s_409, __pyx_k_409, sizeof(__pyx_k_409), 0, 0, 1, 0},
  {&__pyx_kp_s_412, __pyx_k_412, sizeof(__pyx_k_412), 0, 0, 1, 0},
  {&__pyx_kp_s_413, __pyx_k_413, sizeof(__pyx_k_413), 0, 0, 1, 0},
  {&__pyx_kp_u_415, __pyx_k_415, sizeof(__pyx_k_415), 0, 1, 0, 0},
  {&__pyx_kp_u_417, __pyx_k_417, sizeof(__pyx_k_417), 0, 1, 0, 0},
  {&__pyx_kp_u_419, __pyx_k_419, sizeof(__pyx_k_419), 0, 1, 0, 0},
  {&__pyx_kp_s_42, __pyx_k_42, sizeof(__pyx_k_42), 0, 0, 1, 0},
  {&__pyx_kp_u_421, __pyx_k_421, sizeof(__pyx_k_421), 0, 1, 0, 0},
  {&__pyx_kp_u_422, __pyx_k_422, sizeof(__pyx_k_422), 0, 1, 0, 0},
  {&__pyx_kp_u_425, __pyx_k_425, sizeof(__pyx_k_425), 0, 1, 0, 0},
  {&__pyx_n_s_428, __pyx_k_428, sizeof(__pyx_k_428), 0, 0, 1, 1},
  {&__pyx_n_s_429, __pyx_k_429, sizeof(__pyx_k_429), 0, 0, 1, 1},
  {&__pyx_n_s_430, __pyx_k_430, sizeof(__pyx_k_430), 0, 0, 1, 1},
  {&__pyx_n_s_431, __pyx_k_431, sizeof(__pyx_k_431), 0, 0, 1, 1},
  {&__pyx_n_s_432, __pyx_k_432, sizeof(__pyx_k_432), 0, 0, 1, 1},
  {&__pyx_kp_s_435, __pyx_k_435, sizeof(__pyx_k_435), 0, 0, 1, 0},
  {&__pyx_n_s_436, __pyx_k_436, sizeof(__pyx_k_436), 0, 0, 1, 1},
  {&__pyx_kp_s_44, __pyx_k_44, sizeof(__pyx_k_44), 0, 0, 1, 0},
  {&__pyx_kp_s_443, __pyx_k_443, sizeof(__pyx_k_443), 0, 0, 1, 0},
  {&__pyx_kp_s_444, __pyx_k_444, sizeof(__pyx_k_444), 0, 0, 1, 0},
  {&__pyx_n_s_445, __pyx_k_445, sizeof(__pyx_k_445), 0, 0, 1, 1},
  {&__pyx_kp_s_446, __pyx_k_446, sizeof(__pyx_k_446), 0, 0, 1, 0},
  {&__pyx_n_s_448, __pyx_k_448, sizeof(__pyx_k_448), 0, 0, 1, 1},
  {&__pyx_n_s_449, __pyx_k_449, sizeof(__pyx_k_449), 0, 0, 1, 1},
  {&__pyx_kp_s_45, __pyx_k_45, sizeof(__pyx_k_45), 0, 0, 1, 0},
  {&__pyx_n_s_450, __pyx_k_450, sizeof(__pyx_k_450), 0, 0, 1, 1},
  {&__pyx_kp_s_451, __pyx_k_451, sizeof(__pyx_k_451), 0, 0, 1, 0},
  {&__pyx_n_s_452, __pyx_k_452, sizeof(__pyx_k_452), 0, 0, 1, 1},
  {&__pyx_kp_s_453, __pyx_k_453, sizeof(__pyx_k_453), 0, 0, 1, 0},
  {&__pyx_n_s_454, __pyx_k_454, sizeof(__pyx_k_454), 0, 0, 1, 1},
  {&__pyx_n_s_455, __pyx_k_455, sizeof(__pyx_k_455), 0, 0, 1, 1},
  {&__pyx_n_s_456, __pyx_k_456, sizeof(__pyx_k_456), 0, 0, 1, 1},
  {&__pyx_n_s_457, __pyx_k_457, sizeof(__pyx_k_457), 0, 0, 1, 1},
  {&__pyx_kp_s_458, __pyx_k_458, sizeof(__pyx_k_458), 0, 0, 1, 0},
  {&__pyx_n_s_459, __pyx_k_459, sizeof(__pyx_k_459), 0, 0, 1, 1},
  {&__pyx_kp_s_460, __pyx_k_460, sizeof(__pyx_k_460), 0, 0, 1, 0},
  {&__pyx_kp_s_461, __pyx_k_461, sizeof(__pyx_k_461), 0, 0, 1, 0},
  {&__pyx_kp_s_462, __pyx_k_462, sizeof(__pyx_k_462), 0, 0, 1, 0},
  {&__pyx_kp_s_463, __pyx_k_463, sizeof(__pyx_k_463), 0, 0, 1, 0},
  {&__pyx_n_s_468, __pyx_k_468, sizeof(__pyx_k_468), 0, 0, 1, 1},
  {&__pyx_n_s_48, __pyx_k_48, sizeof(__pyx_k_48), 0, 0, 1, 1},
  {&__pyx_kp_s_49, __pyx_k_49, sizeof(__pyx_k_49), 0, 0, 1, 0},
  {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0},
  {&__pyx_kp_s_51, __pyx_k_51, sizeof(__pyx_k_51), 0, 0, 1, 0},
  {&__pyx_n_s_53, __pyx_k_53, sizeof(__pyx_k_53), 0, 0, 1, 1},
  {&__pyx_kp_s_54, __pyx_k_54, sizeof(__pyx_k_54), 0, 0, 1, 0},
  {&__pyx_kp_s_56, __pyx_k_56, sizeof(__pyx_k_56), 0, 0, 1, 0},
  {&__pyx_kp_s_58, __pyx_k_58, sizeof(__pyx_k_58), 0, 0, 1, 0},
  {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0},
  {&__pyx_kp_s_60, __pyx_k_60, sizeof(__pyx_k_60), 0, 0, 1, 0},
  {&__pyx_kp_s_63, __pyx_k_63, sizeof(__pyx_k_63), 0, 0, 1, 0},
  {&__pyx_kp_s_65, __pyx_k_65, sizeof(__pyx_k_65), 0, 0, 1, 0},
  {&__pyx_kp_s_68, __pyx_k_68, sizeof(__pyx_k_68), 0, 0, 1, 0},
  {&__pyx_kp_s_70, __pyx_k_70, sizeof(__pyx_k_70), 0, 0, 1, 0},
  {&__pyx_kp_s_72, __pyx_k_72, sizeof(__pyx_k_72), 0, 0, 1, 0},
  {&__pyx_kp_s_75, __pyx_k_75, sizeof(__pyx_k_75), 0, 0, 1, 0},
  {&__pyx_kp_s_77, __pyx_k_77, sizeof(__pyx_k_77), 0, 0, 1, 0},
  {&__pyx_kp_s_79, __pyx_k_79, sizeof(__pyx_k_79), 0, 0, 1, 0},
  {&__pyx_n_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 1},
  {&__pyx_kp_s_81, __pyx_k_81, sizeof(__pyx_k_81), 0, 0, 1, 0},
  {&__pyx_kp_s_82, __pyx_k_82, sizeof(__pyx_k_82), 0, 0, 1, 0},
  {&__pyx_n_s_85, __pyx_k_85, sizeof(__pyx_k_85), 0, 0, 1, 1},
  {&__pyx_n_s_86, __pyx_k_86, sizeof(__pyx_k_86), 0, 0, 1, 1},
  {&__pyx_n_s_87, __pyx_k_87, sizeof(__pyx_k_87), 0, 0, 1, 1},
  {&__pyx_kp_s_88, __pyx_k_88, sizeof(__pyx_k_88), 0, 0, 1, 0},
  {&__pyx_kp_s_89, __pyx_k_89, sizeof(__pyx_k_89), 0, 0, 1, 0},
  {&__pyx_kp_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 0},
  {&__pyx_kp_s_91, __pyx_k_91, sizeof(__pyx_k_91), 0, 0, 1, 0},
  {&__pyx_kp_s_93, __pyx_k_93, sizeof(__pyx_k_93), 0, 0, 1, 0},
  {&__pyx_kp_s_94, __pyx_k_94, sizeof(__pyx_k_94), 0, 0, 1, 0},
  {&__pyx_kp_s_96, __pyx_k_96, sizeof(__pyx_k_96), 0, 0, 1, 0},
  {&__pyx_kp_s_98, __pyx_k_98, sizeof(__pyx_k_98), 0, 0, 1, 0},
  {&__pyx_n_s__A, __pyx_k__A, sizeof(__pyx_k__A), 0, 0, 1, 1},
  {&__pyx_n_s__AlgorithmBase, __pyx_k__AlgorithmBase, sizeof(__pyx_k__AlgorithmBase), 0, 0, 1, 1},
  {&__pyx_n_s__AssimuloFMIAlg, __pyx_k__AssimuloFMIAlg, sizeof(__pyx_k__AssimuloFMIAlg), 0, 0, 1, 1},
  {&__pyx_n_s__B, __pyx_k__B, sizeof(__pyx_k__B), 0, 0, 1, 1},
  {&__pyx_n_s__C, __pyx_k__C, sizeof(__pyx_k__C), 0, 0, 1, 1},
  {&__pyx_n_s__CS, __pyx_k__CS, sizeof(__pyx_k__CS), 0, 0, 1, 1},
  {&__pyx_n_s__D, __pyx_k__D, sizeof(__pyx_k__D), 0, 0, 1, 1},
  {&__pyx_n_s__Default, __pyx_k__Default, sizeof(__pyx_k__Default), 0, 0, 1, 1},
  {&__pyx_n_s__Exception, __pyx_k__Exception, sizeof(__pyx_k__Exception), 0, 0, 1, 1},
  {&__pyx_n_s__FMI1_DO_STEP_STATUS, __pyx_k__FMI1_DO_STEP_STATUS, sizeof(__pyx_k__FMI1_DO_STEP_STATUS), 0, 0, 1, 1},
  {&__pyx_n_s__FMI1_PENDING_STATUS, __pyx_k__FMI1_PENDING_STATUS, sizeof(__pyx_k__FMI1_PENDING_STATUS), 0, 0, 1, 1},
  {&__pyx_n_s__FMI2_BOOLEAN, __pyx_k__FMI2_BOOLEAN, sizeof(__pyx_k__FMI2_BOOLEAN), 0, 0, 1, 1},
  {&__pyx_n_s__FMI2_CONSTANT, __pyx_k__FMI2_CONSTANT, sizeof(__pyx_k__FMI2_CONSTANT), 0, 0, 1, 1},
  {&__pyx_n_s__FMI2_CONTINUOUS, __pyx_k__FMI2_CONTINUOUS, sizeof(__pyx_k__FMI2_CONTINUOUS), 0, 0, 1, 1},
  {&__pyx_n_s__FMI2_DISCRETE, __pyx_k__FMI2_DISCRETE, sizeof(__pyx_k__FMI2_DISCRETE), 0, 0, 1, 1},
  {&__pyx_n_s__FMI2_ENUMERATION, __pyx_k__FMI2_ENUMERATION, sizeof(__pyx_k__FMI2_ENUMERATION), 0, 0, 1, 1},
  {&__pyx_n_s__FMI2_FALSE, __pyx_k__FMI2_FALSE, sizeof(__pyx_k__FMI2_FALSE), 0, 0, 1, 1},
  {&__pyx_n_s__FMI2_FIXED, __pyx_k__FMI2_FIXED, sizeof(__pyx_k__FMI2_FIXED), 0, 0, 1, 1},
  {&__pyx_n_s__FMI2_INITIAL_APPROX, __pyx_k__FMI2_INITIAL_APPROX, sizeof(__pyx_k__FMI2_INITIAL_APPROX), 0, 0, 1, 1},
  {&__pyx_n_s__FMI2_INITIAL_EXACT, __pyx_k__FMI2_INITIAL_EXACT, sizeof(__pyx_k__FMI2_INITIAL_EXACT), 0, 0, 1, 1},
  {&__pyx_n_s__FMI2_INPUT, __pyx_k__FMI2_INPUT, sizeof(__pyx_k__FMI2_INPUT), 0, 0, 1, 1},
  {&__pyx_n_s__FMI2_INTEGER, __pyx_k__FMI2_INTEGER, sizeof(__pyx_k__FMI2_INTEGER), 0, 0, 1, 1},
  {&__pyx_n_s__FMI2_OUTPUT, __pyx_k__FMI2_OUTPUT, sizeof(__pyx_k__FMI2_OUTPUT), 0, 0, 1, 1},
  {&__pyx_n_s__FMI2_REAL, __pyx_k__FMI2_REAL, sizeof(__pyx_k__FMI2_REAL), 0, 0, 1, 1},
  {&__pyx_n_s__FMI2_STRING, __pyx_k__FMI2_STRING, sizeof(__pyx_k__FMI2_STRING), 0, 0, 1, 1},
  {&__pyx_n_s__FMI2_TRUE, __pyx_k__FMI2_TRUE, sizeof(__pyx_k__FMI2_TRUE), 0, 0, 1, 1},
  {&__pyx_n_s__FMI2_TUNABLE, __pyx_k__FMI2_TUNABLE, sizeof(__pyx_k__FMI2_TUNABLE), 0, 0, 1, 1},
  {&__pyx_n_s__FMI2_UNKNOWN, __pyx_k__FMI2_UNKNOWN, sizeof(__pyx_k__FMI2_UNKNOWN), 0, 0, 1, 1},
  {&__pyx_n_s__FMICSAlg, __pyx_k__FMICSAlg, sizeof(__pyx_k__FMICSAlg), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_ALIAS, __pyx_k__FMI_ALIAS, sizeof(__pyx_k__FMI_ALIAS), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_BOOLEAN, __pyx_k__FMI_BOOLEAN, sizeof(__pyx_k__FMI_BOOLEAN), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_CONSTANT, __pyx_k__FMI_CONSTANT, sizeof(__pyx_k__FMI_CONSTANT), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_CONTINUOUS, __pyx_k__FMI_CONTINUOUS, sizeof(__pyx_k__FMI_CONTINUOUS), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_CS_STANDALONE, __pyx_k__FMI_CS_STANDALONE, sizeof(__pyx_k__FMI_CS_STANDALONE), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_DERIVATIVES, __pyx_k__FMI_DERIVATIVES, sizeof(__pyx_k__FMI_DERIVATIVES), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_DISCARD, __pyx_k__FMI_DISCARD, sizeof(__pyx_k__FMI_DISCARD), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_DISCRETE, __pyx_k__FMI_DISCRETE, sizeof(__pyx_k__FMI_DISCRETE), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_ENUMERATION, __pyx_k__FMI_ENUMERATION, sizeof(__pyx_k__FMI_ENUMERATION), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_ERROR, __pyx_k__FMI_ERROR, sizeof(__pyx_k__FMI_ERROR), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_FALSE, __pyx_k__FMI_FALSE, sizeof(__pyx_k__FMI_FALSE), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_FATAL, __pyx_k__FMI_FATAL, sizeof(__pyx_k__FMI_FATAL), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_INPUT, __pyx_k__FMI_INPUT, sizeof(__pyx_k__FMI_INPUT), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_INPUTS, __pyx_k__FMI_INPUTS, sizeof(__pyx_k__FMI_INPUTS), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_INTEGER, __pyx_k__FMI_INTEGER, sizeof(__pyx_k__FMI_INTEGER), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_INTERNAL, __pyx_k__FMI_INTERNAL, sizeof(__pyx_k__FMI_INTERNAL), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_ME, __pyx_k__FMI_ME, sizeof(__pyx_k__FMI_ME), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_NEGATED_ALIAS, __pyx_k__FMI_NEGATED_ALIAS, sizeof(__pyx_k__FMI_NEGATED_ALIAS), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_NONE, __pyx_k__FMI_NONE, sizeof(__pyx_k__FMI_NONE), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_NO_ALIAS, __pyx_k__FMI_NO_ALIAS, sizeof(__pyx_k__FMI_NO_ALIAS), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_OK, __pyx_k__FMI_OK, sizeof(__pyx_k__FMI_OK), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_OUTPUT, __pyx_k__FMI_OUTPUT, sizeof(__pyx_k__FMI_OUTPUT), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_OUTPUTS, __pyx_k__FMI_OUTPUTS, sizeof(__pyx_k__FMI_OUTPUTS), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_PARAMETER, __pyx_k__FMI_PARAMETER, sizeof(__pyx_k__FMI_PARAMETER), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_PENDING, __pyx_k__FMI_PENDING, sizeof(__pyx_k__FMI_PENDING), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_REAL, __pyx_k__FMI_REAL, sizeof(__pyx_k__FMI_REAL), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_STATES, __pyx_k__FMI_STATES, sizeof(__pyx_k__FMI_STATES), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_STRING, __pyx_k__FMI_STRING, sizeof(__pyx_k__FMI_STRING), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_TRUE, __pyx_k__FMI_TRUE, sizeof(__pyx_k__FMI_TRUE), 0, 0, 1, 1},
  {&__pyx_n_s__FMI_WARNING, __pyx_k__FMI_WARNING, sizeof(__pyx_k__FMI_WARNING), 0, 0, 1, 1},
  {&__pyx_n_s__FMUException, __pyx_k__FMUException, sizeof(__pyx_k__FMUException), 0, 0, 1, 1},
  {&__pyx_n_s__ME, __pyx_k__ME, sizeof(__pyx_k__ME), 0, 0, 1, 1},
  {&__pyx_n_s__Model, __pyx_k__Model, sizeof(__pyx_k__Model), 0, 0, 1, 1},
  {&__pyx_n_s__N, __pyx_k__N, sizeof(__pyx_k__N), 0, 0, 1, 1},
  {&__pyx_n_s__NotImplementedError, __pyx_k__NotImplementedError, sizeof(__pyx_k__NotImplementedError), 0, 0, 1, 1},
  {&__pyx_n_s__OrderedDict, __pyx_k__OrderedDict, sizeof(__pyx_k__OrderedDict), 0, 0, 1, 1},
  {&__pyx_n_s__PyEventInfo, __pyx_k__PyEventInfo, sizeof(__pyx_k__PyEventInfo), 0, 0, 1, 1},
  {&__pyx_n_s__RuntimeError, __pyx_k__RuntimeError, sizeof(__pyx_k__RuntimeError), 0, 0, 1, 1},
  {&__pyx_n_s__SciEstAlg, __pyx_k__SciEstAlg, sizeof(__pyx_k__SciEstAlg), 0, 0, 1, 1},
  {&__pyx_n_s__Slave, __pyx_k__Slave, sizeof(__pyx_k__Slave), 0, 0, 1, 1},
  {&__pyx_n_s__StopTimeDefined, __pyx_k__StopTimeDefined, sizeof(__pyx_k__StopTimeDefined), 0, 0, 1, 1},
  {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1},
  {&__pyx_n_s____enter__, __pyx_k____enter__, sizeof(__pyx_k____enter__), 0, 0, 1, 1},
  {&__pyx_n_s____exit__, __pyx_k____exit__, sizeof(__pyx_k____exit__), 0, 0, 1, 1},
  {&__pyx_n_s____import__, __pyx_k____import__, sizeof(__pyx_k____import__), 0, 0, 1, 1},
  {&__pyx_n_s____init__, __pyx_k____init__, sizeof(__pyx_k____init__), 0, 0, 1, 1},
  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
  {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
  {&__pyx_n_s___convert_filter, __pyx_k___convert_filter, sizeof(__pyx_k___convert_filter), 0, 0, 1, 1},
  {&__pyx_n_s___default_options, __pyx_k___default_options, sizeof(__pyx_k___default_options), 0, 0, 1, 1},
  {&__pyx_n_s___fmu, __pyx_k___fmu, sizeof(__pyx_k___fmu), 0, 0, 1, 1},
  {&__pyx_n_s___get, __pyx_k___get, sizeof(__pyx_k___get), 0, 0, 1, 1},
  {&__pyx_n_s___get_A, __pyx_k___get_A, sizeof(__pyx_k___get_A), 0, 0, 1, 1},
  {&__pyx_n_s___get_B, __pyx_k___get_B, sizeof(__pyx_k___get_B), 0, 0, 1, 1},
  {&__pyx_n_s___get_C, __pyx_k___get_C, sizeof(__pyx_k___get_C), 0, 0, 1, 1},
  {&__pyx_n_s___get_D, __pyx_k___get_D, sizeof(__pyx_k___get_D), 0, 0, 1, 1},
  {&__pyx_n_s___get_alias, __pyx_k___get_alias, sizeof(__pyx_k___get_alias), 0, 0, 1, 1},
  {&__pyx_n_s___get_causality, __pyx_k___get_causality, sizeof(__pyx_k___get_causality), 0, 0, 1, 1},
  {&__pyx_n_s___get_description, __pyx_k___get_description, sizeof(__pyx_k___get_description), 0, 0, 1, 1},
  {&__pyx_n_s___get_initial, __pyx_k___get_initial, sizeof(__pyx_k___get_initial), 0, 0, 1, 1},
  {&__pyx_n_s___get_name, __pyx_k___get_name, sizeof(__pyx_k___get_name), 0, 0, 1, 1},
  {&__pyx_n_s___get_time, __pyx_k___get_time, sizeof(__pyx_k___get_time), 0, 0, 1, 1},
  {&__pyx_n_s___get_type, __pyx_k___get_type, sizeof(__pyx_k___get_type), 0, 0, 1, 1},
  {&__pyx_n_s___get_types_platform, __pyx_k___get_types_platform, sizeof(__pyx_k___get_types_platform), 0, 0, 1, 1},
  {&__pyx_n_s___get_variability, __pyx_k___get_variability, sizeof(__pyx_k___get_variability), 0, 0, 1, 1},
  {&__pyx_n_s___get_version, __pyx_k___get_version, sizeof(__pyx_k___get_version), 0, 0, 1, 1},
  {&__pyx_n_s___set, __pyx_k___set, sizeof(__pyx_k___set), 0, 0, 1, 1},
  {&__pyx_n_s___set_time, __pyx_k___set_time, sizeof(__pyx_k___set_time), 0, 0, 1, 1},
  {&__pyx_n_s__a, __pyx_k__a, sizeof(__pyx_k__a), 0, 0, 1, 1},
  {&__pyx_n_s__abspath, __pyx_k__abspath, sizeof(__pyx_k__abspath), 0, 0, 1, 1},
  {&__pyx_n_s__add_diag, __pyx_k__add_diag, sizeof(__pyx_k__add_diag), 0, 0, 1, 1},
  {&__pyx_n_s__alg, __pyx_k__alg, sizeof(__pyx_k__alg), 0, 0, 1, 1},
  {&__pyx_n_s__algdrive, __pyx_k__algdrive, sizeof(__pyx_k__algdrive), 0, 0, 1, 1},
  {&__pyx_n_s__algorithm, __pyx_k__algorithm, sizeof(__pyx_k__algorithm), 0, 0, 1, 1},
  {&__pyx_n_s__algorithm_drivers, __pyx_k__algorithm_drivers, sizeof(__pyx_k__algorithm_drivers), 0, 0, 1, 1},
  {&__pyx_n_s__alias, __pyx_k__alias, sizeof(__pyx_k__alias), 0, 0, 1, 1},
  {&__pyx_n_s__allocated_context, __pyx_k__allocated_context, sizeof(__pyx_k__allocated_context), 0, 0, 1, 1},
  {&__pyx_n_s__allocated_xml, __pyx_k__allocated_xml, sizeof(__pyx_k__allocated_xml), 0, 0, 1, 1},
  {&__pyx_n_s__array, __pyx_k__array, sizeof(__pyx_k__array), 0, 0, 1, 1},
  {&__pyx_n_s__auto, __pyx_k__auto, sizeof(__pyx_k__auto), 0, 0, 1, 1},
  {&__pyx_n_s__base_path, __pyx_k__base_path, sizeof(__pyx_k__base_path), 0, 0, 1, 1},
  {&__pyx_n_s__basestring, __pyx_k__basestring, sizeof(__pyx_k__basestring), 0, 0, 1, 1},
  {&__pyx_n_s__callBackFunctions, __pyx_k__callBackFunctions, sizeof(__pyx_k__callBackFunctions), 0, 0, 1, 1},
  {&__pyx_n_s__callBackFunctions_1, __pyx_k__callBackFunctions_1, sizeof(__pyx_k__callBackFunctions_1), 0, 0, 1, 1},
  {&__pyx_n_s__callBackFunctions_2, __pyx_k__callBackFunctions_2, sizeof(__pyx_k__callBackFunctions_2), 0, 0, 1, 1},
  {&__pyx_n_s__callbacks, __pyx_k__callbacks, sizeof(__pyx_k__callbacks), 0, 0, 1, 1},
  {&__pyx_n_s__canHandleEvents, __pyx_k__canHandleEvents, sizeof(__pyx_k__canHandleEvents), 0, 0, 1, 1},
  {&__pyx_n_s__canRejectSteps, __pyx_k__canRejectSteps, sizeof(__pyx_k__canRejectSteps), 0, 0, 1, 1},
  {&__pyx_n_s__canSignalEvents, __pyx_k__canSignalEvents, sizeof(__pyx_k__canSignalEvents), 0, 0, 1, 1},
  {&__pyx_n_s__categories, __pyx_k__categories, sizeof(__pyx_k__categories), 0, 0, 1, 1},
  {&__pyx_n_s__causality, __pyx_k__causality, sizeof(__pyx_k__causality), 0, 0, 1, 1},
  {&__pyx_n_s__codecs, __pyx_k__codecs, sizeof(__pyx_k__codecs), 0, 0, 1, 1},
  {&__pyx_n_s__collections, __pyx_k__collections, sizeof(__pyx_k__collections), 0, 0, 1, 1},
  {&__pyx_n_s__compile, __pyx_k__compile, sizeof(__pyx_k__compile), 0, 0, 1, 1},
  {&__pyx_n_s__context, __pyx_k__context, sizeof(__pyx_k__context), 0, 0, 1, 1},
  {&__pyx_n_s__continuous_states, __pyx_k__continuous_states, sizeof(__pyx_k__continuous_states), 0, 0, 1, 1},
  {&__pyx_n_s__cpr_seed, __pyx_k__cpr_seed, sizeof(__pyx_k__cpr_seed), 0, 0, 1, 1},
  {&__pyx_n_s__create_temp_dir, __pyx_k__create_temp_dir, sizeof(__pyx_k__create_temp_dir), 0, 0, 1, 1},
  {&__pyx_n_s__create_temp_file, __pyx_k__create_temp_file, sizeof(__pyx_k__create_temp_file), 0, 0, 1, 1},
  {&__pyx_n_s__csc_matrix, __pyx_k__csc_matrix, sizeof(__pyx_k__csc_matrix), 0, 0, 1, 1},
  {&__pyx_n_s__current_t, __pyx_k__current_t, sizeof(__pyx_k__current_t), 0, 0, 1, 1},
  {&__pyx_n_s__decode, __pyx_k__decode, sizeof(__pyx_k__decode), 0, 0, 1, 1},
  {&__pyx_n_s__delete_temp_dir, __pyx_k__delete_temp_dir, sizeof(__pyx_k__delete_temp_dir), 0, 0, 1, 1},
  {&__pyx_n_s__delete_temp_file, __pyx_k__delete_temp_file, sizeof(__pyx_k__delete_temp_file), 0, 0, 1, 1},
  {&__pyx_n_s__description, __pyx_k__description, sizeof(__pyx_k__description), 0, 0, 1, 1},
  {&__pyx_n_s__do_step, __pyx_k__do_step, sizeof(__pyx_k__do_step), 0, 0, 1, 1},
  {&__pyx_n_s__doc, __pyx_k__doc, sizeof(__pyx_k__doc), 0, 0, 1, 1},
  {&__pyx_n_s__double, __pyx_k__double, sizeof(__pyx_k__double), 0, 0, 1, 1},
  {&__pyx_n_s__dtype, __pyx_k__dtype, sizeof(__pyx_k__dtype), 0, 0, 1, 1},
  {&__pyx_n_s__empty, __pyx_k__empty, sizeof(__pyx_k__empty), 0, 0, 1, 1},
  {&__pyx_n_s__enable_logging, __pyx_k__enable_logging, sizeof(__pyx_k__enable_logging), 0, 0, 1, 1},
  {&__pyx_n_s__encode, __pyx_k__encode, sizeof(__pyx_k__encode), 0, 0, 1, 1},
  {&__pyx_n_s__end_lines, __pyx_k__end_lines, sizeof(__pyx_k__end_lines), 0, 0, 1, 1},
  {&__pyx_n_s__endswith, __pyx_k__endswith, sizeof(__pyx_k__endswith), 0, 0, 1, 1},
  {&__pyx_n_s__eps, __pyx_k__eps, sizeof(__pyx_k__eps), 0, 0, 1, 1},
  {&__pyx_n_s__extend, __pyx_k__extend, sizeof(__pyx_k__extend), 0, 0, 1, 1},
  {&__pyx_n_s__fget, __pyx_k__fget, sizeof(__pyx_k__fget), 0, 0, 1, 1},
  {&__pyx_n_s__file, __pyx_k__file, sizeof(__pyx_k__file), 0, 0, 1, 1},
  {&__pyx_n_s__filter, __pyx_k__filter, sizeof(__pyx_k__filter), 0, 0, 1, 1},
  {&__pyx_n_s__final_time, __pyx_k__final_time, sizeof(__pyx_k__final_time), 0, 0, 1, 1},
  {&__pyx_n_s__finfo, __pyx_k__finfo, sizeof(__pyx_k__finfo), 0, 0, 1, 1},
  {&__pyx_n_s__flat, __pyx_k__flat, sizeof(__pyx_k__flat), 0, 0, 1, 1},
  {&__pyx_n_s__flatten, __pyx_k__flatten, sizeof(__pyx_k__flatten), 0, 0, 1, 1},
  {&__pyx_n_s__float, __pyx_k__float, sizeof(__pyx_k__float), 0, 0, 1, 1},
  {&__pyx_n_s__fmu, __pyx_k__fmu, sizeof(__pyx_k__fmu), 0, 0, 1, 1},
  {&__pyx_n_s__fmu_1, __pyx_k__fmu_1, sizeof(__pyx_k__fmu_1), 0, 0, 1, 1},
  {&__pyx_n_s__fmu_1_kind, __pyx_k__fmu_1_kind, sizeof(__pyx_k__fmu_1_kind), 0, 0, 1, 1},
  {&__pyx_n_s__fmu_2, __pyx_k__fmu_2, sizeof(__pyx_k__fmu_2), 0, 0, 1, 1},
  {&__pyx_n_s__fmu_2_kind, __pyx_k__fmu_2_kind, sizeof(__pyx_k__fmu_2_kind), 0, 0, 1, 1},
  {&__pyx_n_s__fmu_full_path, __pyx_k__fmu_full_path, sizeof(__pyx_k__fmu_full_path), 0, 0, 1, 1},
  {&__pyx_n_s__fmu_kind, __pyx_k__fmu_kind, sizeof(__pyx_k__fmu_kind), 0, 0, 1, 1},
  {&__pyx_n_s__fmu_temp_dir, __pyx_k__fmu_temp_dir, sizeof(__pyx_k__fmu_temp_dir), 0, 0, 1, 1},
  {&__pyx_n_s__fnmatch, __pyx_k__fnmatch, sizeof(__pyx_k__fnmatch), 0, 0, 1, 1},
  {&__pyx_n_s__func_ref, __pyx_k__func_ref, sizeof(__pyx_k__func_ref), 0, 0, 1, 1},
  {&__pyx_n_s__get_boolean, __pyx_k__get_boolean, sizeof(__pyx_k__get_boolean), 0, 0, 1, 1},
  {&__pyx_n_s__get_default_options, __pyx_k__get_default_options, sizeof(__pyx_k__get_default_options), 0, 0, 1, 1},
  {&__pyx_n_s__get_derivatives, __pyx_k__get_derivatives, sizeof(__pyx_k__get_derivatives), 0, 0, 1, 1},
  {&__pyx_n_s__get_input_list, __pyx_k__get_input_list, sizeof(__pyx_k__get_input_list), 0, 0, 1, 1},
  {&__pyx_n_s__get_integer, __pyx_k__get_integer, sizeof(__pyx_k__get_integer), 0, 0, 1, 1},
  {&__pyx_n_s__get_log, __pyx_k__get_log, sizeof(__pyx_k__get_log), 0, 0, 1, 1},
  {&__pyx_n_s__get_model_variables, __pyx_k__get_model_variables, sizeof(__pyx_k__get_model_variables), 0, 0, 1, 1},
  {&__pyx_n_s__get_output_list, __pyx_k__get_output_list, sizeof(__pyx_k__get_output_list), 0, 0, 1, 1},
  {&__pyx_n_s__get_real, __pyx_k__get_real, sizeof(__pyx_k__get_real), 0, 0, 1, 1},
  {&__pyx_n_s__get_result, __pyx_k__get_result, sizeof(__pyx_k__get_result), 0, 0, 1, 1},
  {&__pyx_n_s__get_states_list, __pyx_k__get_states_list, sizeof(__pyx_k__get_states_list), 0, 0, 1, 1},
  {&__pyx_n_s__get_string, __pyx_k__get_string, sizeof(__pyx_k__get_string), 0, 0, 1, 1},
  {&__pyx_n_s__get_variable_fixed, __pyx_k__get_variable_fixed, sizeof(__pyx_k__get_variable_fixed), 0, 0, 1, 1},
  {&__pyx_n_s__get_variable_max, __pyx_k__get_variable_max, sizeof(__pyx_k__get_variable_max), 0, 0, 1, 1},
  {&__pyx_n_s__get_variable_min, __pyx_k__get_variable_min, sizeof(__pyx_k__get_variable_min), 0, 0, 1, 1},
  {&__pyx_n_s__get_variable_start, __pyx_k__get_variable_start, sizeof(__pyx_k__get_variable_start), 0, 0, 1, 1},
  {&__pyx_n_s__group, __pyx_k__group, sizeof(__pyx_k__group), 0, 0, 1, 1},
  {&__pyx_n_s__i, __pyx_k__i, sizeof(__pyx_k__i), 0, 0, 1, 1},
  {&__pyx_n_s__include_alias, __pyx_k__include_alias, sizeof(__pyx_k__include_alias), 0, 0, 1, 1},
  {&__pyx_n_s__initial, __pyx_k__initial, sizeof(__pyx_k__initial), 0, 0, 1, 1},
  {&__pyx_n_s__input, __pyx_k__input, sizeof(__pyx_k__input), 0, 0, 1, 1},
  {&__pyx_n_s__instantiate, __pyx_k__instantiate, sizeof(__pyx_k__instantiate), 0, 0, 1, 1},
  {&__pyx_n_s__instantiate_model, __pyx_k__instantiate_model, sizeof(__pyx_k__instantiate_model), 0, 0, 1, 1},
  {&__pyx_n_s__instantiate_slave, __pyx_k__instantiate_slave, sizeof(__pyx_k__instantiate_slave), 0, 0, 1, 1},
  {&__pyx_n_s__int, __pyx_k__int, sizeof(__pyx_k__int), 0, 0, 1, 1},
  {&__pyx_n_s__int32, __pyx_k__int32, sizeof(__pyx_k__int32), 0, 0, 1, 1},
  {&__pyx_n_s__intermediateResult, __pyx_k__intermediateResult, sizeof(__pyx_k__intermediateResult), 0, 0, 1, 1},
  {&__pyx_n_s__isfile, __pyx_k__isfile, sizeof(__pyx_k__isfile), 0, 0, 1, 1},
  {&__pyx_n_s__iterationConverged, __pyx_k__iterationConverged, sizeof(__pyx_k__iterationConverged), 0, 0, 1, 1},
  {&__pyx_n_s__join, __pyx_k__join, sizeof(__pyx_k__join), 0, 0, 1, 1},
  {&__pyx_n_s__keys, __pyx_k__keys, sizeof(__pyx_k__keys), 0, 0, 1, 1},
  {&__pyx_n_s__kind, __pyx_k__kind, sizeof(__pyx_k__kind), 0, 0, 1, 1},
  {&__pyx_n_s__last_error, __pyx_k__last_error, sizeof(__pyx_k__last_error), 0, 0, 1, 1},
  {&__pyx_n_s__latin_1_encode, __pyx_k__latin_1_encode, sizeof(__pyx_k__latin_1_encode), 0, 0, 1, 1},
  {&__pyx_n_s__line, __pyx_k__line, sizeof(__pyx_k__line), 0, 0, 1, 1},
  {&__pyx_n_s__load_fmu, __pyx_k__load_fmu, sizeof(__pyx_k__load_fmu), 0, 0, 1, 1},
  {&__pyx_n_s__load_fmu_deprecated, __pyx_k__load_fmu_deprecated, sizeof(__pyx_k__load_fmu_deprecated), 0, 0, 1, 1},
  {&__pyx_n_s__log, __pyx_k__log, sizeof(__pyx_k__log), 0, 0, 1, 1},
  {&__pyx_n_s__log_file, __pyx_k__log_file, sizeof(__pyx_k__log_file), 0, 0, 1, 1},
  {&__pyx_n_s__log_file_c, __pyx_k__log_file_c, sizeof(__pyx_k__log_file_c), 0, 0, 1, 1},
  {&__pyx_n_s__log_file_name, __pyx_k__log_file_name, sizeof(__pyx_k__log_file_name), 0, 0, 1, 1},
  {&__pyx_n_s__log_level, __pyx_k__log_level, sizeof(__pyx_k__log_level), 0, 0, 1, 1},
  {&__pyx_n_s__logging, __pyx_k__logging, sizeof(__pyx_k__logging), 0, 0, 1, 1},
  {&__pyx_n_s__logging_on, __pyx_k__logging_on, sizeof(__pyx_k__logging_on), 0, 0, 1, 1},
  {&__pyx_n_s__lower, __pyx_k__lower, sizeof(__pyx_k__lower), 0, 0, 1, 1},
  {&__pyx_n_s__match, __pyx_k__match, sizeof(__pyx_k__match), 0, 0, 1, 1},
  {&__pyx_n_s__measurements, __pyx_k__measurements, sizeof(__pyx_k__measurements), 0, 0, 1, 1},
  {&__pyx_n_s__message, __pyx_k__message, sizeof(__pyx_k__message), 0, 0, 1, 1},
  {&__pyx_n_s__model, __pyx_k__model, sizeof(__pyx_k__model), 0, 0, 1, 1},
  {&__pyx_n_s__module, __pyx_k__module, sizeof(__pyx_k__module), 0, 0, 1, 1},
  {&__pyx_n_s__name, __pyx_k__name, sizeof(__pyx_k__name), 0, 0, 1, 1},
  {&__pyx_n_s__ndmin, __pyx_k__ndmin, sizeof(__pyx_k__ndmin), 0, 0, 1, 1},
  {&__pyx_n_s__needsExecutionTool, __pyx_k__needsExecutionTool, sizeof(__pyx_k__needsExecutionTool), 0, 0, 1, 1},
  {&__pyx_n_s__new_step, __pyx_k__new_step, sizeof(__pyx_k__new_step), 0, 0, 1, 1},
  {&__pyx_n_s__nextEventTime, __pyx_k__nextEventTime, sizeof(__pyx_k__nextEventTime), 0, 0, 1, 1},
  {&__pyx_n_s__numpy, __pyx_k__numpy, sizeof(__pyx_k__numpy), 0, 0, 1, 1},
  {&__pyx_n_s__only_fixed, __pyx_k__only_fixed, sizeof(__pyx_k__only_fixed), 0, 0, 1, 1},
  {&__pyx_n_s__only_start, __pyx_k__only_start, sizeof(__pyx_k__only_start), 0, 0, 1, 1},
  {&__pyx_n_s__open, __pyx_k__open, sizeof(__pyx_k__open), 0, 0, 1, 1},
  {&__pyx_n_s__options, __pyx_k__options, sizeof(__pyx_k__options), 0, 0, 1, 1},
  {&__pyx_n_s__order, __pyx_k__order, sizeof(__pyx_k__order), 0, 0, 1, 1},
  {&__pyx_n_s__orders, __pyx_k__orders, sizeof(__pyx_k__orders), 0, 0, 1, 1},
  {&__pyx_n_s__os, __pyx_k__os, sizeof(__pyx_k__os), 0, 0, 1, 1},
  {&__pyx_n_s__parameters, __pyx_k__parameters, sizeof(__pyx_k__parameters), 0, 0, 1, 1},
  {&__pyx_n_s__path, __pyx_k__path, sizeof(__pyx_k__path), 0, 0, 1, 1},
  {&__pyx_n_s__prod, __pyx_k__prod, sizeof(__pyx_k__prod), 0, 0, 1, 1},
  {&__pyx_n_s__property, __pyx_k__property, sizeof(__pyx_k__property), 0, 0, 1, 1},
  {&__pyx_n_s__python3_flag, __pyx_k__python3_flag, sizeof(__pyx_k__python3_flag), 0, 0, 1, 1},
  {&__pyx_n_s__r, __pyx_k__r, sizeof(__pyx_k__r), 0, 0, 1, 1},
  {&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1},
  {&__pyx_n_s__ravel, __pyx_k__ravel, sizeof(__pyx_k__ravel), 0, 0, 1, 1},
  {&__pyx_n_s__re, __pyx_k__re, sizeof(__pyx_k__re), 0, 0, 1, 1},
  {&__pyx_n_s__readline, __pyx_k__readline, sizeof(__pyx_k__readline), 0, 0, 1, 1},
  {&__pyx_n_s__relativeTolerance, __pyx_k__relativeTolerance, sizeof(__pyx_k__relativeTolerance), 0, 0, 1, 1},
  {&__pyx_n_s__self, __pyx_k__self, sizeof(__pyx_k__self), 0, 0, 1, 1},
  {&__pyx_n_s__serialize_fmu_state, __pyx_k__serialize_fmu_state, sizeof(__pyx_k__serialize_fmu_state), 0, 0, 1, 1},
  {&__pyx_n_s__set_boolean, __pyx_k__set_boolean, sizeof(__pyx_k__set_boolean), 0, 0, 1, 1},
  {&__pyx_n_s__set_integer, __pyx_k__set_integer, sizeof(__pyx_k__set_integer), 0, 0, 1, 1},
  {&__pyx_n_s__set_log_level, __pyx_k__set_log_level, sizeof(__pyx_k__set_log_level), 0, 0, 1, 1},
  {&__pyx_n_s__set_real, __pyx_k__set_real, sizeof(__pyx_k__set_real), 0, 0, 1, 1},
  {&__pyx_n_s__set_string, __pyx_k__set_string, sizeof(__pyx_k__set_string), 0, 0, 1, 1},
  {&__pyx_n_s__size, __pyx_k__size, sizeof(__pyx_k__size), 0, 0, 1, 1},
  {&__pyx_n_s__solve, __pyx_k__solve, sizeof(__pyx_k__solve), 0, 0, 1, 1},
  {&__pyx_n_s__sp, __pyx_k__sp, sizeof(__pyx_k__sp), 0, 0, 1, 1},
  {&__pyx_n_s__start_lines, __pyx_k__start_lines, sizeof(__pyx_k__start_lines), 0, 0, 1, 1},
  {&__pyx_n_s__start_time, __pyx_k__start_time, sizeof(__pyx_k__start_time), 0, 0, 1, 1},
  {&__pyx_n_s__state, __pyx_k__state, sizeof(__pyx_k__state), 0, 0, 1, 1},
  {&__pyx_n_s__stateValuesChanged, __pyx_k__stateValuesChanged, sizeof(__pyx_k__stateValuesChanged), 0, 0, 1, 1},
  {&__pyx_n_s__step_size, __pyx_k__step_size, sizeof(__pyx_k__step_size), 0, 0, 1, 1},
  {&__pyx_n_s__stop_time, __pyx_k__stop_time, sizeof(__pyx_k__stop_time), 0, 0, 1, 1},
  {&__pyx_n_s__stop_time_defined, __pyx_k__stop_time_defined, sizeof(__pyx_k__stop_time_defined), 0, 0, 1, 1},
  {&__pyx_n_s__strip, __pyx_k__strip, sizeof(__pyx_k__strip), 0, 0, 1, 1},
  {&__pyx_n_s__structured, __pyx_k__structured, sizeof(__pyx_k__structured), 0, 0, 1, 1},
  {&__pyx_n_s__sum, __pyx_k__sum, sizeof(__pyx_k__sum), 0, 0, 1, 1},
  {&__pyx_n_s__sys, __pyx_k__sys, sizeof(__pyx_k__sys), 0, 0, 1, 1},
  {&__pyx_n_s__tStart, __pyx_k__tStart, sizeof(__pyx_k__tStart), 0, 0, 1, 1},
  {&__pyx_n_s__tStop, __pyx_k__tStop, sizeof(__pyx_k__tStop), 0, 0, 1, 1},
  {&__pyx_n_s__terminateSimulation, __pyx_k__terminateSimulation, sizeof(__pyx_k__terminateSimulation), 0, 0, 1, 1},
  {&__pyx_n_s__time, __pyx_k__time, sizeof(__pyx_k__time), 0, 0, 1, 1},
  {&__pyx_n_s__tolControlled, __pyx_k__tolControlled, sizeof(__pyx_k__tolControlled), 0, 0, 1, 1},
  {&__pyx_n_s__tolerance, __pyx_k__tolerance, sizeof(__pyx_k__tolerance), 0, 0, 1, 1},
  {&__pyx_n_s__tolerance_defined, __pyx_k__tolerance_defined, sizeof(__pyx_k__tolerance_defined), 0, 0, 1, 1},
  {&__pyx_n_s__translate, __pyx_k__translate, sizeof(__pyx_k__translate), 0, 0, 1, 1},
  {&__pyx_n_s__type, __pyx_k__type, sizeof(__pyx_k__type), 0, 0, 1, 1},
  {&__pyx_n_s__types_platform, __pyx_k__types_platform, sizeof(__pyx_k__types_platform), 0, 0, 1, 1},
  {&__pyx_n_s__uint32, __pyx_k__uint32, sizeof(__pyx_k__uint32), 0, 0, 1, 1},
  {&__pyx_n_s__unknown, __pyx_k__unknown, sizeof(__pyx_k__unknown), 0, 0, 1, 1},
  {&__pyx_n_s__upcomingTimeEvent, __pyx_k__upcomingTimeEvent, sizeof(__pyx_k__upcomingTimeEvent), 0, 0, 1, 1},
  {&__pyx_n_s__upper, __pyx_k__upper, sizeof(__pyx_k__upper), 0, 0, 1, 1},
  {&__pyx_n_s__v, __pyx_k__v, sizeof(__pyx_k__v), 0, 0, 1, 1},
  {&__pyx_n_s__value, __pyx_k__value, sizeof(__pyx_k__value), 0, 0, 1, 1},
  {&__pyx_n_s__value_reference, __pyx_k__value_reference, sizeof(__pyx_k__value_reference), 0, 0, 1, 1},
  {&__pyx_n_s__valueref, __pyx_k__valueref, sizeof(__pyx_k__valueref), 0, 0, 1, 1},
  {&__pyx_n_s__values, __pyx_k__values, sizeof(__pyx_k__values), 0, 0, 1, 1},
  {&__pyx_n_s__var_ref, __pyx_k__var_ref, sizeof(__pyx_k__var_ref), 0, 0, 1, 1},
  {&__pyx_n_s__variability, __pyx_k__variability, sizeof(__pyx_k__variability), 0, 0, 1, 1},
  {&__pyx_n_s__variable_name, __pyx_k__variable_name, sizeof(__pyx_k__variable_name), 0, 0, 1, 1},
  {&__pyx_n_s__variables, __pyx_k__variables, sizeof(__pyx_k__variables), 0, 0, 1, 1},
  {&__pyx_n_s__version, __pyx_k__version, sizeof(__pyx_k__version), 0, 0, 1, 1},
  {&__pyx_n_s__visible, __pyx_k__visible, sizeof(__pyx_k__visible), 0, 0, 1, 1},
  {&__pyx_n_s__w, __pyx_k__w, sizeof(__pyx_k__w), 0, 0, 1, 1},
  {&__pyx_n_s__warning, __pyx_k__warning, sizeof(__pyx_k__warning), 0, 0, 1, 1},
  {&__pyx_n_s__write, __pyx_k__write, sizeof(__pyx_k__write), 0, 0, 1, 1},
  {&__pyx_n_s__x, __pyx_k__x, sizeof(__pyx_k__x), 0, 0, 1, 1},
  {&__pyx_n_s__xrange, __pyx_k__xrange, sizeof(__pyx_k__xrange), 0, 0, 1, 1},
  {&__pyx_n_s__zeros, __pyx_k__zeros, sizeof(__pyx_k__zeros), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_Exception = __Pyx_GetName(__pyx_b, __pyx_n_s__Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_property = __Pyx_GetName(__pyx_b, __pyx_n_s__property); if (!__pyx_builtin_property) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_open = __Pyx_GetName(__pyx_b, __pyx_n_s__open); if (!__pyx_builtin_open) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_basestring = __Pyx_GetName(__pyx_b, __pyx_n_s__basestring); if (!__pyx_builtin_basestring) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if PY_MAJOR_VERSION >= 3
  __pyx_builtin_xrange = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #else
  __pyx_builtin_xrange = __Pyx_GetName(__pyx_b, __pyx_n_s__xrange); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  __pyx_builtin___import__ = __Pyx_GetName(__pyx_b, __pyx_n_s____import__); if (!__pyx_builtin___import__) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_sum = __Pyx_GetName(__pyx_b, __pyx_n_s__sum); if (!__pyx_builtin_sum) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __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 = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_NotImplementedError = __Pyx_GetName(__pyx_b, __pyx_n_s__NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 215; __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[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "pyfmi\fmi.pyx":161
 * #CALLBACKS
 * cdef void importlogger_load_fmu(FMIL.jm_callbacks* c, FMIL.jm_string module, int log_level, FMIL.jm_string message):
 *     with open(<char*>c.context,'a') as file:             # <<<<<<<<<<<<<<
 *         file.write("FMIL: module = %s, log level = %d: %s\n"%(module, log_level, message))
 *     #if log_level <= c.log_level:
 */
  __pyx_k_tuple_3 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_tuple_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_3);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_3));

  /* "pyfmi\fmi.pyx":439
 *         num_lines = 0
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'r') as file:             # <<<<<<<<<<<<<<
 *                 num_lines = sum(1 for line in file)
 *         return num_lines
 */
  __pyx_k_tuple_10 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_tuple_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_10);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_10));

  /* "pyfmi\fmi.pyx":490
 *                         if i > start_lines and i < num_lines - end_lines + 1:
 *                             continue
 *                     log.append(line.strip("\n"))             # <<<<<<<<<<<<<<
 *         return log
 * 
 */
  __pyx_k_tuple_14 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_13)); if (unlikely(!__pyx_k_tuple_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_14);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_14));

  /* "pyfmi\fmi.pyx":475
 * 
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'r') as file:             # <<<<<<<<<<<<<<
 *                 while True:
 *                     i = i + 1
 */
  __pyx_k_tuple_15 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_tuple_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_15);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_15));

  /* "pyfmi\fmi.pyx":495
 *     cdef _logger(self, FMIL.jm_string module, int log_level, FMIL.jm_string message) with gil:
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'a') as file:             # <<<<<<<<<<<<<<
 *                 file.write("FMIL: module = %s, log level = %d: %s\n"%(module, log_level, message))
 *         else:
 */
  __pyx_k_tuple_16 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_tuple_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_16);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_16));

  /* "pyfmi\fmi.pyx":502
 *     def append_log_message(self, module, log_level, message):
 *         if self._fmu_log_name != NULL:
 *             with open(self._fmu_log_name,'a') as file:             # <<<<<<<<<<<<<<
 *                 file.write("FMIL: module = %s, log level = %d: %s\n"%(module, log_level, message))
 *         else:
 */
  __pyx_k_tuple_17 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_tuple_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_17);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_17));

  /* "pyfmi\fmi.pyx":527
 *         """
 *         if level < FMIL.jm_log_level_nothing or level > FMIL.jm_log_level_all:
 *             raise FMUException("Invalid log level for FMI Library (0-7).")             # <<<<<<<<<<<<<<
 *         self.callbacks.log_level = level
 * 
 */
  __pyx_k_tuple_19 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_18)); if (unlikely(!__pyx_k_tuple_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_19);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_19));

  /* "pyfmi\fmi.pyx":554
 *             regexp = [re.compile(regex[:-1])]
 *         else:
 *             raise FMUException("Unknown input.")             # <<<<<<<<<<<<<<
 *         return regexp
 * 
 */
  __pyx_k_tuple_22 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_21)); if (unlikely(!__pyx_k_tuple_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_22);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_22));

  /* "pyfmi\fmi.pyx":832
 *                 raise FMUException("The log level must be between %d and %d"%(FMIL.jm_log_level_nothing, FMIL.jm_log_level_all))
 *         else:
 *             logging.warning("The attribute 'enable_logging' is deprecated. Please use 'log_level' instead. Setting 'log_level' to INFO...")             # <<<<<<<<<<<<<<
 *             self.callbacks.log_level = FMIL.jm_log_level_info if enable_logging else FMIL.jm_log_level_error
 * 
 */
  __pyx_k_tuple_34 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_33)); if (unlikely(!__pyx_k_tuple_34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_34);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_34));

  /* "pyfmi\fmi.pyx":841
 * 
 *         # Check that the file referenced by fmu has the correct file-ending
 *         if not fmu_full_path.endswith(".fmu"):             # <<<<<<<<<<<<<<
 *             raise FMUException("FMUModel must be instantiated with an FMU (.fmu) file.")
 * 
 */
  __pyx_k_tuple_36 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_35)); if (unlikely(!__pyx_k_tuple_36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_36);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_36));

  /* "pyfmi\fmi.pyx":842
 *         # Check that the file referenced by fmu has the correct file-ending
 *         if not fmu_full_path.endswith(".fmu"):
 *             raise FMUException("FMUModel must be instantiated with an FMU (.fmu) file.")             # <<<<<<<<<<<<<<
 * 
 *         #Specify FMI related callbacks
 */
  __pyx_k_tuple_38 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_37)); if (unlikely(!__pyx_k_tuple_38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_38);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_38));

  /* "pyfmi\fmi.pyx":863
 *                 raise FMUException("The FMU version could not be determined. "+last_error)
 *             else:
 *                 raise FMUException("The FMU version could not be determined. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 *         if version != 1:
 *             raise FMUException("This class only supports FMI 1.0 (Model Exchange and Co-Simulation).")
 */
  __pyx_k_tuple_41 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_40)); if (unlikely(!__pyx_k_tuple_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_41);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_41));

  /* "pyfmi\fmi.pyx":865
 *                 raise FMUException("The FMU version could not be determined. Enable logging for possibly more information.")
 *         if version != 1:
 *             raise FMUException("This class only supports FMI 1.0 (Model Exchange and Co-Simulation).")             # <<<<<<<<<<<<<<
 * 
 *         #Parse the XML
 */
  __pyx_k_tuple_43 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_42)); if (unlikely(!__pyx_k_tuple_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_43);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_43));

  /* "pyfmi\fmi.pyx":874
 *                 raise FMUException("The XML file could not be parsed. "+last_error)
 *             else:
 *                 raise FMUException("The XML file could not be parsed. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 *         self._allocated_xml = 1
 * 
 */
  __pyx_k_tuple_46 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_45)); if (unlikely(!__pyx_k_tuple_46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_46);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_46));

  /* "pyfmi\fmi.pyx":880
 *         fmu_kind = FMIL.fmi1_import_get_fmu_kind(self._fmu)
 *         if fmu_kind != FMI_ME and fmu_kind != FMI_CS_STANDALONE:
 *             raise FMUException("This class only supports FMI 1.0 (Model Exchange and Co-Simulation).")             # <<<<<<<<<<<<<<
 *         self._fmu_kind = fmu_kind
 * 
 */
  __pyx_k_tuple_47 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_42)); if (unlikely(!__pyx_k_tuple_47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_47);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_47));

  /* "pyfmi\fmi.pyx":891
 *                 raise FMUException(last_error)
 *             else:
 *                 raise FMUException("Error loading the binary. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 *         self._allocated_dll = 1
 *         FMI_REGISTER_GLOBALLY += 1 #Update the global register of FMUs
 */
  __pyx_k_tuple_50 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_49)); if (unlikely(!__pyx_k_tuple_50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_50);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_50));

  /* "pyfmi\fmi.pyx":914
 * 
 *         #Create the log file
 *         with open(self._fmu_log_name,'w') as file:             # <<<<<<<<<<<<<<
 *             for i in range(len(self._log)):
 *                 file.write("FMIL: module = %s, log level = %d: %s\n"%(self._log[i][0], self._log[i][1], self._log[i][2]))
 */
  __pyx_k_tuple_52 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_tuple_52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_52);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_52));

  /* "pyfmi\fmi.pyx":993
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Real values.')             # <<<<<<<<<<<<<<
 * 
 *         return val
 */
  __pyx_k_tuple_55 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_54)); if (unlikely(!__pyx_k_tuple_55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_55);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_55));

  /* "pyfmi\fmi.pyx":1022
 * 
 *         if val_ref.size != val.size:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'The length of valueref and values are inconsistent.')
 * 
 */
  __pyx_k_tuple_57 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_56)); if (unlikely(!__pyx_k_tuple_57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_57);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_57));

  /* "pyfmi\fmi.pyx":1028
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Real values.')             # <<<<<<<<<<<<<<
 * 
 *     def get_integer(self, valueref):
 */
  __pyx_k_tuple_59 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_58)); if (unlikely(!__pyx_k_tuple_59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_59);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_59));

  /* "pyfmi\fmi.pyx":1060
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Integer values.')             # <<<<<<<<<<<<<<
 * 
 *         return val
 */
  __pyx_k_tuple_61 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_60)); if (unlikely(!__pyx_k_tuple_61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_61);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_61));

  /* "pyfmi\fmi.pyx":1090
 * 
 *         if val_ref.size != val.size:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'The length of valueref and values are inconsistent.')
 * 
 */
  __pyx_k_tuple_62 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_56)); if (unlikely(!__pyx_k_tuple_62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_62);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_62));

  /* "pyfmi\fmi.pyx":1096
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Integer values.')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_64 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_63)); if (unlikely(!__pyx_k_tuple_64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_64);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_64));

  /* "pyfmi\fmi.pyx":1142
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Boolean values.')             # <<<<<<<<<<<<<<
 * 
 *         return N.array(return_values)
 */
  __pyx_k_tuple_66 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_65)); if (unlikely(!__pyx_k_tuple_66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_66);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_66));

  /* "pyfmi\fmi.pyx":1184
 * 
 *         if val_ref.size != values.size:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'The length of valueref and values are inconsistent.')
 * 
 */
  __pyx_k_tuple_67 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_56)); if (unlikely(!__pyx_k_tuple_67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_67);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_67));

  /* "pyfmi\fmi.pyx":1193
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Boolean values.')             # <<<<<<<<<<<<<<
 * 
 *     def get_string(self, valueref):
 */
  __pyx_k_tuple_69 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_68)); if (unlikely(!__pyx_k_tuple_69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_69);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_69));

  /* "pyfmi\fmi.pyx":1222
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the String values.')             # <<<<<<<<<<<<<<
 * 
 *         out = []
 */
  __pyx_k_tuple_71 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_70)); if (unlikely(!__pyx_k_tuple_71)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_71);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_71));

  /* "pyfmi\fmi.pyx":1255
 * 
 *         if not isinstance(values, list):
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'The values needs to be a list of values.')
 *         if len(values) != val_ref.size:
 */
  __pyx_k_tuple_73 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_72)); if (unlikely(!__pyx_k_tuple_73)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_73);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_73));

  /* "pyfmi\fmi.pyx":1258
 *                 'The values needs to be a list of values.')
 *         if len(values) != val_ref.size:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'The length of valueref and values are inconsistent.')
 * 
 */
  __pyx_k_tuple_74 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_56)); if (unlikely(!__pyx_k_tuple_74)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_74);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_74));

  /* "pyfmi\fmi.pyx":1269
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the String values.')             # <<<<<<<<<<<<<<
 * 
 *     def set_debug_logging(self,flag):
 */
  __pyx_k_tuple_76 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_75)); if (unlikely(!__pyx_k_tuple_76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_76);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_76));

  /* "pyfmi\fmi.pyx":1300
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the debugging option.')             # <<<<<<<<<<<<<<
 * 
 *     def set_fmil_log_level(self, FMIL.jm_log_level_enu_t level):
 */
  __pyx_k_tuple_78 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_77)); if (unlikely(!__pyx_k_tuple_78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_78);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_78));

  /* "pyfmi\fmi.pyx":1303
 * 
 *     def set_fmil_log_level(self, FMIL.jm_log_level_enu_t level):
 *         logging.warning("The method 'set_fmil_log_level' is deprecated, use 'set_log_level' instead.")             # <<<<<<<<<<<<<<
 *         self.set_log_level(level)
 * 
 */
  __pyx_k_tuple_80 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_79)); if (unlikely(!__pyx_k_tuple_80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_80);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_80));

  /* "pyfmi\fmi.pyx":1341
 *             self.set_boolean([ref], [value])
 *         else:
 *             raise FMUException('Type not supported.')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_83 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_82)); if (unlikely(!__pyx_k_tuple_83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_83);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_83));

  /* "pyfmi\fmi.pyx":1376
 *             return not value if alias_kind == FMI_NEGATED_ALIAS else value
 *         else:
 *             raise FMUException('Type not supported.')             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_description(self, variable_name):
 */
  __pyx_k_tuple_84 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_82)); if (unlikely(!__pyx_k_tuple_84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_84);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_84));

  /* "pyfmi\fmi.pyx":1490
 *                 raise FMUException("The variable %s could not be found."%variablename)
 *         else:
 *             raise FMUException('Either provide value reference or variable name.')             # <<<<<<<<<<<<<<
 * 
 *         real_variable = FMIL.fmi1_import_get_variable_as_real(variable)
 */
  __pyx_k_tuple_90 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_89)); if (unlikely(!__pyx_k_tuple_90)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_90);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_90));

  /* "pyfmi\fmi.pyx":1494
 *         real_variable = FMIL.fmi1_import_get_variable_as_real(variable)
 *         if real_variable == NULL:
 *             raise FMUException("The variable is not a real variable.")             # <<<<<<<<<<<<<<
 * 
 *         return  FMIL.fmi1_import_get_real_variable_nominal(real_variable)
 */
  __pyx_k_tuple_92 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_91)); if (unlikely(!__pyx_k_tuple_92)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_92);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_92));

  /* "pyfmi\fmi.pyx":1591
 * 
 *         else:
 *             raise FMUException("Unknown variable type.")             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_max(self, variable_name):
 */
  __pyx_k_tuple_95 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_94)); if (unlikely(!__pyx_k_tuple_95)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_95);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_95));

  /* "pyfmi\fmi.pyx":1634
 * 
 *         else:
 *             raise FMUException("The variable type does not have a maximum value.")             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_min(self, variable_name):
 */
  __pyx_k_tuple_97 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_96)); if (unlikely(!__pyx_k_tuple_97)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_97);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_97));

  /* "pyfmi\fmi.pyx":1677
 * 
 *         else:
 *             raise FMUException("The variable type does not have a minimum value.")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_99 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_98)); if (unlikely(!__pyx_k_tuple_99)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_99);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_99));

  /* "pyfmi\fmi.pyx":2119
 * 
 *         if self._fmu_kind != FMI_CS_STANDALONE:
 *             raise FMUException("This class only supports FMI 1.0 for Co-simulation.")             # <<<<<<<<<<<<<<
 * 
 *         self.instantiate_slave(logging = self._enable_logging)
 */
  __pyx_k_tuple_108 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_107)); if (unlikely(!__pyx_k_tuple_108)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_108);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_108));

  /* "pyfmi\fmi.pyx":2249
 *                 orders[i] = order
 *         else:
 *             raise FMUException("The variables must either be a string or a list of strings")             # <<<<<<<<<<<<<<
 * 
 *         values = N.array([0.0]*nref,dtype=N.float, ndmin=1)
 */
  __pyx_k_tuple_112 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_111)); if (unlikely(!__pyx_k_tuple_112)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_112);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_112));

  /* "pyfmi\fmi.pyx":2256
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Real output derivatives.')             # <<<<<<<<<<<<<<
 * 
 *         return values
 */
  __pyx_k_tuple_114 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_113)); if (unlikely(!__pyx_k_tuple_114)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_114);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_114));

  /* "pyfmi\fmi.pyx":2288
 * 
 *             if status != 0:
 *                 raise FMUException('Failed to retrieve the last successful time. See the log for possibly more information.')             # <<<<<<<<<<<<<<
 * 
 *             return value
 */
  __pyx_k_tuple_116 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_115)); if (unlikely(!__pyx_k_tuple_116)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_116);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_116));

  /* "pyfmi\fmi.pyx":2292
 *             return value
 *         else:
 *             raise FMUException('Not supported status kind.')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_118 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_117)); if (unlikely(!__pyx_k_tuple_118)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_118);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_118));

  /* "pyfmi\fmi.pyx":2321
 * 
 *         if nref != np_orders.size:
 *             raise FMUException("The number of variables must be the same as the number of orders.")             # <<<<<<<<<<<<<<
 * 
 *         fmu_capabilities = FMIL.fmi1_import_get_capabilities(self._fmu)
 */
  __pyx_k_tuple_120 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_119)); if (unlikely(!__pyx_k_tuple_120)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_120);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_120));

  /* "pyfmi\fmi.pyx":2329
 *         for i in range(np_orders.size):
 *             if np_orders[i] < 1:
 *                 raise FMUException("The order must be greater than zero.")             # <<<<<<<<<<<<<<
 *         if not can_interpolate_inputs:
 *             raise FMUException("The FMU does not support input derivatives.")
 */
  __pyx_k_tuple_122 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_121)); if (unlikely(!__pyx_k_tuple_122)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_122);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_122));

  /* "pyfmi\fmi.pyx":2331
 *                 raise FMUException("The order must be greater than zero.")
 *         if not can_interpolate_inputs:
 *             raise FMUException("The FMU does not support input derivatives.")             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(variables,str):
 */
  __pyx_k_tuple_124 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_123)); if (unlikely(!__pyx_k_tuple_124)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_124);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_124));

  /* "pyfmi\fmi.pyx":2341
 *                 value_refs[i] = self.get_variable_valueref(variables[i])
 *         else:
 *             raise FMUException("The variables must either be a string or a list of strings")             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi1_import_set_real_input_derivatives(self._fmu, <FMIL.fmi1_value_reference_t*>value_refs.data, nref, <FMIL.fmi1_integer_t*>np_orders.data, <FMIL.fmi1_real_t*>val.data)
 */
  __pyx_k_tuple_125 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_111)); if (unlikely(!__pyx_k_tuple_125)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_125);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_125));

  /* "pyfmi\fmi.pyx":2346
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Real input derivatives.')             # <<<<<<<<<<<<<<
 * 
 *     def simulate(self,
 */
  __pyx_k_tuple_127 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_126)); if (unlikely(!__pyx_k_tuple_127)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_127);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_127));

  /* "pyfmi\fmi.pyx":2462
 * 
 *         if status != FMIL.fmi1_status_ok:
 *             raise FMUException("The slave failed to initialize. See the log for possibly more information.")             # <<<<<<<<<<<<<<
 * 
 *         self._allocated_fmu = 1
 */
  __pyx_k_tuple_136 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_135)); if (unlikely(!__pyx_k_tuple_136)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_136);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_136));

  /* "pyfmi\fmi.pyx":2474
 *         status = FMIL.fmi1_import_reset_slave(self._fmu)
 *         if status != FMIL.fmi1_status_ok:
 *             raise FMUException("Failed to reset the FMU.")             # <<<<<<<<<<<<<<
 * 
 *         #The FMU is no longer initialized
 */
  __pyx_k_tuple_138 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_137)); if (unlikely(!__pyx_k_tuple_138)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_138);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_138));

  /* "pyfmi\fmi.pyx":2517
 * 
 *         if status != FMIL.jm_status_success:
 *             raise FMUException('Failed to instantiate the slave. See the log for possibly more information.')             # <<<<<<<<<<<<<<
 * 
 *         #The FMU is instantiated
 */
  __pyx_k_tuple_142 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_141)); if (unlikely(!__pyx_k_tuple_142)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_142);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_142));

  /* "pyfmi\fmi.pyx":2527
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the debugging option. See the log for possibly more information.')             # <<<<<<<<<<<<<<
 * 
 *     def get_capability_flags(self):
 */
  __pyx_k_tuple_144 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_143)); if (unlikely(!__pyx_k_tuple_144)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_144);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_144));

  /* "pyfmi\fmi.pyx":2590
 * 
 *         if self._fmu_kind != FMI_ME:
 *             raise FMUException("This class only supports FMI 1.0 for Model Exchange.")             # <<<<<<<<<<<<<<
 * 
 *         self.instantiate_model(logging = self._enable_logging)
 */
  __pyx_k_tuple_153 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_152)); if (unlikely(!__pyx_k_tuple_153)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_153);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_153));

  /* "pyfmi\fmi.pyx":2632
 *         status = FMIL.fmi1_import_create_dllfmu(self._fmu, self.callBackFunctions, FMI_REGISTER_GLOBALLY);
 *         if status == FMIL.jm_status_error:
 *             raise FMUException("The DLL could not be reloaded, check the log for more information.")             # <<<<<<<<<<<<<<
 *         FMI_REGISTER_GLOBALLY += 1 #Update the global register of FMUs
 * 
 */
  __pyx_k_tuple_155 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_154)); if (unlikely(!__pyx_k_tuple_155)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_155);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_155));

  /* "pyfmi\fmi.pyx":2685
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the time.')             # <<<<<<<<<<<<<<
 * 
 *     time = property(_get_time,_set_time, doc =
 */
  __pyx_k_tuple_157 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_156)); if (unlikely(!__pyx_k_tuple_157)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_157);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_157));

  /* "pyfmi\fmi.pyx":2699
 * 
 *         if status != 0:
 *             raise FMUException('Failed to retrieve the continuous states.')             # <<<<<<<<<<<<<<
 * 
 *         return ndx
 */
  __pyx_k_tuple_159 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_158)); if (unlikely(!__pyx_k_tuple_159)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_159);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_159));

  /* "pyfmi\fmi.pyx":2708
 * 
 *         if ndx.size != self._nContinuousStates:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'Failed to set the new continuous states. ' \
 *                 'The number of values are not consistent with the number of '\
 */
  __pyx_k_tuple_161 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_160)); if (unlikely(!__pyx_k_tuple_161)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_161);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_161));

  /* "pyfmi\fmi.pyx":2716
 * 
 *         if status >= 3:
 *             raise FMUException('Failed to set the new continuous states.')             # <<<<<<<<<<<<<<
 * 
 *     continuous_states = property(_get_continuous_states, _set_continuous_states,
 */
  __pyx_k_tuple_163 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_162)); if (unlikely(!__pyx_k_tuple_163)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_163);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_163));

  /* "pyfmi\fmi.pyx":2733
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the nominal values.')             # <<<<<<<<<<<<<<
 * 
 *         return ndx
 */
  __pyx_k_tuple_165 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_164)); if (unlikely(!__pyx_k_tuple_165)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_165);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_165));

  /* "pyfmi\fmi.pyx":2789
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the event indicators.')             # <<<<<<<<<<<<<<
 * 
 *         return values
 */
  __pyx_k_tuple_168 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_167)); if (unlikely(!__pyx_k_tuple_168)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_168);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_168));

  /* "pyfmi\fmi.pyx":2916
 * 
 *         if status != 0:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'Failed to get the continuous state reference values.')
 * 
 */
  __pyx_k_tuple_175 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_174)); if (unlikely(!__pyx_k_tuple_175)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_175);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_175));

  /* "pyfmi\fmi.pyx":2940
 * 
 *         if status != 0:
 *             raise FMUException('Failed to call FMI Completed Step.')             # <<<<<<<<<<<<<<
 * 
 *         if callEventUpdate == 1:
 */
  __pyx_k_tuple_177 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_176)); if (unlikely(!__pyx_k_tuple_177)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_177);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_177));

  /* "pyfmi\fmi.pyx":2987
 *         if status == 1:
 *             if self._enable_logging:
 *                 logging.warning(             # <<<<<<<<<<<<<<
 *                     'Initialize returned with a warning.' \
 *                     ' Check the log for information (FMUModel.get_log).')
 */
  __pyx_k_tuple_180 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_179)); if (unlikely(!__pyx_k_tuple_180)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_180);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_180));

  /* "pyfmi\fmi.pyx":2991
 *                     ' Check the log for information (FMUModel.get_log).')
 *             else:
 *                 logging.warning('Initialize returned with a warning.' \             # <<<<<<<<<<<<<<
 *                     ' Enable logging for more information, (FMUModel(..., enable_logging=True)).')
 * 
 */
  __pyx_k_tuple_182 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_181)); if (unlikely(!__pyx_k_tuple_182)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_182);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_182));

  /* "pyfmi\fmi.pyx":2996
 *         if status > 1:
 *             if self._enable_logging:
 *                 raise FMUException(             # <<<<<<<<<<<<<<
 *                     'Initialize returned with an error.' \
 *                     ' Check the log for information (FMUModel.get_log).')
 */
  __pyx_k_tuple_184 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_183)); if (unlikely(!__pyx_k_tuple_184)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_184);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_184));

  /* "pyfmi\fmi.pyx":3000
 *                     ' Check the log for information (FMUModel.get_log).')
 *             else:
 *                 raise FMUException('Initialize returned with an error.' \             # <<<<<<<<<<<<<<
 *                     ' Enable logging for more information, (FMUModel(..., enable_logging=True)).')
 * 
 */
  __pyx_k_tuple_186 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_185)); if (unlikely(!__pyx_k_tuple_186)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_186);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_186));

  /* "pyfmi\fmi.pyx":3034
 * 
 *         if status != 0:
 *             raise FMUException('Failed to instantiate the model. See the log for possibly more information.')             # <<<<<<<<<<<<<<
 * 
 *         #The FMU is instantiated
 */
  __pyx_k_tuple_189 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_188)); if (unlikely(!__pyx_k_tuple_189)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_189);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_189));

  /* "pyfmi\fmi.pyx":3044
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the debugging option. See the log for possibly more information.')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_190 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_143)); if (unlikely(!__pyx_k_tuple_190)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_190);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_190));

  /* "pyfmi\fmi.pyx":3261
 *                 raise FMUException("The log level must be between %d and %d"%(FMIL.jm_log_level_nothing, FMIL.jm_log_level_all))
 *         else:
 *             logging.warning("The attribute 'enable_logging' is deprecated. Please use 'log_level' instead. Setting 'log_level' to INFO...")             # <<<<<<<<<<<<<<
 *             self.callbacks.log_level = FMIL.jm_log_level_info if enable_logging else FMIL.jm_log_level_error
 * 
 */
  __pyx_k_tuple_193 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_33)); if (unlikely(!__pyx_k_tuple_193)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_193);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_193));

  /* "pyfmi\fmi.pyx":3265
 * 
 *         # Check that the file referenced by fmu has the correct file-ending
 *         if not fmu.endswith('.fmu'):             # <<<<<<<<<<<<<<
 *             raise FMUException("FMUModel must be instantiated with an FMU (.fmu) file.")
 * 
 */
  __pyx_k_tuple_194 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_35)); if (unlikely(!__pyx_k_tuple_194)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_194);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_194));

  /* "pyfmi\fmi.pyx":3266
 *         # Check that the file referenced by fmu has the correct file-ending
 *         if not fmu.endswith('.fmu'):
 *             raise FMUException("FMUModel must be instantiated with an FMU (.fmu) file.")             # <<<<<<<<<<<<<<
 * 
 *         #Check that the file exists
 */
  __pyx_k_tuple_195 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_37)); if (unlikely(!__pyx_k_tuple_195)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_195);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_195));

  /* "pyfmi\fmi.pyx":3271
 *         self._fmu_full_path = encode(os.path.abspath(os.path.join(path,fmu)))
 *         if not os.path.isfile(self._fmu_full_path):
 *             raise FMUException('Could not locate the FMU in the specified directory.')             # <<<<<<<<<<<<<<
 * 
 *         # Create a struct for allocation
 */
  __pyx_k_tuple_197 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_196)); if (unlikely(!__pyx_k_tuple_197)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_197);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_197));

  /* "pyfmi\fmi.pyx":3289
 *                 raise FMUException("The FMU version could not be determined. "+last_error)
 *             else:
 *                 raise FMUException("The FMU version could not be determined. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 * 
 *         if self._version != FMIL.fmi_version_2_0_enu:
 */
  __pyx_k_tuple_198 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_40)); if (unlikely(!__pyx_k_tuple_198)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_198);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_198));

  /* "pyfmi\fmi.pyx":3296
 *                 raise FMUException("The FMU version is not supported by this class. "+last_error)
 *             else:
 *                 raise FMUException("The FMU version is not supported by this class. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 * 
 *         #Parse xml and check fmu-kind
 */
  __pyx_k_tuple_201 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_200)); if (unlikely(!__pyx_k_tuple_201)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_201);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_201));

  /* "pyfmi\fmi.pyx":3306
 *                 raise FMUException("The XML-could not be read. "+last_error)
 *             else:
 *                 raise FMUException('The XML-could not be read. Enable logging for possible nore information.')             # <<<<<<<<<<<<<<
 * 
 *         self.callBackFunctions.componentEnvironment = <FMIL.fmi2_component_environment_t>self._fmu
 */
  __pyx_k_tuple_204 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_203)); if (unlikely(!__pyx_k_tuple_204)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_204);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_204));

  /* "pyfmi\fmi.pyx":3319
 *                 raise FMUException("The FMU kind could not be determined. "+last_error)
 *             else:
 *                 raise FMUException("The FMU kind could not be determined. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 *         elif self._fmu_kind == FMIL.fmi2_fmu_kind_me_and_cs:
 *             if isinstance(self,FMUModelME2):
 */
  __pyx_k_tuple_207 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_206)); if (unlikely(!__pyx_k_tuple_207)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_207);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_207));

  /* "pyfmi\fmi.pyx":3326
 *                 self._fmu_kind = FMIL.fmi2_fmu_kind_cs
 *             else:
 *                 raise FMUException("FMUModelBase2 cannot be used directly, use FMUModelME2 or FMUModelCS2.")             # <<<<<<<<<<<<<<
 * 
 *         #Connect the DLL
 */
  __pyx_k_tuple_209 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_208)); if (unlikely(!__pyx_k_tuple_209)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_209);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_209));

  /* "pyfmi\fmi.pyx":3335
 *                 raise FMUException("Error loading the binary. " + last_error)
 *             else:
 *                 raise FMUException("Error loading the binary. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 *         self._allocated_dll = 1
 * 
 */
  __pyx_k_tuple_211 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_49)); if (unlikely(!__pyx_k_tuple_211)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_211);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_211));

  /* "pyfmi\fmi.pyx":3344
 *             self._modelId           = decode(FMIL.fmi2_import_get_model_identifier_CS(self._fmu))
 *         else:
 *             raise FMUException("FMUModelBase2 cannot be used directly, use FMUModelME2 or FMUModelCS2.")             # <<<<<<<<<<<<<<
 * 
 *         #Connect the DLL
 */
  __pyx_k_tuple_212 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_208)); if (unlikely(!__pyx_k_tuple_212)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_212);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_212));

  /* "pyfmi\fmi.pyx":3356
 * 
 *         #Create the log file
 *         with open(self._fmu_log_name,'w') as file:             # <<<<<<<<<<<<<<
 *             for i in range(len(self._log)):
 *                 file.write("FMIL: module = %s, log level = %d: %s\n"%(self._log[i][0], self._log[i][1], self._log[i][2]))
 */
  __pyx_k_tuple_213 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_tuple_213)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_213);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_213));

  /* "pyfmi\fmi.pyx":3389
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Real values.')             # <<<<<<<<<<<<<<
 * 
 *         return output_value
 */
  __pyx_k_tuple_214 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_54)); if (unlikely(!__pyx_k_tuple_214)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_214);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_214));

  /* "pyfmi\fmi.pyx":3417
 * 
 *         if input_valueref.size != set_value.size:
 *             raise FMUException('The length of valueref and values are inconsistent.')             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_set_real(self._fmu, <FMIL.fmi2_value_reference_t*> input_valueref.data, input_valueref.size, <FMIL.fmi2_real_t*> set_value.data)
 */
  __pyx_k_tuple_215 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_56)); if (unlikely(!__pyx_k_tuple_215)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_215);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_215));

  /* "pyfmi\fmi.pyx":3422
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Real values.')             # <<<<<<<<<<<<<<
 * 
 *     def get_integer(self, valueref):
 */
  __pyx_k_tuple_216 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_58)); if (unlikely(!__pyx_k_tuple_216)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_216);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_216));

  /* "pyfmi\fmi.pyx":3455
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Integer values.')             # <<<<<<<<<<<<<<
 * 
 *         return output_value
 */
  __pyx_k_tuple_217 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_60)); if (unlikely(!__pyx_k_tuple_217)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_217);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_217));

  /* "pyfmi\fmi.pyx":3486
 * 
 *         if input_valueref.size != set_value.size:
 *             raise FMUException('The length of valueref and values are inconsistent.')             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_set_integer(self._fmu, <FMIL.fmi2_value_reference_t*> input_valueref.data, nref, <FMIL.fmi2_integer_t*> set_value.data)
 */
  __pyx_k_tuple_218 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_56)); if (unlikely(!__pyx_k_tuple_218)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_218);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_218));

  /* "pyfmi\fmi.pyx":3491
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Integer values.')             # <<<<<<<<<<<<<<
 * 
 *     def get_boolean(self, valueref):
 */
  __pyx_k_tuple_219 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_63)); if (unlikely(!__pyx_k_tuple_219)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_219);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_219));

  /* "pyfmi\fmi.pyx":3537
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Boolean values.')             # <<<<<<<<<<<<<<
 * 
 *         #return val==FMI_TRUE
 */
  __pyx_k_tuple_220 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_65)); if (unlikely(!__pyx_k_tuple_220)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_220);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_220));

  /* "pyfmi\fmi.pyx":3579
 * 
 *         if len(input_valueref) != len(values):
 *             raise FMUException('The length of valueref and values are inconsistent.')             # <<<<<<<<<<<<<<
 * 
 *         #status = FMIL.fmi1_import_set_boolean(self._fmu, <FMIL.fmi1_value_reference_t*>val_ref.data, nref, <FMIL.fmi1_boolean_t*>val.data)
 */
  __pyx_k_tuple_221 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_56)); if (unlikely(!__pyx_k_tuple_221)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_221);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_221));

  /* "pyfmi\fmi.pyx":3587
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Boolean values.')             # <<<<<<<<<<<<<<
 * 
 *     def get_string(self, valueref):
 */
  __pyx_k_tuple_222 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_68)); if (unlikely(!__pyx_k_tuple_222)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_222);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_222));

  /* "pyfmi\fmi.pyx":3616
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the String values.')             # <<<<<<<<<<<<<<
 * 
 *         out = []
 */
  __pyx_k_tuple_223 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_70)); if (unlikely(!__pyx_k_tuple_223)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_223);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_223));

  /* "pyfmi\fmi.pyx":3649
 * 
 *         if not isinstance(values, list):
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'The values needs to be a list of values.')
 *         if len(values) != val_ref.size:
 */
  __pyx_k_tuple_224 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_72)); if (unlikely(!__pyx_k_tuple_224)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_224);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_224));

  /* "pyfmi\fmi.pyx":3652
 *                 'The values needs to be a list of values.')
 *         if len(values) != val_ref.size:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'The length of valueref and values are inconsistent.')
 * 
 */
  __pyx_k_tuple_225 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_56)); if (unlikely(!__pyx_k_tuple_225)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_225);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_225));

  /* "pyfmi\fmi.pyx":3663
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the String values.')             # <<<<<<<<<<<<<<
 * 
 *     def _set(self, variable_name, value):
 */
  __pyx_k_tuple_226 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_75)); if (unlikely(!__pyx_k_tuple_226)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_226);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_226));

  /* "pyfmi\fmi.pyx":3684
 *             self.set_boolean([ref], [value])
 *         else:
 *             raise FMUException('Type not supported.')             # <<<<<<<<<<<<<<
 * 
 *     def _get(self, variable_name):
 */
  __pyx_k_tuple_227 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_82)); if (unlikely(!__pyx_k_tuple_227)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_227);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_227));

  /* "pyfmi\fmi.pyx":3705
 *             return self.get_boolean([ref])
 *         else:
 *             raise FMUException('Type not supported.')             # <<<<<<<<<<<<<<
 * 
 *     def instantiate(self, name= 'Model', visible = False):
 */
  __pyx_k_tuple_228 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_82)); if (unlikely(!__pyx_k_tuple_228)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_228);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_228));

  /* "pyfmi\fmi.pyx":3738
 *             fmuType = FMIL.fmi2_cosimulation
 *         else:
 *             raise FMUException('The instance is not curent an instance of an ME-model or a CS-model. Use load_fmu for correct loading.')             # <<<<<<<<<<<<<<
 * 
 *         name = encode(name)
 */
  __pyx_k_tuple_231 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_230)); if (unlikely(!__pyx_k_tuple_231)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_231);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_231));

  /* "pyfmi\fmi.pyx":3744
 * 
 *         if status != FMIL.jm_status_success:
 *             raise FMUException('Failed to instantiate the model. See the log for possibly more information.')             # <<<<<<<<<<<<<<
 * 
 *     def setup_experiment(self, tolerance_defined=True, tolerance="Default", start_time="Default", stop_time_defined=False, stop_time="Default"):
 */
  __pyx_k_tuple_232 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_188)); if (unlikely(!__pyx_k_tuple_232)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_232);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_232));

  /* "pyfmi\fmi.pyx":3777
 * 
 *         if status != 0:
 *             raise FMUException('Failed to setup the experiment.')             # <<<<<<<<<<<<<<
 * 
 *     def reset(self):
 */
  __pyx_k_tuple_236 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_235)); if (unlikely(!__pyx_k_tuple_236)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_236);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_236));

  /* "pyfmi\fmi.pyx":3788
 *         status = FMIL.fmi2_import_reset(self._fmu)
 *         if status != 0:
 *             raise FMUException('An error occured when reseting the model, see the log for possible more information')             # <<<<<<<<<<<<<<
 * 
 *         #Default values
 */
  __pyx_k_tuple_238 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_237)); if (unlikely(!__pyx_k_tuple_238)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_238);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_238));

  /* "pyfmi\fmi.pyx":3825
 *         if status == 1:
 *             if self._enable_logging:
 *                 logging.warning(             # <<<<<<<<<<<<<<
 *                     'Exit Initialize returned with a warning.' \
 *                     ' Check the log for information (FMUModel.get_log).')
 */
  __pyx_k_tuple_240 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_239)); if (unlikely(!__pyx_k_tuple_240)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_240);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_240));

  /* "pyfmi\fmi.pyx":3829
 *                     ' Check the log for information (FMUModel.get_log).')
 *             else:
 *                 logging.warning('Exit Initialize returned with a warning.' \             # <<<<<<<<<<<<<<
 *                     ' Enable logging for more information, (FMUModel(..., enable_logging=True)).')
 * 
 */
  __pyx_k_tuple_242 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_241)); if (unlikely(!__pyx_k_tuple_242)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_242);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_242));

  /* "pyfmi\fmi.pyx":3834
 *         if status > 1:
 *             if self._enable_logging:
 *                 raise FMUException(             # <<<<<<<<<<<<<<
 *                     'Exit Initialize returned with an error.' \
 *                     ' Check the log for information (FMUModel.get_log).')
 */
  __pyx_k_tuple_244 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_243)); if (unlikely(!__pyx_k_tuple_244)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_244);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_244));

  /* "pyfmi\fmi.pyx":3838
 *                     ' Check the log for information (FMUModel.get_log).')
 *             else:
 *                 raise FMUException('Exit Initialize returned with an error.' \             # <<<<<<<<<<<<<<
 *                     ' Enable logging for more information, (FMUModel(..., enable_logging=True)).')
 * 
 */
  __pyx_k_tuple_246 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_245)); if (unlikely(!__pyx_k_tuple_246)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_246);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_246));

  /* "pyfmi\fmi.pyx":3856
 *         """
 *         if self.time == None:
 *             raise FMUException("Setup Experiment has to be called prior to the initialization method.")             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_enter_initialization_mode(self._fmu)
 */
  __pyx_k_tuple_248 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_247)); if (unlikely(!__pyx_k_tuple_248)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_248);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_248));

  /* "pyfmi\fmi.pyx":3862
 *         if status == 1:
 *             if self._enable_logging:
 *                 logging.warning(             # <<<<<<<<<<<<<<
 *                     'Enter Initialize returned with a warning.' \
 *                     ' Check the log for information (FMUModel.get_log).')
 */
  __pyx_k_tuple_250 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_249)); if (unlikely(!__pyx_k_tuple_250)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_250);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_250));

  /* "pyfmi\fmi.pyx":3866
 *                     ' Check the log for information (FMUModel.get_log).')
 *             else:
 *                 logging.warning('Enter Initialize returned with a warning.' \             # <<<<<<<<<<<<<<
 *                     ' Enable logging for more information, (FMUModel(..., enable_logging=True)).')
 * 
 */
  __pyx_k_tuple_252 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_251)); if (unlikely(!__pyx_k_tuple_252)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_252);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_252));

  /* "pyfmi\fmi.pyx":3871
 *         if status > 1:
 *             if self._enable_logging:
 *                 raise FMUException(             # <<<<<<<<<<<<<<
 *                     'Enter Initialize returned with an error.' \
 *                     ' Check the log for information (FMUModel.get_log).')
 */
  __pyx_k_tuple_254 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_253)); if (unlikely(!__pyx_k_tuple_254)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_254);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_254));

  /* "pyfmi\fmi.pyx":3875
 *                     ' Check the log for information (FMUModel.get_log).')
 *             else:
 *                 raise FMUException('Enter Initialize returned with an error.' \             # <<<<<<<<<<<<<<
 *                     ' Enable logging for more information, (FMUModel(..., enable_logging=True)).')
 * 
 */
  __pyx_k_tuple_256 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_255)); if (unlikely(!__pyx_k_tuple_256)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_256);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_256));

  /* "pyfmi\fmi.pyx":3891
 * 
 *     def set_fmil_log_level(self, FMIL.jm_log_level_enu_t level):
 *         logging.warning("The method 'set_fmil_log_level' is deprecated, use 'set_log_level' instead.")             # <<<<<<<<<<<<<<
 *         self.set_log_level(level)
 * 
 */
  __pyx_k_tuple_259 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_79)); if (unlikely(!__pyx_k_tuple_259)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_259);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_259));

  /* "pyfmi\fmi.pyx":3907
 *             return level
 *         else:
 *             raise FMUException('Logging is not enabled')             # <<<<<<<<<<<<<<
 * 
 *     def set_debug_logging(self, logging_on, categories = []):
 */
  __pyx_k_tuple_261 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_260)); if (unlikely(!__pyx_k_tuple_261)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_261);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_261));

  /* "pyfmi\fmi.pyx":3940
 * 
 *         if len(categories) > 0:
 *             raise FMUException('Currently the logging of categories is not availible. See the docstring for more information')             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_set_debug_logging(self._fmu, log, nCat, NULL)
 */
  __pyx_k_tuple_264 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_263)); if (unlikely(!__pyx_k_tuple_264)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_264);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_264));

  /* "pyfmi\fmi.pyx":3945
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the debugging option.')             # <<<<<<<<<<<<<<
 * 
 *     def get_categories(self):
 */
  __pyx_k_tuple_265 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_77)); if (unlikely(!__pyx_k_tuple_265)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_265);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_265));

  /* "pyfmi\fmi.pyx":4000
 *                 raise FMUException("The variable %s could not be found."%variablename)
 *         else:
 *             raise FMUException('Either provide value reference or variable name.')             # <<<<<<<<<<<<<<
 * 
 *         real_variable = FMIL.fmi2_import_get_variable_as_real(variable)
 */
  __pyx_k_tuple_266 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_89)); if (unlikely(!__pyx_k_tuple_266)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_266);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_266));

  /* "pyfmi\fmi.pyx":4004
 *         real_variable = FMIL.fmi2_import_get_variable_as_real(variable)
 *         if real_variable == NULL:
 *             raise FMUException("The variable is not a real variable.")             # <<<<<<<<<<<<<<
 * 
 *         return  FMIL.fmi2_import_get_real_variable_nominal(real_variable)
 */
  __pyx_k_tuple_267 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_91)); if (unlikely(!__pyx_k_tuple_267)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_267);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_267));

  /* "pyfmi\fmi.pyx":4602
 * 
 *         else:
 *             raise FMUException("Unknown variable type.")             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_max(self, variable_name):
 */
  __pyx_k_tuple_272 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_94)); if (unlikely(!__pyx_k_tuple_272)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_272);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_272));

  /* "pyfmi\fmi.pyx":4645
 * 
 *         else:
 *             raise FMUException("The variable type does not have a maximum value.")             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_variable_min(self, variable_name):
 */
  __pyx_k_tuple_273 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_96)); if (unlikely(!__pyx_k_tuple_273)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_273);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_273));

  /* "pyfmi\fmi.pyx":4688
 * 
 *         else:
 *             raise FMUException("The variable type does not have a minimum value.")             # <<<<<<<<<<<<<<
 * 
 *     def get_fmu_state(self, FMUState2 state = None):
 */
  __pyx_k_tuple_274 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_98)); if (unlikely(!__pyx_k_tuple_274)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_274);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_274));

  /* "pyfmi\fmi.pyx":4715
 * 
 *         if not self._supports_get_set_FMU_state():
 *             raise FMUException('This FMU does not support get and set FMU-state')             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_get_fmu_state(self._fmu, &(state.fmu_state))
 */
  __pyx_k_tuple_277 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_276)); if (unlikely(!__pyx_k_tuple_277)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_277);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_277));

  /* "pyfmi\fmi.pyx":4720
 * 
 *         if status != 0:
 *             raise FMUException('An error occured while trying to get the FMU-state, see the log for possible more information')             # <<<<<<<<<<<<<<
 * 
 *         return state
 */
  __pyx_k_tuple_279 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_278)); if (unlikely(!__pyx_k_tuple_279)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_279);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_279));

  /* "pyfmi\fmi.pyx":4742
 * 
 *         if not self._supports_get_set_FMU_state():
 *             raise FMUException('This FMU dos not support get and set FMU-state')             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_set_fmu_state(self._fmu, internal_state)
 */
  __pyx_k_tuple_281 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_280)); if (unlikely(!__pyx_k_tuple_281)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_281);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_281));

  /* "pyfmi\fmi.pyx":4747
 * 
 *         if status != 0:
 *             raise FMUException('An error occured while trying to set the FMU-state, see the log for possible more information')             # <<<<<<<<<<<<<<
 * 
 *     def free_fmu_state(self, FMUState2 state):
 */
  __pyx_k_tuple_283 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_282)); if (unlikely(!__pyx_k_tuple_283)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_283);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_283));

  /* "pyfmi\fmi.pyx":4768
 * 
 *         if not self._supports_get_set_FMU_state():
 *             raise FMUException('This FMU does not support get and set FMU-state')             # <<<<<<<<<<<<<<
 *         if internal_state == NULL:
 *             print("FMU-state does not seem to be allocated.")
 */
  __pyx_k_tuple_284 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_276)); if (unlikely(!__pyx_k_tuple_284)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_284);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_284));

  /* "pyfmi\fmi.pyx":4776
 * 
 *         if status != 0:
 *             raise FMUException('An error occured while trying to free the FMU-state, see the log for possible more information')             # <<<<<<<<<<<<<<
 * 
 *         #Memory has been released
 */
  __pyx_k_tuple_287 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_286)); if (unlikely(!__pyx_k_tuple_287)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_287);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_287));

  /* "pyfmi\fmi.pyx":4947
 * 
 *         if variable == NULL:
 *             raise FMUException("Unknown variable. Please verify the correctness of the XML file and check the log.")             # <<<<<<<<<<<<<<
 * 
 *         alias_kind       = FMIL.fmi2_import_get_variable_alias_kind(variable)
 */
  __pyx_k_tuple_291 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_290)); if (unlikely(!__pyx_k_tuple_291)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_291);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_291));

  /* "pyfmi\fmi.pyx":4973
 *         variable_list = FMIL.fmi2_import_get_derivatives_list(self._fmu)
 *         if variable_list == NULL:
 *             raise FMUException("The returned states list is NULL.")             # <<<<<<<<<<<<<<
 * 
 *         variable_dict = self._add_scalar_variables(variable_list)
 */
  __pyx_k_tuple_293 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_292)); if (unlikely(!__pyx_k_tuple_293)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_293);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_293));

  /* "pyfmi\fmi.pyx":5013
 * 
 *             if start_indexp == NULL:
 *                 logging.warning(             # <<<<<<<<<<<<<<
 *                         'No dependency information for the outputs was found in the model description.' \
 *                         ' Assuming complete dependency.')
 */
  __pyx_k_tuple_296 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_295)); if (unlikely(!__pyx_k_tuple_296)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_296);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_296));

  /* "pyfmi\fmi.pyx":5070
 * 
 *             if start_indexp == NULL:
 *                 logging.warning(             # <<<<<<<<<<<<<<
 *                     'No dependency information for the derivatives was found in the model description.' \
 *                     ' Assuming complete dependency.')
 */
  __pyx_k_tuple_300 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_299)); if (unlikely(!__pyx_k_tuple_300)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_300);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_300));

  /* "pyfmi\fmi.pyx":5245
 * 
 *         if variable_list == NULL:
 *             raise FMUException("The returned derivatives states list is NULL.")             # <<<<<<<<<<<<<<
 * 
 *         for i in range(variable_list_size):
 */
  __pyx_k_tuple_309 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_308)); if (unlikely(!__pyx_k_tuple_309)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_309);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_309));

  /* "pyfmi\fmi.pyx":5295
 * 
 *         if variable_list == NULL:
 *             raise FMUException("The returned outputs list is NULL.")             # <<<<<<<<<<<<<<
 * 
 *         for i in range(variable_list_size):
 */
  __pyx_k_tuple_311 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_310)); if (unlikely(!__pyx_k_tuple_311)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_311);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_311));

  /* "pyfmi\fmi.pyx":5367
 * 
 *         if not self._provides_directional_derivatives():
 *             raise FMUException('This FMU does not provide directional derivatives')             # <<<<<<<<<<<<<<
 * 
 *         if len(var_ref) != len(v):
 */
  __pyx_k_tuple_314 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_313)); if (unlikely(!__pyx_k_tuple_314)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_314);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_314));

  /* "pyfmi\fmi.pyx":5370
 * 
 *         if len(var_ref) != len(v):
 *             raise FMUException('The length of the list with variables (var_ref) and the seed vector (V) are not equal')             # <<<<<<<<<<<<<<
 * 
 *         for i in range(len(var_ref)):
 */
  __pyx_k_tuple_316 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_315)); if (unlikely(!__pyx_k_tuple_316)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_316);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_316));

  /* "pyfmi\fmi.pyx":5385
 * 
 *         if status != 0:
 *             raise FMUException('An error occured while getting the directional derivative, see the log for possible more information')             # <<<<<<<<<<<<<<
 * 
 *         return dz
 */
  __pyx_k_tuple_318 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_317)); if (unlikely(!__pyx_k_tuple_318)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_318);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_318));

  /* "pyfmi\fmi.pyx":5398
 * 
 *         if not self._provides_directional_derivatives():
 *             raise FMUException('This FMU does not provide directional derivatives')             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_get_directional_derivative(self._fmu,
 */
  __pyx_k_tuple_319 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_313)); if (unlikely(!__pyx_k_tuple_319)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_319);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_319));

  /* "pyfmi\fmi.pyx":5556
 *         if self._fmu_kind != FMIL.fmi2_fmu_kind_cs:
 *             if self._fmu_kind != FMIL.fmi2_fmu_kind_me_and_cs:
 *                 raise FMUException("This class only supports FMI 2.0 for Co-simulation.")             # <<<<<<<<<<<<<<
 * 
 *         if self.get_capability_flags()['needsExecutionTool'] == True:
 */
  __pyx_k_tuple_323 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_322)); if (unlikely(!__pyx_k_tuple_323)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_323);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_323));

  /* "pyfmi\fmi.pyx":5559
 * 
 *         if self.get_capability_flags()['needsExecutionTool'] == True:
 *             raise FMUException('Models that need an execution tool are not supported')             # <<<<<<<<<<<<<<
 * 
 *         self._modelId = decode(FMIL.fmi2_import_get_model_identifier_CS(self._fmu))
 */
  __pyx_k_tuple_326 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_325)); if (unlikely(!__pyx_k_tuple_326)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_326);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_326));

  /* "pyfmi\fmi.pyx":5671
 *         status = FMIL.fmi2_import_cancel_step(self._fmu)
 *         if status != 0:
 *             raise FMUException('An error occured while canceling the step')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_329 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_328)); if (unlikely(!__pyx_k_tuple_329)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_329);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_329));

  /* "pyfmi\fmi.pyx":5704
 * 
 *         if order < 1:
 *             raise FMUException("The order must be greater than zero.")             # <<<<<<<<<<<<<<
 *         if not can_interpolate_inputs:
 *             raise FMUException("The FMU does not support input derivatives.")
 */
  __pyx_k_tuple_330 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_121)); if (unlikely(!__pyx_k_tuple_330)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_330);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_330));

  /* "pyfmi\fmi.pyx":5706
 *             raise FMUException("The order must be greater than zero.")
 *         if not can_interpolate_inputs:
 *             raise FMUException("The FMU does not support input derivatives.")             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(variables,str):
 */
  __pyx_k_tuple_331 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_123)); if (unlikely(!__pyx_k_tuple_331)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_331);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_331));

  /* "pyfmi\fmi.pyx":5717
 *                 orders[i] = order
 *         else:
 *             raise FMUException("The variables must either be a string or a list of strings")             # <<<<<<<<<<<<<<
 * 
 *         status = self._set_input_derivatives(value_refs, val, orders)
 */
  __pyx_k_tuple_332 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_111)); if (unlikely(!__pyx_k_tuple_332)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_332);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_332));

  /* "pyfmi\fmi.pyx":5724
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the Real input derivatives.')             # <<<<<<<<<<<<<<
 * 
 *     cdef int _set_input_derivatives(self, N.ndarray[FMIL.fmi2_value_reference_t, ndim=1, mode="c"] value_refs,
 */
  __pyx_k_tuple_333 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_126)); if (unlikely(!__pyx_k_tuple_333)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_333);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_333));

  /* "pyfmi\fmi.pyx":5784
 *                 orders[i] = order
 *         else:
 *             raise FMUException("The variables must either be a string or a list of strings")             # <<<<<<<<<<<<<<
 * 
 *         values = N.array([0.0]*nref, dtype=N.float, ndmin=1)
 */
  __pyx_k_tuple_334 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_111)); if (unlikely(!__pyx_k_tuple_334)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_334);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_334));

  /* "pyfmi\fmi.pyx":5793
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the Real output derivatives.')             # <<<<<<<<<<<<<<
 * 
 *         return values
 */
  __pyx_k_tuple_335 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_113)); if (unlikely(!__pyx_k_tuple_335)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_335);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_335));

  /* "pyfmi\fmi.pyx":5841
 *             fmi_status_kind = status_kind
 *         else:
 *             raise FMUException('Status kind has to be between 0 and 3')             # <<<<<<<<<<<<<<
 * 
 *         status = FMIL.fmi2_import_get_status(self._fmu, fmi_status_kind, &status_value)
 */
  __pyx_k_tuple_337 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_336)); if (unlikely(!__pyx_k_tuple_337)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_337);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_337));

  /* "pyfmi\fmi.pyx":5845
 *         status = FMIL.fmi2_import_get_status(self._fmu, fmi_status_kind, &status_value)
 *         if status != 0:
 *             raise FMUException('An error occured while retriving the status')             # <<<<<<<<<<<<<<
 * 
 *         return status_value
 */
  __pyx_k_tuple_339 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_338)); if (unlikely(!__pyx_k_tuple_339)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_339);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_339));

  /* "pyfmi\fmi.pyx":5873
 *             fmi_status_kind = status_kind
 *         else:
 *             raise FMUException('Status kind has to be between 0 and 3')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_340 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_336)); if (unlikely(!__pyx_k_tuple_340)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_340);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_340));

  /* "pyfmi\fmi.pyx":5878
 *         status = FMIL.fmi2_import_get_real_status(self._fmu, fmi_status_kind, &output)
 *         if status != 0:
 *             raise FMUException('An error occured while retriving the status')             # <<<<<<<<<<<<<<
 * 
 *         return output
 */
  __pyx_k_tuple_341 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_338)); if (unlikely(!__pyx_k_tuple_341)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_341);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_341));

  /* "pyfmi\fmi.pyx":5906
 *             fmi_status_kind = status_kind
 *         else:
 *             raise FMUException('Status kind has to be between 0 and 3')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_342 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_336)); if (unlikely(!__pyx_k_tuple_342)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_342);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_342));

  /* "pyfmi\fmi.pyx":5911
 *         status = FMIL.fmi2_import_get_integer_status(self._fmu, fmi_status_kind, &output)
 *         if status != 0:
 *             raise FMUException('An error occured while retriving the status')             # <<<<<<<<<<<<<<
 * 
 *         return output
 */
  __pyx_k_tuple_343 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_338)); if (unlikely(!__pyx_k_tuple_343)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_343);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_343));

  /* "pyfmi\fmi.pyx":5939
 *             fmi_status_kind = status_kind
 *         else:
 *             raise FMUException('Status kind has to be between 0 and 3')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_344 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_336)); if (unlikely(!__pyx_k_tuple_344)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_344);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_344));

  /* "pyfmi\fmi.pyx":5944
 *         status = FMIL.fmi2_import_get_boolean_status(self._fmu, fmi_status_kind, &output)
 *         if status != 0:
 *             raise FMUException('An error occured while retriving the status')             # <<<<<<<<<<<<<<
 * 
 *         return output
 */
  __pyx_k_tuple_345 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_338)); if (unlikely(!__pyx_k_tuple_345)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_345);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_345));

  /* "pyfmi\fmi.pyx":5972
 *             fmi_status_kind = status_kind
 *         else:
 *             raise FMUException('Status kind has to be between 0 and 3')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_346 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_336)); if (unlikely(!__pyx_k_tuple_346)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_346);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_346));

  /* "pyfmi\fmi.pyx":5977
 *         status = FMIL.fmi2_import_get_string_status(self._fmu, fmi_status_kind, &output)
 *         if status != 0:
 *             raise FMUException('An error occured while retriving the status')             # <<<<<<<<<<<<<<
 * 
 *         return output
 */
  __pyx_k_tuple_347 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_338)); if (unlikely(!__pyx_k_tuple_347)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_347);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_347));

  /* "pyfmi\fmi.pyx":6154
 *         if self._fmu_kind != FMIL.fmi2_fmu_kind_me:
 *             if self._fmu_kind != FMIL.fmi2_fmu_kind_me_and_cs:
 *                 raise FMUException('This class only supports FMI 2.0 for Model Exchange.')             # <<<<<<<<<<<<<<
 * 
 *         if self.get_capability_flags()['needsExecutionTool'] == True:
 */
  __pyx_k_tuple_355 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_354)); if (unlikely(!__pyx_k_tuple_355)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_355);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_355));

  /* "pyfmi\fmi.pyx":6157
 * 
 *         if self.get_capability_flags()['needsExecutionTool'] == True:
 *             raise FMUException('Models that need an execution tool are not supported')             # <<<<<<<<<<<<<<
 * 
 *         self._eventInfo.newDiscreteStatesNeeded           = FMI2_FALSE
 */
  __pyx_k_tuple_356 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_325)); if (unlikely(!__pyx_k_tuple_356)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_356);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_356));

  /* "pyfmi\fmi.pyx":6220
 * 
 *         if status != 0:
 *             raise FMUException('Failed to set the time.')             # <<<<<<<<<<<<<<
 *         self.__t = t
 * 
 */
  __pyx_k_tuple_357 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_156)); if (unlikely(!__pyx_k_tuple_357)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_357);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_357));

  /* "pyfmi\fmi.pyx":6278
 * 
 *         if status != 0:
 *             raise FMUException('Failed to enter event mode.')             # <<<<<<<<<<<<<<
 * 
 *     def enter_continuous_time_mode(self):
 */
  __pyx_k_tuple_363 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_362)); if (unlikely(!__pyx_k_tuple_363)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_363);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_363));

  /* "pyfmi\fmi.pyx":6289
 * 
 *         if status != 0:
 *             raise FMUException('Failed to enter continuous time mode.')             # <<<<<<<<<<<<<<
 * 
 *     def get_event_indicators(self):
 */
  __pyx_k_tuple_365 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_364)); if (unlikely(!__pyx_k_tuple_365)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_365);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_365));

  /* "pyfmi\fmi.pyx":6312
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the event indicators.')             # <<<<<<<<<<<<<<
 * 
 *         return values
 */
  __pyx_k_tuple_366 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_167)); if (unlikely(!__pyx_k_tuple_366)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_366);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_366));

  /* "pyfmi\fmi.pyx":6410
 * 
 *         if status != 0:
 *             raise FMUException('Failed to call FMI Completed Step.')             # <<<<<<<<<<<<<<
 * 
 *         return enterEventMode==FMI2_TRUE, terminateSimulation==FMI2_TRUE
 */
  __pyx_k_tuple_370 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_176)); if (unlikely(!__pyx_k_tuple_370)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_370);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_370));

  /* "pyfmi\fmi.pyx":6427
 * 
 *         if status != 0:
 *             raise FMUException('Failed to retrieve the continuous states.')             # <<<<<<<<<<<<<<
 * 
 *         return ndx
 */
  __pyx_k_tuple_371 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_158)); if (unlikely(!__pyx_k_tuple_371)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_371);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_371));

  /* "pyfmi\fmi.pyx":6444
 * 
 *         if ndx.size != self._nContinuousStates:
 *             raise FMUException(             # <<<<<<<<<<<<<<
 *                 'Failed to set the new continuous states. ' \
 *                 'The number of values are not consistent with the number of '\
 */
  __pyx_k_tuple_372 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_160)); if (unlikely(!__pyx_k_tuple_372)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_372);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_372));

  /* "pyfmi\fmi.pyx":6452
 * 
 *         if status >= 3:
 *             raise FMUException('Failed to set the new continuous states.')             # <<<<<<<<<<<<<<
 * 
 *     continuous_states = property(_get_continuous_states, _set_continuous_states,
 */
  __pyx_k_tuple_373 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_162)); if (unlikely(!__pyx_k_tuple_373)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_373);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_373));

  /* "pyfmi\fmi.pyx":6475
 * 
 *         if status != 0:
 *             raise FMUException('Failed to get the nominal values.')             # <<<<<<<<<<<<<<
 * 
 *         return ndx
 */
  __pyx_k_tuple_374 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_164)); if (unlikely(!__pyx_k_tuple_374)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_374);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_374));

  /* "pyfmi\fmi.pyx":6748
 * 
 *     # Check that the file referenced by fmu has the correct file-ending
 *     if not fmu_full_path.endswith(".fmu"):             # <<<<<<<<<<<<<<
 *         raise FMUException("FMUModel must be instantiated with an FMU (.fmu) file.")
 * 
 */
  __pyx_k_tuple_385 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_35)); if (unlikely(!__pyx_k_tuple_385)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_385);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_385));

  /* "pyfmi\fmi.pyx":6749
 *     # Check that the file referenced by fmu has the correct file-ending
 *     if not fmu_full_path.endswith(".fmu"):
 *         raise FMUException("FMUModel must be instantiated with an FMU (.fmu) file.")             # <<<<<<<<<<<<<<
 * 
 *     #Specify the general callback functions
 */
  __pyx_k_tuple_386 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_37)); if (unlikely(!__pyx_k_tuple_386)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_386);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_386));

  /* "pyfmi\fmi.pyx":6781
 *             raise FMUException("The FMU version could not be determined. "+decode(last_error))
 *         else:
 *             raise FMUException("The FMU version could not be determined. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 *     if version != 1:
 *         #Delete the context
 */
  __pyx_k_tuple_387 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_40)); if (unlikely(!__pyx_k_tuple_387)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_387);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_387));

  /* "pyfmi\fmi.pyx":6787
 *             FMIL.fmi_import_free_context(context)
 * 
 *         raise FMUException("PyFMI currently only supports FMI 1.0.")             # <<<<<<<<<<<<<<
 * 
 *     #Parse the XML
 */
  __pyx_k_tuple_389 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_388)); if (unlikely(!__pyx_k_tuple_389)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_389);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_389));

  /* "pyfmi\fmi.pyx":6796
 *             raise FMUException("The XML file could not be parsed. "+decode(last_error))
 *         else:
 *             raise FMUException("The XML file could not be parsed. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 *     allocated_xml = True
 * 
 */
  __pyx_k_tuple_390 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_45)); if (unlikely(!__pyx_k_tuple_390)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_390);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_390));

  /* "pyfmi\fmi.pyx":6814
 *             FMIL.fmi_import_free_context(context)
 * 
 *         raise FMUException("PyFMI currently only supports FMI 1.0.")             # <<<<<<<<<<<<<<
 * 
 *     #Delete the XML
 */
  __pyx_k_tuple_391 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_388)); if (unlikely(!__pyx_k_tuple_391)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_391);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_391));

  /* "pyfmi\fmi.pyx":6836
 *             if line == "":
 *                 break
 *             log.append(line.strip("\n"))             # <<<<<<<<<<<<<<
 * 
 *     for i in range(len(log)):
 */
  __pyx_k_tuple_392 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_13)); if (unlikely(!__pyx_k_tuple_392)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_392);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_392));

  /* "pyfmi\fmi.pyx":6831
 * def _handle_load_fmu_exception(fmu, log_file):
 *     log = []
 *     with open(log_file,'r') as file:             # <<<<<<<<<<<<<<
 *         while True:
 *             line = file.readline()
 */
  __pyx_k_tuple_393 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_tuple_393)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_393);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_393));

  /* "pyfmi\fmi.pyx":6903
 *     # Check that the file referenced by fmu has the correct file-ending
 *     fmu_full_path = os.path.abspath(os.path.join(path,fmu))
 *     if not fmu_full_path.endswith('.fmu'):             # <<<<<<<<<<<<<<
 *         raise FMUException("FMUModel must be instantiated with an FMU (.fmu) file.")
 * 
 */
  __pyx_k_tuple_395 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_35)); if (unlikely(!__pyx_k_tuple_395)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_395);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_395));

  /* "pyfmi\fmi.pyx":6904
 *     fmu_full_path = os.path.abspath(os.path.join(path,fmu))
 *     if not fmu_full_path.endswith('.fmu'):
 *         raise FMUException("FMUModel must be instantiated with an FMU (.fmu) file.")             # <<<<<<<<<<<<<<
 * 
 *     #Check that the file exists
 */
  __pyx_k_tuple_396 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_37)); if (unlikely(!__pyx_k_tuple_396)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_396);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_396));

  /* "pyfmi\fmi.pyx":6908
 *     #Check that the file exists
 *     if not os.path.isfile(fmu_full_path):
 *         raise FMUException('Could not locate the FMU in the specified directory.')             # <<<<<<<<<<<<<<
 * 
 *     #Check that kind-argument is well-defined
 */
  __pyx_k_tuple_397 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_196)); if (unlikely(!__pyx_k_tuple_397)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_397);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_397));

  /* "pyfmi\fmi.pyx":6936
 *             raise FMUException("The log level must be between %d and %d"%(FMIL.jm_log_level_nothing, FMIL.jm_log_level_all))
 *     else:
 *         logging.warning("The attribute 'enable_logging' is deprecated. Please use 'log_level' instead. Setting 'log_level' to INFO...")             # <<<<<<<<<<<<<<
 *         callbacks.log_level = FMIL.jm_log_level_info if enable_logging else FMIL.jm_log_level_error
 * 
 */
  __pyx_k_tuple_399 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_33)); if (unlikely(!__pyx_k_tuple_399)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_399);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_399));

  /* "pyfmi\fmi.pyx":6976
 *         else:
 *             _handle_load_fmu_exception(fmu, log_file)
 *             raise FMUException("The FMU version could not be determined. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 * 
 *     if version > 2:
 */
  __pyx_k_tuple_401 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_40)); if (unlikely(!__pyx_k_tuple_401)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_401);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_401));

  /* "pyfmi\fmi.pyx":6988
 *         else:
 *             _handle_load_fmu_exception(fmu, log_file)
 *             raise FMUException("The FMU version is unsupported. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_k_tuple_404 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_403)); if (unlikely(!__pyx_k_tuple_404)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_404);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_404));

  /* "pyfmi\fmi.pyx":7006
 *             else:
 *                 _handle_load_fmu_exception(fmu, log_file)
 *                 raise FMUException('The XML-could not be read. Enable logging for possible nore information.')             # <<<<<<<<<<<<<<
 * 
 *         fmu_1_kind = FMIL.fmi1_import_get_fmu_kind(fmu_1)
 */
  __pyx_k_tuple_405 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_203)); if (unlikely(!__pyx_k_tuple_405)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_405);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_405));

  /* "pyfmi\fmi.pyx":7020
 *             FMIL.fmi_import_rmdir(&callbacks, fmu_temp_dir)
 *             _handle_load_fmu_exception(fmu, log_file)
 *             raise FMUException("PyFMI does not support co-simulation tool")             # <<<<<<<<<<<<<<
 *         else:
 *             FMIL.fmi1_import_free(fmu_1)
 */
  __pyx_k_tuple_407 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_406)); if (unlikely(!__pyx_k_tuple_407)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_407);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_407));

  /* "pyfmi\fmi.pyx":7042
 *             else:
 *                 _handle_load_fmu_exception(fmu, log_file)
 *                 raise FMUException('The XML-could not be read. Enable logging for possible nore information.')             # <<<<<<<<<<<<<<
 * 
 *         fmu_2_kind = FMIL.fmi2_import_get_fmu_kind(fmu_2)
 */
  __pyx_k_tuple_410 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_203)); if (unlikely(!__pyx_k_tuple_410)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_410);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_410));

  /* "pyfmi\fmi.pyx":7057
 *             else:
 *                 _handle_load_fmu_exception(fmu, log_file)
 *                 raise FMUException("The FMU kind could not be determined. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 * 
 *         #FMU kind is known
 */
  __pyx_k_tuple_411 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_206)); if (unlikely(!__pyx_k_tuple_411)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_411);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_411));

  /* "pyfmi\fmi.pyx":7092
 *         else:
 *             _handle_load_fmu_exception(fmu, log_file)
 *             raise FMUException("The FMU version is not found. Enable logging for possibly more information.")             # <<<<<<<<<<<<<<
 * 
 *     #Delete
 */
  __pyx_k_tuple_414 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_413)); if (unlikely(!__pyx_k_tuple_414)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_414);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_414));

  /* "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_416 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_415)); if (unlikely(!__pyx_k_tuple_416)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_416);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_416));

  /* "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_418 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_417)); if (unlikely(!__pyx_k_tuple_418)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_418);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_418));

  /* "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_420 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_419)); if (unlikely(!__pyx_k_tuple_420)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_420);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_420));

  /* "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 == c'>' and little_endian) or
 */
  __pyx_k_tuple_423 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_422)); if (unlikely(!__pyx_k_tuple_423)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_423);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_423));

  /* "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_424 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_419)); if (unlikely(!__pyx_k_tuple_424)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_424);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_424));

  /* "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_426 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_425)); if (unlikely(!__pyx_k_tuple_426)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_426);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_426));

  /* "pyfmi\fmi.pyx":44
 * if python3_flag:
 *     import codecs
 *     def encode(x):             # <<<<<<<<<<<<<<
 *         return codecs.latin_1_encode(x)[0]
 *     def decode(x):
 */
  __pyx_k_tuple_433 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__x)); if (unlikely(!__pyx_k_tuple_433)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_433);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_433));
  __pyx_k_codeobj_434 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_433, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_435, __pyx_n_s__encode, 44, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_434)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":46
 *     def encode(x):
 *         return codecs.latin_1_encode(x)[0]
 *     def decode(x):             # <<<<<<<<<<<<<<
 *         return x.decode()
 * else:
 */
  __pyx_k_tuple_437 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__x)); if (unlikely(!__pyx_k_tuple_437)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_437);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_437));
  __pyx_k_codeobj_438 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_437, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_435, __pyx_n_s__decode, 46, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_438)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":49
 *         return x.decode()
 * else:
 *     def encode(x):             # <<<<<<<<<<<<<<
 *         return x
 *     def decode(x):
 */
  __pyx_k_tuple_439 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__x)); if (unlikely(!__pyx_k_tuple_439)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_439);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_439));
  __pyx_k_codeobj_440 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_439, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_435, __pyx_n_s__encode, 49, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_440)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":51
 *     def encode(x):
 *         return x
 *     def decode(x):             # <<<<<<<<<<<<<<
 *         return x
 * 
 */
  __pyx_k_tuple_441 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__x)); if (unlikely(!__pyx_k_tuple_441)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_441);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_441));
  __pyx_k_codeobj_442 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_441, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_435, __pyx_n_s__decode, 51, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_442)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":120
 * FMI_ME                 = FMIL.fmi1_fmu_kind_enu_me
 * FMI_CS_STANDALONE      = FMIL.fmi1_fmu_kind_enu_cs_standalone
 * FMI_MIME_CS_STANDALONE = encode("application/x-fmu-sharedlibrary")             # <<<<<<<<<<<<<<
 * 
 * FMI_REGISTER_GLOBALLY = 1
 */
  __pyx_k_tuple_447 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_446)); if (unlikely(!__pyx_k_tuple_447)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_447);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_447));

  /* "pyfmi\fmi.pyx":6724
 *         FMUModelME1.__init__(self,fmu,path,enable_logging)
 * 
 * def load_fmu_deprecated(fmu, path='.', enable_logging=True, log_file_name=""):             # <<<<<<<<<<<<<<
 *     """
 *     Helper function for loading FMUs of different kinds.
 */
  __pyx_k_tuple_464 = PyTuple_Pack(16, ((PyObject *)__pyx_n_s__fmu), ((PyObject *)__pyx_n_s__path), ((PyObject *)__pyx_n_s__enable_logging), ((PyObject *)__pyx_n_s__log_file_name), ((PyObject *)__pyx_n_s__callBackFunctions), ((PyObject *)__pyx_n_s__callbacks), ((PyObject *)__pyx_n_s__context), ((PyObject *)__pyx_n_s___fmu), ((PyObject *)__pyx_n_s__last_error), ((PyObject *)__pyx_n_s__allocated_context), ((PyObject *)__pyx_n_s__allocated_xml), ((PyObject *)__pyx_n_s__fmu_temp_dir), ((PyObject *)__pyx_n_s__fmu_full_path), ((PyObject *)__pyx_n_s__version), ((PyObject *)__pyx_n_s__fmu_kind), ((PyObject *)__pyx_n_s__model)); if (unlikely(!__pyx_k_tuple_464)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_464);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_464));
  __pyx_k_codeobj_465 = (PyObject*)__Pyx_PyCode_New(4, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_464, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_435, __pyx_n_s__load_fmu_deprecated, 6724, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_465)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":6829
 *     return model
 * 
 * def _handle_load_fmu_exception(fmu, log_file):             # <<<<<<<<<<<<<<
 *     log = []
 *     with open(log_file,'r') as file:
 */
  __pyx_k_tuple_466 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__fmu), ((PyObject *)__pyx_n_s__log_file), ((PyObject *)__pyx_n_s__log), ((PyObject *)__pyx_n_s__file), ((PyObject *)__pyx_n_s__line), ((PyObject *)__pyx_n_s__i)); if (unlikely(!__pyx_k_tuple_466)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_466);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_466));
  __pyx_k_codeobj_467 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_466, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_435, __pyx_n_s_400, 6829, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_467)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":6841
 *         print log[i]
 * 
 * def load_fmu(fmu, path = '.', enable_logging = None, log_file_name = "", kind = 'auto', log_level=FMI_DEFAULT_LOG_LEVEL):             # <<<<<<<<<<<<<<
 *     """
 *     Helper method for creating a model instance.
 */
  __pyx_k_tuple_469 = PyTuple_Pack(22, ((PyObject *)__pyx_n_s__fmu), ((PyObject *)__pyx_n_s__path), ((PyObject *)__pyx_n_s__enable_logging), ((PyObject *)__pyx_n_s__log_file_name), ((PyObject *)__pyx_n_s__kind), ((PyObject *)__pyx_n_s__log_level), ((PyObject *)__pyx_n_s__context), ((PyObject *)__pyx_n_s__callbacks), ((PyObject *)__pyx_n_s__callBackFunctions_1), ((PyObject *)__pyx_n_s__callBackFunctions_2), ((PyObject *)__pyx_n_s__last_error), ((PyObject *)__pyx_n_s__version), ((PyObject *)__pyx_n_s__fmu_1), ((PyObject *)__pyx_n_s__fmu_2), ((PyObject *)__pyx_n_s__fmu_1_kind), ((PyObject *)__pyx_n_s__fmu_2_kind), ((PyObject *)__pyx_n_s__log_file_c), ((PyObject *)__pyx_n_s__fmu_temp_dir), ((PyObject *)__pyx_n_s__model), ((PyObject *)__pyx_n_s__log_file), ((PyObject *)__pyx_n_s__fmu_full_path), ((PyObject *)__pyx_n_s_468)); if (unlikely(!__pyx_k_tuple_469)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_469);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_469));
  __pyx_k_codeobj_470 = (PyObject*)__Pyx_PyCode_New(6, 0, 22, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_469, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_435, __pyx_n_s__load_fmu, 6841, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_470)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC initfmi(void); /*proto*/
PyMODINIT_FUNC initfmi(void)
#else
PyMODINIT_FUNC PyInit_fmi(void); /*proto*/
PyMODINIT_FUNC PyInit_fmi(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  #if CYTHON_REFNANNY
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  if (!__Pyx_RefNanny) {
      PyErr_Clear();
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
      if (!__Pyx_RefNanny)
          Py_FatalError("failed to import 'refnanny' module");
  }
  #endif
  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_fmi(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_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 ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("fmi"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_427), 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  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, "pyfmi.fmi")) {
      if (unlikely(PyDict_SetItemString(modules, "pyfmi.fmi", __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
  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;}
  if (__pyx_module_is_main_pyfmi__fmi) {
    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  __pyx_vtabptr_5pyfmi_3fmi_ModelBase = &__pyx_vtable_5pyfmi_3fmi_ModelBase;
  __pyx_vtable_5pyfmi_3fmi_ModelBase._logger = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_ModelBase *, jm_string, int, jm_string))__pyx_f_5pyfmi_3fmi_9ModelBase__logger;
  if (PyType_Ready(&__pyx_type_5pyfmi_3fmi_ModelBase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_5pyfmi_3fmi_ModelBase.tp_dict, __pyx_vtabptr_5pyfmi_3fmi_ModelBase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "ModelBase", (PyObject *)&__pyx_type_5pyfmi_3fmi_ModelBase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pyfmi_3fmi_ModelBase = &__pyx_type_5pyfmi_3fmi_ModelBase;
  if (PyType_Ready(&__pyx_type_5pyfmi_3fmi_ScalarVariable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "ScalarVariable", (PyObject *)&__pyx_type_5pyfmi_3fmi_ScalarVariable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pyfmi_3fmi_ScalarVariable = &__pyx_type_5pyfmi_3fmi_ScalarVariable;
  if (PyType_Ready(&__pyx_type_5pyfmi_3fmi_ScalarVariable2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "ScalarVariable2", (PyObject *)&__pyx_type_5pyfmi_3fmi_ScalarVariable2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pyfmi_3fmi_ScalarVariable2 = &__pyx_type_5pyfmi_3fmi_ScalarVariable2;
  if (PyType_Ready(&__pyx_type_5pyfmi_3fmi_FMUState2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "FMUState2", (PyObject *)&__pyx_type_5pyfmi_3fmi_FMUState2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pyfmi_3fmi_FMUState2 = &__pyx_type_5pyfmi_3fmi_FMUState2;
  __pyx_vtabptr_5pyfmi_3fmi_FMUModelBase = &__pyx_vtable_5pyfmi_3fmi_FMUModelBase;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase.__pyx_base = *__pyx_vtabptr_5pyfmi_3fmi_ModelBase;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase._internal_set_fmu_null = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_12FMUModelBase__internal_set_fmu_null;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase.get_variable_description = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_description;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase.get_variable_data_type = (enum fmi1_base_type_enu_t (*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_data_type;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase.get_variable_valueref = (fmi1_value_reference_t (*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_valueref;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase.get_variable_fixed = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_fixed;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase.get_variable_start = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_start;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase.get_variable_max = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_max;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase.get_variable_min = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_min;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase.get_variable_variability = (enum fmi1_variability_enu_t (*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_variability;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase.get_variable_causality = (enum fmi1_causality_enu_t (*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_12FMUModelBase_get_variable_causality;
  __pyx_type_5pyfmi_3fmi_FMUModelBase.tp_base = __pyx_ptype_5pyfmi_3fmi_ModelBase;
  if (PyType_Ready(&__pyx_type_5pyfmi_3fmi_FMUModelBase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pyfmi_3fmi_FMUModelBase, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_5pyfmi_3fmi_12FMUModelBase___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_5pyfmi_3fmi_12FMUModelBase___init__.doc = __pyx_doc_5pyfmi_3fmi_12FMUModelBase___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pyfmi_3fmi_12FMUModelBase___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_5pyfmi_3fmi_FMUModelBase.tp_dict, __pyx_vtabptr_5pyfmi_3fmi_FMUModelBase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "FMUModelBase", (PyObject *)&__pyx_type_5pyfmi_3fmi_FMUModelBase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pyfmi_3fmi_FMUModelBase = &__pyx_type_5pyfmi_3fmi_FMUModelBase;
  __pyx_vtabptr_5pyfmi_3fmi_FMUModelCS1 = &__pyx_vtable_5pyfmi_3fmi_FMUModelCS1;
  __pyx_vtable_5pyfmi_3fmi_FMUModelCS1.__pyx_base = *__pyx_vtabptr_5pyfmi_3fmi_FMUModelBase;
  __pyx_vtable_5pyfmi_3fmi_FMUModelCS1._get_time = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_11FMUModelCS1__get_time;
  __pyx_vtable_5pyfmi_3fmi_FMUModelCS1._set_time = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS1 *, fmi1_real_t, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_11FMUModelCS1__set_time;
  __pyx_type_5pyfmi_3fmi_FMUModelCS1.tp_base = __pyx_ptype_5pyfmi_3fmi_FMUModelBase;
  if (PyType_Ready(&__pyx_type_5pyfmi_3fmi_FMUModelCS1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_5pyfmi_3fmi_FMUModelCS1.tp_dict, __pyx_vtabptr_5pyfmi_3fmi_FMUModelCS1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "FMUModelCS1", (PyObject *)&__pyx_type_5pyfmi_3fmi_FMUModelCS1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pyfmi_3fmi_FMUModelCS1 = &__pyx_type_5pyfmi_3fmi_FMUModelCS1;
  __pyx_vtabptr_5pyfmi_3fmi_FMUModelME1 = &__pyx_vtable_5pyfmi_3fmi_FMUModelME1;
  __pyx_vtable_5pyfmi_3fmi_FMUModelME1.__pyx_base = *__pyx_vtabptr_5pyfmi_3fmi_FMUModelBase;
  __pyx_vtable_5pyfmi_3fmi_FMUModelME1._get_time = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_11FMUModelME1__get_time;
  __pyx_vtable_5pyfmi_3fmi_FMUModelME1._set_time = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *, fmi1_real_t, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_11FMUModelME1__set_time;
  __pyx_vtable_5pyfmi_3fmi_FMUModelME1.get_derivatives = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelME1 *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_11FMUModelME1_get_derivatives;
  __pyx_type_5pyfmi_3fmi_FMUModelME1.tp_base = __pyx_ptype_5pyfmi_3fmi_FMUModelBase;
  if (PyType_Ready(&__pyx_type_5pyfmi_3fmi_FMUModelME1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_5pyfmi_3fmi_FMUModelME1.tp_dict, __pyx_vtabptr_5pyfmi_3fmi_FMUModelME1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "FMUModelME1", (PyObject *)&__pyx_type_5pyfmi_3fmi_FMUModelME1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pyfmi_3fmi_FMUModelME1 = &__pyx_type_5pyfmi_3fmi_FMUModelME1;
  __pyx_vtabptr_5pyfmi_3fmi_FMUModelBase2 = &__pyx_vtable_5pyfmi_3fmi_FMUModelBase2;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase2.__pyx_base = *__pyx_vtabptr_5pyfmi_3fmi_ModelBase;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase2.get_variable_valueref = (fmi2_value_reference_t (*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_valueref;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase2.get_variable_data_type = (fmi2_base_type_enu_t (*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_data_type;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase2.get_variable_description = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_description;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase2.get_variable_variability = (fmi2_variability_enu_t (*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_variability;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase2.get_variable_causality = (fmi2_causality_enu_t (*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_causality;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase2.get_output_dependencies = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_output_dependencies;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase2.get_derivatives_dependencies = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_derivatives_dependencies;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase2.get_variable_start = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_start;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase2.get_variable_max = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_max;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase2.get_variable_min = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_min;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase2.get_variable_initial = (fmi2_initial_enu_t (*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_variable_initial;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase2.serialize_fmu_state = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_13FMUModelBase2_serialize_fmu_state;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase2.deserialize_fmu_state = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_13FMUModelBase2_deserialize_fmu_state;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase2.serialized_fmu_state_size = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_13FMUModelBase2_serialized_fmu_state_size;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase2._add_scalar_variables = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, fmi2_import_variable_list_t *))__pyx_f_5pyfmi_3fmi_13FMUModelBase2__add_scalar_variables;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase2._add_scalar_variable = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, fmi2_import_variable_t *))__pyx_f_5pyfmi_3fmi_13FMUModelBase2__add_scalar_variable;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase2._get_directional_derivative = (int (*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyArrayObject *, PyArrayObject *, PyArrayObject *, PyArrayObject *))__pyx_f_5pyfmi_3fmi_13FMUModelBase2__get_directional_derivative;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase2.set_real = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_13FMUModelBase2_set_real;
  __pyx_vtable_5pyfmi_3fmi_FMUModelBase2.get_real = (PyArrayObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelBase2 *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_13FMUModelBase2_get_real;
  __pyx_type_5pyfmi_3fmi_FMUModelBase2.tp_base = __pyx_ptype_5pyfmi_3fmi_ModelBase;
  if (PyType_Ready(&__pyx_type_5pyfmi_3fmi_FMUModelBase2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pyfmi_3fmi_FMUModelBase2, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_5pyfmi_3fmi_13FMUModelBase2___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_5pyfmi_3fmi_13FMUModelBase2___init__.doc = __pyx_doc_5pyfmi_3fmi_13FMUModelBase2___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pyfmi_3fmi_13FMUModelBase2___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_5pyfmi_3fmi_FMUModelBase2.tp_dict, __pyx_vtabptr_5pyfmi_3fmi_FMUModelBase2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "FMUModelBase2", (PyObject *)&__pyx_type_5pyfmi_3fmi_FMUModelBase2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pyfmi_3fmi_FMUModelBase2 = &__pyx_type_5pyfmi_3fmi_FMUModelBase2;
  __pyx_vtabptr_5pyfmi_3fmi_FMUModelCS2 = &__pyx_vtable_5pyfmi_3fmi_FMUModelCS2;
  __pyx_vtable_5pyfmi_3fmi_FMUModelCS2.__pyx_base = *__pyx_vtabptr_5pyfmi_3fmi_FMUModelBase2;
  __pyx_vtable_5pyfmi_3fmi_FMUModelCS2._get_time = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_11FMUModelCS2__get_time;
  __pyx_vtable_5pyfmi_3fmi_FMUModelCS2._set_time = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *, fmi2_real_t, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_11FMUModelCS2__set_time;
  __pyx_vtable_5pyfmi_3fmi_FMUModelCS2.do_step = (int (*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *, fmi2_real_t, fmi2_real_t, int __pyx_skip_dispatch, struct __pyx_opt_args_5pyfmi_3fmi_11FMUModelCS2_do_step *__pyx_optional_args))__pyx_f_5pyfmi_3fmi_11FMUModelCS2_do_step;
  __pyx_vtable_5pyfmi_3fmi_FMUModelCS2._set_input_derivatives = (int (*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *, PyArrayObject *, PyArrayObject *, PyArrayObject *))__pyx_f_5pyfmi_3fmi_11FMUModelCS2__set_input_derivatives;
  __pyx_vtable_5pyfmi_3fmi_FMUModelCS2._get_output_derivatives = (int (*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelCS2 *, PyArrayObject *, PyArrayObject *, PyArrayObject *))__pyx_f_5pyfmi_3fmi_11FMUModelCS2__get_output_derivatives;
  __pyx_type_5pyfmi_3fmi_FMUModelCS2.tp_base = __pyx_ptype_5pyfmi_3fmi_FMUModelBase2;
  if (PyType_Ready(&__pyx_type_5pyfmi_3fmi_FMUModelCS2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pyfmi_3fmi_FMUModelCS2, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_5pyfmi_3fmi_11FMUModelCS2___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_5pyfmi_3fmi_11FMUModelCS2___init__.doc = __pyx_doc_5pyfmi_3fmi_11FMUModelCS2___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pyfmi_3fmi_11FMUModelCS2___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_5pyfmi_3fmi_FMUModelCS2.tp_dict, __pyx_vtabptr_5pyfmi_3fmi_FMUModelCS2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "FMUModelCS2", (PyObject *)&__pyx_type_5pyfmi_3fmi_FMUModelCS2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pyfmi_3fmi_FMUModelCS2 = &__pyx_type_5pyfmi_3fmi_FMUModelCS2;
  __pyx_vtabptr_5pyfmi_3fmi_FMUModelME2 = &__pyx_vtable_5pyfmi_3fmi_FMUModelME2;
  __pyx_vtable_5pyfmi_3fmi_FMUModelME2.__pyx_base = *__pyx_vtabptr_5pyfmi_3fmi_FMUModelBase2;
  __pyx_vtable_5pyfmi_3fmi_FMUModelME2._get_time = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_11FMUModelME2__get_time;
  __pyx_vtable_5pyfmi_3fmi_FMUModelME2._set_time = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *, fmi2_real_t, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_11FMUModelME2__set_time;
  __pyx_vtable_5pyfmi_3fmi_FMUModelME2.get_derivatives = (PyObject *(*)(struct __pyx_obj_5pyfmi_3fmi_FMUModelME2 *, int __pyx_skip_dispatch))__pyx_f_5pyfmi_3fmi_11FMUModelME2_get_derivatives;
  __pyx_type_5pyfmi_3fmi_FMUModelME2.tp_base = __pyx_ptype_5pyfmi_3fmi_FMUModelBase2;
  if (PyType_Ready(&__pyx_type_5pyfmi_3fmi_FMUModelME2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pyfmi_3fmi_FMUModelME2, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_5pyfmi_3fmi_11FMUModelME2___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_5pyfmi_3fmi_11FMUModelME2___init__.doc = __pyx_doc_5pyfmi_3fmi_11FMUModelME2___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pyfmi_3fmi_11FMUModelME2___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_5pyfmi_3fmi_FMUModelME2.tp_dict, __pyx_vtabptr_5pyfmi_3fmi_FMUModelME2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "FMUModelME2", (PyObject *)&__pyx_type_5pyfmi_3fmi_FMUModelME2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pyfmi_3fmi_FMUModelME2 = &__pyx_type_5pyfmi_3fmi_FMUModelME2;
  __pyx_vtabptr_5pyfmi_3fmi_FMUModel = &__pyx_vtable_5pyfmi_3fmi_FMUModel;
  __pyx_vtable_5pyfmi_3fmi_FMUModel.__pyx_base = *__pyx_vtabptr_5pyfmi_3fmi_FMUModelME1;
  __pyx_type_5pyfmi_3fmi_FMUModel.tp_base = __pyx_ptype_5pyfmi_3fmi_FMUModelME1;
  if (PyType_Ready(&__pyx_type_5pyfmi_3fmi_FMUModel) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_5pyfmi_3fmi_FMUModel.tp_dict, __pyx_vtabptr_5pyfmi_3fmi_FMUModel) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "FMUModel", (PyObject *)&__pyx_type_5pyfmi_3fmi_FMUModel) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pyfmi_3fmi_FMUModel = &__pyx_type_5pyfmi_3fmi_FMUModel;
  if (PyType_Ready(&__pyx_type_5pyfmi_3fmi___pyx_scope_struct__get_number_of_lines_log) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pyfmi_3fmi___pyx_scope_struct__get_number_of_lines_log = &__pyx_type_5pyfmi_3fmi___pyx_scope_struct__get_number_of_lines_log;
  if (PyType_Ready(&__pyx_type_5pyfmi_3fmi___pyx_scope_struct_1_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pyfmi_3fmi___pyx_scope_struct_1_genexpr = &__pyx_type_5pyfmi_3fmi___pyx_scope_struct_1_genexpr;
  /*--- Type import code ---*/
  __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[3]; __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[2]; __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[2]; __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[2]; __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[2]; __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[2]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/

  /* "pyfmi\fmi.pyx":20
 * Module containing the FMI interface Python wrappers.
 * """
 * import os             # <<<<<<<<<<<<<<
 * import sys
 * import logging
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__os), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__os, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":21
 * """
 * import os
 * import sys             # <<<<<<<<<<<<<<
 * import logging
 * import fnmatch
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__sys), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":22
 * import os
 * import sys
 * import logging             # <<<<<<<<<<<<<<
 * import fnmatch
 * import re
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__logging), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__logging, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":23
 * import sys
 * import logging
 * import fnmatch             # <<<<<<<<<<<<<<
 * import re
 * from collections import OrderedDict
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__fnmatch), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__fnmatch, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":24
 * import logging
 * import fnmatch
 * import re             # <<<<<<<<<<<<<<
 * from collections import OrderedDict
 * 
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__re), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__re, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":25
 * import fnmatch
 * import re
 * from collections import OrderedDict             # <<<<<<<<<<<<<<
 * 
 * import scipy.sparse as sp
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__OrderedDict));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__OrderedDict));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__OrderedDict));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__collections), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __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__OrderedDict);
  if (__pyx_t_1 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__OrderedDict);
    if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__OrderedDict, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":27
 * from collections import OrderedDict
 * 
 * import scipy.sparse as sp             # <<<<<<<<<<<<<<
 * import numpy as N
 * cimport numpy as N
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s_429));
  PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s_429));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s_429));
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s_428), ((PyObject *)__pyx_t_2), -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__sp, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":28
 * 
 * import scipy.sparse as sp
 * import numpy as N             # <<<<<<<<<<<<<<
 * cimport numpy as N
 * 
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__N, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":31
 * cimport numpy as N
 * 
 * N.import_array()             # <<<<<<<<<<<<<<
 * 
 * cimport fmil_import as FMIL
 */
  import_array();

  /* "pyfmi\fmi.pyx":35
 * cimport fmil_import as FMIL
 * 
 * from pyfmi.common.core import create_temp_dir, delete_temp_dir             # <<<<<<<<<<<<<<
 * from pyfmi.common.core import create_temp_file, delete_temp_file
 * #from pyfmi.common.core cimport BaseModel
 */
  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__create_temp_dir));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__create_temp_dir));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__create_temp_dir));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__delete_temp_dir));
  PyList_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__delete_temp_dir));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__delete_temp_dir));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s_430), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __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__create_temp_dir);
  if (__pyx_t_1 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__create_temp_dir);
    if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__create_temp_dir, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__delete_temp_dir);
  if (__pyx_t_1 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__delete_temp_dir);
    if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__delete_temp_dir, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":36
 * 
 * from pyfmi.common.core import create_temp_dir, delete_temp_dir
 * from pyfmi.common.core import create_temp_file, delete_temp_file             # <<<<<<<<<<<<<<
 * #from pyfmi.common.core cimport BaseModel
 * 
 */
  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__create_temp_file));
  PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__create_temp_file));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__create_temp_file));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__delete_temp_file));
  PyList_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_n_s__delete_temp_file));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__delete_temp_file));
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s_430), ((PyObject *)__pyx_t_2), -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__create_temp_file);
  if (__pyx_t_2 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__create_temp_file);
    if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__create_temp_file, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__delete_temp_file);
  if (__pyx_t_2 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__delete_temp_file);
    if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__delete_temp_file, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":39
 * #from pyfmi.common.core cimport BaseModel
 * 
 * from pyfmi.common import python3_flag             # <<<<<<<<<<<<<<
 * from pyfmi.fmi_util import cpr_seed
 * 
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__python3_flag));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__python3_flag));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__python3_flag));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s_431), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __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__python3_flag);
  if (__pyx_t_1 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__python3_flag);
    if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__python3_flag, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":40
 * 
 * from pyfmi.common import python3_flag
 * from pyfmi.fmi_util import cpr_seed             # <<<<<<<<<<<<<<
 * 
 * if python3_flag:
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__cpr_seed));
  PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__cpr_seed));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cpr_seed));
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s_432), ((PyObject *)__pyx_t_2), -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__cpr_seed);
  if (__pyx_t_2 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__cpr_seed);
    if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__cpr_seed, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":42
 * from pyfmi.fmi_util import cpr_seed
 * 
 * if python3_flag:             # <<<<<<<<<<<<<<
 *     import codecs
 *     def encode(x):
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__python3_flag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "pyfmi\fmi.pyx":43
 * 
 * if python3_flag:
 *     import codecs             # <<<<<<<<<<<<<<
 *     def encode(x):
 *         return codecs.latin_1_encode(x)[0]
 */
    __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__codecs), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s__codecs, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyfmi\fmi.pyx":44
 * if python3_flag:
 *     import codecs
 *     def encode(x):             # <<<<<<<<<<<<<<
 *         return codecs.latin_1_encode(x)[0]
 *     def decode(x):
 */
    __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5pyfmi_3fmi_1encode, NULL, __pyx_n_s_436); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s__encode, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyfmi\fmi.pyx":46
 *     def encode(x):
 *         return codecs.latin_1_encode(x)[0]
 *     def decode(x):             # <<<<<<<<<<<<<<
 *         return x.decode()
 * else:
 */
    __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5pyfmi_3fmi_3decode, NULL, __pyx_n_s_436); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s__decode, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L2;
  }
  /*else*/ {

    /* "pyfmi\fmi.pyx":49
 *         return x.decode()
 * else:
 *     def encode(x):             # <<<<<<<<<<<<<<
 *         return x
 *     def decode(x):
 */
    __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5pyfmi_3fmi_5encode, NULL, __pyx_n_s_436); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s__encode, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyfmi\fmi.pyx":51
 *     def encode(x):
 *         return x
 *     def decode(x):             # <<<<<<<<<<<<<<
 *         return x
 * 
 */
    __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5pyfmi_3fmi_7decode, NULL, __pyx_n_s_436); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s__decode, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L2:;

  /* "pyfmi\fmi.pyx":54
 *         return x
 * 
 * int   = N.int32             # <<<<<<<<<<<<<<
 * N.int = N.int32
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__int32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__int, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":55
 * 
 * int   = N.int32
 * N.int = N.int32             # <<<<<<<<<<<<<<
 * 
 * """Basic flags related to FMI"""
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__int32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s__int, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":59
 * """Basic flags related to FMI"""
 * 
 * FMI_TRUE  = '\x01'             # <<<<<<<<<<<<<<
 * FMI_FALSE = '\x00'
 * 
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_TRUE, ((PyObject *)__pyx_kp_s_443)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":60
 * 
 * FMI_TRUE  = '\x01'
 * FMI_FALSE = '\x00'             # <<<<<<<<<<<<<<
 * 
 * FMI2_TRUE = FMIL.fmi2_true
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_FALSE, ((PyObject *)__pyx_kp_s_444)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":62
 * FMI_FALSE = '\x00'
 * 
 * FMI2_TRUE = FMIL.fmi2_true             # <<<<<<<<<<<<<<
 * FMI2_FALSE = FMIL.fmi2_false
 * 
 */
  __pyx_t_2 = PyInt_FromLong(fmi2_true); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI2_TRUE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":63
 * 
 * FMI2_TRUE = FMIL.fmi2_true
 * FMI2_FALSE = FMIL.fmi2_false             # <<<<<<<<<<<<<<
 * 
 * # Status
 */
  __pyx_t_2 = PyInt_FromLong(fmi2_false); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI2_FALSE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":66
 * 
 * # Status
 * FMI_OK      = FMIL.fmi1_status_ok             # <<<<<<<<<<<<<<
 * FMI_WARNING = FMIL.fmi1_status_warning
 * FMI_DISCARD = FMIL.fmi1_status_discard
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_status_ok); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_OK, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":67
 * # Status
 * FMI_OK      = FMIL.fmi1_status_ok
 * FMI_WARNING = FMIL.fmi1_status_warning             # <<<<<<<<<<<<<<
 * FMI_DISCARD = FMIL.fmi1_status_discard
 * FMI_ERROR   = FMIL.fmi1_status_error
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_status_warning); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_WARNING, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":68
 * FMI_OK      = FMIL.fmi1_status_ok
 * FMI_WARNING = FMIL.fmi1_status_warning
 * FMI_DISCARD = FMIL.fmi1_status_discard             # <<<<<<<<<<<<<<
 * FMI_ERROR   = FMIL.fmi1_status_error
 * FMI_FATAL   = FMIL.fmi1_status_fatal
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_status_discard); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_DISCARD, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":69
 * FMI_WARNING = FMIL.fmi1_status_warning
 * FMI_DISCARD = FMIL.fmi1_status_discard
 * FMI_ERROR   = FMIL.fmi1_status_error             # <<<<<<<<<<<<<<
 * FMI_FATAL   = FMIL.fmi1_status_fatal
 * FMI_PENDING = FMIL.fmi1_status_pending
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_status_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_ERROR, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":70
 * FMI_DISCARD = FMIL.fmi1_status_discard
 * FMI_ERROR   = FMIL.fmi1_status_error
 * FMI_FATAL   = FMIL.fmi1_status_fatal             # <<<<<<<<<<<<<<
 * FMI_PENDING = FMIL.fmi1_status_pending
 * 
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_status_fatal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_FATAL, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":71
 * FMI_ERROR   = FMIL.fmi1_status_error
 * FMI_FATAL   = FMIL.fmi1_status_fatal
 * FMI_PENDING = FMIL.fmi1_status_pending             # <<<<<<<<<<<<<<
 * 
 * FMI1_DO_STEP_STATUS       = FMIL.fmi1_do_step_status
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_status_pending); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_PENDING, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":73
 * FMI_PENDING = FMIL.fmi1_status_pending
 * 
 * FMI1_DO_STEP_STATUS       = FMIL.fmi1_do_step_status             # <<<<<<<<<<<<<<
 * FMI1_PENDING_STATUS       = FMIL.fmi1_pending_status
 * FMI1_LAST_SUCCESSFUL_TIME = FMIL.fmi1_last_successful_time
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_do_step_status); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI1_DO_STEP_STATUS, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":74
 * 
 * FMI1_DO_STEP_STATUS       = FMIL.fmi1_do_step_status
 * FMI1_PENDING_STATUS       = FMIL.fmi1_pending_status             # <<<<<<<<<<<<<<
 * FMI1_LAST_SUCCESSFUL_TIME = FMIL.fmi1_last_successful_time
 * 
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_pending_status); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI1_PENDING_STATUS, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":75
 * FMI1_DO_STEP_STATUS       = FMIL.fmi1_do_step_status
 * FMI1_PENDING_STATUS       = FMIL.fmi1_pending_status
 * FMI1_LAST_SUCCESSFUL_TIME = FMIL.fmi1_last_successful_time             # <<<<<<<<<<<<<<
 * 
 * # Types
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_last_successful_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_445, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":78
 * 
 * # Types
 * FMI_REAL        = FMIL.fmi1_base_type_real             # <<<<<<<<<<<<<<
 * FMI_INTEGER     = FMIL.fmi1_base_type_int
 * FMI_BOOLEAN     = FMIL.fmi1_base_type_bool
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_base_type_real); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_REAL, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":79
 * # Types
 * FMI_REAL        = FMIL.fmi1_base_type_real
 * FMI_INTEGER     = FMIL.fmi1_base_type_int             # <<<<<<<<<<<<<<
 * FMI_BOOLEAN     = FMIL.fmi1_base_type_bool
 * FMI_STRING      = FMIL.fmi1_base_type_str
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_base_type_int); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_INTEGER, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":80
 * FMI_REAL        = FMIL.fmi1_base_type_real
 * FMI_INTEGER     = FMIL.fmi1_base_type_int
 * FMI_BOOLEAN     = FMIL.fmi1_base_type_bool             # <<<<<<<<<<<<<<
 * FMI_STRING      = FMIL.fmi1_base_type_str
 * FMI_ENUMERATION = FMIL.fmi1_base_type_enum
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_base_type_bool); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_BOOLEAN, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":81
 * FMI_INTEGER     = FMIL.fmi1_base_type_int
 * FMI_BOOLEAN     = FMIL.fmi1_base_type_bool
 * FMI_STRING      = FMIL.fmi1_base_type_str             # <<<<<<<<<<<<<<
 * FMI_ENUMERATION = FMIL.fmi1_base_type_enum
 * 
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_base_type_str); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_STRING, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":82
 * FMI_BOOLEAN     = FMIL.fmi1_base_type_bool
 * FMI_STRING      = FMIL.fmi1_base_type_str
 * FMI_ENUMERATION = FMIL.fmi1_base_type_enum             # <<<<<<<<<<<<<<
 * 
 * FMI2_REAL        = FMIL.fmi2_base_type_real
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_base_type_enum); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_ENUMERATION, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":84
 * FMI_ENUMERATION = FMIL.fmi1_base_type_enum
 * 
 * FMI2_REAL        = FMIL.fmi2_base_type_real             # <<<<<<<<<<<<<<
 * FMI2_INTEGER     = FMIL.fmi2_base_type_int
 * FMI2_BOOLEAN     = FMIL.fmi2_base_type_bool
 */
  __pyx_t_2 = PyInt_FromLong(fmi2_base_type_real); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI2_REAL, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":85
 * 
 * FMI2_REAL        = FMIL.fmi2_base_type_real
 * FMI2_INTEGER     = FMIL.fmi2_base_type_int             # <<<<<<<<<<<<<<
 * FMI2_BOOLEAN     = FMIL.fmi2_base_type_bool
 * FMI2_STRING      = FMIL.fmi2_base_type_str
 */
  __pyx_t_2 = PyInt_FromLong(fmi2_base_type_int); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI2_INTEGER, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":86
 * FMI2_REAL        = FMIL.fmi2_base_type_real
 * FMI2_INTEGER     = FMIL.fmi2_base_type_int
 * FMI2_BOOLEAN     = FMIL.fmi2_base_type_bool             # <<<<<<<<<<<<<<
 * FMI2_STRING      = FMIL.fmi2_base_type_str
 * FMI2_ENUMERATION = FMIL.fmi2_base_type_enum
 */
  __pyx_t_2 = PyInt_FromLong(fmi2_base_type_bool); 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);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI2_BOOLEAN, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":87
 * FMI2_INTEGER     = FMIL.fmi2_base_type_int
 * FMI2_BOOLEAN     = FMIL.fmi2_base_type_bool
 * FMI2_STRING      = FMIL.fmi2_base_type_str             # <<<<<<<<<<<<<<
 * FMI2_ENUMERATION = FMIL.fmi2_base_type_enum
 * 
 */
  __pyx_t_2 = PyInt_FromLong(fmi2_base_type_str); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI2_STRING, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":88
 * FMI2_BOOLEAN     = FMIL.fmi2_base_type_bool
 * FMI2_STRING      = FMIL.fmi2_base_type_str
 * FMI2_ENUMERATION = FMIL.fmi2_base_type_enum             # <<<<<<<<<<<<<<
 * 
 * # Alias data
 */
  __pyx_t_2 = PyInt_FromLong(fmi2_base_type_enum); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI2_ENUMERATION, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":91
 * 
 * # Alias data
 * FMI_NO_ALIAS      = FMIL.fmi1_variable_is_not_alias             # <<<<<<<<<<<<<<
 * FMI_ALIAS         = FMIL.fmi1_variable_is_alias
 * FMI_NEGATED_ALIAS = FMIL.fmi1_variable_is_negated_alias
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_variable_is_not_alias); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_NO_ALIAS, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":92
 * # Alias data
 * FMI_NO_ALIAS      = FMIL.fmi1_variable_is_not_alias
 * FMI_ALIAS         = FMIL.fmi1_variable_is_alias             # <<<<<<<<<<<<<<
 * FMI_NEGATED_ALIAS = FMIL.fmi1_variable_is_negated_alias
 * 
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_variable_is_alias); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_ALIAS, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":93
 * FMI_NO_ALIAS      = FMIL.fmi1_variable_is_not_alias
 * FMI_ALIAS         = FMIL.fmi1_variable_is_alias
 * FMI_NEGATED_ALIAS = FMIL.fmi1_variable_is_negated_alias             # <<<<<<<<<<<<<<
 * 
 * # Variability
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_variable_is_negated_alias); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_NEGATED_ALIAS, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":96
 * 
 * # Variability
 * FMI_CONTINUOUS = FMIL.fmi1_variability_enu_continuous             # <<<<<<<<<<<<<<
 * FMI_CONSTANT   = FMIL.fmi1_variability_enu_constant
 * FMI_PARAMETER  = FMIL.fmi1_variability_enu_parameter
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_variability_enu_continuous); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_CONTINUOUS, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":97
 * # Variability
 * FMI_CONTINUOUS = FMIL.fmi1_variability_enu_continuous
 * FMI_CONSTANT   = FMIL.fmi1_variability_enu_constant             # <<<<<<<<<<<<<<
 * FMI_PARAMETER  = FMIL.fmi1_variability_enu_parameter
 * FMI_DISCRETE   = FMIL.fmi1_variability_enu_discrete
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_variability_enu_constant); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_CONSTANT, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":98
 * FMI_CONTINUOUS = FMIL.fmi1_variability_enu_continuous
 * FMI_CONSTANT   = FMIL.fmi1_variability_enu_constant
 * FMI_PARAMETER  = FMIL.fmi1_variability_enu_parameter             # <<<<<<<<<<<<<<
 * FMI_DISCRETE   = FMIL.fmi1_variability_enu_discrete
 * 
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_variability_enu_parameter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_PARAMETER, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":99
 * FMI_CONSTANT   = FMIL.fmi1_variability_enu_constant
 * FMI_PARAMETER  = FMIL.fmi1_variability_enu_parameter
 * FMI_DISCRETE   = FMIL.fmi1_variability_enu_discrete             # <<<<<<<<<<<<<<
 * 
 * FMI2_CONSTANT   = FMIL.fmi2_variability_enu_constant
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_variability_enu_discrete); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_DISCRETE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":101
 * FMI_DISCRETE   = FMIL.fmi1_variability_enu_discrete
 * 
 * FMI2_CONSTANT   = FMIL.fmi2_variability_enu_constant             # <<<<<<<<<<<<<<
 * FMI2_FIXED      = FMIL.fmi2_variability_enu_fixed
 * FMI2_TUNABLE    = FMIL.fmi2_variability_enu_tunable
 */
  __pyx_t_2 = PyInt_FromLong(fmi2_variability_enu_constant); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI2_CONSTANT, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":102
 * 
 * FMI2_CONSTANT   = FMIL.fmi2_variability_enu_constant
 * FMI2_FIXED      = FMIL.fmi2_variability_enu_fixed             # <<<<<<<<<<<<<<
 * FMI2_TUNABLE    = FMIL.fmi2_variability_enu_tunable
 * FMI2_DISCRETE   = FMIL.fmi2_variability_enu_discrete
 */
  __pyx_t_2 = PyInt_FromLong(fmi2_variability_enu_fixed); 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);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI2_FIXED, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":103
 * FMI2_CONSTANT   = FMIL.fmi2_variability_enu_constant
 * FMI2_FIXED      = FMIL.fmi2_variability_enu_fixed
 * FMI2_TUNABLE    = FMIL.fmi2_variability_enu_tunable             # <<<<<<<<<<<<<<
 * FMI2_DISCRETE   = FMIL.fmi2_variability_enu_discrete
 * FMI2_CONTINUOUS = FMIL.fmi2_variability_enu_continuous
 */
  __pyx_t_2 = PyInt_FromLong(fmi2_variability_enu_tunable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI2_TUNABLE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":104
 * FMI2_FIXED      = FMIL.fmi2_variability_enu_fixed
 * FMI2_TUNABLE    = FMIL.fmi2_variability_enu_tunable
 * FMI2_DISCRETE   = FMIL.fmi2_variability_enu_discrete             # <<<<<<<<<<<<<<
 * FMI2_CONTINUOUS = FMIL.fmi2_variability_enu_continuous
 * FMI2_UNKNOWN    = FMIL.fmi2_variability_enu_unknown
 */
  __pyx_t_2 = PyInt_FromLong(fmi2_variability_enu_discrete); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI2_DISCRETE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":105
 * FMI2_TUNABLE    = FMIL.fmi2_variability_enu_tunable
 * FMI2_DISCRETE   = FMIL.fmi2_variability_enu_discrete
 * FMI2_CONTINUOUS = FMIL.fmi2_variability_enu_continuous             # <<<<<<<<<<<<<<
 * FMI2_UNKNOWN    = FMIL.fmi2_variability_enu_unknown
 * 
 */
  __pyx_t_2 = PyInt_FromLong(fmi2_variability_enu_continuous); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI2_CONTINUOUS, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":106
 * FMI2_DISCRETE   = FMIL.fmi2_variability_enu_discrete
 * FMI2_CONTINUOUS = FMIL.fmi2_variability_enu_continuous
 * FMI2_UNKNOWN    = FMIL.fmi2_variability_enu_unknown             # <<<<<<<<<<<<<<
 * 
 * # Causality
 */
  __pyx_t_2 = PyInt_FromLong(fmi2_variability_enu_unknown); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI2_UNKNOWN, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":109
 * 
 * # Causality
 * FMI_INPUT    = FMIL.fmi1_causality_enu_input             # <<<<<<<<<<<<<<
 * FMI_OUTPUT   = FMIL.fmi1_causality_enu_output
 * FMI_INTERNAL = FMIL.fmi1_causality_enu_internal
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_causality_enu_input); 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);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_INPUT, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":110
 * # Causality
 * FMI_INPUT    = FMIL.fmi1_causality_enu_input
 * FMI_OUTPUT   = FMIL.fmi1_causality_enu_output             # <<<<<<<<<<<<<<
 * FMI_INTERNAL = FMIL.fmi1_causality_enu_internal
 * FMI_NONE     = FMIL.fmi1_causality_enu_none
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_causality_enu_output); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_OUTPUT, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":111
 * FMI_INPUT    = FMIL.fmi1_causality_enu_input
 * FMI_OUTPUT   = FMIL.fmi1_causality_enu_output
 * FMI_INTERNAL = FMIL.fmi1_causality_enu_internal             # <<<<<<<<<<<<<<
 * FMI_NONE     = FMIL.fmi1_causality_enu_none
 * 
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_causality_enu_internal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_INTERNAL, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":112
 * FMI_OUTPUT   = FMIL.fmi1_causality_enu_output
 * FMI_INTERNAL = FMIL.fmi1_causality_enu_internal
 * FMI_NONE     = FMIL.fmi1_causality_enu_none             # <<<<<<<<<<<<<<
 * 
 * FMI2_INPUT   = FMIL.fmi2_causality_enu_input
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_causality_enu_none); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_NONE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":114
 * FMI_NONE     = FMIL.fmi1_causality_enu_none
 * 
 * FMI2_INPUT   = FMIL.fmi2_causality_enu_input             # <<<<<<<<<<<<<<
 * FMI2_OUTPUT   = FMIL.fmi2_causality_enu_output
 * 
 */
  __pyx_t_2 = PyInt_FromLong(fmi2_causality_enu_input); 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);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI2_INPUT, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":115
 * 
 * FMI2_INPUT   = FMIL.fmi2_causality_enu_input
 * FMI2_OUTPUT   = FMIL.fmi2_causality_enu_output             # <<<<<<<<<<<<<<
 * 
 * # FMI types
 */
  __pyx_t_2 = PyInt_FromLong(fmi2_causality_enu_output); 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);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI2_OUTPUT, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":118
 * 
 * # FMI types
 * FMI_ME                 = FMIL.fmi1_fmu_kind_enu_me             # <<<<<<<<<<<<<<
 * FMI_CS_STANDALONE      = FMIL.fmi1_fmu_kind_enu_cs_standalone
 * FMI_MIME_CS_STANDALONE = encode("application/x-fmu-sharedlibrary")
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_fmu_kind_enu_me); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_ME, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":119
 * # FMI types
 * FMI_ME                 = FMIL.fmi1_fmu_kind_enu_me
 * FMI_CS_STANDALONE      = FMIL.fmi1_fmu_kind_enu_cs_standalone             # <<<<<<<<<<<<<<
 * FMI_MIME_CS_STANDALONE = encode("application/x-fmu-sharedlibrary")
 * 
 */
  __pyx_t_2 = PyInt_FromLong(fmi1_fmu_kind_enu_cs_standalone); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_CS_STANDALONE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":120
 * FMI_ME                 = FMIL.fmi1_fmu_kind_enu_me
 * FMI_CS_STANDALONE      = FMIL.fmi1_fmu_kind_enu_cs_standalone
 * FMI_MIME_CS_STANDALONE = encode("application/x-fmu-sharedlibrary")             # <<<<<<<<<<<<<<
 * 
 * FMI_REGISTER_GLOBALLY = 1
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_447), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_140, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":122
 * FMI_MIME_CS_STANDALONE = encode("application/x-fmu-sharedlibrary")
 * 
 * FMI_REGISTER_GLOBALLY = 1             # <<<<<<<<<<<<<<
 * FMI_DEFAULT_LOG_LEVEL = FMIL.jm_log_level_error
 * 
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_48, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":123
 * 
 * FMI_REGISTER_GLOBALLY = 1
 * FMI_DEFAULT_LOG_LEVEL = FMIL.jm_log_level_error             # <<<<<<<<<<<<<<
 * 
 * # INITIAL
 */
  __pyx_t_1 = PyInt_FromLong(jm_log_level_error); 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);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_448, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":126
 * 
 * # INITIAL
 * FMI2_INITIAL_EXACT      = 0             # <<<<<<<<<<<<<<
 * FMI2_INITIAL_APPROX     = 1
 * FMI2_INITIAL_CALCULATED = 2
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI2_INITIAL_EXACT, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":127
 * # INITIAL
 * FMI2_INITIAL_EXACT      = 0
 * FMI2_INITIAL_APPROX     = 1             # <<<<<<<<<<<<<<
 * FMI2_INITIAL_CALCULATED = 2
 * FMI2_INITIAL_UNKNOWN    = 3
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI2_INITIAL_APPROX, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":128
 * FMI2_INITIAL_EXACT      = 0
 * FMI2_INITIAL_APPROX     = 1
 * FMI2_INITIAL_CALCULATED = 2             # <<<<<<<<<<<<<<
 * FMI2_INITIAL_UNKNOWN    = 3
 * 
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_449, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":129
 * FMI2_INITIAL_APPROX     = 1
 * FMI2_INITIAL_CALCULATED = 2
 * FMI2_INITIAL_UNKNOWN    = 3             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_450, __pyx_int_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":134
 * """Flags for evaluation of FMI Jacobians"""
 * """Evaluate Jacobian w.r.t. states."""
 * FMI_STATES = 1             # <<<<<<<<<<<<<<
 * """Evaluate Jacobian w.r.t. inputs."""
 * FMI_INPUTS = 2
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_STATES, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":136
 * FMI_STATES = 1
 * """Evaluate Jacobian w.r.t. inputs."""
 * FMI_INPUTS = 2             # <<<<<<<<<<<<<<
 * """Evaluate Jacobian of derivatives."""
 * FMI_DERIVATIVES = 1
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_INPUTS, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":138
 * FMI_INPUTS = 2
 * """Evaluate Jacobian of derivatives."""
 * FMI_DERIVATIVES = 1             # <<<<<<<<<<<<<<
 * """Evaluate Jacobian of outputs."""
 * FMI_OUTPUTS = 2
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_DERIVATIVES, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":140
 * FMI_DERIVATIVES = 1
 * """Evaluate Jacobian of outputs."""
 * FMI_OUTPUTS = 2             # <<<<<<<<<<<<<<
 * 
 * #CALLBACKS
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMI_OUTPUTS, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyfmi\fmi.pyx":348
 *                  input=(),
 *                  algorithm='SciEstAlg',
 *                  options={}):             # <<<<<<<<<<<<<<
 *         """
 *         Compact function for model estimation.
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_k_7 = ((PyObject *)__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":558
 * 
 * 
 * class FMUException(Exception):             # <<<<<<<<<<<<<<
 *     """
 *     An FMU exception.
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_builtin_Exception);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_Exception);
  __Pyx_GIVEREF(__pyx_builtin_Exception);
  if (PyDict_SetItemString(((PyObject *)__pyx_t_1), "__doc__", ((PyObject *)__pyx_kp_s_451)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __Pyx_CreateClass(((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_1), __pyx_n_s__FMUException, __pyx_n_s__FMUException, __pyx_n_s_436); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FMUException, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":564
 *     pass
 * 
 * class PyEventInfo():             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_4 = __Pyx_CreateClass(((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1), __pyx_n_s__PyEventInfo, __pyx_n_s__PyEventInfo, __pyx_n_s_436); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__PyEventInfo, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":573
 *     """
 *     def __init__(self, name, value_reference, type, description="",
 *                        variability=FMIL.fmi1_variability_enu_continuous,             # <<<<<<<<<<<<<<
 *                        causality=FMIL.fmi1_causality_enu_internal,
 *                        alias=FMIL.fmi1_variable_is_not_alias):
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_variability_enu_continuous); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_23 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":574
 *     def __init__(self, name, value_reference, type, description="",
 *                        variability=FMIL.fmi1_variability_enu_continuous,
 *                        causality=FMIL.fmi1_causality_enu_internal,             # <<<<<<<<<<<<<<
 *                        alias=FMIL.fmi1_variable_is_not_alias):
 * 
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_causality_enu_internal); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_24 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":575
 *                        variability=FMIL.fmi1_variability_enu_continuous,
 *                        causality=FMIL.fmi1_causality_enu_internal,
 *                        alias=FMIL.fmi1_variable_is_not_alias):             # <<<<<<<<<<<<<<
 * 
 *         self._name            = name
 */
  __pyx_t_1 = PyInt_FromLong(fmi1_variable_is_not_alias); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_25 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":594
 *         """
 *         return self._name
 *     name = property(_get_name)             # <<<<<<<<<<<<<<
 * 
 *     def _get_value_reference(self):
 */
  __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable, __pyx_n_s___get_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable->tp_dict, __pyx_n_s__name, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_ScalarVariable);

  /* "pyfmi\fmi.pyx":605
 *         """
 *         return self._value_reference
 *     value_reference = property(_get_value_reference)             # <<<<<<<<<<<<<<
 * 
 *     def _get_type(self):
 */
  __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable, __pyx_n_s_452); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable->tp_dict, __pyx_n_s__value_reference, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_ScalarVariable);

  /* "pyfmi\fmi.pyx":617
 *         """
 *         return self._type
 *     type = property(_get_type)             # <<<<<<<<<<<<<<
 * 
 *     def _get_description(self):
 */
  __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable, __pyx_n_s___get_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable->tp_dict, __pyx_n_s__type, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_ScalarVariable);

  /* "pyfmi\fmi.pyx":629
 *         """
 *         return self._description
 *     description = property(_get_description)             # <<<<<<<<<<<<<<
 * 
 *     def _get_variability(self):
 */
  __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable, __pyx_n_s___get_description); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable->tp_dict, __pyx_n_s__description, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_ScalarVariable);

  /* "pyfmi\fmi.pyx":641
 *         """
 *         return self._variability
 *     variability = property(_get_variability)             # <<<<<<<<<<<<<<
 * 
 *     def _get_causality(self):
 */
  __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable, __pyx_n_s___get_variability); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable->tp_dict, __pyx_n_s__variability, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_ScalarVariable);

  /* "pyfmi\fmi.pyx":653
 *         """
 *         return self._causality
 *     causality = property(_get_causality)             # <<<<<<<<<<<<<<
 * 
 *     def _get_alias(self):
 */
  __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable, __pyx_n_s___get_causality); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable->tp_dict, __pyx_n_s__causality, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_ScalarVariable);

  /* "pyfmi\fmi.pyx":665
 *         """
 *         return self._alias
 *     alias = property(_get_alias)             # <<<<<<<<<<<<<<
 * 
 * cdef class ScalarVariable2:
 */
  __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable, __pyx_n_s___get_alias); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable->tp_dict, __pyx_n_s__alias, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_ScalarVariable);

  /* "pyfmi\fmi.pyx":672
 *     """
 *     def __init__(self, name, value_reference, type, description = "",
 *                        variability = FMIL.fmi2_variability_enu_unknown,             # <<<<<<<<<<<<<<
 *                        causality   = FMIL.fmi2_causality_enu_unknown,
 *                        alias       = FMIL.fmi2_variable_is_not_alias,
 */
  __pyx_t_1 = PyInt_FromLong(fmi2_variability_enu_unknown); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_26 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":673
 *     def __init__(self, name, value_reference, type, description = "",
 *                        variability = FMIL.fmi2_variability_enu_unknown,
 *                        causality   = FMIL.fmi2_causality_enu_unknown,             # <<<<<<<<<<<<<<
 *                        alias       = FMIL.fmi2_variable_is_not_alias,
 *                        initial     = FMIL.fmi2_initial_enu_unknown):
 */
  __pyx_t_1 = PyInt_FromLong(fmi2_causality_enu_unknown); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_27 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":674
 *                        variability = FMIL.fmi2_variability_enu_unknown,
 *                        causality   = FMIL.fmi2_causality_enu_unknown,
 *                        alias       = FMIL.fmi2_variable_is_not_alias,             # <<<<<<<<<<<<<<
 *                        initial     = FMIL.fmi2_initial_enu_unknown):
 * 
 */
  __pyx_t_1 = PyInt_FromLong(fmi2_variable_is_not_alias); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_28 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":675
 *                        causality   = FMIL.fmi2_causality_enu_unknown,
 *                        alias       = FMIL.fmi2_variable_is_not_alias,
 *                        initial     = FMIL.fmi2_initial_enu_unknown):             # <<<<<<<<<<<<<<
 * 
 *         self._name            = name
 */
  __pyx_t_1 = PyInt_FromLong(fmi2_initial_enu_unknown); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_29 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":695
 *         """
 *         return self._name
 *     name = property(_get_name)             # <<<<<<<<<<<<<<
 * 
 *     def _get_value_reference(self):
 */
  __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable2, __pyx_n_s___get_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable2->tp_dict, __pyx_n_s__name, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_ScalarVariable2);

  /* "pyfmi\fmi.pyx":706
 *         """
 *         return self._value_reference
 *     value_reference = property(_get_value_reference)             # <<<<<<<<<<<<<<
 * 
 *     def _get_type(self):
 */
  __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable2, __pyx_n_s_452); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable2->tp_dict, __pyx_n_s__value_reference, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_ScalarVariable2);

  /* "pyfmi\fmi.pyx":718
 *         """
 *         return self._type
 *     type = property(_get_type)             # <<<<<<<<<<<<<<
 * 
 *     def _get_description(self):
 */
  __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable2, __pyx_n_s___get_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable2->tp_dict, __pyx_n_s__type, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_ScalarVariable2);

  /* "pyfmi\fmi.pyx":730
 *         """
 *         return self._description
 *     description = property(_get_description)             # <<<<<<<<<<<<<<
 * 
 *     def _get_variability(self):
 */
  __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable2, __pyx_n_s___get_description); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable2->tp_dict, __pyx_n_s__description, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_ScalarVariable2);

  /* "pyfmi\fmi.pyx":742
 *         """
 *         return self._variability
 *     variability = property(_get_variability)             # <<<<<<<<<<<<<<
 * 
 *     def _get_causality(self):
 */
  __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable2, __pyx_n_s___get_variability); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable2->tp_dict, __pyx_n_s__variability, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_ScalarVariable2);

  /* "pyfmi\fmi.pyx":754
 *         """
 *         return self._causality
 *     causality = property(_get_causality)             # <<<<<<<<<<<<<<
 * 
 *     def _get_alias(self):
 */
  __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable2, __pyx_n_s___get_causality); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable2->tp_dict, __pyx_n_s__causality, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_ScalarVariable2);

  /* "pyfmi\fmi.pyx":766
 *         """
 *         return self._alias
 *     alias = property(_get_alias)             # <<<<<<<<<<<<<<
 * 
 *     def _get_initial(self):
 */
  __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable2, __pyx_n_s___get_alias); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable2->tp_dict, __pyx_n_s__alias, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_ScalarVariable2);

  /* "pyfmi\fmi.pyx":779
 *         """
 *         return self._initial
 *     initial = property(_get_initial)             # <<<<<<<<<<<<<<
 * 
 * cdef class FMUState2:
 */
  __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable2, __pyx_n_s___get_initial); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_ScalarVariable2->tp_dict, __pyx_n_s__initial, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_ScalarVariable2);

  /* "pyfmi\fmi.pyx":794
 *     An FMI Model loaded from a DLL.
 *     """
 *     def __init__(self, fmu, path='.', enable_logging=None, log_file_name="", log_level=FMI_DEFAULT_LOG_LEVEL):             # <<<<<<<<<<<<<<
 *         """
 *         Constructor.
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_448); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_31 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":942
 *         return version
 * 
 *     version = property(fget=_get_version)             # <<<<<<<<<<<<<<
 * 
 *     def get_ode_sizes(self):
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_4 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelBase, __pyx_n_s___get_version); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__fget), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelBase->tp_dict, __pyx_n_s__version, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_FMUModelBase);

  /* "pyfmi\fmi.pyx":1680
 * 
 * 
 *     def get_model_variables(self,type=None, include_alias=True,             # <<<<<<<<<<<<<<
 *                             causality=None,   variability=None,
 *                             only_start=False,  only_fixed=False,
 */
  __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_k_100 = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":1682
 *     def get_model_variables(self,type=None, include_alias=True,
 *                             causality=None,   variability=None,
 *                             only_start=False,  only_fixed=False,             # <<<<<<<<<<<<<<
 *                             filter=None):
 *         """
 */
  __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_k_101 = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_k_102 = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":2114
 *     #stepFinished not supported
 * 
 *     def __init__(self, fmu, path='.', enable_logging=None, log_file_name="", log_level=FMI_DEFAULT_LOG_LEVEL):             # <<<<<<<<<<<<<<
 *         #Call super
 *         FMUModelBase.__init__(self,fmu,path,enable_logging,log_file_name, log_level)
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s_448); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_k_106 = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":2129
 *         self.__t = t
 * 
 *     time = property(_get_time,_set_time, doc =             # <<<<<<<<<<<<<<
 *     """
 *     Property for accessing the current time of the simulation. Calls the
 */
  __pyx_t_4 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelCS1, __pyx_n_s___get_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelCS1, __pyx_n_s___set_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; __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 = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_4 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__doc), ((PyObject *)__pyx_kp_s_453)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelCS1->tp_dict, __pyx_n_s__time, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_FMUModelCS1);

  /* "pyfmi\fmi.pyx":2163
 *             self._fmu_log_name = NULL
 * 
 *     def do_step(self, FMIL.fmi1_real_t current_t, FMIL.fmi1_real_t step_size, new_step=True):             # <<<<<<<<<<<<<<
 *         """
 *         Performs an integrator step.
 */
  __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_k_109 = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyfmi\fmi.pyx":2276
 *         return FMIL.fmi1_import_get_types_platform(self._fmu)
 * 
 *     types_platform = property(fget=_get_types_platform)             # <<<<<<<<<<<<<<
 * 
 *     def get_real_status(self, status_kind):
 */
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelCS1, __pyx_n_s___get_types_platform); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__fget), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelCS1->tp_dict, __pyx_n_s__types_platform, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_FMUModelCS1);

  /* "pyfmi\fmi.pyx":2353
 *                  input=(),
 *                  algorithm='FMICSAlg',
 *                  options={}):             # <<<<<<<<<<<<<<
 *         """
 *         Compact function for model simulation.
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_k_128 = ((PyObject *)__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2442
 *         return self._default_options('pyfmi.fmi_algorithm_drivers', algorithm)
 * 
 *     def initialize(self, tStart=0.0, tStop=1.0, StopTimeDefined=False):             # <<<<<<<<<<<<<<
 *         """
 *         Initializes the slave.
 */
  __pyx_t_1 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_132 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_133 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_134 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2488
 * 
 * 
 *     def instantiate_slave(self, name='Slave', logging=False):             # <<<<<<<<<<<<<<
 *         """
 *         Instantiate the slave.
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_139 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2585
 *     """
 * 
 *     def __init__(self, fmu, path='.', enable_logging=None, log_file_name="", log_level=FMI_DEFAULT_LOG_LEVEL):             # <<<<<<<<<<<<<<
 *         #Call super
 *         FMUModelBase.__init__(self,fmu,path,enable_logging,log_file_name, log_level)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_448); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_151 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":2610
 *         return FMIL.fmi1_import_get_model_types_platform(self._fmu)
 * 
 *     model_types_platform = property(fget=_get_model_types_platform)             # <<<<<<<<<<<<<<
 * 
 *     def reset(self):
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_4 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME1, __pyx_n_s_454); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__fget), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME1->tp_dict, __pyx_n_s_455, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_FMUModelME1);

  /* "pyfmi\fmi.pyx":2687
 *             raise FMUException('Failed to set the time.')
 * 
 *     time = property(_get_time,_set_time, doc =             # <<<<<<<<<<<<<<
 *     """
 *     Property for accessing the current time of the simulation. Calls the
 */
  __pyx_t_4 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME1, __pyx_n_s___get_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME1, __pyx_n_s___set_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2687; __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 = 2687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_4 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__doc), ((PyObject *)__pyx_kp_s_453)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME1->tp_dict, __pyx_n_s__time, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_FMUModelME1);

  /* "pyfmi\fmi.pyx":2718
 *             raise FMUException('Failed to set the new continuous states.')
 * 
 *     continuous_states = property(_get_continuous_states, _set_continuous_states,             # <<<<<<<<<<<<<<
 *         doc=
 *     """
 */
  __pyx_t_4 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME1, __pyx_n_s_456); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME1, __pyx_n_s_457); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2718; __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 = 2718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_4 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__doc), ((PyObject *)__pyx_kp_s_458)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME1->tp_dict, __pyx_n_s__continuous_states, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_FMUModelME1);

  /* "pyfmi\fmi.pyx":2737
 *         return ndx
 * 
 *     nominal_continuous_states = property(_get_nominal_continuous_states, doc =             # <<<<<<<<<<<<<<
 *     """
 *     Property for accessing the nominal values of the continuous states. Calls
 */
  __pyx_t_4 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME1, __pyx_n_s_459); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__doc), ((PyObject *)__pyx_kp_s_460)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME1->tp_dict, __pyx_n_s_170, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_FMUModelME1);

  /* "pyfmi\fmi.pyx":2820
 *         return [rtol, atol]
 * 
 *     def event_update(self, intermediateResult=False):             # <<<<<<<<<<<<<<
 *         """
 *         Updates the event information at the current time-point. If
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_171 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":2948
 * 
 * 
 *     def initialize(self, tolControlled=True, relativeTolerance=None):             # <<<<<<<<<<<<<<
 *         """
 *         Initializes the model and computes initial values for all variables,
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_178 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":3006
 * 
 * 
 *     def instantiate_model(self, name='Model', logging=False):             # <<<<<<<<<<<<<<
 *         """
 *         Instantiate the model.
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_187 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":3053
 *                  input=(),
 *                  algorithm='AssimuloFMIAlg',
 *                  options={}):             # <<<<<<<<<<<<<<
 *         """
 *         Compact function for model simulation.
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_k_191 = ((PyObject *)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":3170
 *     FMI Model loaded from a dll.
 *     """
 *     def __init__(self, fmu, path='.', enable_logging=None, log_file_name="", log_level=FMI_DEFAULT_LOG_LEVEL):             # <<<<<<<<<<<<<<
 *         """
 *         Constructor of the model.
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s_448); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_192 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":3707
 *             raise FMUException('Type not supported.')
 * 
 *     def instantiate(self, name= 'Model', visible = False):             # <<<<<<<<<<<<<<
 *         """
 *         Instantiate the model.
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_229 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":3746
 *             raise FMUException('Failed to instantiate the model. See the log for possibly more information.')
 * 
 *     def setup_experiment(self, tolerance_defined=True, tolerance="Default", start_time="Default", stop_time_defined=False, stop_time="Default"):             # <<<<<<<<<<<<<<
 *         """
 *         Calls the underlying FMU method for creating an experiment.
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_233 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_234 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":3909
 *             raise FMUException('Logging is not enabled')
 * 
 *     def set_debug_logging(self, logging_on, categories = []):             # <<<<<<<<<<<<<<
 *         """
 *         Specifies if the debugging should be turned on or off.
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_262 = ((PyObject *)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":4198
 * 
 * 
 *     def get_model_variables(self, type = None, include_alias = True,             # <<<<<<<<<<<<<<
 *                              causality = None,   variability = None,
 *                             only_start = False,   only_fixed = False,
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_268 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":4200
 *     def get_model_variables(self, type = None, include_alias = True,
 *                              causality = None,   variability = None,
 *                             only_start = False,   only_fixed = False,             # <<<<<<<<<<<<<<
 *                             filter = None):
 *         """
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_269 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_270 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":5097
 *         return states, inputs
 * 
 *     def _get_directional_proxy(self, var_ref, func_ref, group, add_diag=False):             # <<<<<<<<<<<<<<
 *         cdef list data = []
 *         cdef list row = []
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_301 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":5208
 * 
 * 
 *     def get_state_space_representation(self, A=True, B=True, C=True, D=True):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a state space representation of the model. I.e::
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_304 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_305 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_306 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_307 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":5525
 *     Co-simulation model loaded from a dll
 *     """
 *     def __init__(self, fmu, path = '.', enable_logging = True, log_file_name = "", log_level=FMI_DEFAULT_LOG_LEVEL):             # <<<<<<<<<<<<<<
 *         """
 *         Constructor of the model.
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_320 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s_448); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_321 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":5609
 *         self.__t = t
 * 
 *     time = property(_get_time,_set_time, doc =             # <<<<<<<<<<<<<<
 *     """
 *     Property for accessing the current time of the simulation. Calls the
 */
  __pyx_t_2 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelCS2, __pyx_n_s___get_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelCS2, __pyx_n_s___set_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__doc), ((PyObject *)__pyx_kp_s_461)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelCS2->tp_dict, __pyx_n_s__time, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_FMUModelCS2);

  /* "pyfmi\fmi.pyx":5615
 *     """)
 * 
 *     cpdef int do_step(self, FMIL.fmi2_real_t current_t, FMIL.fmi2_real_t step_size, new_step=True):             # <<<<<<<<<<<<<<
 *         """
 *         Performs an integrator step.
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_327 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":5987
 *                  input=(),
 *                  algorithm='FMICSAlg',
 *                  options={}):             # <<<<<<<<<<<<<<
 *         """
 *         Compact function for model simulation.
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_k_348 = ((PyObject *)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":6124
 *     """
 * 
 *     def __init__(self, fmu, path = '.', enable_logging = True, log_file_name = "", log_level=FMI_DEFAULT_LOG_LEVEL):             # <<<<<<<<<<<<<<
 *         """
 *         Constructor of the model.
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_352 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s_448); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_353 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":6223
 *         self.__t = t
 * 
 *     time = property(_get_time,_set_time, doc =             # <<<<<<<<<<<<<<
 *     """
 *     Property for accessing the current time of the simulation. Calls the
 */
  __pyx_t_2 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME2, __pyx_n_s___get_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME2, __pyx_n_s___set_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__doc), ((PyObject *)__pyx_kp_s_453)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME2->tp_dict, __pyx_n_s__time, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_FMUModelME2);

  /* "pyfmi\fmi.pyx":6316
 *         return values
 * 
 *     def event_update(self, intermediateResult=False):             # <<<<<<<<<<<<<<
 *         """
 *         Updates the event information at the current time-point. If
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_367 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":6389
 *         return [rtol, atol]
 * 
 *     def completed_integrator_step(self, no_set_FMU_state_prior_to_current_point = True):             # <<<<<<<<<<<<<<
 *         """
 *         This method must be called by the environment after every completed step
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_369 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyfmi\fmi.pyx":6454
 *             raise FMUException('Failed to set the new continuous states.')
 * 
 *     continuous_states = property(_get_continuous_states, _set_continuous_states,             # <<<<<<<<<<<<<<
 *         doc=
 *     """
 */
  __pyx_t_2 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME2, __pyx_n_s_456); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME2, __pyx_n_s_457); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__doc), ((PyObject *)__pyx_kp_s_462)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME2->tp_dict, __pyx_n_s__continuous_states, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_FMUModelME2);

  /* "pyfmi\fmi.pyx":6479
 *         return ndx
 * 
 *     nominal_continuous_states = property(_get_nominal_continuous_states, doc =             # <<<<<<<<<<<<<<
 *     """
 *     Property for accessing the nominal values of the continuous states. Calls
 */
  __pyx_t_2 = __Pyx_GetName((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME2, __pyx_n_s_459); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__doc), ((PyObject *)__pyx_kp_s_463)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pyfmi_3fmi_FMUModelME2->tp_dict, __pyx_n_s_170, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_5pyfmi_3fmi_FMUModelME2);

  /* "pyfmi\fmi.pyx":6516
 *                  input=(),
 *                  algorithm='AssimuloFMIAlg',
 *                  options={}):             # <<<<<<<<<<<<<<
 *         """
 *         Compact function for model simulation.
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_k_375 = ((PyObject *)__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6648
 *         return FMIL.fmi2_import_get_capability(self._fmu, FMIL.fmi2_me_canGetAndSetFMUstate)
 * 
 *     def _get_directional_proxy(self, var_ref, func_ref, group, add_diag=False):             # <<<<<<<<<<<<<<
 *         if self._provides_directional_derivatives() and not self.force_finite_differences:
 *             return FMUModelBase2._get_directional_proxy(self, var_ref, func_ref, group, add_diag)
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_378 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6654
 *             return self._estimate_directional_derivative(var_ref, func_ref, group, add_diag)
 * 
 *     def _estimate_directional_derivative(self, var_ref, func_ref, group, add_diag=False):             # <<<<<<<<<<<<<<
 *         cdef list data = []
 *         cdef list row = []
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_380 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6720
 * #Temporary should be removed! (after a period)
 * cdef class FMUModel(FMUModelME1):
 *     def __init__(self, fmu, path='.', enable_logging=True):             # <<<<<<<<<<<<<<
 *         print "WARNING: This class is deprecated and has been superseded with FMUModelME1. The recommended entry-point for loading an FMU is now the function load_fmu."
 *         FMUModelME1.__init__(self,fmu,path,enable_logging)
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_382 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6724
 *         FMUModelME1.__init__(self,fmu,path,enable_logging)
 * 
 * def load_fmu_deprecated(fmu, path='.', enable_logging=True, log_file_name=""):             # <<<<<<<<<<<<<<
 *     """
 *     Helper function for loading FMUs of different kinds.
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_384 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5pyfmi_3fmi_9load_fmu_deprecated, NULL, __pyx_n_s_436); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__load_fmu_deprecated, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6829
 *     return model
 * 
 * def _handle_load_fmu_exception(fmu, log_file):             # <<<<<<<<<<<<<<
 *     log = []
 *     with open(log_file,'r') as file:
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5pyfmi_3fmi_11_handle_load_fmu_exception, NULL, __pyx_n_s_436); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_400, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":6841
 *         print log[i]
 * 
 * def load_fmu(fmu, path = '.', enable_logging = None, log_file_name = "", kind = 'auto', log_level=FMI_DEFAULT_LOG_LEVEL):             # <<<<<<<<<<<<<<
 *     """
 *     Helper method for creating a model instance.
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_448); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_394 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5pyfmi_3fmi_13load_fmu, NULL, __pyx_n_s_436); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__load_fmu, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyfmi\fmi.pyx":1
 * #!/usr/bin/env python             # <<<<<<<<<<<<<<
 * # -*- coding: utf-8 -*-
 * 
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "numpy.pxd":975
 *      arr.base = baseptr
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     if arr.base is NULL:
 *         return None
 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  if (__pyx_m) {
    __Pyx_AddTraceback("init pyfmi.fmi", __pyx_clineno, __pyx_lineno, __pyx_filename);
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init pyfmi.fmi");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

/* Runtime support code */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule((char *)modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif /* CYTHON_REFNANNY */

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
    PyObject *result;
    result = PyObject_GetAttr(dict, name);
    if (!result) {
        if (dict != __pyx_b) {
            PyErr_Clear();
            result = PyObject_GetAttr(__pyx_b, name);
        }
        if (!result) {
            PyErr_SetObject(PyExc_NameError, name);
        }
    }
    return result;
}

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;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    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
    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;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    /* Make sure tstate is in a consistent state when we XDECREF
       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;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    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;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    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
}

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)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%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);
}

static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    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;
            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;
                    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, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%s() got an unexpected keyword argument '%s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

static PyObject* __Pyx_Globals(void) {
    Py_ssize_t i;
    PyObject *names = NULL;
    PyObject *globals = PyObject_GetAttrString(__pyx_m, "__dict__");
    if (!globals) {
        PyErr_SetString(PyExc_TypeError,
            "current module must have __dict__ attribute");
        goto bad;
    }
    names = PyObject_Dir(__pyx_m);
    if (!names)
        goto bad;
    for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject* name = PySequence_GetItem(names, i);
        if (!name)
            goto bad;
#else
        PyObject* name = PyList_GET_ITEM(names, i);
#endif
        if (!PyDict_Contains(globals, name)) {
            PyObject* value = PyObject_GetAttr(__pyx_m, name);
            if (!value) {
#if CYTHON_COMPILING_IN_PYPY
                Py_DECREF(name);
#endif
                goto bad;
            }
            if (PyDict_SetItem(globals, name, value) < 0) {
#if CYTHON_COMPILING_IN_PYPY
                Py_DECREF(name);
#endif
                Py_DECREF(value);
                goto bad;
            }
        }
#if CYTHON_COMPILING_IN_PYPY
        Py_DECREF(name);
#endif
    }
    Py_DECREF(names);
    return globals;
bad:
    Py_XDECREF(names);
    Py_XDECREF(globals);
    return NULL;
}

#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    Py_XINCREF(type);
    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)) {
    #else
    if (PyType_Check(type)) {
    #endif
#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;
        }
        value = type;
        #if PY_VERSION_HEX < 0x02050000
            if (PyInstance_Check(type)) {
                type = (PyObject*) ((PyInstanceObject*)type)->in_class;
                Py_INCREF(type);
            }
            else {
                type = 0;
                PyErr_SetString(PyExc_TypeError,
                    "raise: exception must be an old-style class or instance");
                goto raise_error;
            }
        #else
            type = (PyObject*) Py_TYPE(type);
            Py_INCREF(type);
            if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
                PyErr_SetString(PyExc_TypeError,
                    "raise: exception class must be a subclass of BaseException");
                goto raise_error;
            }
        #endif
    }
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    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)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } 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 && cause != Py_None) {
        PyObject *fixed_cause;
        if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        }
        else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        }
        else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
        PyThreadState *tstate = PyThreadState_GET();
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    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)))
        #endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
    }
    if ((!kw_allowed) && unlikely(key))
        goto invalid_keyword;
    return 1;
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
        "%s() got an unexpected keyword argument '%s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_Format(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(PyObject_TypeCheck(obj, type)))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                 Py_TYPE(obj)->tp_name, type->tp_name);
    return 0;
}

static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
  unsigned int n = 1;
  return *(unsigned char*)(&n) != 0;
}
static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
                              __Pyx_BufFmt_StackElem* stack,
                              __Pyx_TypeInfo* type) {
  stack[0].field = &ctx->root;
  stack[0].parent_offset = 0;
  ctx->root.type = type;
  ctx->root.name = "buffer dtype";
  ctx->root.offset = 0;
  ctx->head = stack;
  ctx->head->field = &ctx->root;
  ctx->fmt_offset = 0;
  ctx->head->parent_offset = 0;
  ctx->new_packmode = '@';
  ctx->enc_packmode = '@';
  ctx->new_count = 1;
  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;
    ctx->head->parent_offset = 0;
    type = type->fields->type;
  }
}
static int __Pyx_BufFmt_ParseNumber(const char** ts) {
    int count;
    const char* t = *ts;
    if (*t < '0' || *t > '9') {
      return -1;
    } else {
        count = *t++ - '0';
        while (*t >= '0' && *t < '9') {
            count *= 10;
            count += *t++ - '0';
        }
    }
    *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 'c': return "'char'";
    case 'b': return "'signed char'";
    case 'B': return "'unsigned char'";
    case 'h': return "'short'";
    case 'H': return "'unsigned short'";
    case 'i': return "'int'";
    case 'I': return "'unsigned int'";
    case 'l': return "'long'";
    case 'L': return "'unsigned long'";
    case 'q': return "'long long'";
    case 'Q': return "'unsigned long long'";
    case 'f': return (is_complex ? "'complex float'" : "'float'");
    case 'd': return (is_complex ? "'complex double'" : "'double'");
    case 'g': return (is_complex ? "'complex long double'" : "'long double'");
    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': 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;
    case 'f': return (is_complex ? 8 : 4);
    case 'd': return (is_complex ? 16 : 8);
    case 'g': {
      PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
      return 0;
    }
    case 'O': case 'P': return sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
  switch (ch) {
    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);
    #ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(PY_LONG_LONG);
    #endif
    case 'f': return sizeof(float) * (is_complex ? 2 : 1);
    case 'd': return sizeof(double) * (is_complex ? 2 : 1);
    case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
    case 'O': case 'P': return sizeof(void*);
    default: {
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
  }
}
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;
typedef struct { char c; float x; } __Pyx_st_float;
typedef struct { char c; double x; } __Pyx_st_double;
typedef struct { char c; long double x; } __Pyx_st_longdouble;
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, 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_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);
#ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
#endif
    case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
    case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
    case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
    case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      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':
        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;
    const char* quote;
    if (ctx->head == NULL) {
      expected = "end";
      quote = "";
    } else {
      expected = ctx->head->field->type->name;
      quote = "'";
    }
    PyErr_Format(PyExc_ValueError,
                 "Buffer dtype mismatch, expected %s%s%s but got %s",
                 quote, expected, quote,
                 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
  } else {
    __Pyx_StructField* field = ctx->head->field;
    __Pyx_StructField* parent = (ctx->head - 1)->field;
    PyErr_Format(PyExc_ValueError,
                 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
                 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
                 parent->type->name, field->name);
  }
}
static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
  char group;
  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 {
      size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
    }
    if (ctx->enc_packmode == '@') {
      size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
      size_t align_mod_offset;
      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) {
        size_t parent_offset = ctx->head->parent_offset + field->offset;
        ++ctx->head;
        ctx->head->field = type->fields;
        ctx->head->parent_offset = parent_offset;
        continue;
      }
      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 %" 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 */
    while (1) {
      if (field == &ctx->root) {
        ctx->head = NULL;
        if (ctx->enc_count != 0) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return -1;
        }
        break; /* breaks both loops as ctx->enc_count == 0 */
      }
      ctx->head->field = ++field;
      if (field->type == NULL) {
        --ctx->head;
        field = ctx->head->field;
        continue;
      } else if (field->type->typegroup == 'S') {
        size_t parent_offset = ctx->head->parent_offset + field->offset;
        if (field->type->fields->type == NULL) continue; /* empty struct */
        field = field->type->fields;
        ++ctx->head;
        ctx->head->field = field;
        ctx->head->parent_offset = parent_offset;
        break;
      } else {
        break;
      }
    }
  } while (ctx->enc_count);
  ctx->enc_type = 0;
  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) {
    switch(*ts) {
      case 0:
        if (ctx->enc_type != 0 && ctx->head == NULL) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return NULL;
        }
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        if (ctx->head != NULL) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return NULL;
        }
                return ts;
      case ' ':
      case 10:
      case 13:
        ++ts;
        break;
      case '<':
        if (!__Pyx_IsLittleEndian()) {
          PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
          return NULL;
        }
        ctx->new_packmode = '=';
        ++ts;
        break;
      case '>':
      case '!':
        if (__Pyx_IsLittleEndian()) {
          PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
          return NULL;
        }
        ctx->new_packmode = '=';
        ++ts;
        break;
      case '=':
      case '@':
      case '^':
        ctx->new_packmode = *ts++;
        break;
      case 'T': /* substruct */
        {
          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) {
            ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
            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 */
        {
          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;
        ctx->fmt_offset += ctx->new_count;
        ctx->new_count = 1;
        ctx->enc_count = 0;
        ctx->enc_type = 0;
        ctx->enc_packmode = ctx->new_packmode;
        ++ts;
        break;
      case 'Z':
        got_Z = 1;
        ++ts;
        if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
          __Pyx_BufFmt_RaiseUnexpectedChar('Z');
          return NULL;
        }        /* fall through */
      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 's': case 'p':
        if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
            ctx->enc_packmode == ctx->new_packmode) {
          ctx->enc_count += ctx->new_count;
        } else {
          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
          ctx->enc_count = ctx->new_count;
          ctx->enc_packmode = ctx->new_packmode;
          ctx->enc_type = *ts;
          ctx->is_complex = got_Z;
        }
        ++ts;
        ctx->new_count = 1;
        got_Z = 0;
        break;
      case ':':
        ++ts;
        while(*ts != ':') ++ts;
        ++ts;
        break;
      case '(':
        if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
        break;
      default:
        {
          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;
  buf->strides = __Pyx_zeros;
  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)
{
  if (obj == Py_None || obj == NULL) {
    __Pyx_ZeroBuffer(buf);
    return 0;
  }
  buf->buf = NULL;
  if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail;
  if (buf->ndim != nd) {
    PyErr_Format(PyExc_ValueError,
                 "Buffer has wrong number of dimensions (expected %d, got %d)",
                 nd, buf->ndim);
    goto fail;
  }
  if (!cast) {
    __Pyx_BufFmt_Context ctx;
    __Pyx_BufFmt_Init(&ctx, stack, dtype);
    if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
  }
  if ((unsigned)buf->itemsize != dtype->size) {
    PyErr_Format(PyExc_ValueError,
      "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;
  }
  if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
  return 0;
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 PyObject* __Pyx_decode_c_string(
         const char* cstring, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
    Py_ssize_t length;
    if (unlikely((start < 0) | (stop < 0))) {
        length = strlen(cstring);
        if (start < 0) {
            start += length;
            if (start < 0)
                start = 0;
        }
        if (stop < 0)
            stop += length;
    }
    length = stop - start;
    if (unlikely(length <= 0))
        return PyUnicode_FromUnicode(NULL, 0);
    cstring += start;
    if (decode_func) {
        return decode_func(cstring, length, errors);
    } else {
        return PyUnicode_Decode(cstring, length, encoding, errors);
    }
}

static void __Pyx_RaiseBufferFallbackError(void) {
  PyErr_Format(PyExc_ValueError,
     "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!");
}

static void __Pyx_RaiseBufferIndexError(int axis) {
  PyErr_Format(PyExc_IndexError,
     "Out of bounds on buffer access (axis %d)", axis);
}

static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact)
{
    if (!type) {
        PyErr_Format(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (none_allowed && obj == Py_None) return 1;
    else if (exact) {
        if (Py_TYPE(obj) == type) return 1;
    }
    else {
        if (PyObject_TypeCheck(obj, type)) return 1;
    }
    PyErr_Format(PyExc_TypeError,
        "Argument '%s' has incorrect type (expected %s, got %s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
    return 0;
}

static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%s to unpack",
                 index, (index == 1) ? "" : "s");
}

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 {
        return __Pyx_IterFinish();
    }
    return 0;
}

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_VERSION_HEX < 0x03030000
    PyObject *py_import = 0;
    py_import = __Pyx_GetAttrString(__pyx_b, "__import__");
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    #if PY_VERSION_HEX >= 0x02050000
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                #if PY_VERSION_HEX < 0x03030000
                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);
                #else
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                #endif
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0; /* try absolute import on failure */
        }
        #endif
        if (!module) {
            #if PY_VERSION_HEX < 0x03030000
            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
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
    #else
    if (level>0) {
        PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
        goto bad;
    }
    module = PyObject_CallFunctionObjArgs(py_import,
        name, global_dict, empty_dict, list, NULL);
    #endif
bad:
    #if PY_VERSION_HEX < 0x03030000
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    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
}

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;
    *tb = tstate->exc_traceback;
    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;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = 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);
  #endif
        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;
    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 */


    static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases) {
    PyObject *metaclass;
#if PY_MAJOR_VERSION < 3
    if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) {
        PyObject *base = PyTuple_GET_ITEM(bases, 0);
        metaclass = PyObject_GetAttrString(base, (char *)"__class__");
        if (!metaclass) {
            PyErr_Clear();
            metaclass = (PyObject*) Py_TYPE(base);
        }
    } else {
        metaclass = (PyObject *) &PyClass_Type;
    }
#else
    if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) {
        PyObject *base = PyTuple_GET_ITEM(bases, 0);
        metaclass = (PyObject*) Py_TYPE(base);
    } else {
        metaclass = (PyObject *) &PyType_Type;
    }
#endif
    Py_INCREF(metaclass);
    return metaclass;
}

static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name,
                                   PyObject *qualname, PyObject *modname) {
    PyObject *result;
    PyObject *metaclass;
    if (PyDict_SetItemString(dict, "__module__", modname) < 0)
        return NULL;
    if (PyDict_SetItemString(dict, "__qualname__", qualname) < 0)
        return NULL;
    metaclass = PyDict_GetItemString(dict, "__metaclass__");
    if (metaclass) {
        Py_INCREF(metaclass);
    } else {
        metaclass = __Pyx_FindPy2Metaclass(bases);
    }
    result = PyObject_CallFunctionObjArgs(metaclass, name, bases, dict, NULL);
    Py_DECREF(metaclass);
    return result;
}

static CYTHON_INLINE fmi1_value_reference_t __Pyx_PyInt_from_py_fmi1_value_reference_t(PyObject* x) {
    const fmi1_value_reference_t neg_one = (fmi1_value_reference_t)-1, const_zero = (fmi1_value_reference_t)0;
    const int is_unsigned = const_zero < neg_one;
    if (sizeof(fmi1_value_reference_t) == sizeof(char)) {
        if (is_unsigned)
            return (fmi1_value_reference_t)__Pyx_PyInt_AsUnsignedChar(x);
        else
            return (fmi1_value_reference_t)__Pyx_PyInt_AsSignedChar(x);
    } else if (sizeof(fmi1_value_reference_t) == sizeof(short)) {
        if (is_unsigned)
            return (fmi1_value_reference_t)__Pyx_PyInt_AsUnsignedShort(x);
        else
            return (fmi1_value_reference_t)__Pyx_PyInt_AsSignedShort(x);
    } else if (sizeof(fmi1_value_reference_t) == sizeof(int)) {
        if (is_unsigned)
            return (fmi1_value_reference_t)__Pyx_PyInt_AsUnsignedInt(x);
        else
            return (fmi1_value_reference_t)__Pyx_PyInt_AsSignedInt(x);
    } else if (sizeof(fmi1_value_reference_t) == sizeof(long)) {
        if (is_unsigned)
            return (fmi1_value_reference_t)__Pyx_PyInt_AsUnsignedLong(x);
        else
            return (fmi1_value_reference_t)__Pyx_PyInt_AsSignedLong(x);
    } else if (sizeof(fmi1_value_reference_t) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return (fmi1_value_reference_t)__Pyx_PyInt_AsUnsignedLongLong(x);
        else
            return (fmi1_value_reference_t)__Pyx_PyInt_AsSignedLongLong(x);
    }  else {
        #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
        PyErr_SetString(PyExc_RuntimeError,
                        "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
        #else
        fmi1_value_reference_t val;
        PyObject *v = __Pyx_PyNumber_Int(x);
        #if PY_VERSION_HEX < 0x03000000
        if (likely(v) && !PyLong_Check(v)) {
            PyObject *tmp = v;
            v = PyNumber_Long(tmp);
            Py_DECREF(tmp);
        }
        #endif
        if (likely(v)) {
            int one = 1; int is_little = (int)*(unsigned char *)&one;
            unsigned char *bytes = (unsigned char *)&val;
            int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                          bytes, sizeof(val),
                                          is_little, !is_unsigned);
            Py_DECREF(v);
            if (likely(!ret))
                return val;
        }
        #endif
        return (fmi1_value_reference_t)-1;
    }
}

static CYTHON_INLINE fmi1_integer_t __Pyx_PyInt_from_py_fmi1_integer_t(PyObject* x) {
    const fmi1_integer_t neg_one = (fmi1_integer_t)-1, const_zero = (fmi1_integer_t)0;
    const int is_unsigned = const_zero < neg_one;
    if (sizeof(fmi1_integer_t) == sizeof(char)) {
        if (is_unsigned)
            return (fmi1_integer_t)__Pyx_PyInt_AsUnsignedChar(x);
        else
            return (fmi1_integer_t)__Pyx_PyInt_AsSignedChar(x);
    } else if (sizeof(fmi1_integer_t) == sizeof(short)) {
        if (is_unsigned)
            return (fmi1_integer_t)__Pyx_PyInt_AsUnsignedShort(x);
        else
            return (fmi1_integer_t)__Pyx_PyInt_AsSignedShort(x);
    } else if (sizeof(fmi1_integer_t) == sizeof(int)) {
        if (is_unsigned)
            return (fmi1_integer_t)__Pyx_PyInt_AsUnsignedInt(x);
        else
            return (fmi1_integer_t)__Pyx_PyInt_AsSignedInt(x);
    } else if (sizeof(fmi1_integer_t) == sizeof(long)) {
        if (is_unsigned)
            return (fmi1_integer_t)__Pyx_PyInt_AsUnsignedLong(x);
        else
            return (fmi1_integer_t)__Pyx_PyInt_AsSignedLong(x);
    } else if (sizeof(fmi1_integer_t) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return (fmi1_integer_t)__Pyx_PyInt_AsUnsignedLongLong(x);
        else
            return (fmi1_integer_t)__Pyx_PyInt_AsSignedLongLong(x);
    }  else {
        #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
        PyErr_SetString(PyExc_RuntimeError,
                        "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
        #else
        fmi1_integer_t val;
        PyObject *v = __Pyx_PyNumber_Int(x);
        #if PY_VERSION_HEX < 0x03000000
        if (likely(v) && !PyLong_Check(v)) {
            PyObject *tmp = v;
            v = PyNumber_Long(tmp);
            Py_DECREF(tmp);
        }
        #endif
        if (likely(v)) {
            int one = 1; int is_little = (int)*(unsigned char *)&one;
            unsigned char *bytes = (unsigned char *)&val;
            int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                          bytes, sizeof(val),
                                          is_little, !is_unsigned);
            Py_DECREF(v);
            if (likely(!ret))
                return val;
        }
        #endif
        return (fmi1_integer_t)-1;
    }
}

static CYTHON_INLINE fmi2_integer_t __Pyx_PyInt_from_py_fmi2_integer_t(PyObject* x) {
    const fmi2_integer_t neg_one = (fmi2_integer_t)-1, const_zero = (fmi2_integer_t)0;
    const int is_unsigned = const_zero < neg_one;
    if (sizeof(fmi2_integer_t) == sizeof(char)) {
        if (is_unsigned)
            return (fmi2_integer_t)__Pyx_PyInt_AsUnsignedChar(x);
        else
            return (fmi2_integer_t)__Pyx_PyInt_AsSignedChar(x);
    } else if (sizeof(fmi2_integer_t) == sizeof(short)) {
        if (is_unsigned)
            return (fmi2_integer_t)__Pyx_PyInt_AsUnsignedShort(x);
        else
            return (fmi2_integer_t)__Pyx_PyInt_AsSignedShort(x);
    } else if (sizeof(fmi2_integer_t) == sizeof(int)) {
        if (is_unsigned)
            return (fmi2_integer_t)__Pyx_PyInt_AsUnsignedInt(x);
        else
            return (fmi2_integer_t)__Pyx_PyInt_AsSignedInt(x);
    } else if (sizeof(fmi2_integer_t) == sizeof(long)) {
        if (is_unsigned)
            return (fmi2_integer_t)__Pyx_PyInt_AsUnsignedLong(x);
        else
            return (fmi2_integer_t)__Pyx_PyInt_AsSignedLong(x);
    } else if (sizeof(fmi2_integer_t) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return (fmi2_integer_t)__Pyx_PyInt_AsUnsignedLongLong(x);
        else
            return (fmi2_integer_t)__Pyx_PyInt_AsSignedLongLong(x);
    }  else {
        #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
        PyErr_SetString(PyExc_RuntimeError,
                        "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
        #else
        fmi2_integer_t val;
        PyObject *v = __Pyx_PyNumber_Int(x);
        #if PY_VERSION_HEX < 0x03000000
        if (likely(v) && !PyLong_Check(v)) {
            PyObject *tmp = v;
            v = PyNumber_Long(tmp);
            Py_DECREF(tmp);
        }
        #endif
        if (likely(v)) {
            int one = 1; int is_little = (int)*(unsigned char *)&one;
            unsigned char *bytes = (unsigned char *)&val;
            int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                          bytes, sizeof(val),
                                          is_little, !is_unsigned);
            Py_DECREF(v);
            if (likely(!ret))
                return val;
        }
        #endif
        return (fmi2_integer_t)-1;
    }
}

#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
static PyObject *__Pyx_GetStdout(void) {
    PyObject *f = PySys_GetObject((char *)"stdout");
    if (!f) {
        PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
    }
    return f;
}
static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) {
    int i;
    if (!f) {
        if (!(f = __Pyx_GetStdout()))
            return -1;
    }
    Py_INCREF(f);
    for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) {
        PyObject* v;
        if (PyFile_SoftSpace(f, 1)) {
            if (PyFile_WriteString(" ", f) < 0)
                goto error;
        }
        v = PyTuple_GET_ITEM(arg_tuple, i);
        if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
            goto error;
        if (PyString_Check(v)) {
            char *s = PyString_AsString(v);
            Py_ssize_t len = PyString_Size(v);
            if (len > 0 &&
                isspace(Py_CHARMASK(s[len-1])) &&
                s[len-1] != ' ')
                    PyFile_SoftSpace(f, 0);
        }
    }
    if (newline) {
        if (PyFile_WriteString("\n", f) < 0)
            goto error;
        PyFile_SoftSpace(f, 0);
    }
    Py_DECREF(f);
    return 0;
error:
    Py_DECREF(f);
    return -1;
}
#else /* Python 3 has a print function */
static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) {
    PyObject* kwargs = 0;
    PyObject* result = 0;
    PyObject* end_string;
    if (unlikely(!__pyx_print)) {
        __pyx_print = __Pyx_GetAttrString(__pyx_b, "print");
        if (!__pyx_print)
            return -1;
    }
    if (stream) {
        kwargs = PyDict_New();
        if (unlikely(!kwargs))
            return -1;
        if (unlikely(PyDict_SetItemString(kwargs, "file", stream) < 0))
            goto bad;
        if (!newline) {
            end_string = PyUnicode_FromStringAndSize(" ", 1);
            if (unlikely(!end_string))
                goto bad;
            if (PyDict_SetItemString(kwargs, "end", end_string) < 0) {
                Py_DECREF(end_string);
                goto bad;
            }
            Py_DECREF(end_string);
        }
    } else if (!newline) {
        if (unlikely(!__pyx_print_kwargs)) {
            __pyx_print_kwargs = PyDict_New();
            if (unlikely(!__pyx_print_kwargs))
                return -1;
            end_string = PyUnicode_FromStringAndSize(" ", 1);
            if (unlikely(!end_string))
                return -1;
            if (PyDict_SetItemString(__pyx_print_kwargs, "end", end_string) < 0) {
                Py_DECREF(end_string);
                return -1;
            }
            Py_DECREF(end_string);
        }
        kwargs = __pyx_print_kwargs;
    }
    result = PyObject_Call(__pyx_print, arg_tuple, kwargs);
    if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs))
        Py_DECREF(kwargs);
    if (!result)
        return -1;
    Py_DECREF(result);
    return 0;
bad:
    if (kwargs != __pyx_print_kwargs)
        Py_XDECREF(kwargs);
    return -1;
}
#endif

#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
static int __Pyx_PrintOne(PyObject* f, PyObject *o) {
    if (!f) {
        if (!(f = __Pyx_GetStdout()))
            return -1;
    }
    Py_INCREF(f);
    if (PyFile_SoftSpace(f, 0)) {
        if (PyFile_WriteString(" ", f) < 0)
            goto error;
    }
    if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0)
        goto error;
    if (PyFile_WriteString("\n", f) < 0)
        goto error;
    Py_DECREF(f);
    return 0;
error:
    Py_DECREF(f);
    return -1;
    /* the line below is just to avoid C compiler
     * warnings about unused functions */
    return __Pyx_Print(f, NULL, 0);
}
#else /* Python 3 has a print function */
static int __Pyx_PrintOne(PyObject* stream, PyObject *o) {
    int res;
    PyObject* arg_tuple = PyTuple_Pack(1, o);
    if (unlikely(!arg_tuple))
        return -1;
    res = __Pyx_Print(stream, arg_tuple, 1);
    Py_DECREF(arg_tuple);
    return res;
}
#endif

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_fmi1_value_reference_t(fmi1_value_reference_t val) {
    const fmi1_value_reference_t neg_one = (fmi1_value_reference_t)-1, const_zero = (fmi1_value_reference_t)0;
    const int is_unsigned = const_zero < neg_one;
    if ((sizeof(fmi1_value_reference_t) == sizeof(char))  ||
        (sizeof(fmi1_value_reference_t) == sizeof(short))) {
        return PyInt_FromLong((long)val);
    } else if ((sizeof(fmi1_value_reference_t) == sizeof(int)) ||
               (sizeof(fmi1_value_reference_t) == sizeof(long))) {
        if (is_unsigned)
            return PyLong_FromUnsignedLong((unsigned long)val);
        else
            return PyInt_FromLong((long)val);
    } else if (sizeof(fmi1_value_reference_t) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
        else
            return PyLong_FromLongLong((PY_LONG_LONG)val);
    } else {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        return _PyLong_FromByteArray(bytes, sizeof(fmi1_value_reference_t),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE size_t __Pyx_PyInt_from_py_size_t(PyObject* x) {
    const size_t neg_one = (size_t)-1, const_zero = (size_t)0;
    const int is_unsigned = const_zero < neg_one;
    if (sizeof(size_t) == sizeof(char)) {
        if (is_unsigned)
            return (size_t)__Pyx_PyInt_AsUnsignedChar(x);
        else
            return (size_t)__Pyx_PyInt_AsSignedChar(x);
    } else if (sizeof(size_t) == sizeof(short)) {
        if (is_unsigned)
            return (size_t)__Pyx_PyInt_AsUnsignedShort(x);
        else
            return (size_t)__Pyx_PyInt_AsSignedShort(x);
    } else if (sizeof(size_t) == sizeof(int)) {
        if (is_unsigned)
            return (size_t)__Pyx_PyInt_AsUnsignedInt(x);
        else
            return (size_t)__Pyx_PyInt_AsSignedInt(x);
    } else if (sizeof(size_t) == sizeof(long)) {
        if (is_unsigned)
            return (size_t)__Pyx_PyInt_AsUnsignedLong(x);
        else
            return (size_t)__Pyx_PyInt_AsSignedLong(x);
    } else if (sizeof(size_t) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return (size_t)__Pyx_PyInt_AsUnsignedLongLong(x);
        else
            return (size_t)__Pyx_PyInt_AsSignedLongLong(x);
    }  else {
        #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
        PyErr_SetString(PyExc_RuntimeError,
                        "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
        #else
        size_t val;
        PyObject *v = __Pyx_PyNumber_Int(x);
        #if PY_VERSION_HEX < 0x03000000
        if (likely(v) && !PyLong_Check(v)) {
            PyObject *tmp = v;
            v = PyNumber_Long(tmp);
            Py_DECREF(tmp);
        }
        #endif
        if (likely(v)) {
            int one = 1; int is_little = (int)*(unsigned char *)&one;
            unsigned char *bytes = (unsigned char *)&val;
            int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                          bytes, sizeof(val),
                                          is_little, !is_unsigned);
            Py_DECREF(v);
            if (likely(!ret))
                return val;
        }
        #endif
        return (size_t)-1;
    }
}

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_size_t(size_t val) {
    const size_t neg_one = (size_t)-1, const_zero = (size_t)0;
    const int is_unsigned = const_zero < neg_one;
    if ((sizeof(size_t) == sizeof(char))  ||
        (sizeof(size_t) == sizeof(short))) {
        return PyInt_FromLong((long)val);
    } else if ((sizeof(size_t) == sizeof(int)) ||
               (sizeof(size_t) == sizeof(long))) {
        if (is_unsigned)
            return PyLong_FromUnsignedLong((unsigned long)val);
        else
            return PyInt_FromLong((long)val);
    } else if (sizeof(size_t) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
        else
            return PyLong_FromLongLong((PY_LONG_LONG)val);
    } else {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        return _PyLong_FromByteArray(bytes, sizeof(size_t),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_fmi1_boolean_t(fmi1_boolean_t val) {
    const fmi1_boolean_t neg_one = (fmi1_boolean_t)-1, const_zero = (fmi1_boolean_t)0;
    const int is_unsigned = const_zero < neg_one;
    if ((sizeof(fmi1_boolean_t) == sizeof(char))  ||
        (sizeof(fmi1_boolean_t) == sizeof(short))) {
        return PyInt_FromLong((long)val);
    } else if ((sizeof(fmi1_boolean_t) == sizeof(int)) ||
               (sizeof(fmi1_boolean_t) == sizeof(long))) {
        if (is_unsigned)
            return PyLong_FromUnsignedLong((unsigned long)val);
        else
            return PyInt_FromLong((long)val);
    } else if (sizeof(fmi1_boolean_t) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
        else
            return PyLong_FromLongLong((PY_LONG_LONG)val);
    } else {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        return _PyLong_FromByteArray(bytes, sizeof(fmi1_boolean_t),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_fmi1_integer_t(fmi1_integer_t val) {
    const fmi1_integer_t neg_one = (fmi1_integer_t)-1, const_zero = (fmi1_integer_t)0;
    const int is_unsigned = const_zero < neg_one;
    if ((sizeof(fmi1_integer_t) == sizeof(char))  ||
        (sizeof(fmi1_integer_t) == sizeof(short))) {
        return PyInt_FromLong((long)val);
    } else if ((sizeof(fmi1_integer_t) == sizeof(int)) ||
               (sizeof(fmi1_integer_t) == sizeof(long))) {
        if (is_unsigned)
            return PyLong_FromUnsignedLong((unsigned long)val);
        else
            return PyInt_FromLong((long)val);
    } else if (sizeof(fmi1_integer_t) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
        else
            return PyLong_FromLongLong((PY_LONG_LONG)val);
    } else {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        return _PyLong_FromByteArray(bytes, sizeof(fmi1_integer_t),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE fmi2_boolean_t __Pyx_PyInt_from_py_fmi2_boolean_t(PyObject* x) {
    const fmi2_boolean_t neg_one = (fmi2_boolean_t)-1, const_zero = (fmi2_boolean_t)0;
    const int is_unsigned = const_zero < neg_one;
    if (sizeof(fmi2_boolean_t) == sizeof(char)) {
        if (is_unsigned)
            return (fmi2_boolean_t)__Pyx_PyInt_AsUnsignedChar(x);
        else
            return (fmi2_boolean_t)__Pyx_PyInt_AsSignedChar(x);
    } else if (sizeof(fmi2_boolean_t) == sizeof(short)) {
        if (is_unsigned)
            return (fmi2_boolean_t)__Pyx_PyInt_AsUnsignedShort(x);
        else
            return (fmi2_boolean_t)__Pyx_PyInt_AsSignedShort(x);
    } else if (sizeof(fmi2_boolean_t) == sizeof(int)) {
        if (is_unsigned)
            return (fmi2_boolean_t)__Pyx_PyInt_AsUnsignedInt(x);
        else
            return (fmi2_boolean_t)__Pyx_PyInt_AsSignedInt(x);
    } else if (sizeof(fmi2_boolean_t) == sizeof(long)) {
        if (is_unsigned)
            return (fmi2_boolean_t)__Pyx_PyInt_AsUnsignedLong(x);
        else
            return (fmi2_boolean_t)__Pyx_PyInt_AsSignedLong(x);
    } else if (sizeof(fmi2_boolean_t) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return (fmi2_boolean_t)__Pyx_PyInt_AsUnsignedLongLong(x);
        else
            return (fmi2_boolean_t)__Pyx_PyInt_AsSignedLongLong(x);
    }  else {
        #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
        PyErr_SetString(PyExc_RuntimeError,
                        "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
        #else
        fmi2_boolean_t val;
        PyObject *v = __Pyx_PyNumber_Int(x);
        #if PY_VERSION_HEX < 0x03000000
        if (likely(v) && !PyLong_Check(v)) {
            PyObject *tmp = v;
            v = PyNumber_Long(tmp);
            Py_DECREF(tmp);
        }
        #endif
        if (likely(v)) {
            int one = 1; int is_little = (int)*(unsigned char *)&one;
            unsigned char *bytes = (unsigned char *)&val;
            int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                          bytes, sizeof(val),
                                          is_little, !is_unsigned);
            Py_DECREF(v);
            if (likely(!ret))
                return val;
        }
        #endif
        return (fmi2_boolean_t)-1;
    }
}

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_fmi2_boolean_t(fmi2_boolean_t val) {
    const fmi2_boolean_t neg_one = (fmi2_boolean_t)-1, const_zero = (fmi2_boolean_t)0;
    const int is_unsigned = const_zero < neg_one;
    if ((sizeof(fmi2_boolean_t) == sizeof(char))  ||
        (sizeof(fmi2_boolean_t) == sizeof(short))) {
        return PyInt_FromLong((long)val);
    } else if ((sizeof(fmi2_boolean_t) == sizeof(int)) ||
               (sizeof(fmi2_boolean_t) == sizeof(long))) {
        if (is_unsigned)
            return PyLong_FromUnsignedLong((unsigned long)val);
        else
            return PyInt_FromLong((long)val);
    } else if (sizeof(fmi2_boolean_t) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
        else
            return PyLong_FromLongLong((PY_LONG_LONG)val);
    } else {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        return _PyLong_FromByteArray(bytes, sizeof(fmi2_boolean_t),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_fmi2_integer_t(fmi2_integer_t val) {
    const fmi2_integer_t neg_one = (fmi2_integer_t)-1, const_zero = (fmi2_integer_t)0;
    const int is_unsigned = const_zero < neg_one;
    if ((sizeof(fmi2_integer_t) == sizeof(char))  ||
        (sizeof(fmi2_integer_t) == sizeof(short))) {
        return PyInt_FromLong((long)val);
    } else if ((sizeof(fmi2_integer_t) == sizeof(int)) ||
               (sizeof(fmi2_integer_t) == sizeof(long))) {
        if (is_unsigned)
            return PyLong_FromUnsignedLong((unsigned long)val);
        else
            return PyInt_FromLong((long)val);
    } else if (sizeof(fmi2_integer_t) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
        else
            return PyLong_FromLongLong((PY_LONG_LONG)val);
    } else {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        return _PyLong_FromByteArray(bytes, sizeof(fmi2_integer_t),
                                     little, !is_unsigned);
    }
}

#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      return ::std::complex< float >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      return x + y*(__pyx_t_float_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      __pyx_t_float_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

#if CYTHON_CCOMPLEX
#else
    static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        float denom = b.real * b.real + b.imag * b.imag;
        z.real = (a.real * b.real + a.imag * b.imag) / denom;
        z.imag = (a.imag * b.real - a.real * b.imag) / denom;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) {
        __pyx_t_float_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) {
        __pyx_t_float_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrtf(z.real*z.real + z.imag*z.imag);
          #else
            return hypotf(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
            __pyx_t_float_complex z;
            float r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    float denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        z = __Pyx_c_prodf(a, a);
                        return __Pyx_c_prodf(a, a);
                    case 3:
                        z = __Pyx_c_prodf(a, a);
                        return __Pyx_c_prodf(z, a);
                    case 4:
                        z = __Pyx_c_prodf(a, a);
                        return __Pyx_c_prodf(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                }
                r = a.real;
                theta = 0;
            } else {
                r = __Pyx_c_absf(a);
                theta = atan2f(a.imag, a.real);
            }
            lnr = logf(r);
            z_r = expf(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cosf(z_theta);
            z.imag = z_r * sinf(z_theta);
            return z;
        }
    #endif
#endif

#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return ::std::complex< double >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return x + y*(__pyx_t_double_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      __pyx_t_double_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

#if CYTHON_CCOMPLEX
#else
    static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        double denom = b.real * b.real + b.imag * b.imag;
        z.real = (a.real * b.real + a.imag * b.imag) / denom;
        z.imag = (a.imag * b.real - a.real * b.imag) / denom;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrt(z.real*z.real + z.imag*z.imag);
          #else
            return hypot(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) {
            __pyx_t_double_complex z;
            double r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    double denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        z = __Pyx_c_prod(a, a);
                        return __Pyx_c_prod(a, a);
                    case 3:
                        z = __Pyx_c_prod(a, a);
                        return __Pyx_c_prod(z, a);
                    case 4:
                        z = __Pyx_c_prod(a, a);
                        return __Pyx_c_prod(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                }
                r = a.real;
                theta = 0;
            } else {
                r = __Pyx_c_abs(a);
                theta = atan2(a.imag, a.real);
            }
            lnr = log(r);
            z_r = exp(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cos(z_theta);
            z.imag = z_r * sin(z_theta);
            return z;
        }
    #endif
#endif

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
    const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned char" :
                    "value too large to convert to unsigned char");
            }
            return (unsigned char)-1;
        }
        return (unsigned char)val;
    }
    return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
    const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned short" :
                    "value too large to convert to unsigned short");
            }
            return (unsigned short)-1;
        }
        return (unsigned short)val;
    }
    return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
    const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned int" :
                    "value too large to convert to unsigned int");
            }
            return (unsigned int)-1;
        }
        return (unsigned int)val;
    }
    return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
    const char neg_one = (char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to char" :
                    "value too large to convert to char");
            }
            return (char)-1;
        }
        return (char)val;
    }
    return (char)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
    const short neg_one = (short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to short" :
                    "value too large to convert to short");
            }
            return (short)-1;
        }
        return (short)val;
    }
    return (short)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
    const signed char neg_one = (signed char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed char" :
                    "value too large to convert to signed char");
            }
            return (signed char)-1;
        }
        return (signed char)val;
    }
    return (signed char)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
    const signed short neg_one = (signed short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed short" :
                    "value too large to convert to signed short");
            }
            return (signed short)-1;
        }
        return (signed short)val;
    }
    return (signed short)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
    const signed int neg_one = (signed int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed int" :
                    "value too large to convert to signed int");
            }
            return (signed int)-1;
        }
        return (signed int)val;
    }
    return (signed int)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
    const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned long");
            return (unsigned long)-1;
        }
        return (unsigned long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned long");
                return (unsigned long)-1;
            }
            return (unsigned long)PyLong_AsUnsignedLong(x);
        } else {
            return (unsigned long)PyLong_AsLong(x);
        }
    } else {
        unsigned long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned long)-1;
        val = __Pyx_PyInt_AsUnsignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned PY_LONG_LONG");
            return (unsigned PY_LONG_LONG)-1;
        }
        return (unsigned PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned PY_LONG_LONG");
                return (unsigned PY_LONG_LONG)-1;
            }
            return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        unsigned PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
    const long neg_one = (long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to long");
            return (long)-1;
        }
        return (long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to long");
                return (long)-1;
            }
            return (long)PyLong_AsUnsignedLong(x);
        } else {
            return (long)PyLong_AsLong(x);
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (long)-1;
        val = __Pyx_PyInt_AsLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
    const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to PY_LONG_LONG");
            return (PY_LONG_LONG)-1;
        }
        return (PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to PY_LONG_LONG");
                return (PY_LONG_LONG)-1;
            }
            return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
    const signed long neg_one = (signed long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed long");
            return (signed long)-1;
        }
        return (signed long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed long");
                return (signed long)-1;
            }
            return (signed long)PyLong_AsUnsignedLong(x);
        } else {
            return (signed long)PyLong_AsLong(x);
        }
    } else {
        signed long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed long)-1;
        val = __Pyx_PyInt_AsSignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
    const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed PY_LONG_LONG");
            return (signed PY_LONG_LONG)-1;
        }
        return (signed PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed PY_LONG_LONG");
                return (signed PY_LONG_LONG)-1;
            }
            return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (signed PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        signed PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsSignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
}

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 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
int __Pyx_Generator_CheckRunning(__pyx_GeneratorObject *gen) {
    if (unlikely(gen->is_running)) {
        PyErr_SetString(PyExc_ValueError,
                        "generator already executing");
        return 1;
    }
    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 (unlikely(self->resume_label == -1)) {
        PyErr_SetNone(PyExc_StopIteration);
        return NULL;
    }
    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);
#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 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) {
    __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 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);
#else
        PyErr_SetNone(PyExc_GeneratorExit);
#endif
    retval = __Pyx_Generator_SendEx(gen, NULL);
    if (retval) {
        Py_DECREF(retval);
        PyErr_SetString(PyExc_RuntimeError,
                        "generator ignored GeneratorExit");
        return NULL;
    }
    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))
    {
        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) {
    __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(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) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        #if PY_VERSION_HEX < 0x02050000
        return PyErr_Warn(NULL, message);
        #else
        return PyErr_WarnEx(NULL, message, 1);
        #endif
    }
    return 0;
}

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);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItemString(dict, "__pyx_vtable__", ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

#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,
    size_t size, int strict)
{
    PyObject *py_module = 0;
    PyObject *result = 0;
    PyObject *py_name = 0;
    char warning[200];
    Py_ssize_t basicsize;
#ifdef Py_LIMITED_API
    PyObject *py_basicsize;
#endif
    py_module = __Pyx_ImportModule(module_name);
    if (!py_module)
        goto bad;
    py_name = __Pyx_PyIdentifier_FromString(class_name);
    if (!py_name)
        goto bad;
    result = PyObject_GetAttr(py_module, py_name);
    Py_DECREF(py_name);
    py_name = 0;
    Py_DECREF(py_module);
    py_module = 0;
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%s.%s is not a type object",
            module_name, class_name);
        goto bad;
    }
#ifndef Py_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
#else
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if (!strict && (size_t)basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility",
            module_name, class_name);
        #if PY_VERSION_HEX < 0x02050000
        if (PyErr_Warn(NULL, warning) < 0) goto bad;
        #else
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
        #endif
    }
    else if ((size_t)basicsize != size) {
        PyErr_Format(PyExc_ValueError,
            "%s.%s has the wrong size, try recompiling",
            module_name, class_name);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(py_module);
    Py_XDECREF(result);
    return NULL;
}
#endif

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 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;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,            /*int argcount,*/
        0,            /*int kwonlyargcount,*/
        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,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,      /*int firstlineno,*/
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    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,*/
        py_globals,          /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    py_frame->f_lineno = py_line;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else  /* Python 3+ has unicode identifiers */
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  PyNumberMethods *m;
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_VERSION_HEX < 0x03000000
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return Py_INCREF(x), x;
  m = Py_TYPE(x)->tp_as_number;
#if PY_VERSION_HEX < 0x03000000
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
#else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
#endif
  if (res) {
#if PY_VERSION_HEX < 0x03000000
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%s__ returned non-%s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject* x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
#if PY_VERSION_HEX < 0x02050000
   if (ival <= LONG_MAX)
       return PyInt_FromLong((long)ival);
   else {
       unsigned char *bytes = (unsigned char *) &ival;
       int one = 1; int little = (int)*(unsigned char*)&one;
       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
   }
#else
   return PyInt_FromSize_t(ival);
#endif
}
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
   unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
   if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
       return (size_t)-1;
   } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
       PyErr_SetString(PyExc_OverflowError,
                       "value too large to convert to size_t");
       return (size_t)-1;
   }
   return (size_t)val;
}


#endif /* Py_PYTHON_H */
